From 14b73d89ddaf4643a995d47abfd219f945edce36 Mon Sep 17 00:00:00 2001 From: FeignClaims Date: Mon, 12 Aug 2024 19:56:49 +0800 Subject: [PATCH 1/3] fix: undef _FORTIFY_SOURCE before setting --- src/Hardening.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Hardening.cmake b/src/Hardening.cmake index eb8c985d..dc7bb670 100644 --- a/src/Hardening.cmake +++ b/src/Hardening.cmake @@ -44,7 +44,7 @@ function( list(APPEND HARDENING_COMPILE_OPTIONS -Wstringop-overflow=4 -Wformat-overflow=2) endif() - target_compile_definitions(${_project_name} INTERFACE $<$:_FORTIFY_SOURCE=3>) + target_compile_options(${_project_name} INTERFACE $<$:-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3>) endif() if(${ENABLE_ELF_PROTECTION}) From 388fcedfe6a2cba06616d36a0293b6a7f3a65f37 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Mon, 12 Aug 2024 01:11:31 -0700 Subject: [PATCH 2/3] ci: remove deprecated macos 11 + disable macos gcc --- .github/workflows/ci.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 879e6435..d29e522e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,14 +40,6 @@ jobs: - os: "windows-2022" compiler: "msvc" vcvarsall: false - - os: "macos-11" - compiler: "gcc" - cmake: true - vcvarsall: true - - os: "macos-13" - compiler: "gcc" - cmake: true - vcvarsall: true exclude: # fails with an internal error - os: "macos-12" From 8a526b6a2b282f69c3b45fbc150e7dd082ecd06f Mon Sep 17 00:00:00 2001 From: FeignClaims Date: Mon, 12 Aug 2024 23:45:57 +0800 Subject: [PATCH 3/3] test: _FORTIFY_SOURCE should be defined only once --- tests/myproj/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/myproj/CMakeLists.txt b/tests/myproj/CMakeLists.txt index d578b17f..1bfa2849 100644 --- a/tests/myproj/CMakeLists.txt +++ b/tests/myproj/CMakeLists.txt @@ -88,6 +88,10 @@ project_options( # CLANG_WARNINGS "-Weverything" LINKER "${LINKER}" + + # Test if _FORTIFY_SOURCE is defined only once when ENABLE_OVERFLOW_PROTECTION + ENABLE_OVERFLOW_PROTECTION + CLANG_TIDY_EXTRA_ARGUMENTS "-warnings-as-errors=clang-diagnostic-macro-redefined" ) # NOTE: project_options and project_warnings are defined inside project_options