All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: grub-devel <grub-devel@gnu.org>
Subject: [PATCH] Fix for linker build ID in Fedora 8
Date: Fri, 23 Nov 2007 22:07:10 -0500	[thread overview]
Message-ID: <1195873630.7449.8.camel@dv> (raw)

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



             reply	other threads:[~2007-11-24  3:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-24  3:07 Pavel Roskin [this message]
2007-11-25 22:26 ` [PATCH] Fix for linker build ID in Fedora 8 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
  -- strict thread matches above, loose matches on Subject: below --
2007-11-14  7:39 Pavel Roskin
2007-11-18  6:50 ` Robert Millan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1195873630.7449.8.camel@dv \
    --to=proski@gnu.org \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.