From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10661 invoked by alias); 17 Jun 2008 10:41:18 -0000 Received: (qmail 10647 invoked by uid 22791); 17 Jun 2008 10:41:17 -0000 X-Spam-Check-By: sourceware.org Received: from c2bthomr10.btconnect.com (HELO c2bthomr10.btconnect.com) (213.123.20.128) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 17 Jun 2008 10:40:50 +0000 Received: from [192.168.1.100] (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by c2bthomr10.btconnect.com with ESMTP id BFX76650; Tue, 17 Jun 2008 11:40:46 +0100 (BST) Mime-Version: 1.0 (Apple Message framework v753.1) Content-Transfer-Encoding: 7bit Message-Id: <159EDE9B-231E-4848-8F8D-FB8D86883C58@sandoe-acoustics.co.uk> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: Fortran List , GCC Development From: IainS Subject: [patch, howto, gfortan] make check fix ppc64/darwin8 Date: Tue, 17 Jun 2008 10:41:00 -0000 X-Mailer: Apple Mail (2.753.1) X-Junkmail-Status: score=10/50, host=c2bthomr10.btconnect.com X-Junkmail-SD-Raw: score=unknown, refid=str=0001.0A090206.485794AF.00CD,ss=1,fgs=0, ip=192.168.1.100, so=2007-10-30 19:00:17, dmn=5.4.3/2008-02-01 X-Junkmail-IWF: false Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2008-06/txt/msg00361.txt.bz2 I came across a "gotcha" whilst trying to test the static implementation of libgfortran on PPC64-apple-darwin8. Thanks to Tobias B for pointing me at 99% of the solution. Probably the number of affected systems is small ;) - but, FWIW, here's HOWTO and a fix. ----- If you host on {powerpc, i686}-apple-darwin8 and you want to static link (or check libgfortran) -m64 for PPC64 then this applies to you. There is an incompatibility [presumably in ld64] between the default debug symbol generation (stabs) and what's required for linking/checking PPC64 on darwin8 ... this incompatibility "is not going to be fixed". The specific crunch is that every -O3 torture test is compiled with -g => in gfortran this causes every -O3 torture test to fail when checking -m64. ---- The solution is to build the required code with -gdwarf-2, unfortunately the "-g" flag is hard-coded in a couple of relevant places: (a) in "fortran-torture.exp" and in "gcc-dg.exp" (which is included in gfortran-dg.exp) [ the change to gcc-dg.exp makes this non-local to gfortran ] (b) in the top level configure (as a default C/CXX/FLAGS_FOR_TARGET). The minimum change work-around is this: 1/ configure/make gcc with CFLAGS_FOR_TARGET = "-02 -gdwarf-2 - pipe" (and CXXFLAGS_FOR_TARGET the same) 2/ apply the following : Index: gcc/testsuite/lib/gcc-dg.exp =================================================================== --- gcc/testsuite/lib/gcc-dg.exp (revision 136861) +++ gcc/testsuite/lib/gcc-dg.exp (working copy) @@ -48,9 +48,15 @@ { -O2 } \ { -O3 -fomit-frame-pointer } \ { -O3 -fomit-frame-pointer -funroll-loops } \ - { -O3 -fomit-frame-pointer -funroll-all-loops -finline- functions } \ - { -O3 -g } \ - { -Os } ] + { -O3 -fomit-frame-pointer -funroll-all-loops -finline- functions } ] + + if { [istarget "*-*-darwin8"] } { + lappend DG_TORTURE_OPTIONS { -O3 -gdwarf-2 } + } else { + lappend DG_TORTURE_OPTIONS { -O3 -g } + } + + lappend DG_TORTURE_OPTIONS { -Os } } global GCC_UNDER_TEST Index: gcc/testsuite/lib/fortran-torture.exp =================================================================== --- gcc/testsuite/lib/fortran-torture.exp (revision 136861) +++ gcc/testsuite/lib/fortran-torture.exp (working copy) @@ -73,9 +73,16 @@ { -O2 } \ { -O2 -fomit-frame-pointer -finline-functions } \ { -O2 -fomit-frame-pointer -finline-functions -funroll- loops } \ - { -O2 -fbounds-check } \ - { -O3 -g } \ - { -Os } + { -O2 -fbounds-check } + + if { [istarget "*-*-darwin8"] } { + lappend options { -O3 -gdwarf-2 } + } else { + lappend options { -O3 -g } + } + + lappend options { -Os } + if { $test_tree_vectorize } { lappend options $vectorizer_options } ************************************* COMPARISONs of make check-host with and without the changes This is on darwin 8.11.0 ************************************* make check-host (default, m32) one extra pass, no regressions ************************************* g++ ----- no change gcc ----- one extra pass from using dwarf-2 FAIL: gcc.dg/pch/save-temps-1.c -O3 -g assembly comparison PASS: gcc.dg/pch/save-temps-1.c -O3 -gdwarf-2 assembly comparison gfortran ---------- no change obj-c++ ---------- no change obj-c ------ no change ************************************* make check-host (m64) RUNTESTFLAGS="--target_board=unix/-m64" 69 extra passes, no regressions ************************************* g++ ------ one extra pass from using dwarf-2 FAIL: g++.old-deja/g++.eh/badalloc1.C execution test (-g) PASS: g++.old-deja/g++.eh/badalloc1.C execution test (-gdwarf-2) gcc ----- one extra pass from using dwarf-2 FAIL: gcc.dg/pch/save-temps-1.c -O3 -g assembly comparison PASS: gcc.dg/pch/save-temps-1.c -O3 -gdwarf-2 assembly comparison gfortran (every test with -O3 -g fails ) ---------- 67 extra passes using -gdwarf-2 === gfortran Summary (-g) === # of expected passes 26196 # of unexpected failures 85 # of expected failures 46 # of unsupported tests 59 /Volumes/SwapScratch/OS-source/gcc-44-build/n2n/gcc/testsuite/ gfortran/../../gfortran version 4.4.0 20080612 (experimental) (GCC) === gfortran Summary (-gdwarf-2) === # of expected passes 26263 # of unexpected failures 18 # of expected failures 46 # of unsupported tests 59 /Volumes/SwapScratch/OS-source/gcc-44-build/n2n/gcc/testsuite/ gfortran/../../gfortran version 4.4.0 20080612 (experimental) (GCC) obj-c++ ---------- no change obj-c ------ no change ---- I guess, there's one residual puzzle to me; from the doc. I'd understand that the -O3 optimizations are in the back end and therefore common to all the tools. However, this problem only really shows up to any significant extent with gfortran. ttfn, Iain