From patchwork Thu Aug 11 13:00:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Terry Guo X-Patchwork-Id: 109610 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id F3D9DB6F83 for ; Thu, 11 Aug 2011 23:01:02 +1000 (EST) Received: (qmail 867 invoked by alias); 11 Aug 2011 13:01:01 -0000 Received: (qmail 844 invoked by uid 22791); 11 Aug 2011 13:01:00 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL, BAYES_00, MSGID_MULTIPLE_AT, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from service87.mimecast.com (HELO service87.mimecast.com) (94.185.240.25) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Thu, 11 Aug 2011 13:00:42 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Thu, 11 Aug 2011 14:00:39 +0100 Received: from Terrysh02 ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.0); Thu, 11 Aug 2011 14:00:32 +0100 From: "Terry Guo" To: , Subject: [PATCH, libstdc++-v3] Enable to cross-test libstdc++ on simulator. Date: Thu, 11 Aug 2011 21:00:24 +0800 Message-ID: <000401cc5826$a45ef5b0$ed1ce110$@guo@arm.com> MIME-Version: 1.0 X-MC-Unique: 111081114003904601 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 * testsuite/Makefile.in (TEST_GCC_EXEC_PREFIX): New. @test ! -f site.exp || \ sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp BR, Terry 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