diff --git a/ChangeLog b/ChangeLog index c14397f54..3ceca774d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-04-17 Lubomir Kundrak + + * aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): take only .text + section into account, newer toolchains generate unique build ids + * configure.ac: remove the test for --build-id=none acceptance, + we want build ids to bre preserved + * genmk.rb: add -R .note.gnu.build-id to objcopy, so build id + far from other sections don't cause the raw binary images grow + size + 2008-04-15 Robert Millan * disk/lvm.c: Update copyright year. diff --git a/aclocal.m4 b/aclocal.m4 index a634253bb..fc6706614 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -61,7 +61,7 @@ for link_addr in 2000 8000 7C00; do else AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr]) fi - if AC_TRY_COMMAND([${OBJCOPY-objcopy} -O binary conftest.exec conftest]); then : + if AC_TRY_COMMAND([${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest]); then : else AC_MSG_ERROR([${OBJCOPY-objcopy} cannot create binary files]) fi diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index b0153a4ad..d06042185 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -22,7 +22,7 @@ CLEANFILES += boot.img boot.exec boot_img-boot_i386_pc_boot.o MOSTLYCLEANFILES += boot_img-boot_i386_pc_boot.d boot.img: boot.exec - $(OBJCOPY) -O binary -R .note -R .comment $< $@ + $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ boot.exec: boot_img-boot_i386_pc_boot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(boot_img_LDFLAGS) @@ -40,7 +40,7 @@ CLEANFILES += pxeboot.img pxeboot.exec pxeboot_img-boot_i386_pc_pxeboot.o MOSTLYCLEANFILES += pxeboot_img-boot_i386_pc_pxeboot.d pxeboot.img: pxeboot.exec - $(OBJCOPY) -O binary -R .note -R .comment $< $@ + $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ pxeboot.exec: pxeboot_img-boot_i386_pc_pxeboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(pxeboot_img_LDFLAGS) @@ -58,7 +58,7 @@ CLEANFILES += diskboot.img diskboot.exec diskboot_img-boot_i386_pc_diskboot.o MOSTLYCLEANFILES += diskboot_img-boot_i386_pc_diskboot.d diskboot.img: diskboot.exec - $(OBJCOPY) -O binary -R .note -R .comment $< $@ + $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ diskboot.exec: diskboot_img-boot_i386_pc_diskboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(diskboot_img_LDFLAGS) @@ -76,7 +76,7 @@ CLEANFILES += lnxboot.img lnxboot.exec lnxboot_img-boot_i386_pc_lnxboot.o MOSTLYCLEANFILES += lnxboot_img-boot_i386_pc_lnxboot.d lnxboot.img: lnxboot.exec - $(OBJCOPY) -O binary -R .note -R .comment $< $@ + $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ lnxboot.exec: lnxboot_img-boot_i386_pc_lnxboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(lnxboot_img_LDFLAGS) @@ -94,7 +94,7 @@ CLEANFILES += cdboot.img cdboot.exec cdboot_img-boot_i386_pc_cdboot.o MOSTLYCLEANFILES += cdboot_img-boot_i386_pc_cdboot.d cdboot.img: cdboot.exec - $(OBJCOPY) -O binary -R .note -R .comment $< $@ + $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ cdboot.exec: cdboot_img-boot_i386_pc_cdboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(cdboot_img_LDFLAGS) @@ -118,7 +118,7 @@ CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_im MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_env.d kernel_img-term_i386_pc_console.d kernel_img-symlist.d kernel.img: kernel.exec - $(OBJCOPY) -O binary -R .note -R .comment $< $@ + $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_img_LDFLAGS) diff --git a/configure b/configure index 2517a3c62..1f44d1900 100644 --- a/configure +++ b/configure @@ -6686,60 +6686,6 @@ if test "x$target_m32" = x1; then TARGET_LDFLAGS="$TARGET_LDFLAGS -m32" fi -{ echo "$as_me:$LINENO: checking whether the linker accepts \`--build-id=none'" >&5 -echo $ECHO_N "checking whether the linker accepts \`--build-id=none'... $ECHO_C" >&6; } -save_LDFLAGS="$LDFLAGS" -LDFLAGS="$LDFLAGS -Wl,--build-id=none" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - build_id_flag=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - build_id_flag=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $build_id_flag" >&5 -echo "${ECHO_T}$build_id_flag" >&6; } -LDFLAGS="$save_LDFLAGS" -if test "x$build_id_flag" = xyes; then - TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none" -fi - # # Compiler features. # @@ -6820,7 +6766,7 @@ for link_addr in 2000 8000 7C00; do echo "$as_me: error: ${CC-cc} cannot link at address $link_addr" >&2;} { (exit 1); exit 1; }; } fi - if { ac_try='${OBJCOPY-objcopy} -O binary conftest.exec conftest' + if { ac_try='${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? diff --git a/configure.ac b/configure.ac index 80cb54238..5ec7a47de 100644 --- a/configure.ac +++ b/configure.ac @@ -238,16 +238,6 @@ if test "x$target_m32" = x1; then TARGET_LDFLAGS="$TARGET_LDFLAGS -m32" fi -AC_MSG_CHECKING([whether the 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. # diff --git a/genmk.rb b/genmk.rb index 9faea5aad..a2179fab5 100644 --- a/genmk.rb +++ b/genmk.rb @@ -1,6 +1,6 @@ #! /usr/bin/ruby -w # -# Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc. +# Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. # # This genmk.rb is free software; the author # gives unlimited permission to copy and/or distribute it, @@ -57,7 +57,7 @@ class Image MOSTLYCLEANFILES += #{deps_str} #{@name}: #{exe} - $(OBJCOPY) -O binary -R .note -R .comment $< $@ + $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ #{exe}: #{objs_str} $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS)