From 78e11c07a3723943217e9231e9b2a44727bd278c Mon Sep 17 00:00:00 2001 From: Nicolas Frayer Date: Thu, 9 Nov 2023 18:05:37 +0100 Subject: [PATCH] Linker: added --no-warn-rwx-segments linker option added --no-warn-rwx-segments as build will fail after ld.bfd default options have been changed. Please refer: https://fedoraproject.org/wiki/Changes/Linker_Error_On_Security_Issues Signed-off-by: Nicolas Frayer --- grub.macros | 4 ++-- grub2.spec | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/grub.macros b/grub.macros index 959b972..0198ffc 100644 --- a/grub.macros +++ b/grub.macros @@ -15,7 +15,7 @@ %endif # gnulib actively ignores CFLAGS because it's terrible -%global cc_equals "CC=%{ccpath} -fPIE -Wl,-z,noexecstack" +%global cc_equals "CC=%{ccpath} -fPIE -Wl,-z,noexecstack -Wl,--no-warn-rwx-segments" %global cflags_sed \\\ sed \\\ @@ -68,7 +68,7 @@ )} %global efi_host_ldflags %{expand:%%(echo %{host_ldflags})} -%global target_ldflags %{expand:%%(echo %{build_ldflags} -static | %{ldflags_sed})} +%global target_ldflags %{expand:%%(echo %{build_ldflags} -Wl,--no-warn-rwx-segments -static | %{ldflags_sed})} %global legacy_target_ldflags \\\ %{expand:%%(echo %{target_ldflags} | \\\ %{ldflags_sed} \\\ diff --git a/grub2.spec b/grub2.spec index 2656795..0506296 100644 --- a/grub2.spec +++ b/grub2.spec @@ -17,7 +17,7 @@ Name: grub2 Epoch: 1 Version: 2.06 -Release: 106%{?dist} +Release: 107%{?dist} Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -555,6 +555,11 @@ mv ${EFI_HOME}/grub.cfg.stb ${EFI_HOME}/grub.cfg %endif %changelog +* Wed Nov 15 2023 Nicolas Frayer - 2.06-107 +- Linker: added --no-warn-rwx-segments as build will fail after +ld.bfd default options have been changed. +https://fedoraproject.org/wiki/Changes/Linker_Error_On_Security_Issues + * Wed Nov 15 2023 Nicolas Frayer - 2.06-106 - Remove [Install] section from aux systemd units - Related: #2247635