use the GNU linker

This commit is contained in:
Sebastien Bourdeauducq 2019-06-06 00:07:53 +08:00
parent cf86c11dce
commit f707295646
2 changed files with 2 additions and 7 deletions

View File

@ -20,11 +20,6 @@ rec {
name = oa.name + "-riscv"; name = oa.name + "-riscv";
cmakeFlags = oa.cmakeFlags ++ ["-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=RISCV"]; cmakeFlags = oa.cmakeFlags ++ ["-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=RISCV"];
}); });
lld_7 = (pkgs.lld_7.overrideAttrs(oa: {
name = oa.name + "-riscv";
})).override {
llvm = llvm_7;
};
rustc = (pkgs.rustc.overrideAttrs(oa: { rustc = (pkgs.rustc.overrideAttrs(oa: {
name = "${oa.pname}-${oa.version}-riscv"; name = "${oa.pname}-${oa.version}-riscv";
})).override { })).override {

View File

@ -3,6 +3,6 @@ let
hx = import ./derivations.nix { inherit pkgs; }; hx = import ./derivations.nix { inherit pkgs; };
in in
pkgs.mkShell { pkgs.mkShell {
buildInputs = [ hx.rustc hx.rust-riscv32imc-crates hx.lld_7 hx.cargo ]; buildInputs = [ hx.rustc hx.rust-riscv32imc-crates hx.binutils-riscv hx.cargo ];
RUSTFLAGS="-L ${hx.rust-riscv32imc-crates}/lib/rustlib/riscv32imc-unknown-none-elf/lib -C linker=lld"; RUSTFLAGS="-L ${hx.rust-riscv32imc-crates}/lib/rustlib/riscv32imc-unknown-none-elf/lib -C linker=riscv32-unknown-elf-ld -C link-arg=-Tlink.x";
} }