mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-17 15:02:24 +00:00
Build: Only specify -fzero-call-used-regs with compiler >= GCC 11.1
This fixes the use case of using clang, or building inside CLion with an older host compiler.
This commit is contained in:
parent
7915994dfc
commit
f43423edc3
Notes:
sideshowbarker
2024-07-18 08:20:17 +09:00
Author: https://github.com/bgianfo
Commit: f43423edc3
Pull-request: https://github.com/SerenityOS/serenity/pull/9011
Reviewed-by: https://github.com/gunnarbeutner ✅
1 changed files with 6 additions and 2 deletions
|
@ -347,9 +347,13 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-80387 -mno-mmx -mno-sse -mno-sse2")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-asynchronous-unwind-tables")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-asynchronous-unwind-tables")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdlib -nostdinc -nostdinc++")
|
||||||
|
|
||||||
|
# Apply any flags that are only available on >= GCC 11.1
|
||||||
|
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11.1)
|
||||||
# Zero any registers used within a function on return (to reduce data lifetime and ROP gadgets).
|
# Zero any registers used within a function on return (to reduce data lifetime and ROP gadgets).
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fzero-call-used-regs=used-gpr")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fzero-call-used-regs=used-gpr")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdlib -nostdinc -nostdinc++")
|
endif()
|
||||||
|
|
||||||
if ("${SERENITY_ARCH}" STREQUAL "x86_64")
|
if ("${SERENITY_ARCH}" STREQUAL "x86_64")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcmodel=large -mno-red-zone")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcmodel=large -mno-red-zone")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue