-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
CONFIG_THREAD_LOCAL_STORAGE=y build fails with ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb #29541
Comments
@galak: FYI |
This error doesn't happen if built with CONFIG_NEWLIB_LIBC=y, which leads us to the patch #29542. Note that I didn't try to investigate why emutls.c "the emulation of thread local storage using malloc()" https://github.com/gcc-mirror/gcc/blob/master/libgcc/emutls.c is being used. @galak, let me know if you think that should be investigated. |
@dcpleung fyi |
since this is the case w/minlibc that fails, its odd to me that this works ok w/Zephyr SDK & fails w/gnuarmemb. |
Apparently, some implicitly linked libs included with Zephyr SDK provide abort(). |
looking at the error message in more detail, I see this is in libgcc, so that partially explains it. |
Based on https://github.com/ARM-software/toolchain-gnu-bare-metal/blob/365499ead3c18e9c1a70880c34d8efe08549df3c/build-toolchain.sh#L423 we should probably change things so TLS is only supported w/Zephyr toolchain. |
Submitted #29591 to limit the kconfig option to Zephyr SDK only. Hopefully that fixes the issue. |
Right. But that's orthogonal to the missing abort() in minlibc, PR #29542. |
Toolchains other than Zephyr SDK may not support generating code with thread local storage. So limit TLS to Zephyr SDK for now, and only enable TLS on other toolchains as needed. Fixes zephyrproject-rtos#29541 Signed-off-by: Daniel Leung <[email protected]>
It's not clear to me the root cause here. Does this toolchain really not support TLS at all? Or is this just some reference to abort() from libgcc that is simply fixed by #29542 |
According to the link from @galak, it looks like the toolchain is built without TLS support (as configured with |
abort() is an important runtime function, oftentimes used to signal abnormal execution conditions in generic applications. Worse, they may be used under such circumstances in e.g. compiler support libraries, in which case lack of implementation of this function will lead to link error. Fixes: zephyrproject-rtos#29541 Signed-off-by: Paul Sokolovsky <[email protected]>
abort() is an important runtime function, oftentimes used to signal abnormal execution conditions in generic applications. Worse, they may be used under such circumstances in e.g. compiler support libraries, in which case lack of implementation of this function will lead to link error. Fixes: #29541 Signed-off-by: Paul Sokolovsky <[email protected]>
Toolchains other than Zephyr SDK may not support generating code with thread local storage. So limit TLS to Zephyr SDK for now, and only enable TLS on other toolchains as needed. Fixes #29541 Signed-off-by: Daniel Leung <[email protected]>
ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb is one of the supported toolchains to build Zephyr (for ARM architecture). After #28982 was merged, and with CONFIG_THREAD_LOCAL_STORAGE enabled (which it is, for one sanitycheck configuration of tests/kernel/common), the build fails with:
Full build log: https://ci.linaro.org/job/zephyr-upstream/PLATFORM=frdm_k64f,ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb,label=docker-xenial-amd64-13/5680/console
The text was updated successfully, but these errors were encountered: