Hello,
In order to run regression test on simulator, the testglue.c will be
compiled and linked to return the return status of cases executed on
simulator. In my recent work, I built a cross compiler for arm-none-eabi.
When run regression test for libstdc++-v3 using command "make check-target
"RUNTESTFLAGS=--target_board=arm-none-eabi-qemu/-mthumb/-mcpu=cortex-m3", I
got the below errors:
Test Run By build on Thu Aug 11 14:30:04 2011
Target is arm-none-eabi
Host is arm-none-eabi
Build is i686-pc-linux-gnu
=== libstdc++ tests ===
Schedule of variations:
arm-none-eabi-qemu/-mthumb/-mcpu=cortex-m3
Running target arm-none-eabi-qemu/-mthumb/-mcpu=cortex-m3
Using
/home/build/work/jenkins-daily-build/src/oban-scripts/dejagnu/boards/arm-non
e-eabi-qemu.exp as board description file for target.
Using
/home/build/work/jenkins-daily-build/src/oban-scripts/dejagnu/boards/qemu.ex
p as generic interface file for target.
Using
/home/build/work/jenkins-daily-build/src/gcc/libstdc++-v3/testsuite/config/d
efault.exp as tool-and-target-specific interface file.
Running
/home/build/work/jenkins-daily-build/src/gcc/libstdc++-v3/testsuite/libstdc+
+-abi/abi.exp ...
LD_LIBRARY_PATH =
Executing on host:
/home/build/work/jenkins-daily-build/build-linux/gcc-final/gcc/xgcc
-B/home/build/work/jenkins-daily-build/build-linux/gcc-final/gcc/ -w
-fexceptions -c -mthumb -mcpu=cortex-m3 -o
/home/build/work/jenkins-daily-build/build-linux/gcc-final/arm-none-eabi/lib
stdc++-v3/testsuite/testglue.o /usr/share/dejagnu/testglue.c (timeout =
300)
/usr/share/dejagnu/testglue.c:1:19: fatal error: stdio.h: No such file or
directory
compilation terminated.
compiler exited with status 1
output is:
/usr/share/dejagnu/testglue.c:1:19: fatal error: stdio.h: No such file or
directory
compilation terminated.
After investigated how the gcc regression test works, I thought the above
fail is due to missing "set TEST_GCC_EXEC_PREFIX ...." in
gcc-build/arm-none-eabi/libstdc++-v3/testsuite/site.exp. The
TEST_GCC_EXEC_PREFIX impacts the value of GCC_EXEC_PREFIX which impacts the
way GCC to find header files. The GCC regression test defines this variable,
I don't know why libstdc++ doesn't define. After add this variable, the
testglue.c can be built and the regression test works fine.
If run this regression test natively or doesn't set need_status_wrapper in
board description file, the testglue.c won't be involved and thus no such
failure.
Here is the patch to define TEST_GCC_EXEC_PREFIX in site.exp of libstdc++
regression test. Tested for arm-none-eabi using QEMU with different GCC
options Os/O0/O2/O3. No regression found. OK to commit?
libstdc++-v3/ChangLog:
2011-08-11 Terry Guo <[email protected]>
* testsuite/Makefile.in (TEST_GCC_EXEC_PREFIX): New.
diff --git a/libstdc++-v3/testsuite/Makefile.in
b/libstdc++-v3/testsuite/Makefile.in
index 37e8a3c..52c3431 100644
--- a/libstdc++-v3/testsuite/Makefile.in
+++ b/libstdc++-v3/testsuite/Makefile.in
@@ -504,6 +504,7 @@ site.exp: Makefile
@echo 'set libiconv "$(LIBICONV)"' >>site.tmp
@echo 'set baseline_dir "$(baseline_dir)"' >> site.tmp
@echo 'set baseline_subdir_switch "$(baseline_subdir_switch)"' >>
site.tmp
+ @echo 'set TEST_GCC_EXEC_PREFIX "$(libdir)/gcc/"' >> site.tmp
@echo '## All variables above are generated by configure. Do Not
Edit ##' >>site.tmp
@test ! -f site.exp || \
sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
BR,
Terry