Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally use Clang compiler #9

Open
mitsukaki opened this issue Jul 1, 2016 · 18 comments
Open

Optionally use Clang compiler #9

mitsukaki opened this issue Jul 1, 2016 · 18 comments

Comments

@mitsukaki
Copy link

Continuing discussion from NodeOS/NodeOS#267 (comment)

Starting @piranna and @luii

@joshgarde
Copy link
Member

Already using clang here on OS X. Works just fine.

@piranna
Copy link
Member

piranna commented Jul 4, 2016

Already using clang here on OS X. Works just fine.

Are you using clang to generate the cross-compiler, or have you replaced gcc for clang IN the compiler? If so, have you been able to compile a working kernel?

@joshgarde
Copy link
Member

Mac OS X aliases gcc and g++ over to clang by default. Only tried the cross-compiler and the other two projects I've ported over so far with good results. I haven't tried compiling the kernel yet (which I assume is part of nodeos-barebones) because I'm still caught up with travis support, but I'll try it later.

@piranna
Copy link
Member

piranna commented Jul 4, 2016

I haven't tried compiling the kernel yet (which I assume is part of nodeos-barebones)

Yes, it is, just wanted to be sure :-) Anyway it's a huge effort, specially the Travis part! :-D

@piranna
Copy link
Member

piranna commented Jul 8, 2016

If you are in th mood, go for it ;-) Have you tried to compile Node.js with
gcc?
El 8/7/2016 10:48, "joshgarde" notifications@github.com escribió:

Update: It seems that nodejs, when compiling for OS X, expects clang
instead of GCC so clang support for the toolchain might be my next project.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#9 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAgfviY6dCcYr3Uv1CCTZlWUex7eQLLgks5qTg7DgaJpZM4JDXAT
.

@joshgarde
Copy link
Member

joshgarde commented Jul 8, 2016

Update: It seems that nodejs, when compiling for OS X, expects clang
instead of GCC so clang support for the toolchain might be my next project.

Node.js throws clang specific arguments at CXX and CC when trying to compile for OS X so GCC isn't really an option unless I can override those args or just get GCC to ignore them. I can compile for Linux on OS X, which works for a while before I get an internal compiler error.

@joshgarde
Copy link
Member

joshgarde commented Jul 8, 2016

The compiler error, seems to be resulting from an invalid file path though, but I'm not really sure where the path is coming from.

  x86_64-nodeos-linux-musl-g++ '-DV8_TARGET_ARCH_X64' '-DENABLE_DISASSEMBLER' -I../deps/v8  -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fno-strict-aliasing -m64 -O3 -fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/.deps//Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/v8_libbase/deps/v8/src/base/platform/platform-linux.o.d.raw   -c -o /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/v8_libbase/deps/v8/src/base/platform/platform-linux.o ../deps/v8/src/base/platform/platform-linux.cc
  x86_64-nodeos-linux-musl-g++ '-DV8_TARGET_ARCH_X64' '-DENABLE_DISASSEMBLER' -I../deps/v8  -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fno-strict-aliasing -m64 -O3 -fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/.deps//Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/v8_libbase/deps/v8/src/base/platform/platform-posix.o.d.raw   -c -o /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/v8_libbase/deps/v8/src/base/platform/platform-posix.o ../deps/v8/src/base/platform/platform-posix.cc
  x86_64-nodeos-linux-musl-gcc '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_GNU_SOURCE' '-DCARES_STATICLIB' '-DHAVE_CONFIG_H' -I../deps/cares/include -I../deps/cares/src -I../deps/cares/config/linux  -pthread -Wall -Wextra -Wno-unused-parameter -m64 -g -pedantic -Wall -Wextra -Wno-unused-parameter --std=gnu89 -O3 -fno-omit-frame-pointer  -MMD -MF /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/.deps//Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o.d.raw   -c -o /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o ../deps/cares/src/ares_cancel.c
  x86_64-nodeos-linux-musl-gcc '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_GNU_SOURCE' '-DCARES_STATICLIB' '-DHAVE_CONFIG_H' -I../deps/cares/include -I../deps/cares/src -I../deps/cares/config/linux  -pthread -Wall -Wextra -Wno-unused-parameter -m64 -g -pedantic -Wall -Wextra -Wno-unused-parameter --std=gnu89 -O3 -fno-omit-frame-pointer  -MMD -MF /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/.deps//Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares__close_sockets.o.d.raw   -c -o /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares__close_sockets.o ../deps/cares/src/ares__close_sockets.c

I believe the problem is with the last two commands. Take notice of the /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/.deps//Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares__close_sockets.o.d.raw path. It's combined two paths together for some reason. I'm really not sure if it's a problem with Node.js' makefile or if it's a problem with the nodejs package on here.

@piranna
Copy link
Member

piranna commented Jul 8, 2016

Update: It seems that nodejs, when compiling for OS X, expects clang
instead of GCC so clang support for the toolchain might be my next
project.

