chakra-core / ChakraCore

ChakraCore is an open source Javascript engine with a C API.
MIT License
9.07k stars 1.19k forks source link

Disable x86 (32-bit) Linux builds or issue a warning #4091

Open fatcerberus opened 6 years ago

fatcerberus commented 6 years ago

Tried to make a 32-bit ChakraCore build for Linux (Ubuntu), but the build failed. I was able to build for x64 without a hitch, but x86 proved futile.

Command line:

fatcerberus@pigcult-vm:~/src/ChakraCore$ ./build.sh --embed-icu -j=4 --lto --arch=x86

Gave me the following output:

lto: ranlib disabled
Custom CXX /home/fatcerberus/src/ChakraCore/cc-toolchain/build/bin/clang++
Custom CC  /home/fatcerberus/src/ChakraCore/cc-toolchain/build/bin/clang
Build path: /home/fatcerberus/src/ChakraCore/out/Release
-- /home/fatcerberus/src/ChakraCore/bin/ch/DbgController.js.h is up to date. skipping.
Compile Target : x86
Generating Release makefiles

-- found ICU libs: deps/icu/source/output/include//../lib/
-- Configuring done
-- Generating done
-- Build files have been written to: /home/fatcerberus/src/ChakraCore/out/Release
[  0%] Building CXX object lib/Jsrt/Core/CMakeFiles/Chakra.Jsrt.Core.dir/JsrtContextCore.cpp.o
[  1%] Building CXX object pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/file.cpp.o
clang-4.0: error: argument unused during compilation: '-arch i386' [-Werror,-Wunused-command-line-argument]
lib/Jsrt/Core/CMakeFiles/Chakra.Jsrt.Core.dir/build.make:62: recipe for target 'lib/Jsrt/Core/CMakeFiles/Chakra.Jsrt.Core.dir/JsrtContextCore.cpp.o' failed
make[2]: *** [lib/Jsrt/Core/CMakeFiles/Chakra.Jsrt.Core.dir/JsrtContextCore.cpp.o] Error 1
CMakeFiles/Makefile2:1448: recipe for target 'lib/Jsrt/Core/CMakeFiles/Chakra.Jsrt.Core.dir/all' failed
make[1]: *** [lib/Jsrt/Core/CMakeFiles/Chakra.Jsrt.Core.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
clang-4.0: error: argument unused during compilation: '-arch i386' [-Werror,-Wunused-command-line-argument]
pal/src/CMakeFiles/Chakra.Pal.dir/build.make:62: recipe for target 'pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/file.cpp.o' failed
make[2]: *** [pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/file.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[  1%] Building CXX object pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/filecrt.cpp.o
[  1%] Building CXX object pal/src/CMakeFiles/Chakra.Pal.Singular.dir/cruntime/filecrt.cpp.o
[  1%] Building CXX object pal/src/CMakeFiles/Chakra.Pal.Singular.dir/cruntime/file.cpp.o
clang-4.0: error: argument unused during compilation: '-arch i386' [-Werror,-Wunused-command-line-argument]
pal/src/CMakeFiles/Chakra.Pal.dir/build.make:86: recipe for target 'pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/filecrt.cpp.o' failed
make[2]: *** [pal/src/CMakeFiles/Chakra.Pal.dir/cruntime/filecrt.cpp.o] Error 1
CMakeFiles/Makefile2:142: recipe for target 'pal/src/CMakeFiles/Chakra.Pal.dir/all' failed
make[1]: *** [pal/src/CMakeFiles/Chakra.Pal.dir/all] Error 2
clang-4.0: error: argument unused during compilation: '-arch i386' [-Werror,-Wunused-command-line-argument]
pal/src/CMakeFiles/Chakra.Pal.Singular.dir/build.make:62: recipe for target 'pal/src/CMakeFiles/Chakra.Pal.Singular.dir/cruntime/file.cpp.o' failed
make[2]: *** [pal/src/CMakeFiles/Chakra.Pal.Singular.dir/cruntime/file.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
clang-4.0: error: argument unused during compilation: '-arch i386' [-Werror,-Wunused-command-line-argument]
pal/src/CMakeFiles/Chakra.Pal.Singular.dir/build.make:86: recipe for target 'pal/src/CMakeFiles/Chakra.Pal.Singular.dir/cruntime/filecrt.cpp.o' failed
make[2]: *** [pal/src/CMakeFiles/Chakra.Pal.Singular.dir/cruntime/filecrt.cpp.o] Error 1
[  1%] Building CXX object pal/src/CMakeFiles/Chakra.Pal.Singular.dir/cruntime/finite.cpp.o
clang-4.0: error: argument unused during compilation: '-arch i386' [-Werror,-Wunused-command-line-argument]
pal/src/CMakeFiles/Chakra.Pal.Singular.dir/build.make:110: recipe for target 'pal/src/CMakeFiles/Chakra.Pal.Singular.dir/cruntime/finite.cpp.o' failed
make[2]: *** [pal/src/CMakeFiles/Chakra.Pal.Singular.dir/cruntime/finite.cpp.o] Error 1
CMakeFiles/Makefile2:105: recipe for target 'pal/src/CMakeFiles/Chakra.Pal.Singular.dir/all' failed
make[1]: *** [pal/src/CMakeFiles/Chakra.Pal.Singular.dir/all] Error 2
[  1%] Building CXX object lib/Backend/CMakeFiles/Chakra.Backend.dir/AgenPeeps.cpp.o
[  1%] Building CXX object lib/Backend/CMakeFiles/Chakra.Backend.dir/AsmJsJITInfo.cpp.o
[  1%] Building CXX object lib/Backend/CMakeFiles/Chakra.Backend.dir/Backend.cpp.o
clang-4.0clang-4.0: : errorerror: : argument unused during compilation: '-arch i386' [-Werror,-Wunused-command-line-argument]argument unused during compilation: '-arch i386' [-Werror,-Wunused-command-line-argument]

lib/Backend/CMakeFiles/Chakra.Backend.dir/build.make:62: recipe for target 'lib/Backend/CMakeFiles/Chakra.Backend.dir/AgenPeeps.cpp.o' failed
make[2]: *** [lib/Backend/CMakeFiles/Chakra.Backend.dir/AgenPeeps.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
lib/Backend/CMakeFiles/Chakra.Backend.dir/build.make:86: recipe for target 'lib/Backend/CMakeFiles/Chakra.Backend.dir/AsmJsJITInfo.cpp.o' failed
make[2]: *** [lib/Backend/CMakeFiles/Chakra.Backend.dir/AsmJsJITInfo.cpp.o] Error 1
[  1%] Building CXX object lib/Backend/CMakeFiles/Chakra.Backend.dir/BackendApi.cpp.o
clang-4.0: error: argument unused during compilation: '-arch i386' [-Werror,-Wunused-command-line-argument]
clang-4.0: error: argument unused during compilation: '-arch i386' [-Werror,-Wunused-command-line-argument]
lib/Backend/CMakeFiles/Chakra.Backend.dir/build.make:110: recipe for target 'lib/Backend/CMakeFiles/Chakra.Backend.dir/Backend.cpp.o' failed
make[2]: *** [lib/Backend/CMakeFiles/Chakra.Backend.dir/Backend.cpp.o] Error 1
lib/Backend/CMakeFiles/Chakra.Backend.dir/build.make:134: recipe for target 'lib/Backend/CMakeFiles/Chakra.Backend.dir/BackendApi.cpp.o' failed
make[2]: *** [lib/Backend/CMakeFiles/Chakra.Backend.dir/BackendApi.cpp.o] Error 1
CMakeFiles/Makefile2:285: recipe for target 'lib/Backend/CMakeFiles/Chakra.Backend.dir/all' failed
make[1]: *** [lib/Backend/CMakeFiles/Chakra.Backend.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
See error details above. Exit code was 2
obastemur commented 6 years ago

@fatcerberus no short/mid term x86 support on *nix. We might add a message warning the user for x86. Would you like to send a PR?

fatcerberus commented 6 years ago

Oh, it's not supported? That's fine then, I thought it was because the --help output shows:

--arch[=S]        Set target arch (arm, x86, amd64)

Implying it's supported. I agree there should be a warning for it, though.

obastemur commented 6 years ago

Implying it's supported. I agree there should be a warning for it, though.

@fatcerberus would you like to send a PR?

fatcerberus commented 6 years ago

@obastemur I would, but what I’m confused about is that build.sh is only for Unix platforms; is x86 relevant to any of them? It seems to only be relevant for Windows nowadays, where build.sh doesn’t apply.

In light of all that, it seems like the --arch=x86 option shouldn’t even exist?

obastemur commented 6 years ago

In light of all that, it seems like the --arch=x86 option shouldn’t even exist?

At the moment, yes, there is nothing can keep end-user from using it or there is no even warning. could be nice to have a warning message ? and we could close this issue with that? :)

fatcerberus commented 6 years ago

Yeah, what I was trying to figure out was whether to make a PR that adds the warning, or if I should just completely remove x86 from the list of architectures on the —help screen (or both).

obastemur commented 6 years ago

Simply adding a warning is enough IMHO.

ppenzin commented 4 years ago

The errors have nothing to do with x86 support per se, -arch flag is not getting used in that particular compile command, which is normally a warning, but -Werror turns it into an error and aborts the build, which does sound a bit excessive.

rhuanjl commented 4 years ago

As an extra note, x86 has never been supported on linux - so if it does actually build after the flags are fixed there will likely be some issues to iron out - I think there are few places in the source tree where there's architecture specific stuff that has x86 gated behind #ifdef windows or #ifdef win32 or the like.

This is purely anecdotal I haven't gone through the source tree looking for these (I also don't have a linux machine so cannot easily experiment with this - whilst the linux and macOS builds are similar apple have removed support for running 32bit code from macOS, so I cannot run 32bit binaries on my machine).