* 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.
This commit is contained in:
proski 2007-11-25 02:01:30 +00:00
parent f7f9d35210
commit 6af9db01bc
4 changed files with 75 additions and 2 deletions

View File

@ -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

2
aclocal.m4 vendored
View 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

56
configure vendored
View File

@ -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=$?

View 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.
#