Node.js throws clang specific arguments at CXX and CC when trying to
compile for OS X so GCC isn't really an option unless I can override those
args or just get GCC to ignore them.

Maybe is it time to create a pull-request to allow to compile Node.js on
OSX using gcc...? ;-)

I can compile for Linux instead on OS X, which works for a while before I
get an internal compiler error.

That's a shame, because that's just what we need for NodeOS, to compile it
for Linux... :-( The prebuild ones could be used, but it should compile too
as fallback... :-/

@piranna
Copy link
Member

piranna commented Jul 8, 2016

Can you post the full backtrace?
El 8/7/2016 6:50 PM, "joshgarde" notifications@github.com escribió:

The compiler error, seems to be resulting from an invalid file path
though, but I'm not really sure where the path is coming from.

x86_64-nodeos-linux-musl-g++ '-DV8_TARGET_ARCH_X64' '-DENABLE_DISASSEMBLER' -I../deps/v8 -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fno-strict-aliasing -m64 -O3 -fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/.deps//Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/v8_libbase/deps/v8/src/base/platform/platform-linux.o.d.raw -c -o /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/v8_libbase/deps/v8/src/base/platform/platform-linux.o ../deps/v8/src/base/platform/platform-linux.cc
x86_64-nodeos-linux-musl-g++ '-DV8_TARGET_ARCH_X64' '-DENABLE_DISASSEMBLER' -I../deps/v8 -pthread -Wall -Wextra -Wno-unused-parameter -m64 -fno-strict-aliasing -m64 -O3 -fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/.deps//Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/v8_libbase/deps/v8/src/base/platform/platform-posix.o.d.raw -c -o /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/v8_libbase/deps/v8/src/base/platform/platform-posix.o ../deps/v8/src/base/platform/platform-posix.cc
x86_64-nodeos-linux-musl-gcc '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_GNU_SOURCE' '-DCARES_STATICLIB' '-DHAVE_CONFIG_H' -I../deps/cares/include -I../deps/cares/src -I../deps/cares/config/linux -pthread -Wall -Wextra -Wno-unused-parameter -m64 -g -pedantic -Wall -Wextra -Wno-unused-parameter --std=gnu89 -O3 -fno-omit-frame-pointer -MMD -MF /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/.deps//Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o.d.raw -c -o /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o ../deps/cares/src/ares_cancel.c
x86_64-nodeos-linux-musl-gcc '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_GNU_SOURCE' '-DCARES_STATICLIB' '-DHAVE_CONFIG_H' -I../deps/cares/include -I../deps/cares/src -I../deps/cares/config/linux -pthread -Wall -Wextra -Wno-unused-parameter -m64 -g -pedantic -Wall -Wextra -Wno-unused-parameter --std=gnu89 -O3 -fno-omit-frame-pointer -MMD -MF /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/.deps//Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares__close_sockets.o.d.raw -c -o /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares__close_sockets.o ../deps/cares/src/ares__close_sockets.c

I believe the problem is with the last two commands. Take notice of the
/Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/.deps//Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares__close_sockets.o.d.raw
path. I'm really not sure if it's a problem with Node.js' makefile or if
it's a problem with the nodejs package on here.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#9 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAgfvnNZ7uBryhy6FHJU3cvdsep72Gptks5qTn_ygaJpZM4JDXAT
.

@joshgarde
Copy link
Member

  x86_64-nodeos-linux-musl-gcc '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_GNU_SOURCE' '-DCARES_STATICLIB' '-DHAVE_CONFIG_H' -I../deps/cares/include -I../deps/cares/src -I../deps/cares/config/linux  -pthread -Wall -Wextra -Wno-unused-parameter -m64 -g -pedantic -Wall -Wextra -Wno-unused-parameter --std=gnu89 -O3 -fno-omit-frame-pointer  -MMD -MF /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/.deps//Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o.d.raw   -c -o /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o ../deps/cares/src/ares_cancel.c
  x86_64-nodeos-linux-musl-gcc '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_GNU_SOURCE' '-DCARES_STATICLIB' '-DHAVE_CONFIG_H' -I../deps/cares/include -I../deps/cares/src -I../deps/cares/config/linux  -pthread -Wall -Wextra -Wno-unused-parameter -m64 -g -pedantic -Wall -Wextra -Wno-unused-parameter --std=gnu89 -O3 -fno-omit-frame-pointer  -MMD -MF /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/.deps//Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares__close_sockets.o.d.raw   -c -o /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares__close_sockets.o ../deps/cares/src/ares__close_sockets.c
x86_64-nodeos-linux-musl-gcc: internal compiler error: Killed: 9 (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[1]: *** [/Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares__close_sockets.o] Error 4
make[1]: *** Waiting for unfinished jobs....
x86_64-nodeos-linux-musl-gcc: internal compiler error: Killed: 9 (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[1]: *** [/Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o] Error 4
make: *** [node] Error 2

npm ERR! Darwin 14.5.0
npm ERR! argv "/opt/local/bin/node" "/opt/local/bin/npm" "run" "build" "--"
npm ERR! node v4.4.7
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! nodeos-nodejs@6.2.2 build: `scripts/build`
npm ERR! Exit status 9

@joshgarde
Copy link
Member

Not a lot of help, but the rest of the compile works fine. Not a memory issue either (Monitoring it the entire build). I can only assume it's the broken file path.

@piranna
Copy link
Member

piranna commented Jul 8, 2016

Not a lot of help, but the rest of the compile works fine. Not a memory
issue either (Monitoring it the entire build). I can only assume it's the
broken file path.

It could be, but I've only get internal errors on cc1 due to out of memory
errors... How much ram do you have? Could you be able to compile it in a
fleshly rebooted system?

@joshgarde
Copy link
Member

8GB of RAM & around 4-5GB free upon fresh reboot.

  x86_64-nodeos-linux-musl-gcc '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_GNU_SOURCE' '-DCARES_STATICLIB' '-DHAVE_CONFIG_H' -I../deps/cares/include -I../deps/cares/src -I../deps/cares/config/linux  -pthread -Wall -Wextra -Wno-unused-parameter -m64 -g -pedantic -Wall -Wextra -Wno-unused-parameter --std=gnu89 -O3 -fno-omit-frame-pointer  -MMD -MF /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/.deps//Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o.d.raw   -c -o /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o ../deps/cares/src/ares_cancel.c
  x86_64-nodeos-linux-musl-gcc '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_GNU_SOURCE' '-DCARES_STATICLIB' '-DHAVE_CONFIG_H' -I../deps/cares/include -I../deps/cares/src -I../deps/cares/config/linux  -pthread -Wall -Wextra -Wno-unused-parameter -m64 -g -pedantic -Wall -Wextra -Wno-unused-parameter --std=gnu89 -O3 -fno-omit-frame-pointer  -MMD -MF /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/.deps//Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares__close_sockets.o.d.raw   -c -o /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares__close_sockets.o ../deps/cares/src/ares__close_sockets.c
x86_64-nodeos-linux-musl-gcc: internal compiler error: Killed: 9 (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[1]: *** [/Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o] Error 4
make[1]: *** Waiting for unfinished jobs....
x86_64-nodeos-linux-musl-gcc: internal compiler error: Killed: 9 (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[1]: *** [/Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares__close_sockets.o] Error 4
make: *** [node] Error 2

@piranna
Copy link
Member

piranna commented Jul 8, 2016

Sh*t, then I don't know what happens here... Not-capitalized filesystem?
El 8/7/2016 19:49, "joshgarde" notifications@github.com escribió:

8GB of RAM & around 4-5GB free upon fresh reboot.

x86_64-nodeos-linux-musl-gcc '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_GNU_SOURCE' '-DCARES_STATICLIB' '-DHAVE_CONFIG_H' -I../deps/cares/include -I../deps/cares/src -I../deps/cares/config/linux -pthread -Wall -Wextra -Wno-unused-parameter -m64 -g -pedantic -Wall -Wextra -Wno-unused-parameter --std=gnu89 -O3 -fno-omit-frame-pointer -MMD -MF /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/.deps//Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o.d.raw -c -o /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o ../deps/cares/src/ares_cancel.c
x86_64-nodeos-linux-musl-gcc '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_GNU_SOURCE' '-DCARES_STATICLIB' '-DHAVE_CONFIG_H' -I../deps/cares/include -I../deps/cares/src -I../deps/cares/config/linux -pthread -Wall -Wextra -Wno-unused-parameter -m64 -g -pedantic -Wall -Wextra -Wno-unused-parameter --std=gnu89 -O3 -fno-omit-frame-pointer -MMD -MF /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/.deps//Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares__close_sockets.o.d.raw -c -o /Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares__close_sockets.o ../deps/cares/src/ares__close_sockets.c
x86_64-nodeos-linux-musl-gcc: internal compiler error: Killed: 9 (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.
make[1]: *** [/Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o] Error 4
make[1]: *** Waiting for unfinished jobs....
x86_64-nodeos-linux-musl-gcc: internal compiler error: Killed: 9 (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.
make[1]: *** [/Volumes/NodeOS-OSX/nodejs/deps/node/out/Release/obj.target/cares/deps/cares/src/ares__close_sockets.o] Error 4
make: *** [node] Error 2


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#9 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAgfvgLStmuC9NG1KKiEuD8xD58TmMQCks5qTo2ugaJpZM4JDXAT
.

@joshgarde
Copy link
Member

I'm compiling node.js on my case sensitive file system. It's probably just the broken file path.

@joshgarde
Copy link
Member

You also have to remember, I'm compiling Linux on OS X so weird errors are to be expected.

@piranna
Copy link
Member

piranna commented Jul 8, 2016

You also have to remember, I'm compiling Linux on OS X so weird errors
are to be expected.

Regarding to this point, are you sure you are using only the include files
provided by nodeos-cross-toolchain and there's no leak from the OSX system
ones? This could lead to some funny bugs...

@joshgarde
Copy link
Member

I'll double check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants