-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Options to use an alternate compiler #12218
Comments
The fundamental problem here is that emscripten only supports a single LLVM version at any given time. You cannot expect to be able to use it with your system version of LLVM or with any version other than the one it is expecting. I have an open issue to try to move towards supporting LLVM stable so that we can one day support your use case: However as you can see libcompiler_rt uses a feature that clang 10 simply doesn't support. Your solution of trying to work around this by using your system compiler only for your user code could work but seems... dangerous. If you are using your own custom clang version for some reason presumably you also want to use it for the system libraries? The reason the this hack didn't work when you set I'm am keen to help you find a solution. Perhaps we can work on #11362 |
One possible solution is to provide a way to override the |
I have indeed an internal customized version of llvm with extra features that I want to be able to apply to my program :) |
Do you not also want those extra features when you compile the emscripten system libraries? Would it be possible to rebase on top of LLVM latest? (I know that isn't always easy :) |
I'm afraid the short answer is that we don't support this setup today. Its not unusual for emscripten to depend unconditionally on features in llvm tip-of-tree. |
I'm closing this issue because the problem is already discussed in #11362, where this issue is already linked. No need to have two threads about it :) |
No, these features have no impact on the system libraries, only for client code.
Unfortunately it's impossible for me to rebase to latest :( |
This is more of a discussion than an issue.
At the time of this writing there are two main solutions to set the path to the clang compiler used by
emcc
:LLVM_ROOT
config variable (orEM_LLVM_ROOT
environment variable) to point to the root of the LLVM installation,EMMAKEN_COMPILER
environment variable to point to the compiler to use (i.e. the deprecated method).I've found the first option to be very restrictive about the supported versions of Clang, mostly because
-fignore-exceptions
is passed by default to the compiler. This compilation flag is not available in old versions of Clang and the build will fail.As I use Emscripten with a custom clang-based compiler a few versions behind upstream, I would like Emscripten to keep some flexibility on the backend compiler features.
For example, here's what I got trying to use the Clang compiler provided in Ubuntu. With the
EMMAKEN_COMPILER
way:(1) First run to compile the system libraries with the default compiler.
(2) Ok, it failed because Clang 10 does not know about
-fignore-exceptions
. Let's force-fexceptions
:(3) No luck here. Use the default compiler to compile the system libraries.
(4) And then use the custom compiler to compile the actual program:
Sucess! I managed to compile my program with a custom compiler.
(5) Now see if we can do the same with
LLVM_ROOT
.The error is clear:
error in backend: don't yet support defined globals
, so I reuse the solution in (3); I use the default compiler to compile the system libraries.(6) Then I try to compile my program:
As you can see it recompiles the system libraries and we are back to the problem of the defined globals. I have no other solution to use another compiler.
What can I do to use a custom older compiler with
LLVM_ROOT
and a recent version of Emscripten?The text was updated successfully, but these errors were encountered: