mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 13:02:45 +00:00 
			
		
		
		
	 e706de8f91
			
		
	
	
		e706de8f91
		
	
	
	
	
		
			
			While playing with conditionally disabling -O2 optimization when building the Userland subdirectory, I discovered that we can no longer link errors without -O2. This happens as LibM.so doesn't link to anything else, resulting in no stack protector implementation. It appears that optimization somehow avoids this problem? To fix this inject LibC/ssp.cpp as we do with in dynamic loader.
		
			
				
	
	
		
			13 lines
		
	
	
	
		
			370 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
	
		
			370 B
		
	
	
	
		
			CMake
		
	
	
	
	
	
| set(SOURCES
 | |
|     math.cpp
 | |
|     ../LibC/ssp.cpp
 | |
| )
 | |
| 
 | |
| set_source_files_properties (../LibC/ssp.cpp PROPERTIES COMPILE_FLAGS
 | |
|     "-fno-stack-protector")
 | |
| 
 | |
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdlib")
 | |
| serenity_libc(LibM m)
 | |
| #target_link_libraries(LibM)
 | |
| #set_target_properties(LibM PROPERTIES OUTPUT_NAME m)
 | |
| #target_link_directories(LibM PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
 |