mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +00:00 
			
		
		
		
	Fix lintian warning hardening-no-fortify-functions
This commit is contained in:
		| @@ -1158,6 +1158,11 @@ if(NOT VOLKGNSSSDR_FOUND) | ||||
|         ${USE_THIS_PYTHON} | ||||
|     ) | ||||
|  | ||||
|     if(ENABLE_PACKAGING) | ||||
|        set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} | ||||
|            -DENABLE_PACKAGING=ON | ||||
|        ) | ||||
|     endif() | ||||
|     if(DEFINED ENV{OECORE_TARGET_SYSROOT}) | ||||
|         set(VOLK_GNSSSDR_CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} | ||||
|             -DCROSSCOMPILE_MULTILIB=TRUE | ||||
|   | ||||
| @@ -556,6 +556,13 @@ else() | ||||
|     message(STATUS "System profiling is disabled.") | ||||
| endif() | ||||
| message(STATUS "  Modify using: -DENABLE_PROFILING=ON/OFF") | ||||
|  | ||||
| ######################################################################## | ||||
| # Option to pass _FORTIFY_SOURCES=2 to the compiler regardless of | ||||
| # the building type | ||||
| ######################################################################## | ||||
| option(ENABLE_PACKAGING "Always pass _FORTIFY_SOURCES=2 to the compiler" OFF) | ||||
|  | ||||
| ######################################################################## | ||||
|  | ||||
| ######################################################################## | ||||
|   | ||||
| @@ -71,6 +71,12 @@ else() | ||||
|     target_link_libraries(volk_gnsssdr_profile PRIVATE volk_gnsssdr ${orc_lib}) | ||||
| endif() | ||||
|  | ||||
| if(UNIX) | ||||
|     target_compile_definitions(volk_gnsssdr_profile | ||||
|         PUBLIC $<$<CONFIG:Release>:_FORTIFY_SOURCE=2>$<$<CONFIG:RelWithDebInfo>:_FORTIFY_SOURCE=2>$<$<ENABLE_PACKAGING>:_FORTIFY_SOURCE=2> | ||||
|     ) | ||||
| endif() | ||||
|  | ||||
| if(ENABLE_STRIP) | ||||
|     if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) | ||||
|         set_target_properties(volk_gnsssdr_profile | ||||
| @@ -94,6 +100,12 @@ else() | ||||
|     target_link_libraries(volk_gnsssdr-config-info volk_gnsssdr ${orc_lib}) | ||||
| endif() | ||||
|  | ||||
| if(UNIX) | ||||
|     target_compile_definitions(volk_gnsssdr-config-info | ||||
|         PUBLIC $<$<CONFIG:Release>:_FORTIFY_SOURCE=2>$<$<CONFIG:RelWithDebInfo>:_FORTIFY_SOURCE=2>$<$<ENABLE_PACKAGING>:_FORTIFY_SOURCE=2> | ||||
|     ) | ||||
| endif() | ||||
|  | ||||
| if(ENABLE_STRIP) | ||||
|     if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) | ||||
|         set_target_properties(volk_gnsssdr-config-info | ||||
|   | ||||
| @@ -592,7 +592,7 @@ if(NOT (ENABLE_STATIC_LIBS AND (CMAKE_GENERATOR STREQUAL Xcode))) | ||||
|     ) | ||||
|     if(UNIX) | ||||
|         target_compile_definitions(volk_gnsssdr | ||||
|             PUBLIC $<$<CONFIG:Release>:_FORTIFY_SOURCE=2>$<$<CONFIG:RelWithDebInfo>:_FORTIFY_SOURCE=2> | ||||
|             PUBLIC $<$<CONFIG:Release>:_FORTIFY_SOURCE=2>$<$<CONFIG:RelWithDebInfo>:_FORTIFY_SOURCE=2>$<$<ENABLE_PACKAGING>:_FORTIFY_SOURCE=2> | ||||
|         ) | ||||
|     endif() | ||||
|     if(USE_CPU_FEATURES) | ||||
| @@ -667,7 +667,7 @@ if(ENABLE_STATIC_LIBS) | ||||
|     ) | ||||
|     if(UNIX) | ||||
|         target_compile_definitions(volk_gnsssdr_static | ||||
|             PUBLIC $<$<CONFIG:Release>:_FORTIFY_SOURCE=2>$<$<CONFIG:RelWithDebInfo>:_FORTIFY_SOURCE=2> | ||||
|             PUBLIC $<$<CONFIG:Release>:_FORTIFY_SOURCE=2>$<$<CONFIG:RelWithDebInfo>:_FORTIFY_SOURCE=2>$<$<ENABLE_PACKAGING>:_FORTIFY_SOURCE=2> | ||||
|         ) | ||||
|     endif() | ||||
|     set_target_properties(volk_gnsssdr_static PROPERTIES OUTPUT_NAME volk_gnsssdr) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez