Skip to content

Commit 90d3cf5

Browse files
committed
[Macros/Tests] Build test plugins with the same compiler as the dylib
Sanitizer ABI are apparently not stable. We need to build the executable with the same compiler as the linking dylib. rdar://119141141
1 parent a7a0b32 commit 90d3cf5

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

test/Macros/lit.local.cfg

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ if get_target_os() in ['windows-msvc']:
2121
else:
2222
# FIXME(compnerd) do all the targets we currently support use SysV ABI?
2323
config.substitutions.insert(0, ('%target-abi', 'SYSV'))
24+
config.substitutions.insert(0, ('%cmake-c-compiler', config.cmake_c_compiler))
2425
config.substitutions.insert(
2526
0,
2627
(
2728
'%swift-build-c-plugin',
28-
'%clang %c-flags %exe-linker-flags -isysroot %host_sdk -I %swift_src_root/include -L %swift-lib-dir -l_swiftMockPlugin -Xlinker -rpath -Xlinker %swift-lib-dir'
29+
'%cmake-c-compiler %c-flags %exe-linker-flags -target %host_triple -isysroot %host_sdk -I %swift_src_root/include -L %swift-lib-dir -l_swiftMockPlugin -Xlinker -rpath -Xlinker %swift-lib-dir'
2930
)
3031
)
3132
config.substitutions.append(('%c-flags', config.c_flags))

test/lit.site.cfg.in

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ config.swift_driver_test_options = "@SWIFT_DRIVER_TEST_OPTIONS@"
4444
config.swift_frontend_test_options = "@SWIFT_FRONTEND_TEST_OPTIONS@"
4545
config.swift_ide_test_test_options = "@SWIFT_IDE_TEST_TEST_OPTIONS@"
4646

47+
config.cmake_c_compiler = r'''@CMAKE_C_COMPILER@'''
48+
config.cmake_cxx_compiler = r'''@CMAKE_CXX_COMPILER@'''
4749
config.c_flags = r'''@CMAKE_C_FLAGS@'''
4850
config.exe_linker_flags = r'''@CMAKE_EXE_LINKER_FLAGS@'''
4951

tools/libMockPlugin/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ add_llvm_symbol_exports(libMockPlugin ${LLVM_EXPORTED_SYMBOL_FILE})
1616

1717
add_dependencies(tools libMockPlugin)
1818
# Adds -dead_strip option
19-
add_link_opts(libStaticMirror)
19+
add_link_opts(libMockPlugin)

0 commit comments

Comments
 (0)