You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ clang -mmacos-version-min=14.0 tls.c -c
$ ld -arch x86_64 -platform_version macos 14.0 14.0 tls.o
Undefined symbols for architecture x86_64:
"__tlv_bootstrap", referenced from:
_var in tls.o
"_pthread_create", referenced from:
_main in tls.o
"_puts", referenced from:
_func in tls.o
ld: symbol(s) not found for architecture x86_64
$ # __tlv_bootstrap indicates normal TLS
$ clang -mmacos-version-min=14.0 tls.c -c -femulated-tls
$ ld -arch x86_64 -platform_version macos 14.0 14.0 tls.o
Undefined symbols for architecture x86_64:
"___emutls_get_address", referenced from:
_func in tls.o
_func in tls.o
"_pthread_create", referenced from:
_main in tls.o
"_puts", referenced from:
_func in tls.o
ld: symbol(s) not found for architecture x86_64
$ # ___emutls_get_address indicates emulated TLS
$ clang tls.c -c -femulated-tls -flto
$ ld -arch x86_64 -platform_version macos 14.0 14.0 tls.o
Undefined symbols for architecture x86_64:
"__tlv_bootstrap", referenced from:
_var in lto.o
"_pthread_create", referenced from:
_main in lto.o
"_puts", referenced from:
_func in lto.o
ld: symbol(s) not found for architecture x86_64
$ # __tlv_bootstrap is used dispite -femulated-tls being passed.
It happens when using -emit-llvm instead of -flto too. My guess is that the TLS model used is decided after LLVM IR generation, is there a workaround to use emulated TLS with LTO?
The text was updated successfully, but these errors were encountered:
tls.c
:Run on macOS:
It happens when using -emit-llvm instead of -flto too. My guess is that the TLS model used is decided after LLVM IR generation, is there a workaround to use emulated TLS with LTO?
The text was updated successfully, but these errors were encountered: