I build the toolchain with newlib. gcc.dg/tls/alias-1.c and gcc.dg/tls/opt-2.c fail because symbol '__aeabi_read_tp' is missing in newlib C. These two tests should be marked unsupported instead of just letting them fail. The test alias-1.c does linking, and requires test target tls /* { dg-require-effective-target tls } */ However, the rule of tls is just checking whether a piece of code can be compiled quietly. The rule does not check whether the code can be linked quietly. Similarly, the test opt-2.c does linking, and requires test target tls_native. However, the rule of tls_native only checks compilation, not linking. The failures of the two tests are also observed on test report on target arm-unknown-elf: http://gcc.gnu.org/ml/gcc-testresults/2009-04/msg01691.html Below is the failure message we get: Executing on host: /usr/local/google/tmp/gcc4.4_dejagnu/obj/gcc-4.4/gcc/xgcc -B/usr/local/google/tmp/gcc4.4_dejagnu/obj/gcc-4.4/gcc/ /usr/local/google/nightly/sources/arm_toolchain/gcc-4.4/gcc/testsuite/gcc.dg/tls/alias-1.c gcc_tg.o -ansi -pedantic-errors -DSTACK_SIZE=16384 -L/usr/local/google/tmp/gcc4.4_dejagnu/obj/ld -Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -lm -o alias-1.exe (timeout = 800) /tmp/ccozOlBU.o: In function `main': alias-1.c:(.text+0x10): undefined reference to `__aeabi_read_tp' collect2: ld returned 1 exit status compiler exited with status 1 output is: /tmp/ccozOlBU.o: In function `main': alias-1.c:(.text+0x10): undefined reference to `__aeabi_read_tp' collect2: ld returned 1 exit status FAIL: gcc.dg/tls/alias-1.c (test for excess errors) Excess errors: alias-1.c:(.text+0x10): undefined reference to `__aeabi_read_tp' Executing on host: /usr/local/google/tmp/gcc4.4_dejagnu/obj/gcc-4.4/gcc/xgcc -B/usr/local/google/tmp/gcc4.4_dejagnu/obj/gcc-4.4/gcc/ /usr/local/google/nightly/sources/arm_toolchain/gcc-4.4/gcc/testsuite/gcc.dg/tls/opt-2.c gcc_tg.o -O2 -ftls-model=initial-exec -DSTACK_SIZE=16384 -L/usr/local/google/tmp/gcc4.4_dejagnu/obj/ld -Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -lm -o opt-2.exe (timeout = 800) /tmp/ccKCVaB4.o: In function `foo': opt-2.c:(.text+0x68): undefined reference to `__aeabi_read_tp' collect2: ld returned 1 exit status compiler exited with status 1 output is: /tmp/ccKCVaB4.o: In function `foo': opt-2.c:(.text+0x68): undefined reference to `__aeabi_read_tp' collect2: ld returned 1 exit status FAIL: gcc.dg/tls/opt-2.c (test for excess errors) Excess errors: opt-2.c:(.text+0x68): undefined reference to `__aeabi_read_tp' Target: arm-eabi Configured with: /usr/local/google/nightly/sources/arm_toolchain/gcc-4.4/configure --prefix=/usr/local/google/tmp/gcc4.4_dejagnu/install --target=arm-eabi --build=x86_64-linux-gnu --host=x86_64-linux-gnu --with-gmp=/usr/local/google/tmp/gcc4.4_dejagnu/install --with-mpfr=/usr/local/google/tmp/gcc4.4_dejagnu/install --enable-multilib --with-newlib --with-gnu-as --with-gnu-ld --enable-languages=c,c++ Thread model: single gcc version 4.4.0 20090416 (prerelease) (GCC)
Long description just barely missing that you can fix it by changing that dg-line into: /* { dg-require-effective-target tls_runtime } */ though strictly speaking it's not perfect; you'd want a predicate that checks using a link-test, not a run-test. But all in all, I don't think the distinction is worthwhile.
(In reply to comment #1) Bah, I missed the follow-up, as it wasn't in the audit trail. Feel free to ignore comment #1 and comment #2 (this ;)
Subject: Bug 39790 Author: jingyu Date: Tue Apr 28 20:39:11 2009 New Revision: 146913 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146913 Log: PR testsuite/39790 * lib/target-supports.exp (check_effective_target_tls): Remove comment of caching. (check_effective_target_tls_native): Likewise. (check_effective_target_tls_runtime): Likewise. * gcc.dg/tls/alias-1.c (dg-require-effective-target): Change target tls to tls_runtime. * gcc.dg/tls/opt-2.c: Add dg-require-effective-target tls_runtime. Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/tls/alias-1.c trunk/gcc/testsuite/gcc.dg/tls/opt-2.c trunk/gcc/testsuite/lib/target-supports.exp
Subject: Bug 39790 Author: jingyu Date: Tue Apr 28 20:57:42 2009 New Revision: 146914 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146914 Log: Backport from mainline. PR testsuite/39790 * lib/target-supports.exp (check_effective_target_tls): Remove comment of caching. (check_effective_target_tls_native): Likewise. (check_effective_target_tls_runtime): Likewise. * gcc.dg/tls/alias-1.c (dg-require-effective-target): Change target tls to tls_runtime. * gcc.dg/tls/opt-2.c: Add dg-require-effective-target tls_runtime. Modified: branches/gcc-4_4-branch/gcc/testsuite/ChangeLog branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/tls/alias-1.c branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/tls/opt-2.c branches/gcc-4_4-branch/gcc/testsuite/lib/target-supports.exp
Patch was committed to trunk and branch 4.4.