Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove supplementary definitions of __bswapsi2 #137

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions crates/private/tests/root-task/ring-test-harness/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,3 @@ mod dummy_custom_getrandom {

getrandom::register_custom_getrandom!(dummy_custom_getrandom);
}

mod compiler_builtins_supplement {
// https://github.com/rust-lang/compiler-builtins/pull/563
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
#[no_mangle]
pub extern "C" fn __bswapsi2(u: u32) -> u32 {
u.swap_bytes()
}
}

This file was deleted.

1 change: 0 additions & 1 deletion crates/sel4-async/network/rustls/utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

extern crate alloc;

mod compiler_builtins_supplement;
mod dummy_custom_getrandom;
mod no_server_cert_verifier;
mod time_provider_impl;
Expand Down
28 changes: 24 additions & 4 deletions hacking/nix/rust-utils/build-sysroot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
#

{ lib, stdenv, buildPlatform, hostPlatform, buildPackages
, runCommand, linkFarm
, runCommand, runCommandCC, linkFarm
, fetchurl
, vendorLockfile, crateUtils, symlinkToRegularFile
, defaultRustToolchain, defaultRustTargetInfo
, rustToolchain ? defaultRustToolchain
Expand All @@ -27,6 +28,7 @@ in
, rustTargetInfo ? defaultRustTargetInfo
, alloc ? true
, compilerBuiltinsMem ? true
, compilerBuiltinsC ? true
}:

let
Expand Down Expand Up @@ -80,15 +82,33 @@ let

features = lib.concatStringsSep "," (lib.optionals compilerBuiltinsMem [
"compiler-builtins-mem"
] ++ lib.optionals compilerBuiltinsC [
"compiler-builtins-c"
]);

compilerRTSource = let
v = "18.0-2024-02-13";
name = "compiler-rt";
llvmSourceTarball = fetchurl {
name = "llvm-project.tar.gz";
url = "https://github.com/rust-lang/llvm-project/archive/rustc/${v}.tar.gz";
sha256 = "sha256-fMc84lCWfNy0Xiq1X7nrT53MQPlfRqGEb4qBAmqehAA=";
};
in
runCommand name {} ''
tar xzf ${llvmSourceTarball} --strip-components 1 llvm-project-rustc-${v}/${name}
mv ${name} $out
'';

in
runCommand "sysroot" {
(if compilerBuiltinsC then runCommandCC else runCommand) "sysroot" ({
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ rustToolchain ];

RUST_TARGET_PATH = rustTargetInfo.path;
} ''
} // lib.optionalAttrs compilerBuiltinsC {
"CC_${rustTargetInfo.name}" = "${stdenv.cc.targetPrefix}gcc";
RUST_COMPILER_RT_ROOT = compilerRTSource;
}) ''
cargo build \
-Z unstable-options \
--offline \
Expand Down
Loading