-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
linux: Fix compile using GCC #2038
Comments
This is out of scope for our current milestones and current roadmap but we'll keep this in mind. During our initial work bringing ChakraCore cross-platform, we decided it was best to focus on a single compiler toolchain. You should be able to install a compatible version of clang on most distributions so this shouldn't be a blocking issue for you. :) |
As @dilijev mentioned, this is not one of the priorities we have at hand due to Clang does the job very well. However, supporting GCC would be really nice! Added |
On the surface GCC builds fail because CMake passes Clang-only flags to the compiler. Unless there are any deeper issues underneath, this should be relatively easy to fix by testing which flavor of compiler flags the compiler supports, which is a good practice anyway. Generally, rather than quietly depending on behavior specific to a particular compiler, it is a good practice to test for the required features and spellings of flags, and ultimately emit informative error messages when developer's compiler lacks something. |
On macOS I've built with gcc successfully with the cmake files as they are, be curious to see what issues it has on linux at the moment |
On earlier versions of Ubuntu C++ GCC was too old to accept new C++ flags: Lines 400 to 411 in e6c8f78
With 20.04 the situation is better, but there are some flags it won't take. What I can see right now is -fasm-blocks and -fcolor-diagnostics (latter is definitely a Clang spelling of the flag). We might be able to fix this if we distinguish between GCC and Clang spellings of compiler options. Also it would probably help to write a check for minimum GCC version, so that users don't try to build it with older compiler which comes with older Ubuntu.
Lesser issue the use of |
I was able to get through those by being inserting a check for GCC, but then it gets a bunch of type resolution errors from PAL. I can share CMake changes though. |
ChakraCore depends on clang because clang emulate a lot of the MSVC compiler behavior. So beyond the flags, there is a whole bunch of things that needs to fix to start using more of the PAL. I spend a couple hours to hack thru it just because I am curious and was able to get PAL and WABT to build. #6611 is the draft PR if you guys want to take it. |
Looking at the size of the draft diff and the number of issues clearly I hadn't built CC with gcc on macOS, looked into what I'd done and found that on macOS usr/bin/g++ and usr/bin/gcc are renamed copies of clang - I don't know why apple did that but yeah.... @curtisman thanks for investigation - considering the size of it we're probably not going to get this in soon but really appreciate the starter/pointers in the right direction. |
I think you need to get GCC from homebrew on OSX. |
This is sort of a big request, but fix compilation using GCC (version 5.4.0) on Ubuntu 16.04 LTS. Many Linux distributions use GCC as the default compiler.
The text was updated successfully, but these errors were encountered: