1 Star 0 Fork 98

yu_boyun/grub2

forked from src-openEuler/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0103-Make-it-possible-to-enabled-build-id-sha1.patch 1.93 KB
一键复制 编辑 原始数据 按行查看 历史
hanzj0122_admin 提交于 2020-07-29 20:47 . update to 2.04
From cc30961c213539793d723cd1ce0c61b8a5553c12 Mon Sep 17 00:00:00 2001
From: Peter Jones <[email protected]>
Date: Thu, 25 Jun 2015 15:41:06 -0400
Subject: [PATCH 103/220] Make it possible to enabled --build-id=sha1
Signed-off-by: Peter Jones <[email protected]>
---
acinclude.m4 | 19 +++++++++++++++++++
configure.ac | 8 ++++++++
2 files changed, 27 insertions(+)
diff --git a/acinclude.m4 b/acinclude.m4
index 78cdf6e..242e829 100644
--- 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])
diff --git a/configure.ac b/configure.ac
index eb851b8..8ee18ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1414,7 +1414,15 @@ grub_PROG_TARGET_CC
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
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yu_boyun/grub2.git
[email protected]:yu_boyun/grub2.git
yu_boyun
grub2
grub2
master

搜索帮助