mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
20 lines
549 B
Bash
Executable File
20 lines
549 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
filtered_args=()
|
|
for arg in "$@"; do
|
|
# napi-build emits `-Wl -undefined dynamic_lookup` on macOS. When rustc calls
|
|
# rust-lld directly, `-Wl` is not a real linker flag; the following Darwin
|
|
# args are already valid for rust-lld and must be preserved.
|
|
if [[ "$arg" == "-Wl" ]]; then
|
|
continue
|
|
fi
|
|
filtered_args+=("$arg")
|
|
done
|
|
|
|
sysroot="$(rustc --print sysroot)"
|
|
host="$(rustc -vV | sed -n 's/^host: //p')"
|
|
rust_lld="$sysroot/lib/rustlib/$host/bin/rust-lld"
|
|
|
|
exec "$rust_lld" "${filtered_args[@]}"
|