Skip to content

Commit

Permalink
RPM: Add -fPIE to logger CFLAGS for consistency with -pie in LDFLAGS
Browse files Browse the repository at this point in the history
  • Loading branch information
solardiz committed Feb 3, 2025
1 parent 1097a98 commit 87c07fe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lkrg.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Summary: Linux Kernel Runtime Guard (LKRG)
Name: lkrg
Version: 0.9.9
Release: 4%{?dist}
Release: 5%{?dist}
License: GPLv2
URL: https://lkrg.org
Source: https://lkrg.org/download/%name-%version.tar.gz
Expand Down Expand Up @@ -36,7 +36,7 @@ Userspace tools to support Linux Kernel Runtime Guard (LKRG) remote logging.

%build
make %{?_smp_mflags} KERNEL=/usr/src/kernels/%kmod_headers_version
make -C logger %{?_smp_mflags} CFLAGS='%optflags' LDFLAGS='-s -pie -Wl,-z,defs -Wl,-z,relro -Wl,-z,now %optflags'
make -C logger %{?_smp_mflags} CFLAGS='-fPIE %optflags' LDFLAGS='-s -fPIE -pie -Wl,-z,defs -Wl,-z,relro -Wl,-z,now %optflags'

%install
rm -rf %buildroot
Expand Down Expand Up @@ -85,6 +85,10 @@ fi
%dir %attr(0750,lkrg-logger,lkrg-logger) /var/log/lkrg-logger

%changelog
* Mon Feb 3 2025 Solar Designer <[email protected]> 0.9.9-5
- Add -fPIE to logger CFLAGS for consistency with -pie in LDFLAGS
(but no issues were seen on Rocky Linux 8 and 9 even without this change)

* Fri Jan 31 2025 Solar Designer <[email protected]> 0.9.9-4
- Pass -s -pie -Wl,-z,defs -Wl,-z,relro -Wl,-z,now and optflags into LDFLAGS
when building the logger userspace binaries
Expand Down

0 comments on commit 87c07fe

Please sign in to comment.