From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1IsCtD-0001F2-Ez for mharc-grub-devel@gnu.org; Wed, 14 Nov 2007 02:42:23 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IsCtB-0001Ep-Ky for grub-devel@gnu.org; Wed, 14 Nov 2007 02:42:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IsCtA-0001Ed-5E for grub-devel@gnu.org; Wed, 14 Nov 2007 02:42:21 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IsCt9-0001Ea-W3 for grub-devel@gnu.org; Wed, 14 Nov 2007 02:42:20 -0500 Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IsCt9-0003tZ-9W for grub-devel@gnu.org; Wed, 14 Nov 2007 02:42:19 -0500 Received: from c60.cesmail.net ([216.154.195.49]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IsCt8-0004Am-1d for grub-devel@gnu.org; Wed, 14 Nov 2007 02:42:18 -0500 Received: from unknown (HELO relay.cesmail.net) ([192.168.1.81]) by c60.cesmail.net with ESMTP; 14 Nov 2007 02:39:03 -0500 Received: from [192.168.1.21] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by relay.cesmail.net (Postfix) with ESMTP id 67DEF618FE1 for ; Wed, 14 Nov 2007 02:39:03 -0500 (EST) From: Pavel Roskin To: grub-devel Content-Type: text/plain Date: Wed, 14 Nov 2007 02:39:02 -0500 Message-Id: <1195025942.22086.11.camel@dv> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 (2.12.1-3.fc8) Content-Transfer-Encoding: 7bit X-detected-kernel: by mx20.gnu.org: Genre and OS details not recognized. X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) Subject: [PATCH] Fix for linker build ID in Fedora 8 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2007 07:42:21 -0000 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 * 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