Skip to content

Commit 946ee34

Browse files
authored
Merge pull request #76706 from hyp/eng/android-lld
[android][build.ps1] use the newly built lld when linking swift runti…
2 parents 0005b95 + 66715b6 commit 946ee34

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

utils/build.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,13 @@ function Build-CMakeProject {
984984
# Add additional linker flags for generating the debug info.
985985
Append-FlagsDefine $Defines CMAKE_SHARED_LINKER_FLAGS "/debug"
986986
Append-FlagsDefine $Defines CMAKE_EXE_LINKER_FLAGS "/debug"
987+
} elseif ($Platform -eq "Android") {
988+
# Use a built lld linker as the Android's NDK linker might be too
989+
# old and not support all required relocations needed by the Swift
990+
# runtime.
991+
$ldPath = ([IO.Path]::Combine($CompilersBinaryCache, "bin", "ld.lld"))
992+
Append-FlagsDefine $Defines CMAKE_SHARED_LINKER_FLAGS "--ld-path=$ldPath"
993+
Append-FlagsDefine $Defines CMAKE_EXE_LINKER_FLAGS "--ld-path=$ldPath"
987994
}
988995
}
989996

0 commit comments

Comments
 (0)