public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/54584] New: m68k-uclinux error: Link tests are not allowed after GCC_NO_EXECUTABLES
@ 2012-09-14 20:44 baker at usgs dot gov
  2012-09-15  0:39 ` [Bug target/54584] " baker at usgs dot gov
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: baker at usgs dot gov @ 2012-09-14 20:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54584

             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=28193
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-mac
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=yes:

configure:3885: /tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/./gcc/xgcc
-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-gcc-4.7-20120908/m68k-uclinux/include
-isystem
/tmp/freescale-coldfile-xgcc/cross-gcc-4.7-20120908/../freescale-coldfire-gcc-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-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 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 used:

# 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-mac -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_™_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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-09-19  0:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-14 20:44 [Bug target/54584] New: m68k-uclinux error: Link tests are not allowed after GCC_NO_EXECUTABLES baker at usgs dot gov
2012-09-15  0:39 ` [Bug target/54584] " baker at usgs dot gov
2012-09-18  2:45 ` baker at usgs dot gov
2012-09-18 21:43 ` baker at usgs dot gov
2012-09-18 21:53 ` baker at usgs dot gov
2012-09-18 23:30 ` hp at gcc dot gnu.org
2012-09-19  0:05 ` baker at usgs dot gov
2012-09-19  0:15 ` baker at usgs dot gov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).