From 478212ef4154c9ec0692da641c3fbc9c81e24d87 Mon Sep 17 00:00:00 2001 From: Alexey Sheplyakov Date: Fri, 7 Jul 2023 09:35:03 +0000 Subject: [PATCH] ALT: build: do NOT set _FORTIFY_SOURCE ... ... the compiler does it by default. [ 33%] Building CXX object sources/ade/CMakeFiles/ade.dir/source/graph.cpp.o cd /usr/src/RPM/BUILD/ade-0.1.1/x86_64-alt-linux/sources/ade && /usr/bin/c++ -D_FORTIFY_SOURCE=2 -I/usr/src/RPM/BUILD/ade-0.1.1/sources/ade/include -pipe -frecord-gcc-switches -Wall -g -O2 -flto=auto -ffat-lto-objects -Werror -Wall -Wextra -Wconversion -Wshadow -Wno-error=cpp -Wformat -Wformat-security -fPIC -fstack-protector-strong -std=gnu++11 -MD -MT sources/ade/CMakeFiles/ade.dir/source/graph.cpp.o -MF CMakeFiles/ade.dir/source/graph.cpp.o.d -o CMakeFiles/ade.dir/source/graph.cpp.o -c /usr/src/RPM/BUILD/ade-0.1.1/sources/ade/source/graph.cpp : error: "_FORTIFY_SOURCE" redefined [-Werror] : note: this is the location of the previous definition cc1plus: all warnings being treated as errors --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c428db2..2fba2b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) function(add_security_flags target) if(UNIX) - target_compile_definitions( ${target} PRIVATE _FORTIFY_SOURCE=2 ) if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) target_compile_options( ${target} PRIVATE -fstack-protector) -- 2.33.8