mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
rustc: don't try to use non-existent rust-lld
This removes the need to manually override Rust's default linker for every package that builds for wasm32-unknown-unknown.
This commit is contained in:
parent
a21afc1d92
commit
07f40e6892
@ -82,8 +82,6 @@ rustPlatform.buildRustPackage rec {
|
||||
# available for `rustc-wasm32`
|
||||
WASM_BUILD_STD = 0;
|
||||
|
||||
# NOTE: we need to force lld otherwise rust-lld is not found for wasm32 target
|
||||
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "lld";
|
||||
OPENSSL_NO_VENDOR = 1;
|
||||
PROTOC = "${protobuf}/bin/protoc";
|
||||
ROCKSDB_LIB_DIR = "${rocksdb}/lib";
|
||||
|
@ -96,7 +96,6 @@ rustPlatform.buildRustPackage rec {
|
||||
echo entering pagefind_web...
|
||||
(
|
||||
cd pagefind_web
|
||||
export RUSTFLAGS="-C linker=lld"
|
||||
bash ./local_build.sh
|
||||
)
|
||||
|
||||
|
@ -78,8 +78,6 @@ rustPlatform.buildRustPackage rec {
|
||||
]
|
||||
++ lib.optionals stdenv.isLinux [ (lib.getLib wayland) ];
|
||||
|
||||
env.CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "lld";
|
||||
|
||||
addDlopenRunpaths = map (p: "${lib.getLib p}/lib") (
|
||||
lib.optionals stdenv.hostPlatform.isLinux [
|
||||
libxkbcommon
|
||||
|
@ -83,7 +83,7 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
|
||||
postBuild = ''
|
||||
CC=clang CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER=lld cargo build \
|
||||
CC=clang cargo build \
|
||||
--target wasm32-unknown-unknown \
|
||||
--release
|
||||
|
||||
|
@ -63,7 +63,7 @@ let
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
HOME=$(mktemp -d) RUSTFLAGS="-C linker=lld" wasm-pack build --target web --release
|
||||
HOME=$(mktemp -d) wasm-pack build --target web --release
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
|
@ -192,6 +192,12 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||
postPatch = ''
|
||||
patchShebangs src/etc
|
||||
|
||||
# rust-lld is the name rustup uses for its bundled lld, so that it
|
||||
# doesn't conflict with any system lld. This is not an
|
||||
# appropriate default for Nixpkgs, where there is no rust-lld.
|
||||
substituteInPlace compiler/rustc_target/src/spec/*/*.rs \
|
||||
--replace-quiet '"rust-lld"' '"lld"'
|
||||
|
||||
${optionalString (!withBundledLLVM) "rm -rf src/llvm"}
|
||||
|
||||
# Useful debugging parameter
|
||||
|
@ -51,7 +51,7 @@ let
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
HOME=`pwd` RUSTFLAGS="-C linker=lld" ./app/build.sh
|
||||
HOME=`pwd` ./app/build.sh
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
|
@ -76,10 +76,6 @@ let
|
||||
|
||||
cargoDeps = rustPlatform.importCargoLock cargoLock;
|
||||
|
||||
RUSTFLAGS = builtins.concatStringsSep " " [
|
||||
"-C linker=lld"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ nodejs yarn fixup-yarn-lock ] ++
|
||||
lib.optional (lib.versionAtLeast version "15") [
|
||||
binaryen
|
||||
|
Loading…
Reference in New Issue
Block a user