Skip to content

Commit 40ea736

Browse files
authored
Merge pull request #9744 from milseman/static_stdlib
[stdlib] Static linking test case
2 parents 2a5d7a1 + f1a7c3d commit 40ea736

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/Driver/ToolChains.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1237,10 +1237,10 @@ toolchains::Darwin::constructInvocation(const LinkJobAction &job,
12371237
getRuntimeStaticLibraryPath(StaticRuntimeLibPath, context.Args, *this);
12381238
Arguments.push_back(context.Args.MakeArgString(StaticRuntimeLibPath));
12391239
Arguments.push_back("-lc++");
1240+
Arguments.push_back("-licucore");
12401241
Arguments.push_back("-framework");
12411242
Arguments.push_back("Foundation");
12421243
Arguments.push_back("-force_load_swift_libs");
1243-
Arguments.push_back("-licucore");
12441244
} else {
12451245
Arguments.push_back(context.Args.MakeArgString(RuntimeLibPath));
12461246
}

test/Driver/static-stdlib-icu.swift

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// REQUIRES: OS=macosx
2+
// Note: This is really about the /host/ environment
3+
4+
// RUN: %swiftc_driver -driver-print-jobs -static-stdlib %S/../Inputs/empty.swift | %FileCheck -check-prefix STATIC %s
5+
// RUN: %swiftc_driver -driver-print-jobs %S/../Inputs/empty.swift | %FileCheck -check-prefix NO_STATIC %s
6+
7+
// STATIC: {{.*}}-L {{[^ ]*}}/lib/swift_static/macosx {{.*}}-licucore
8+
// NO_STATIC: {{.*}}-L {{[^ ]*}}/lib/swift/macosx

0 commit comments

Comments
 (0)