From patchwork Wed Oct 15 15:46:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 400016 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5FB4F140139 for ; Thu, 16 Oct 2014 02:47:07 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=l3J/U6/NQMdnnYl2Hsdxaba2ziYKlfQYlT8w50zlxPa28DUH1t Lz+2L2K1uUjMpzt4oMt2ofPnWWWH8fxF8quNUtw1kAMsJBU7VecKRAMsKYIXhwoP sKQMpdM9sIPtARBdi1TwDNnwAAtSLUunReG/K1cFFIoYJnHqD2jZnGrN8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; s= default; bh=f52X54leCKZ2KESurwPwsgMyAgY=; b=wAL3e5tsoHtHqJphSxvD 9UMVXgj53Daw7vBJnp9rrcR8v6cQ2ssmaLS0mzJQ1XGHKzo212OgrvrLIbY0rwUq C8vcXI8E97ZWEW7ttrNjhHQ6nB+BkS+z/M14FEv+8GiQs5pyUVT/koVrlu7BkvSr kIDbVfgG3P0i4mIqoKaioQA= Received: (qmail 26982 invoked by alias); 15 Oct 2014 15:47:01 -0000 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 Received: (qmail 26960 invoked by uid 89); 15 Oct 2014 15:47:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, T_FROM_12LTRDOM autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Oct 2014 15:46:58 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1XeQmq-0002uV-KD from Thomas_Schwinge@mentor.com ; Wed, 15 Oct 2014 08:46:52 -0700 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.3.181.6; Wed, 15 Oct 2014 16:46:51 +0100 From: Thomas Schwinge To: Jakub Jelinek , Richard Henderson , CC: Rainer Orth , Mike Stump , Janis Johnson Subject: libgomp testsuite: (not) using a specific driver for C++, Fortran? User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Wed, 15 Oct 2014 17:46:48 +0200 Message-ID: <87h9z5wd1z.fsf@schwinge.name> MIME-Version: 1.0 Hi! No matter whether it's C, C++, or Fortran source code, the libgomp testsuite always uses (for build-tree testing) gcc/xgcc, or (for installed testing) GCC_UNDER_TEST. It doesn't make use of GXX_UNDER_TEST, GFORTRAN_UNDER_TEST. To support the latter two languages' needs, some -l[...] flags are then added via lang_link_flags. For example, for Fortran this is -lgfortran. This is, however, not what would happen if using the gfortran driver to build (which is what a user would be doing -- which we should replicate as much as possible at least for installed testing): the gfortran driver also adds -lquadmath, if applicable. Now, I wonder why to re-invent all that in the libgomp testsuite, if the respective driver already has that knowledge, via spec files, for example? (Also, the regular GCC compiler tests, gcc/testsuite/, are doing the right thing.) Why is libgomp testsuite implemented this way -- just a legacy of the past, or is there a need for that (that I'm not seeing)? Maybe the question also is: why isn't the libgomp testsuite using more of the infrastructure for specific languages, that is already implemented in gcc/testsuite/lib/? (That is, why does libgomp have to use libgomp_target_compile, instead of [language]_target_compile, for example.) And maybe that problem also applied to additional target libraries' testsuites; I have not yet looked. Anyway, here is a prototype patch to describe how I began to address this for the issue I stumbled upon, which is that the linker complained: Executing on host: x86_64-none-linux-gnu-gcc [...]/libgomp/testsuite/libgomp.fortran/aligned1.f03 [...] -fopenmp -O0 -fopenmp -fcray-pointer -lgfortran -lm -o ./aligned1.exe (timeout = 300) [...]/ld: warning: libquadmath.so.0, needed by [...]/libgfortran.so, not found (try using -rpath or -rpath-link) [...]/libgfortran.so: undefined reference to `logq@QUADMATH_1.0' [...] (That goes away if I add -lquadmath to the command line, but that's not the point I'm making here.) Am I on the right track with the following? Grüße, Thomas --- libgomp/testsuite/lib/libgomp.exp +++ libgomp/testsuite/lib/libgomp.exp @@ -210,7 +210,6 @@ proc libgomp_target_compile { source dest type options } { lappend options "additional_flags=[libio_include_flags]" lappend options "timeout=[timeout_value]" - lappend options "compiler=$GCC_UNDER_TEST" set options [concat $libgomp_compile_options $options] --- libgomp/testsuite/libgomp.c++/c++.exp +++ libgomp/testsuite/libgomp.c++/c++.exp @@ -4,6 +4,7 @@ load_gcc_lib gcc-dg.exp global shlib_ext set shlib_ext [get_shlib_extension] +#TODO set lang_link_flags "-lstdc++" set lang_test_file_found 0 set lang_library_path "../libstdc++-v3/src/.libs" @@ -41,6 +42,11 @@ if { $blddir != "" } { } if { $lang_test_file_found } { + if ![info exists GXX_UNDER_TEST] then { + set GXX_UNDER_TEST $GCC_UNDER_TEST + } + lappend libgomp_compile_options "compiler=$GXX_UNDER_TEST" + # Gather a list of all tests. set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]] --- libgomp/testsuite/libgomp.c/c.exp +++ libgomp/testsuite/libgomp.c/c.exp @@ -23,6 +23,8 @@ dg-init # Turn on OpenMP. lappend ALWAYS_CFLAGS "additional_flags=-fopenmp" +lappend libgomp_compile_options "compiler=$GCC_UNDER_TEST" + # Gather a list of all tests. set tests [lsort [find $srcdir/$subdir *.c]] --- libgomp/testsuite/libgomp.fortran/fortran.exp +++ libgomp/testsuite/libgomp.fortran/fortran.exp @@ -7,6 +7,7 @@ global ALWAYS_CFLAGS set shlib_ext [get_shlib_extension] set lang_library_path "../libgfortran/.libs" +#TODO set lang_link_flags "-lgfortran" if [info exists lang_include_flags] then { unset lang_include_flags @@ -44,6 +45,11 @@ if { $blddir != "" } { } if { $lang_test_file_found } { + if ![info exists GFORTRAN_UNDER_TEST] then { + set GFORTRAN_UNDER_TEST $GCC_UNDER_TEST + } + lappend libgomp_compile_options "compiler=$GFORTRAN_UNDER_TEST" + # Gather a list of all tests. set tests [lsort [find $srcdir/$subdir *.\[fF\]{,90,95,03,08}]] --- libgomp/testsuite/libgomp.graphite/graphite.exp +++ libgomp/testsuite/libgomp.graphite/graphite.exp @@ -48,6 +48,8 @@ dg-init # Turn on OpenMP. lappend ALWAYS_CFLAGS "additional_flags=-fopenmp" +lappend libgomp_compile_options "compiler=$GCC_UNDER_TEST" + # Gather a list of all tests. set tests [lsort [find $srcdir/$subdir *.c]]