Skip to content

Commit ff2a0ae

Browse files
committed
build: more stringent gold checks
This is the only site which allowed you to accidentally accept gold for targets which are not ELFish. For the time being, we can only add unit tests for the host variant, so use the `SWIFT_HOST_VARIANT_SDK` to determine the target file format. This will make supporting cross-compiling to non-ELFish targets simpler.
1 parent 1abe85a commit ff2a0ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmake/modules/AddSwiftUnittests.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ function(add_swift_unittest test_dirname)
4747
set_property(TARGET "${test_dirname}" APPEND_STRING PROPERTY
4848
LINK_FLAGS " -fprofile-instr-generate -fcoverage-mapping")
4949
endif()
50-
elseif(${SWIFT_ENABLE_GOLD_LINKER})
50+
endif()
51+
52+
if(SWIFT_ENABLE_GOLD_LINKER AND
53+
"${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_OBJECT_FORMAT}" STREQUAL "ELF")
5154
set_property(TARGET "${test_dirname}" APPEND_STRING PROPERTY
5255
LINK_FLAGS " -fuse-ld=gold")
5356
endif()

0 commit comments

Comments
 (0)