From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30226 invoked by alias); 14 Sep 2012 20:44:45 -0000 Received: (qmail 30215 invoked by uid 22791); 14 Sep 2012 20:44:43 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 14 Sep 2012 20:44:28 +0000 From: "baker at usgs dot gov" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/54584] New: m68k-uclinux error: Link tests are not allowed after GCC_NO_EXECUTABLES Date: Fri, 14 Sep 2012 20:44:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: blocker X-Bugzilla-Who: baker at usgs dot gov X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-09/txt/msg01135.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D54584 Bug #: 54584 Summary: m68k-uclinux error: Link tests are not allowed after GCC_NO_EXECUTABLES Classification: Unclassified Product: gcc Version: 4.7.1 Status: UNCONFIRMED Severity: blocker Priority: P3 Component: target AssignedTo: unassigned@gcc.gnu.org ReportedBy: baker@usgs.gov Created attachment 28193 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=3D28193 Make m68k-uclinux-gcc/g++ cross compilers Host: i686-pc-linux (also x86_64-apple-darwin10.8.0) Target: m68k-uclinux (Coldfire) Build of msep-data/libstdc++-v3 fails for FreeScale Coldfire uClinux target (complete configure and build commands are attached): : Running configure in multilib subdir msep-data : checking command to parse /tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/nm output from /tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/xgcc -B/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/ -B/usr/local/gcc-4.7-20120908/m68k-uclinux/bin/ -B/usr/local/gcc-4.7-20120908/m68k-uclinux/lib/ -isystem /usr/local/gcc-4.7-20120908/m68k-uclinux/include -isystem /usr/local/gcc-4.7-20120908/m68k-uclinux/sys-include -msep-data -Wa,-mno-m= ac object... failed : checking for shl_load... configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES. make[2]: *** [configure-target-libstdc++-v3] Error 1 In msep-data/libstdc++-v3/config.log there is an earlier link failure which causes gcc_no_link=3Dyes: configure:3885: /tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/x= gcc -B/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/ -B/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/../freescale-coldfire= -gcc-4.7-20120908/m68k-uclinux/bin/ -B/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/../freescale-coldfire= -gcc-4.7-20120908/m68k-uclinux/lib/ -isystem /tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/../freescale-coldfire-g= cc-4.7-20120908/m68k-uclinux/include -isystem /tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/../freescale-coldfire-g= cc-4.7-20120908/m68k-uclinux/sys-include -msep-data -Wa,-mno-mac -o conftest -g -O2 conftest.c >&5 /tmp/freescale-coldfile-xgcc/freescale-coldfire-2011.09/m68k-uclinux/bin/ld= .real: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status configure:11284: checking for shl_load configure:11284: error: Link tests are not allowed after GCC_NO_EXECUTABLES. I extracted the failed command and showed that the link fails for both msep-data and -fPIC (implied by -msep-data): $ cat conftest.c /* confdefs.h */ #define PACKAGE_NAME "package-unused" #define PACKAGE_TARNAME "libstdc++" #define PACKAGE_VERSION "version-unused" #define PACKAGE_STRING "package-unused version-unused" #define PACKAGE_BUGREPORT "" #define PACKAGE_URL "" /* end confdefs.h. */ int main () { ; return 0; } # Failed link from libstdc++-v3/configure: /tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/xgcc -t -B/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/ -B/usr/local/gcc-4.7-20120908/m68k-uclinux/bin/ -B/usr/local/gcc-4.7-20120908/m68k-uclinux/lib/ -isystem /usr/local/gcc-4.7-20120908/m68k-uclinux/include -isystem /usr/local/gcc-4.7-20120908/m68k-uclinux/sys-include -msep-data -Wa,-mno-ma= c -o conftest conftest.o # /usr/local/gcc-4.7-20120908/m68k-uclinux/bin/ld.real: final link failed: Nonrepresentable section on output # collect2: error: ld returned 1 exit status # The problem is actually with -fPIC (implied by -msep-data): /tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/xgcc -t -B/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/ -B/usr/local/gcc-4.7-20120908/m68k-uclinux/bin/ -B/usr/local/gcc-4.7-20120908/m68k-uclinux/lib/ -isystem /usr/local/gcc-4.7-20120908/m68k-uclinux/include -isystem /usr/local/gcc-4.7-20120908/m68k-uclinux/sys-include -fPIC -Wa,-mno-mac -o conftest conftest.o # /usr/local/gcc-4.7-20120908/m68k-uclinux/bin/ld.real: final link failed: Nonrepresentable section on output # collect2: error: ld returned 1 exit status The link does not fail when the GCC 4.6 crtbegin.o/crtend.o binaries are us= ed: # Linking with the 4.6 crtbegin/crtend binaries makes the problem go away: \mv cross-gcc-4.7-20120908/gcc/msep-data/crtbegin{,-4.7}.o \mv cross-gcc-4.7-20120908/gcc/msep-data/crtend{,-4.7}.o \cp cross-gcc-{4.6-20120907,4.7-20120908}/gcc/msep-data/crtbegin.o \cp cross-gcc-{4.6-20120907,4.7-20120908}/gcc/msep-data/crtend.o /tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/xgcc -t -B/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/ -B/usr/local/gcc-4.7-20120908/m68k-uclinux/bin/ -B/usr/local/gcc-4.7-20120908/m68k-uclinux/lib/ -isystem /usr/local/gcc-4.7-20120908/m68k-uclinux/include -isystem /usr/local/gcc-4.7-20120908/m68k-uclinux/sys-include -msep-data -Wa,-mno-ma= c -o conftest conftest.o \mv cross-gcc-4.7-20120908/gcc/msep-data/crtbegin{-4.7,}.o \mv cross-gcc-4.7-20120908/gcc/msep-data/crtend{-4.7,}.o Two new features in GCC 4.7 libgcc/crtstuff.c (was gcc/crtstuff.c in GCC 4.= 6) controlled by USE_INITFINI_ARRAY and USE_=E2=84=A2_CLONE_REGISTRY: USE_INITFINI_ARRAY is defined in gcc/config/initfini-array.h if HAVE_INITFINI_ARRAY_SUPPORT is defined: #ifdef HAVE_INITFINI_ARRAY_SUPPORT #define USE_INITFINI_ARRAY It is not defined in cross-gcc-4.7-20120908/gcc/auto-host.h: /* #undef HAVE_INITFINI_ARRAY_SUPPORT */ I assume the definition is controlled by the new --enable-initfini-array GCC configure option. USE_TM_CLONE_REGISTRY is defined in libgcc/crtstuff.c if it is not already defined and OBJECT_FORMAT_ELF is defined: #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) # define USE_TM_CLONE_REGISTRY 1 #endif This permits USE_TM_CLONE_REGISTRY to be defined as 0 elsewhere to disable = the feature, as is done for OpenVMS/Alpha in gcc/config/alpha/vms.h. Don't know if -fgnu-tm depends on USE_TM_CLONE_REGISTRY. (How can it? It = is only set to 1 in crtstuff.c.) I'm guessing that code emitted for -fgnu-tm = will fail to link when USE_TM_CLONE_REGISTRY is 0. Perhaps all that is required is to fix the attributes of section .tm_clone_table. In the mean time, apply the same fix used for OpenMVS/Alpha to gcc/config/m68k/uclinux.h (this patch is good for both GCC 4.7 and GCC 4.8): --- gcc-4.7/gcc/config/m68k/uclinux.h +++ gcc-4.7-patched/gcc/config/m68k/uclinux.h @@ -22,2 +22,4 @@ +/* Do not use TM clone registry. It breaks -msep-data (-fPIC) code. */ +#define USE_TM_CLONE_REGISTRY 0 #undef STARTFILE_SPEC