Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cmake/common/targets/executable.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ function(sourcemeta_executable)
target_link_options(${TARGET_NAME} PRIVATE /guard:cf /CETCOMPAT)
endif()

# Linux-specific ELF linker hardening options
# Linux-specific ELF linker hardening and compatibility options
if(SOURCEMETA_OS_LINUX AND (SOURCEMETA_COMPILER_LLVM OR SOURCEMETA_COMPILER_GCC))
# Maximize compatibility of pre-built binaries across Linux distros
if(NOT BUILD_SHARED_LIBS)
target_link_options(${TARGET_NAME} PRIVATE -static-libstdc++ -static-libgcc)
endif()
target_link_options(${TARGET_NAME} PRIVATE
"LINKER:-z,nodlopen"
"LINKER:-z,noexecstack"
Expand Down
Loading