]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* configure.ac: Test if '--build-id=none' is supported by the
authorproski <proski@localhost>
Sun, 25 Nov 2007 02:01:30 +0000 (02:01 +0000)
committerproski <proski@localhost>
Sun, 25 Nov 2007 02:01:30 +0000 (02:01 +0000)
linker.  If yes, add it to TARGET_LDFLAGS.  Build ID causes
objcopy to generate incorrect binary files (binutils
2.17.50.0.18-1 as shipped by Fedora 8).
* aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Use LDFLAGS when
linking, so that build ID doesn't break the test.

ChangeLog
aclocal.m4
configure
configure.ac

index f4a859746b54ae7f637eaf85f0e8431102db3378..23a50badc82d3c55f0a763694d7c673bb74df31f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-11-24  Pavel Roskin  <proski@gnu.org>
+
+       * configure.ac: Test if '--build-id=none' is supported by the
+       linker.  If yes, add it to TARGET_LDFLAGS.  Build ID causes
+       objcopy to generate incorrect binary files (binutils
+       2.17.50.0.18-1 as shipped by Fedora 8).
+       * aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Use LDFLAGS when
+       linking, so that build ID doesn't break the test.
+
 2007-11-24  Pavel Roskin  <proski@gnu.org>
 
        * include/grub/i386/time.h: use "void" in the argument list
index 706c3ef2150779caf9423adb8c4865a668a0842a..803d57b9147241cd1202c23ad0895a283fd564b6 100644 (file)
@@ -57,7 +57,7 @@ else
 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
index 89be3b0cb53ef59b48a8f30f370a6200ae417ec3..3c3847ff4af0159a94c89da36de23993a05c2d89 100644 (file)
--- a/configure
+++ b/configure
@@ -6632,6 +6632,60 @@ 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.
 #
@@ -6701,7 +6755,7 @@ echo "$as_me: error: ${CC-cc} cannot compile C source code" >&2;}
 fi
 grub_cv_prog_objcopy_absolute=yes
 for link_addr in 2000 8000 7C00; do
-  if { ac_try='${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'
+  if { ac_try='${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
index fce60119de9d0e98598929213a57fdb51eb8db65..e9739a57ab61734dd099a6627653c0130d81c599 100644 (file)
@@ -229,6 +229,16 @@ 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.
 #