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
Scala Native should allow nativeLTO option #1951
Comments
I tried to do the following as suggested by Wojciech as a workaround. This did nothing and I noticed that when compiling the linking output line is missing.
sbt plugin
When I added to the compile options as well - can't remember if it needs to be in both compiling and linking but perhaps this is closer.
|
I also wanted to mention that perhaps we could share the actual Scala Native code in the future via this WIP project. |
@ekrich There seems to not be such a problems on Ubuntu, in fact combination of
would enable usage of LTO. It can be confirmed with usage of
[debug] Running
/usr/bin/clang
-c
/home/wmazur/projects/scalacenter/scala-native/scala-native/sandbox/src/main/scala/.scala-build/project_4c5dc41f25-0480e1dff6/native/1.ll
-o
/home/wmazur/projects/scalacenter/scala-native/scala-native/sandbox/src/main/scala/.scala-build/project_4c5dc41f25-0480e1dff6/native/1.ll.o
-Wno-override-module
-fexceptions
-funwind-tables
-fvisibility=hidden
-O0
-flto=thin
-I/usr/local/include
-I/usr/lib/llvm-14/include
-Qunused-arguments and the lto is also present in linking config ( The issue with the compilation might be present in combination with MacOS + LLVM 15, and should be fixed since version 0.4.11 when we added opaque pointers support. My version of scala-cli was using 0.4.9 by default, so it's possible that might be also the case for your build. Probably forcing latest version with |
@WojciechMazur I forgot to follow up. I indeed found your workaround just after I posted that last post of mine above. |
I closed the issue, in Scala CLI was added the
|
Is your feature request related to a problem? Please describe.
I am trying to create a reproducer for XCode LLVM tools that only happens when using LTO "thin" option. Scala-cli seems to be the only reasonable way outside of the Scala world to share Scala Native code.
Describe the solution you'd like
In Scala Native you can have the Link Time Optimization (LTO) set to "thin", "full", or "none" (default)
A clear and concise description of what you want to happen.
Describe alternatives you've considered
I would have them install sbt instead and have a special repo on github for the reproducer.m Perhaps use a template and then add sbt options.
Additional context
Selecting a garbage collector would be nice as well although default "immix" is good but single threaded.
The text was updated successfully, but these errors were encountered: