| ... | ... | @@ -2012,6 +2012,18 @@ fn buildOutputType( |
| 2012 | 2012 | link_libcpp = true; |
| 2013 | 2013 | } |
| 2014 | 2014 | |
| 2015 | if (target_info.target.cpu.arch.isWasm() and linker_shared_memory) { |
| 2016 | if (output_mode == .Obj) { |
| 2017 | fatal("shared memory is not allowed in object files", .{}); |
| 2018 | } |
| 2019 | |
| 2020 | if (!target_info.target.cpu.features.isEnabled(@enumToInt(std.Target.wasm.Feature.atomics)) or |
| 2021 | !target_info.target.cpu.features.isEnabled(@enumToInt(std.Target.wasm.Feature.bulk_memory))) |
| 2022 | { |
| 2023 | fatal("'atomics' and 'bulk-memory' features must be used in order to use shared memory", .{}); |
| 2024 | } |
| 2025 | } |
| 2026 | |
| 2015 | 2027 | // Now that we have target info, we can find out if any of the system libraries |
| 2016 | 2028 | // are part of libc or libc++. We remove them from the list and communicate their |
| 2017 | 2029 | // existence via flags instead. |