Skip to content

Commit 49332f8

Browse files
committed
Fix the minimal/lto configuration
We need to disable opaque pointers when we compiler the runtime the linker complains: ``` ld: Opaque pointers are only supported in -opaque-pointers mode ``` Alternatively, we could pass the opaque-pointers flag to the linker but then it would complain about the swiftc generated files which still use typed pointers. Until swiftc is fixed, disable opaque pointers for .cpp runtime files. rdar://106515243
1 parent a05853b commit 49332f8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

stdlib/cmake/modules/AddSwiftStdlib.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ function(_add_target_variant_c_compile_link_flags)
137137
_compute_lto_flag("${CFLAGS_ENABLE_LTO}" _lto_flag_out)
138138
if (_lto_flag_out)
139139
list(APPEND result "${_lto_flag_out}")
140+
# Disable opaque pointers in lto mode.
141+
list(APPEND result "-Xclang")
142+
list(APPEND result "-no-opaque-pointers")
140143
endif()
141144

142145
set("${CFLAGS_RESULT_VAR_NAME}" "${result}" PARENT_SCOPE)

0 commit comments

Comments
 (0)