Skip to content

Commit 8e0362e

Browse files
committed
[stubs] Autolink against icucore on Darwin.
Programs using a statically linked build of the standard library need to explicitly link against icucore. There are various potential hacks^Wsolutions to this problem, and this is an attempt at a lesser of evils approach. Emit a linker directive to perform autolinking against icucore on Darwin systems. This allows us to avoid hacking the compiler driver and propagating that hack onto any build systems that don't go through the driver.
1 parent 4640246 commit 8e0362e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/public/stubs/UnicodeNormalization.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,10 @@ int32_t ubrk_preceding(UBreakIterator *, int32_t);
317317
int32_t ubrk_following(UBreakIterator *, int32_t);
318318
void ubrk_setText(UBreakIterator *, const UChar *, int32_t, UErrorCode *);
319319
}
320+
321+
// Force an autolink with ICU
322+
asm(".linker_option \"-licucore\"\n");
323+
320324
#endif // defined(__APPLE__)
321325

322326
void swift::__swift_stdlib_ubrk_close(

0 commit comments

Comments
 (0)