casaroli commented on code in PR #20723: URL: https://github.com/apache/nuttx/pull/20723#discussion_r4321610111
########## libs/libc/tls/CMakeLists.txt: ########## @@ -20,7 +20,20 @@ # # ############################################################################## -set(SRCS task_getinfo.c tls_getinfo.c) +set(SRCS task_getinfo.c tls_getinfo.c tls_emutls.c) + +# Take the emutls functions from libc, not from libgcc: the apps refer to them +# only after the linker has scanned libc (see tools/Config.mk). + +if(CONFIG_ARCH_TOOLCHAIN_GCC AND NOT CONFIG_ARCH_SIM) Review Comment: You are right: the sim on Windows with MinGW gcc uses emutls, and there libgcc's copy is per host thread, which all NuttX threads share. I will enable `CONFIG_TLS_EMUTLS` for the sim when the host toolchain is gcc with GNU ld (Linux and MinGW), with `-Wl,--wrap=...` as you propose, because the sim links through the compiler driver. It stays off where the host linker has no `--wrap`: macOS (ld64) and MSVC. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
