grub2/0001-Fix-build-error-in-binutils-2.36.patch
Michael Chang b2d62d6d4b Accepting request 874318 from home:michael-chang:branches:Base:System
- Fix build error in binutils 2.36 (bsc#1181741)
  * 0001-Fix-build-error-in-binutils-2.36.patch
- Fix executable stack in grub-emu (bsc#1181696)
  * 0001-emu-fix-executable-stack-marking.patch

OBS-URL: https://build.opensuse.org/request/show/874318
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=373
2021-02-23 00:58:17 +00:00

48 lines
1.9 KiB
Diff

From 7801d671905329d28e789082225570fc54fe5784 Mon Sep 17 00:00:00 2001
From: Michael Chang <mchang@suse.com>
Date: Fri, 19 Feb 2021 17:40:43 +0800
Subject: [PATCH] Fix build error in binutils 2.36
The build fails in binutils 2.36
[ 520s] cat kernel_syms.lst > syminfo.lst.new
[ 520s] /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: section .note.gnu.property VMA [0000000000400158,0000000000400187] overlaps section .bss VMA [000000000000f000,000000000041e1af]
It is caused by assembler now generates the GNU property notes section
by default. Use the assmbler option -mx86-used-note=no to disable the
section from being generated to workaround the ensuing linker issue.
Signed-off-by: Michael Chang <mchang@suse.com>
---
configure.ac | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/configure.ac b/configure.ac
index c39e8379f..a3fb713ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -827,6 +827,20 @@ if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ) && test "x$p
TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow"
fi
+if ( test "x$target_cpu" = xi386 || test "x$target_cpu" = xx86_64 ); then
+ AC_CACHE_CHECK([whether -Wa,-mx86-used-note works], [grub_cv_cc_mx86_used_note], [
+ CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no -Werror"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+ [grub_cv_cc_mx86_used_note=yes],
+ [grub_cv_cc_mx86_used_note=no])
+ ])
+
+ if test "x$grub_cv_cc_mx86_used_note" = xyes; then
+ TARGET_CFLAGS="$TARGET_CFLAGS -Wa,-mx86-used-note=no"
+ TARGET_CCASFLAGS="$TARGET_CCASFLAGS -Wa,-mx86-used-note=no"
+ fi
+fi
+
# GRUB doesn't use float or doubles at all. Yet some toolchains may decide
# that floats are a good fit to run instead of what's written in the code.
# Given that floating point unit is disabled (if present to begin with)
--
2.30.0