Skip to content
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

macos 11 with llvm 14 broken #235

Open
lczech opened this issue Mar 13, 2024 · 6 comments
Open

macos 11 with llvm 14 broken #235

lczech opened this issue Mar 13, 2024 · 6 comments

Comments

@lczech
Copy link

lczech commented Mar 13, 2024

Hi there,

after my source files all compile fine, I'm getting a linking error at the end:

ld: warning: directory not found for option '-L"/Users/runner/llvm/lib"'
ld: warning: dylib (/Users/runner/llvm/lib/libc++.dylib) was built for newer macOS version (11.6) than being linked (11.0)
ld: warning: dylib (/Users/runner/llvm/lib/libunwind.dylib) was built for newer macOS version (11.6) than being linked (11.0)
ld: warning: dylib (/Users/runner/llvm/lib/libunwind.dylib) was built for newer macOS version (11.6) than being linked (11.0)
ThinLTO: CMakeFiles/grenedalf.dir/src/commands/analyze/fst.cpp.o1: error: Invalid value (Producer: 'LLVM14.0.6' Reader: 'LLVM APPLE_1_1300.0.29.30_0')
LLVM ERROR: Can't load module, abort.
clang-14: error: unable to execute command: Abort trap: 6
clang-14: error: linker command failed due to signal (use -v to see invocation)

This only happens with macos 11 and llvm 14, and seems to be coming from some mismatching versions. I am not entirely sure if this is a setup-cpp issue (it seems so though), or something else. If something else, feel free to close this issue again ;-)

Cheers
Lucas

Upvote & Fund

@aminya is using Polar.sh so you can upvote and help fund this issue. The funding is received once the issue is completed & confirmed by you.

Thank you in advance for helping prioritize & fund our backlog!


Fund with Polar
lczech added a commit to lczech/grenedalf that referenced this issue Mar 14, 2024
@aminya
Copy link
Owner

aminya commented Mar 14, 2024

It seems to me that the reason it is broken is because of LTO. Not sure what we can do to fix that old LLVM.

@lczech
Copy link
Author

lczech commented Mar 14, 2024

Not sure that I understand. It seemed to me that this is due to a setup of two conflicting versions of LLVM. How would LTO introduce this error?

@aminya
Copy link
Owner

aminya commented Mar 14, 2024

Because in LTO, the linker strictly requires matching MacOS target versions. If you build without LTO, it warns, but it will succeed in building.

@lczech
Copy link
Author

lczech commented Mar 14, 2024

Ah I see, thanks for the explanation! Isn't that something that would be fixed by having matching target versions though? Is that something that could be done here in setup-cpp? I'd like to keep LTO activated if possible, and not have to introduce an exception for certain OS/compiler combinations :-)

@aminya
Copy link
Owner

aminya commented Mar 15, 2024

Those specific binaries that LLVM provided are built with that target version. I'll see if there's a solution other than building from the source

@lczech
Copy link
Author

lczech commented Mar 15, 2024

Ah now it makes sense that you said

Not sure what we can do to fix that old LLVM.

before :-D Thanks for being patient with me, now I get it!

No worries, if that's too much hassle, I don't think it's the most important thing to fix. I have now simply excluded OSX11 + LLVM14 from my GitHub Actions workflow, which is okay. Any user that happens to want to use exactly those two will then have to deal with it somehow ;-)

Feel free to close the issue if this requires more than just a quick version fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants