-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Regression suite: undefined reference to `__tls_get_addr' #752
Comments
I would not expect the TLS (Thread Local Storage) tests to work for an embedded elf target. Our newlib port does not have TLS support. They should not be run at all. This testcase gcc.dg/tls/opt-12.c has a line The TLS tests should work for a linux target. If you check the gcc.log file, you should see where it tried to compile a tls_runtimeX.c file, where X is a random number (probably a process id), and this should get the same __tls_get_addr link error, which will disable all TLS tests. |
The compilation of the |
You can find check_effective_target_tls_runtime in gcc/testsuite/lib/target-supports.exp. You could try extracting the C code from there and compiling it with the options in the gcc.log file to see what is happening. In my gcc.log file I see The march/mabi/mcmodel options should not matter. Make sure it is the right compiler with no unexpected options. I've never tried a -j number as high as 128. I think about 16 is the highest i've tried. It is possible that there is a bug in the testsuite that causes it to fail at high -j values. We have seen cases where a tcl/expect variable got set for some testcases and then we forgot to unset it when done, which may cause failures for following tests that depend on the exact order in which the tests are run, which depends on the -j factor. But that seems unlikely. Probably something simpler has gone wrong but not obvious what that might be. |
Is there a way to tell dejganu to not delete all the tmp files it used/produced? Otherwise I will try and play around with |
I'm compiling this from __thread int thr __attribute__((tls_model("global-dynamic"))) = 0;
int main (void) { return thr; } with
basically verbatim from I can't get it to fail linking. |
I don't know why that works in the gcc log but not directly. I suspect a hidden environment variable is set somewhere. You can fix this by adding a -B option that points at the dir with the crt0.o file, and put a trailing slash at the end to tell gcc that it is a dir name. Or you can just use the compiler in the install tree which is simpler. I don't know if there is an option to avoid deleting temp files. You can pass -v options to get verbose info, the more -v options the more verbose it is, but that may not help. You can use something like RUNTESTFLAGS="-v -v -v -v" to do that. If you add -S, you should see a call to __tls_get_addr, and there should be no definition in newlib libc.a. |
I ammended the exact command in gcc.log with
I'm not sure where I'm going wrong |
I would suggest ignoring the testsuite failures. They aren't important. If they are bothering you, you can put them in the allow lists in the test dir so that make report will ignore them. The toolchain is maintained by volunteer labor, and getting the testsuite to pass without error is more work than we have time to do. |
Thanks for the help I will use the allow list |
When I run
make report-gcc
with gdb-sim (by commenting out the PATH extension step pointing to qemu) I see various failureslike this
using
riscv-sim/-march=rv32imafc/-mabi=ilp32f/-mcmodel=medlow
These failures are all related to the missing symbol `__tls_get_addr'.
When running the regression suite with qemu, it just skips over those tests I believe (maybe because there is no executable produced?)
The text was updated successfully, but these errors were encountered: