@@ -1324,37 +1324,7 @@ struct WasmLd<'a> {
1324
1324
1325
1325
impl < ' a > WasmLd < ' a > {
1326
1326
fn new ( cmd : Command , sess : & ' a Session ) -> WasmLd < ' a > {
1327
- // If the atomics feature is enabled for wasm then we need a whole bunch
1328
- // of flags:
1329
- //
1330
- // * `--shared-memory` - the link won't even succeed without this, flags
1331
- // the one linear memory as `shared`
1332
- //
1333
- // * `--max-memory=1G` - when specifying a shared memory this must also
1334
- // be specified. We conservatively choose 1GB but users should be able
1335
- // to override this with `-C link-arg`.
1336
- //
1337
- // * `--import-memory` - it doesn't make much sense for memory to be
1338
- // exported in a threaded module because typically you're
1339
- // sharing memory and instantiating the module multiple times. As a
1340
- // result if it were exported then we'd just have no sharing.
1341
- //
1342
- // On wasm32-unknown-unknown, we also export symbols for glue code to use:
1343
- // * `--export=*tls*` - when `#[thread_local]` symbols are used these
1344
- // symbols are how the TLS segments are initialized and configured.
1345
- let mut wasm_ld = WasmLd { cmd, sess } ;
1346
- if sess. target_features . contains ( & sym:: atomics) {
1347
- wasm_ld. link_args ( & [ "--shared-memory" , "--max-memory=1073741824" , "--import-memory" ] ) ;
1348
- if sess. target . os == "unknown" || sess. target . os == "none" {
1349
- wasm_ld. link_args ( & [
1350
- "--export=__wasm_init_tls" ,
1351
- "--export=__tls_size" ,
1352
- "--export=__tls_align" ,
1353
- "--export=__tls_base" ,
1354
- ] ) ;
1355
- }
1356
- }
1357
- wasm_ld
1327
+ WasmLd { cmd, sess }
1358
1328
}
1359
1329
}
1360
1330
0 commit comments