File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1290,6 +1290,15 @@ public final class ProductBuildDescription {
1290
1290
return [ " -Xlinker " , " -dead_strip " ]
1291
1291
} else if buildParameters. triple. isWindows ( ) {
1292
1292
return [ " -Xlinker " , " /OPT:REF " ]
1293
+ } else if buildParameters. triple. arch == . wasm32 {
1294
+ // FIXME: wasm-ld strips data segments referenced through __start/__stop symbols
1295
+ // during GC, and it removes Swift metadata sections like swift5_protocols
1296
+ // We should add support of SHF_GNU_RETAIN-like flag for __attribute__((retain))
1297
+ // to LLVM and wasm-ld
1298
+ // This workaround is required for not only WASI but also all WebAssembly archs
1299
+ // using wasm-ld (e.g. wasm32-unknown-unknown). So this branch is conditioned by
1300
+ // arch == .wasm32
1301
+ return [ ]
1293
1302
} else {
1294
1303
return [ " -Xlinker " , " --gc-sections " ]
1295
1304
}
You can’t perform that action at this time.
0 commit comments