Pass --build-id=sha1 to linker explicitly
authorMatt Ellis <matell@microsoft.com>
Thu, 23 Jun 2016 00:40:56 +0000 (17:40 -0700)
committerMatt Ellis <matell@microsoft.com>
Thu, 23 Jun 2016 00:40:56 +0000 (17:40 -0700)
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

src/libraries/Native/CMakeLists.txt

index eb75f89..11cfc16 100644 (file)
@@ -102,6 +102,8 @@ endif ()
 
 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)