2018-07-12 14:56:34 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-04-03 17:41:24 +00:00
|
|
|
From: Peter Jones <pjones@redhat.com>
|
|
|
|
Date: Thu, 25 Jun 2015 15:41:06 -0400
|
2018-07-10 18:39:10 +00:00
|
|
|
Subject: [PATCH] Make it possible to enabled --build-id=sha1
|
2018-04-03 17:41:24 +00:00
|
|
|
|
|
|
|
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
|
|
---
|
|
|
|
configure.ac | 8 ++++++++
|
|
|
|
acinclude.m4 | 19 +++++++++++++++++++
|
|
|
|
2 files changed, 27 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/configure.ac b/configure.ac
|
2024-10-18 18:18:00 +00:00
|
|
|
index 3602b4ab62b..fcfbcbb664d 100644
|
2018-04-03 17:41:24 +00:00
|
|
|
--- a/configure.ac
|
|
|
|
+++ b/configure.ac
|
2024-10-18 18:18:00 +00:00
|
|
|
@@ -1540,7 +1540,15 @@ grub_PROG_TARGET_CC
|
2018-04-03 17:41:24 +00:00
|
|
|
if test "x$TARGET_APPLE_LINKER" != x1 ; then
|
|
|
|
grub_PROG_OBJCOPY_ABSOLUTE
|
|
|
|
fi
|
|
|
|
+
|
|
|
|
+AC_ARG_ENABLE([build-id],
|
|
|
|
+ [AS_HELP_STRING([--enable-build-id],
|
|
|
|
+ [ask the linker to supply build-id notes (default=no)])])
|
|
|
|
+if test x$enable_build_id = xyes; then
|
|
|
|
+grub_PROG_LD_BUILD_ID_SHA1
|
|
|
|
+else
|
|
|
|
grub_PROG_LD_BUILD_ID_NONE
|
|
|
|
+fi
|
|
|
|
if test "x$target_cpu" = xi386; then
|
|
|
|
if test "$platform" != emu && test "x$TARGET_APPLE_LINKER" != x1 ; then
|
|
|
|
if test ! -z "$TARGET_IMG_LDSCRIPT"; then
|
|
|
|
diff --git a/acinclude.m4 b/acinclude.m4
|
2024-10-18 18:18:00 +00:00
|
|
|
index fa7840f09af..0231e64e337 100644
|
2018-04-03 17:41:24 +00:00
|
|
|
--- a/acinclude.m4
|
|
|
|
+++ b/acinclude.m4
|
|
|
|
@@ -136,6 +136,25 @@ if test "x$grub_cv_prog_ld_build_id_none" = xyes; then
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
|
|
+dnl Supply --build-id=sha1 to ld if building modules.
|
|
|
|
+dnl This suppresses warnings from ld on some systems
|
|
|
|
+AC_DEFUN([grub_PROG_LD_BUILD_ID_SHA1],
|
|
|
|
+[AC_MSG_CHECKING([whether linker accepts --build-id=sha1])
|
|
|
|
+AC_CACHE_VAL(grub_cv_prog_ld_build_id_sha1,
|
|
|
|
+[save_LDFLAGS="$LDFLAGS"
|
|
|
|
+LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"
|
|
|
|
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
|
|
|
+ [grub_cv_prog_ld_build_id_sha1=yes],
|
|
|
|
+ [grub_cv_prog_ld_build_id_sha1=no])
|
|
|
|
+LDFLAGS="$save_LDFLAGS"
|
|
|
|
+])
|
|
|
|
+AC_MSG_RESULT([$grub_cv_prog_ld_build_id_sha1])
|
|
|
|
+
|
|
|
|
+if test "x$grub_cv_prog_ld_build_id_sha1" = xyes; then
|
|
|
|
+ TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=sha1"
|
|
|
|
+fi
|
|
|
|
+])
|
|
|
|
+
|
|
|
|
dnl Check nm
|
|
|
|
AC_DEFUN([grub_PROG_NM_WORKS],
|
|
|
|
[AC_MSG_CHECKING([whether nm works])
|