Skip to content

Commit

Permalink
Use gcc option _FORTIFY_SOURCE=3
Browse files Browse the repository at this point in the history
The RPM spec has been updated to use gcc option _FORTIFY_SOURCE=3
since it's now required by rpminspect. The code that configures
this option in CMake script has been removed to reduce dependency
on CMake.
  • Loading branch information
edewata committed Mar 8, 2024
1 parent 0b5bd0c commit 29cd3e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 0 additions & 5 deletions cmake/Modules/DefineCompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ if (UNIX AND NOT WIN32)
if (WITH_STACK_PROTECTOR)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector-strong")
endif (WITH_STACK_PROTECTOR)

check_c_compiler_flag("-D_FORTIFY_SOURCE=2" WITH_FORTIFY_SOURCE)
if (WITH_FORTIFY_SOURCE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FORTIFY_SOURCE=2")
endif (WITH_FORTIFY_SOURCE)
endif (${CMAKE_C_COMPILER_ID} MATCHES GNU)

#
Expand Down
3 changes: 3 additions & 0 deletions pki.spec
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,9 @@ C_FLAGS="$C_FLAGS -D_GLIBCXX_ASSERTIONS"

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

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

pkgs=base\
Expand Down

0 comments on commit 29cd3e5

Please sign in to comment.