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

LLVM 15 library is broken #112200

Closed
2 tasks done
lerno opened this issue Oct 3, 2022 · 3 comments
Closed
2 tasks done

LLVM 15 library is broken #112200

lerno opened this issue Oct 3, 2022 · 3 comments
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age

Comments

@lerno
Copy link

lerno commented Oct 3, 2022

brew gist-logs <formula> link OR brew config AND brew doctor output

Spaceman:temp lerno$ brew gist-logs llvm
Error: No logs.

Verification

  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.

What were you trying to do (and why)?

Linking to LLVM 15 to compile a compiler.

What happened (include all command output)?

Linking fails due the compiler being a different version than the one LLVM is compiled with:

ld: in /usr/local/opt/llvm/lib/libLLVMTarget.a(Target.cpp.o), could not parse object file
 /usr/local/opt/llvm/lib/libLLVMTarget.a(Target.cpp.o): 'Not an int attribute
 (Producer: 'LLVM15.0.1' Reader: 'LLVM APPLE_1_1316.0.21.2.5_0')', using libLTO 
 version 'LLVM version 13.1.6, (clang-1316.0.21.2.5)' for architecture x86_64

What did you expect to happen?

Compile the program. Just like it does for all previous brew versions, like llvm@14, llvm@13 etc.

Step-by-step reproduction instructions (by running brew commands)

brew install llvm

Then link with libLLVMTarget.a using Clang 13.

The problem is that LLVM@15 is compiled with the thinLTO option. That makes the library compiler version dependent. And worse, dependent on a later compiler version than is normally installed on MacOS is XCode is used.

The solution is simple: remove the thinLTO directive.

@lerno lerno added the bug Reproducible Homebrew/homebrew-core bug label Oct 3, 2022
@carlocab
Copy link
Member

carlocab commented Oct 3, 2022

Will be fixed in #112154.

@carlocab carlocab linked a pull request Oct 3, 2022 that will close this issue
6 tasks
@carlocab carlocab closed this as completed Oct 3, 2022
@carlocab
Copy link
Member

carlocab commented Oct 3, 2022

Should be fixed now. Do

brew update && brew reinstall llvm

@lerno
Copy link
Author

lerno commented Oct 3, 2022

Works, thank you!

@github-actions github-actions bot added the outdated PR was locked due to age label Nov 7, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants