[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix for linker build ID in Fedora 8

From: Pavel Roskin
Subject: [PATCH] Fix for linker build ID in Fedora 8
Date: Wed, 14 Nov 2007 02:39:02 -0500


[Sorry for not replying earlier.  All messages from my account
were getting lost.  Anyway, I'll need to retire that address due to
massive spam.]

Here's an alternate patch for the issue that appeared on Fedora 8.  The
linker adds a "build ID" ( by default.  That section
makes objcopy create output files about 128M long when asked to use
binary format.  Needless to say, they are not suitable as grub images.
Also, the build ID section breaks the test for objcopy in the configure

This patch is less intrusive than the one I posted earlier, so I hope it
will be accepted.

2007-10-29  Pavel Roskin  <address@hidden>

        * Test if '--build-id=none' is supported by the
        linker.  Add it to TARGET_LDFLAGS if possible.  Build ID
        interferes with objcopy.
        * aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Use LDFLAGS when
        linking, so that build ID doesn't break the test.

--- aclocal.m4
+++ aclocal.m4
@@ -57,7 +57,7 @@
 for link_addr in 2000 8000 7C00; do
-  if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext 
-Wl,$link_addr conftest.o -o conftest.exec]); then :
+  if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext 
-Wl,$link_addr conftest.o -o conftest.exec]); then :
     AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
@@ -229,6 +229,16 @@
+AC_MSG_CHECKING([whether linker accepts `--build-id=none'])
+LDFLAGS="$LDFLAGS -Wl,--build-id=none"
+AC_TRY_LINK(, , build_id_flag=yes, build_id_flag=no)
+if test "x$build_id_flag" = xyes; then
+  TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none"
 # Compiler features.

Pavel Roskin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]