On some platforms, a build-id was not being added to native artifacts
and we would like it to be present. Explicitly pass --build-id=sha1 to
the linker.
Related: dotnet/coreclrdotnet/corefx#5796
Commit migrated from https://github.com/dotnet/corefx/commit/
72efebeca9e062c4f257125574911df9ce9c8d0c
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -Wa,--noexecstack")
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--build-id=sha1")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--build-id=sha1")
endif ()
if(CMAKE_SYSTEM_NAME STREQUAL Linux)