LLVM 15: Opaque pointers are only supported in -opaque-pointers mode #3666
Replies: 4 comments 13 replies
-
Hi, yes, I benchmarked this locally and enabling LTO resulted in ~5% reduction in building LLVM, which seemed like it was worth it (since thin LTO barely increases the build time). We can revisit this if enough people are tripped up by it, but there are plenty of workarounds, of which you've listed a few. Others include:
Options 1 and 2 should be straightforward to do from within a CMake script, and you can likely also emulate 3 if you really need to. We also set Let me know if there are specific examples of CMake scripts that are now broken and you can't fix with above and I'm happy to look into it. |
Beta Was this translation helpful? Give feedback.
-
I'm pretty sure this issue has broken using Homebrew LLVM with Halide (halide-lang.org, https://github.com/halide/Halide), since we are also failing with either the '-opaque-pointers mode' error or |
Beta Was this translation helpful? Give feedback.
-
So if I understand correctly, you're now installing a static-library version of LLVM that won't work without special linker flags? (If so, I must confess, this seems like a suboptimal decision, even if it does save a few percent off of build times. ) |
Beta Was this translation helpful? Give feedback.
-
Fix in Homebrew/homebrew-core#112154. |
Beta Was this translation helpful? Give feedback.
-
Hello 👋🏻 !
Thanks very much for making LLVM 15 available so quickly! And for
brew
in general :)I've noticed that for LLVM 15 the formula enables LTO (IIRC, that wasn't the case for LLVM 14). This can lead to some unexpected behaviour. For example:
I can work around this by using
llvm-nm
from the LLVM formula instead (i.e./opt/homebrew/Cellar/llvm/15.0.0/bin/llvm-nm
).Here's another example of a rather counter-intuitive behaviour. Basically, below I'm trying to use the LLVM dev libraries to build a dummy tool. Source code:
Shell command:
Again, there's a workaround for this. It boils down to making sure that the LLVM 15 libraries installed with
brew
are prioritised over the system ones - just use-lto_library /opt/homebrew/Cellar/llvm/15.0.0/lib/libLTO.dylib
.In simple cases all this can be worked around. It becomes a bit tricky when writing a CMake script that's meant to work for LLVM from
brew
as well as e.g. when building LLVM from sources. Perhaps it's worth re-visiting the value setLLVM_ENABLE_LTO
?Hopefully this quick summary will help others who encounter similar issue.
-Andrzej
Beta Was this translation helpful? Give feedback.
All reactions