Skip to content

Commit

Permalink
Fix compiling option in RHEL-10
Browse files Browse the repository at this point in the history
RHEL-10 requires cf protection and lto flags, similar to Fedora
  • Loading branch information
fmarco76 committed Dec 16, 2024
1 parent d1c38d4 commit 2b3d75b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pki.spec
Original file line number Diff line number Diff line change
Expand Up @@ -1269,13 +1269,14 @@ popd
C_FLAGS="-s"
CXX_FLAGS="$CXX_FLAGS -g -fPIE -pie"

%if 0%{?fedora}
%if 0%{?fedora} || 0%{?rhel} && 0%{?rhel} >= 10
# https://sourceware.org/annobin/annobin.html/Test-gaps.html
C_FLAGS="$C_FLAGS -fplugin=annobin"

%ifarch x86_64
# https://sourceware.org/annobin/annobin.html/Test-cf-protection.html
C_FLAGS="$C_FLAGS -fcf-protection=full"
CXX_FLAGS="$CXX_FLAGS -fcf-protection=full"
%endif

# https://sourceware.org/annobin/annobin.html/Test-optimization.html
Expand All @@ -1287,7 +1288,7 @@ C_FLAGS="$C_FLAGS -D_GLIBCXX_ASSERTIONS"
CXX_FLAGS="$CXX_FLAGS -D_GLIBCXX_ASSERTIONS"

# https://sourceware.org/annobin/annobin.html/Test-lto.html
C_FLAGS="$C_FLAGS -fno-lto"
C_FLAGS="$C_FLAGS -flto"

# https://sourceware.org/annobin/annobin.html/Test-fortify.html
C_FLAGS="$C_FLAGS -D_FORTIFY_SOURCE=3"
Expand Down

0 comments on commit 2b3d75b

Please sign in to comment.