Skip to content

Commit 1e7ed77

Browse files
finagolfinartemcm
authored andcommitted
Android: add the stdlib RPATH when natively building on Android with Termux
This is the equivalent of the already-merged C++ Driver change in swiftlang/swift#69538.
1 parent 22645f3 commit 1e7ed77

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Sources/SwiftDriver/Jobs/GenericUnixToolchain+LinkerSupport.swift

+10-2
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,16 @@ extension GenericUnixToolchain {
127127
isShared: hasRuntimeArgs
128128
)
129129

130-
if hasRuntimeArgs && targetTriple.environment != .android &&
131-
toolchainStdlibRpath {
130+
// An exception is made for native Android environments like the Termux
131+
// app as they build and run natively like a Unix environment on Android,
132+
// so add the stdlib RPATH by default there.
133+
#if os(Android)
134+
let addRpath = true
135+
#else
136+
let addRpath = targetTriple.environment != .android
137+
#endif
138+
139+
if hasRuntimeArgs && addRpath && toolchainStdlibRpath {
132140
// FIXME: We probably shouldn't be adding an rpath here unless we know
133141
// ahead of time the standard library won't be copied.
134142
for path in runtimePaths {

0 commit comments

Comments
 (0)