Skip to content

LLVM 20 packages ship bitcode instead of object files #133580

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

Open
AlexDenisov opened this issue Mar 29, 2025 · 3 comments · May be fixed by #140381
Open

LLVM 20 packages ship bitcode instead of object files #133580

AlexDenisov opened this issue Mar 29, 2025 · 3 comments · May be fixed by #140381

Comments

@AlexDenisov
Copy link
Member

It seems that the packages for (at least) LLVM 20.1.0 and 20.1.1 ship bitcode files instead of object files on both Linux and macOS.

Packages I checked:

This yields packages unusable at least on macOS with Xcode's clang, linking emits a lot of errors like this:

 could not parse bitcode object file /opt/LLVM/20.1.0/lib/libLLVMSupport.a[32](CodeGenCoverage.cpp.o): 'Unknown attribute kind (91) (Producer: 'LLVM20.1.0' Reader: 'LLVM APPLE_1_1600.0.26.6_0')', using libLTO version 'LLVM version 16.0.0' in '/opt/LLVM/20.1.0/lib/libLLVMSupport.a[32](CodeGenCoverage.cpp.o)'

Workaround

As a workaround, one can use compilers from the same package, but also have to use lld (-fuse-ld=lld), otherwise it fails with default Xcode linker (albeit for an unrelated reason):

> echo "int main() { return 0; }" > main.c
> /opt/LLVM/20.1.0/bin/clang main.c
dyld[10373]: Symbol not found: ___cxa_demangle
  Referenced from: <565CE761-C1EB-37F5-9738-E1BCF6F2EC75> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
  Expected in:     <4C4C44F0-5555-3144-A1B9-74F6D413BAC4> /opt/LLVM/20.1.0/lib/libc++.1.0.dylib
clang: error: unable to execute command: Abort trap: 6
clang: error: linker command failed due to signal (use -v to see invocation)

This works though:

/opt/LLVM/20.1.0/bin/clang main.c -fuse-ld=lld
@AlexDenisov AlexDenisov added bug Indicates an unexpected problem or unintended behavior infrastructure Bugs about LLVM infrastructure labels Mar 29, 2025
@llvmbot
Copy link
Member

llvmbot commented Mar 29, 2025

@llvm/issue-subscribers-infrastructure

Author: Alex Denisov (AlexDenisov)

It seems that the packages for (at least) LLVM 20.1.0 and 20.1.1 ship bitcode files instead of object files on both Linux and macOS.

Packages I checked:

This yields packages unusable at least on macOS with Xcode's clang, linking emits a lot of errors like this:

 could not parse bitcode object file /opt/LLVM/20.1.0/lib/libLLVMSupport.a[32](CodeGenCoverage.cpp.o): 'Unknown attribute kind (91) (Producer: 'LLVM20.1.0' Reader: 'LLVM APPLE_1_1600.0.26.6_0')', using libLTO version 'LLVM version 16.0.0' in '/opt/LLVM/20.1.0/lib/libLLVMSupport.a[32](CodeGenCoverage.cpp.o)'

Workaround

As a workaround, one can use compilers from the same package, but also have to use lld (-fuse-ld=lld), otherwise it fails with default Xcode linker (albeit for an unrelated reason):

&gt; echo "int main() { return 0; }" &gt; main.c
&gt; /opt/LLVM/20.1.0/bin/clang main.c
dyld[10373]: Symbol not found: ___cxa_demangle
  Referenced from: &lt;565CE761-C1EB-37F5-9738-E1BCF6F2EC75&gt; /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
  Expected in:     &lt;4C4C44F0-5555-3144-A1B9-74F6D413BAC4&gt; /opt/LLVM/20.1.0/lib/libc++.1.0.dylib
clang: error: unable to execute command: Abort trap: 6
clang: error: linker command failed due to signal (use -v to see invocation)

This works though:

/opt/LLVM/20.1.0/bin/clang main.c -fuse-ld=lld

@llvmbot
Copy link
Member

llvmbot commented Mar 29, 2025

@llvm/issue-subscribers-bug

Author: Alex Denisov (AlexDenisov)

It seems that the packages for (at least) LLVM 20.1.0 and 20.1.1 ship bitcode files instead of object files on both Linux and macOS.

Packages I checked:

This yields packages unusable at least on macOS with Xcode's clang, linking emits a lot of errors like this:

 could not parse bitcode object file /opt/LLVM/20.1.0/lib/libLLVMSupport.a[32](CodeGenCoverage.cpp.o): 'Unknown attribute kind (91) (Producer: 'LLVM20.1.0' Reader: 'LLVM APPLE_1_1600.0.26.6_0')', using libLTO version 'LLVM version 16.0.0' in '/opt/LLVM/20.1.0/lib/libLLVMSupport.a[32](CodeGenCoverage.cpp.o)'

Workaround

As a workaround, one can use compilers from the same package, but also have to use lld (-fuse-ld=lld), otherwise it fails with default Xcode linker (albeit for an unrelated reason):

&gt; echo "int main() { return 0; }" &gt; main.c
&gt; /opt/LLVM/20.1.0/bin/clang main.c
dyld[10373]: Symbol not found: ___cxa_demangle
  Referenced from: &lt;565CE761-C1EB-37F5-9738-E1BCF6F2EC75&gt; /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
  Expected in:     &lt;4C4C44F0-5555-3144-A1B9-74F6D413BAC4&gt; /opt/LLVM/20.1.0/lib/libc++.1.0.dylib
clang: error: unable to execute command: Abort trap: 6
clang: error: linker command failed due to signal (use -v to see invocation)

This works though:

/opt/LLVM/20.1.0/bin/clang main.c -fuse-ld=lld

@EugeneZelenko EugeneZelenko added packaging platform:macos and removed bug Indicates an unexpected problem or unintended behavior infrastructure Bugs about LLVM infrastructure labels Mar 29, 2025
@nikic
Copy link
Contributor

nikic commented Apr 4, 2025

cc @tstellar

@nikic nikic added this to the LLVM 20.X Release milestone Apr 4, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in LLVM Release Status Apr 4, 2025
@tstellar tstellar moved this from Needs Triage to Needs Fix in LLVM Release Status Apr 11, 2025
@tstellar tstellar linked a pull request May 17, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Fix
Development

Successfully merging a pull request may close this issue.

4 participants