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 <nfrayer@redhat.com>
This commit is contained in:
Nicolas Frayer 2023-11-09 18:05:37 +01:00
parent 88924af554
commit 7b857b827a
2 changed files with 8 additions and 3 deletions

View File

@ -15,7 +15,7 @@
%endif %endif
# gnulib actively ignores CFLAGS because it's terrible # 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 \\\ %global cflags_sed \\\
sed \\\ sed \\\
@ -68,7 +68,7 @@
)} )}
%global efi_host_ldflags %{expand:%%(echo %{host_ldflags})} %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 \\\ %global legacy_target_ldflags \\\
%{expand:%%(echo %{target_ldflags} | \\\ %{expand:%%(echo %{target_ldflags} | \\\
%{ldflags_sed} \\\ %{ldflags_sed} \\\

View File

@ -17,7 +17,7 @@
Name: grub2 Name: grub2
Epoch: 1 Epoch: 1
Version: 2.06 Version: 2.06
Release: 108%{?dist} Release: 109%{?dist}
Summary: Bootloader with support for Linux, Multiboot and more Summary: Bootloader with support for Linux, Multiboot and more
License: GPLv3+ License: GPLv3+
URL: http://www.gnu.org/software/grub/ URL: http://www.gnu.org/software/grub/
@ -555,6 +555,11 @@ mv ${EFI_HOME}/grub.cfg.stb ${EFI_HOME}/grub.cfg
%endif %endif
%changelog %changelog
* Wed Nov 15 2023 Nicolas Frayer <nfrayer@redhat.com> - 2.06-109
- 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
* Tue Nov 14 2023 Nicolas Frayer <nfrayer@redhat.com> - 2.06-108 * Tue Nov 14 2023 Nicolas Frayer <nfrayer@redhat.com> - 2.06-108
- Remove [Install] section from aux systemd units - Remove [Install] section from aux systemd units
- Related: #2247635 - Related: #2247635