Skip to content

[Linux] Enable build-ids. #4992

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ endif()
include(SwiftSupport)
include(GNUInstallDirs)
include(XCTest)
include(CheckLinkerFlag)

check_linker_flag(C "LINKER:-build-id=sha1" LINKER_SUPPORTS_BUILD_ID)

set(CF_DEPLOYMENT_SWIFT YES CACHE BOOL "Build for Swift" FORCE)

Expand Down
4 changes: 4 additions & 0 deletions CoreFoundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
endif()
endif()

if(LINKER_SUPPORTS_BUILD_ID)
target_link_options(CoreFoundation PRIVATE "LINKER:-build-id=sha1")
endif()

if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
if((NS_CURL_ASSUME_FEATURES_MISSING) OR (CURL_VERSION_STRING VERSION_LESS "7.32.0"))
add_compile_definitions($<$<COMPILE_LANGUAGE:C>:NS_CURL_MISSING_XFERINFOFUNCTION>)
Expand Down
3 changes: 3 additions & 0 deletions Sources/Foundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL WASI)
"SHELL:-Xfrontend -public-autolink-library -Xfrontend wasi-emulated-getpid")
endif()

if(LINKER_SUPPORTS_BUILD_ID)
target_link_options(Foundation PRIVATE "LINKER:-build-id=sha1")
endif()

set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS Foundation)
_install_target(Foundation)
3 changes: 3 additions & 0 deletions Sources/FoundationNetworking/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin|Windows")
target_link_options(FoundationNetworking PRIVATE "SHELL:-no-toolchain-stdlib-rpath")
endif()

if(LINKER_SUPPORTS_BUILD_ID)
target_link_options(FoundationNetworking PRIVATE "LINKER:-build-id=sha1")
endif()

set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS FoundationNetworking)
_install_target(FoundationNetworking)
4 changes: 4 additions & 0 deletions Sources/FoundationXML/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL WASI)
-Xcc -D_WASI_EMULATED_MMAN")
endif()

if(LINKER_SUPPORTS_BUILD_ID)
target_link_options(FoundationXML PRIVATE "LINKER:-build-id=sha1")
endif()

set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS FoundationXML)
_install_target(FoundationXML)