File tree Expand file tree Collapse file tree 2 files changed +788
-4
lines changed
Sources/SWBGenericUnixPlatform Expand file tree Collapse file tree 2 files changed +788
-4
lines changed Original file line number Diff line number Diff line change @@ -126,10 +126,18 @@ struct GenericUnixSDKRegistryExtension: SDKRegistryExtension {
126126 defaultProperties = [ : ]
127127 }
128128
129- if operatingSystem == . freebsd || ( operatingSystem == . linux && operatingSystem. distribution? . kind == . amazon && operatingSystem. distribution? . version == " 2 " ) || operatingSystem != context. hostOperatingSystem {
130- // FreeBSD is always LLVM-based, use lld
131- // Amazon Linux 2 has a gold linker bug see: https://sourceware.org/bugzilla/show_bug.cgi?id=23016, use lld
132- // or if we're cross-compiling, use lld
129+ let shouldUseLLD = {
130+ switch operatingSystem {
131+ case . freebsd:
132+ return true // FreeBSD is always LLVM-based.
133+ case . linux where operatingSystem. distribution? . kind == . amazon && operatingSystem. distribution? . version == " 2 " :
134+ return true // Amazon Linux 2 has a gold linker bug see: https://sourceware.org/bugzilla/show_bug.cgi?id=23016.
135+ default :
136+ return operatingSystem != context. hostOperatingSystem // Cross-compiling
137+ }
138+ } ( )
139+
140+ if shouldUseLLD {
133141 defaultProperties [ " ALTERNATE_LINKER " ] = " lld "
134142 }
135143
You can’t perform that action at this time.
0 commit comments