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

-mmacosx-version-min=10.5 causes a linker error with latest clang/llvm from trunk #20586

Closed
llvmbot opened this issue Jul 5, 2014 · 5 comments
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Jul 5, 2014

Bugzilla Link 20212
Resolution FIXED
Resolved on Jul 22, 2014 10:56
Version trunk
OS MacOS X
Reporter LLVM Bugzilla Contributor
CC @TNorthover

Extended Description

Latest clang from trunk causes a linker error with '-mmacosx-version-min=' <= 10.5 given.
Xcode clang works as expected (note: this only happens for x86_64).

$ echo "int main(){return 0;}" | ~/llvm-trunk/bin/clang -xc -mmacosx-version-min=10.5 -arch x86_64 -
ld: symbol index out of range file '/var/folders/yv/43njmxj17k7gv_04z6m21krm0000gn/T/--fab1f1.o' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

$ ld -v
@(#)PROGRAM:ld PROJECT:ld64-236.3
configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 armv6m armv7m armv7em
LTO support using: LLVM version 3.4svn

$ ~/llvm-trunk/bin/clang --version
clang version 3.5.0 (http://llvm.org/git/clang.git c556f81241cf74850840c2e0df7a8f213674074d) (http://llvm.org/git/llvm.git db8cb22)

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jul 6, 2014

This reduces to just:

.globl	_main

_main:
.cfi_startproc
retq
.cfi_endproc

.subsections_via_symbols

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jul 6, 2014

This was caused by r211500.

Nick, so it looks like a current ld64 still expects the func.eh symbols to be present when targeting 10.5.

Is this a bug in ld64? If not, what are the exact requirements?

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jul 22, 2014

Any updates on it?
There is a necessity to update Rust's LLVM and it's a show-stopper.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jul 22, 2014

There is a thread about this issues in

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140714/226294.html

@TNorthover
Copy link
Contributor

I've just committed r213665 that should fix this.

It makes us emit __eh_frame sections without relocations even on older OS X versions. Apparently any ld64 after version 97.17 (Xcode 3.2.6) should be able to cope, but before that a newer version would have to be installed manually.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang Clang issues not falling into any other category
Projects
None yet
Development

No branches or pull requests

2 participants