Skip to content

Commit a1c6bf2

Browse files
committed
Cleanup and update to rustc 2023-06-19
1 parent 3d7ec59 commit a1c6bf2

7 files changed

+9
-98
lines changed

0001-Allow-overwriting-the-sysroot-compile-flag-via-rustc.patch

-27
This file was deleted.

build_sysroot/build_sysroot.sh

-9
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,3 @@ fi
2828
# Copy files to sysroot
2929
mkdir -p sysroot/lib/rustlib/$TARGET_TRIPLE/lib/
3030
cp -r target/$TARGET_TRIPLE/$sysroot_channel/deps/* sysroot/lib/rustlib/$TARGET_TRIPLE/lib/
31-
32-
# Since we can't override the sysroot for the UI tests anymore, we create a new toolchain and manually overwrite the sysroot directory.
33-
# TODO: to remove.
34-
#rust_toolchain=$(cat ../rust-toolchain | grep channel | sed 's/channel = "\(.*\)"/\1/')
35-
#my_toolchain_dir=$HOME/.rustup/toolchains/codegen_gcc_ui_tests-$rust_toolchain-$TARGET_TRIPLE
36-
#rm -rf $my_toolchain_dir
37-
#cp -r $HOME/.rustup/toolchains/$rust_toolchain-$TARGET_TRIPLE $my_toolchain_dir
38-
#rm -rf $my_toolchain_dir/lib/rustlib/$TARGET_TRIPLE/
39-
#cp -r ../build_sysroot/sysroot/* $my_toolchain_dir

example/mini_core.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,10 @@ impl<T> Box<T> {
504504

505505
impl<T: ?Sized, A: Allocator> Drop for Box<T, A> {
506506
fn drop(&mut self) {
507-
// drop is currently performed by compiler.
507+
// inner value is dropped by compiler.
508+
unsafe {
509+
libc::free(self.0.pointer.0 as *mut u8);
510+
}
508511
}
509512
}
510513

@@ -521,11 +524,6 @@ unsafe fn allocate(size: usize, _align: usize) -> *mut u8 {
521524
libc::malloc(size)
522525
}
523526

524-
#[lang = "box_free"]
525-
unsafe fn box_free<T: ?Sized>(ptr: Unique<T>, _alloc: ()) {
526-
libc::free(ptr.pointer.0 as *mut u8);
527-
}
528-
529527
#[lang = "drop"]
530528
pub trait Drop {
531529
fn drop(&mut self);

patches/0023-core-Ignore-failing-tests.patch

-49
This file was deleted.

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2023-06-10"
2+
channel = "nightly-2023-06-19"
33
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]

src/common.rs

+4
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ impl<'gcc, 'tcx> ConstMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
108108
self.const_uint(self.type_u64(), i)
109109
}
110110

111+
fn const_u128(&self, i: u128) -> RValue<'gcc> {
112+
self.const_uint_big(self.type_u128(), i)
113+
}
114+
111115
fn const_usize(&self, i: u64) -> RValue<'gcc> {
112116
let bit_size = self.data_layout().pointer_size.bits();
113117
if bit_size < 64 {

test.sh

-6
Original file line numberDiff line numberDiff line change
@@ -209,26 +209,20 @@ function setup_rustc() {
209209
cd rust
210210
git fetch
211211
git checkout $(rustc -V | cut -d' ' -f3 | tr -d '(')
212-
git am ../0001-Allow-overwriting-the-sysroot-compile-flag-via-rustc.patch
213212
export RUSTFLAGS=
214213

215214
rm config.toml || true
216215

217-
my_toolchain_dir=$HOME/.rustup/toolchains/codegen_gcc_ui_tests-$rust_toolchain-$TARGET_TRIPLE
218-
219216
cat > config.toml <<EOF
220217
changelog-seen = 2
221218
222219
[rust]
223220
codegen-backends = []
224221
deny-warnings = false
225222
226-
# FIXME: it works with the original rustc and cargo.
227223
[build]
228-
#cargo = "$my_toolchain_dir/bin/cargo"
229224
cargo = "$(rustup which cargo)"
230225
local-rebuild = true
231-
#rustc = "$my_toolchain_dir/bin/rustc"
232226
rustc = "$HOME/.rustup/toolchains/$rust_toolchain-$TARGET_TRIPLE/bin/rustc"
233227
234228
[target.x86_64-unknown-linux-gnu]

0 commit comments

Comments
 (0)