All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix for linker build ID in Fedora 8
@ 2007-11-14  7:39 Pavel Roskin
  2007-11-18  6:50 ` Robert Millan
  0 siblings, 1 reply; 13+ messages in thread
From: Pavel Roskin @ 2007-11-14  7:39 UTC (permalink / raw)
  To: grub-devel

Hello!

[Sorry for not replying earlier.  All messages from my gnu.org 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" (.not.gnu.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
script.

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

2007-10-29  Pavel Roskin  <proski-grub@xemaps.com>

	* configure.ac: 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 @@
 fi
 grub_cv_prog_objcopy_absolute=yes
 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 :
   else
     AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
   fi
--- configure.ac
+++ configure.ac
@@ -229,6 +229,16 @@
   TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
 fi
 
+AC_MSG_CHECKING([whether linker accepts `--build-id=none'])
+save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS -Wl,--build-id=none"
+AC_TRY_LINK(, , build_id_flag=yes, build_id_flag=no)
+AC_MSG_RESULT([$build_id_flag])
+LDFLAGS="$save_LDFLAGS"
+if test "x$build_id_flag" = xyes; then
+  TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none"
+fi
+
 #
 # Compiler features.
 #


-- 
Regards,
Pavel Roskin



^ permalink raw reply	[flat|nested] 13+ messages in thread
* [PATCH] Fix for linker build ID in Fedora 8
@ 2007-11-24  3:07 Pavel Roskin
  2007-11-25 22:26 ` Lubomir Kundrak
  0 siblings, 1 reply; 13+ messages in thread
From: Pavel Roskin @ 2007-11-24  3:07 UTC (permalink / raw)
  To: grub-devel

Hello!

Sorry for re-sending this patch.  My e-mail was incorrectly set up.  It
should be fixed now.  Please ignore the previous post from my xemaps.com
address.

Here's an alternate patch for the issue that appeared on Fedora 8.  The
linker adds a "build ID" (.not.gnu.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
script.

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

2007-11-23  Pavel Roskin  <proski@gnu.org>
	* configure.ac: 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 @@
 fi
 grub_cv_prog_objcopy_absolute=yes
 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 :
   else
     AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
   fi
--- configure.ac
+++ configure.ac
@@ -229,6 +229,16 @@
   TARGET_LDFLAGS="$TARGET_LDFLAGS -m32"
 fi
 
+AC_MSG_CHECKING([whether linker accepts `--build-id=none'])
+save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS -Wl,--build-id=none"
+AC_TRY_LINK(, , build_id_flag=yes, build_id_flag=no)
+AC_MSG_RESULT([$build_id_flag])
+LDFLAGS="$save_LDFLAGS"
+if test "x$build_id_flag" = xyes; then
+  TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none"
+fi
+
 #
 # Compiler features.
 #


-- 
Regards,
Pavel Roskin
-- 
Regards,
Pavel Roskin



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

end of thread, other threads:[~2007-12-14  6:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-14  7:39 [PATCH] Fix for linker build ID in Fedora 8 Pavel Roskin
2007-11-18  6:50 ` Robert Millan
  -- strict thread matches above, loose matches on Subject: below --
2007-11-24  3:07 Pavel Roskin
2007-11-25 22:26 ` Lubomir Kundrak
2007-11-26 10:28   ` Lubomir Kundrak
2007-11-26 12:35     ` Pavel Roskin
2007-11-26 12:54       ` Lubomir Kundrak
2007-11-26 13:06         ` Pavel Roskin
2007-12-12 15:45           ` Robert Millan
2007-12-14  4:33             ` Pavel Roskin
2007-12-14  5:45             ` Pavel Roskin
2007-12-14  6:10               ` Bean
2007-12-14  6:47                 ` Pavel Roskin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.