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

Compiling rustc on OSX 10.6 fails with "Symbol not found: __tlv_bootstrap" #10842

Closed
agrif opened this issue Dec 7, 2013 · 9 comments
Closed
Labels
O-macos Operating system: macOS

Comments

@agrif
Copy link

agrif commented Dec 7, 2013

The full relevant part of the error:

compile_and_link: x86_64-apple-darwin/stage0/lib/rustc/x86_64-apple-darwin/lib/libstd.dylib
dyld: Symbol not found: __tlv_bootstrap
  Referenced from: /Users/agrif/local/rust/x86_64-apple-darwin/stage0/bin/../lib/libstd-6425b930ca146ae9-0.9-pre.dylib
  Expected in: /usr/lib/libSystem.B.dylib
 in /Users/agrif/local/rust/x86_64-apple-darwin/stage0/bin/../lib/libstd-6425b930ca146ae9-0.9-pre.dylib

It looks like __tlv_bootstrap is a marker symbol for the thread local variables rust uses, and this is available in 10.7 but not 10.6.

@alexcrichton provided me with this snippet of LLVM code that fails to link in both GCC and Clang with the same error.

OSX 10.6 is still listed in the README as a supported platform. I'd love to be able to compile this under 10.6, but if not, remember to update that readme.

@emberian
Copy link
Member

emberian commented Dec 7, 2013

What even is __tlv_bootstrap? I can't find any references to it in the wild, except things not working.

@alexcrichton
Copy link
Member

This is all related to LLVM's treatment of thread_local globals. Due to LLVM not being able to compile the small assembly snippet of mine, I'm pinning this on an LLVM limitation rather than a rust compiler error. Our options include:

  • Drop support for 10.6
  • Don't use #[thread_local] at all on OSX
  • Add cfg(osx_version = "10.6") (where does it end?)

I'm not liking any of these options...

@huonw
Copy link
Member

huonw commented Dec 7, 2013

Another option: Add a feature detection mechanism, i.e. #[cfg(feature_supported="thread_local")]?

@thestinger
Copy link
Contributor

Does this work on OS X 10.7?

@agrif
Copy link
Author

agrif commented Dec 9, 2013

brson in the mozilla #rust IRC channel mentioned that the OSX builds are done on 10.7, so I assume that means it builds on 10.7, and that also explains why this failure on 10.6 went unnoticed.

@lkuper
Copy link
Contributor

lkuper commented Jan 5, 2014

I have the same failure under 10.6.

@michaelbartnett
Copy link

Also running into this (MacOS 10.6.8, Xcode 4.2). Here's another terminal paste, much like the other: https://gist.github.com/michaelbartnett/8432437

@alexcrichton
Copy link
Member

Closing as a result of #11952, we're dropping support for 10.6

alexcrichton pushed a commit to alexcrichton/rust that referenced this issue Feb 1, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 30, 2023
allow disabling module inception on private modules

Fixes rust-lang#10842

changelog: Enhancement [`module_inception`]: Added `allow-private-module-inception` configuration.
[rust-lang#10917](rust-lang/rust-clippy#10917)
<!-- changelog_checked -->
@i3roly
Copy link

i3roly commented Jan 5, 2025

@alexcrichton is there any way for a determined person to get rust to play along?

i mean, if someone produces the right settings for a clang that successfully can target 10.6, is it possible to use it to finish a rustc compilation?

this is a little insane that thread_local was the reason the rust team shut it down. especially since there is an emulated tls model flag.

i'm not asking if there's a way to get a rustc compiler on 10.6.

i am asking for a way to build rustc on a more modern mac that can successfully target 10.6.

it seems i can get a libclang_rt with little effort (maybe it's wrong, i dont know) and this seems to be a huge part of the 10.7 limitation i'm seeing on a lot of prebuilt rust libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-macos Operating system: macOS
Projects
None yet
Development

No branches or pull requests

8 participants