about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--0001-Allow-overwriting-the-sysroot-compile-flag-via-rustc.patch27
-rwxr-xr-xbuild_sysroot/build_sysroot.sh9
-rw-r--r--example/mini_core.rs10
-rw-r--r--patches/0023-core-Ignore-failing-tests.patch49
-rw-r--r--rust-toolchain2
-rw-r--r--src/common.rs4
-rwxr-xr-xtest.sh7
7 files changed, 9 insertions, 99 deletions
diff --git a/0001-Allow-overwriting-the-sysroot-compile-flag-via-rustc.patch b/0001-Allow-overwriting-the-sysroot-compile-flag-via-rustc.patch
deleted file mode 100644
index f7860bd9105..00000000000
--- a/0001-Allow-overwriting-the-sysroot-compile-flag-via-rustc.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 8d5e85607d3d52f920990334ae1cfa9798ad9259 Mon Sep 17 00:00:00 2001
-From: Antoni Boucher <bouanto@zoho.com>
-Date: Thu, 8 Jun 2023 17:27:34 -0400
-Subject: [PATCH] Allow overwriting the sysroot compile flag via --rustc-args
-
----
- src/tools/compiletest/src/runtest.rs | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
-index 6582b534488..d16a7d66154 100644
---- a/src/tools/compiletest/src/runtest.rs
-+++ b/src/tools/compiletest/src/runtest.rs
-@@ -1951,7 +1951,9 @@ fn make_compile_args(
-         rustc.arg("-Ztranslate-remapped-path-to-local-path=no");
- 
-         // Optionally prevent default --sysroot if specified in test compile-flags.
--        if !self.props.compile_flags.iter().any(|flag| flag.starts_with("--sysroot")) {
-+        if !self.props.compile_flags.iter().any(|flag| flag.starts_with("--sysroot"))
-+            && !self.config.host_rustcflags.iter().any(|flag| flag == "--sysroot")
-+        {
-             // In stage 0, make sure we use `stage0-sysroot` instead of the bootstrap sysroot.
-             rustc.arg("--sysroot").arg(&self.config.sysroot_base);
-         }
--- 
-2.41.0
-
diff --git a/build_sysroot/build_sysroot.sh b/build_sysroot/build_sysroot.sh
index 7f2c8d6121d..9d692d599f6 100755
--- a/build_sysroot/build_sysroot.sh
+++ b/build_sysroot/build_sysroot.sh
@@ -28,12 +28,3 @@ fi
 # Copy files to sysroot
 mkdir -p sysroot/lib/rustlib/$TARGET_TRIPLE/lib/
 cp -r target/$TARGET_TRIPLE/$sysroot_channel/deps/* sysroot/lib/rustlib/$TARGET_TRIPLE/lib/
-
-# Since we can't override the sysroot for the UI tests anymore, we create a new toolchain and manually overwrite the sysroot directory.
-# TODO: to remove.
-#rust_toolchain=$(cat ../rust-toolchain | grep channel | sed 's/channel = "\(.*\)"/\1/')
-#my_toolchain_dir=$HOME/.rustup/toolchains/codegen_gcc_ui_tests-$rust_toolchain-$TARGET_TRIPLE
-#rm -rf $my_toolchain_dir
-#cp -r $HOME/.rustup/toolchains/$rust_toolchain-$TARGET_TRIPLE $my_toolchain_dir
-#rm -rf $my_toolchain_dir/lib/rustlib/$TARGET_TRIPLE/
-#cp -r ../build_sysroot/sysroot/* $my_toolchain_dir
diff --git a/example/mini_core.rs b/example/mini_core.rs
index 835419efc3a..0cd7e6047c2 100644
--- a/example/mini_core.rs
+++ b/example/mini_core.rs
@@ -504,7 +504,10 @@ impl<T> Box<T> {
 
 impl<T: ?Sized, A: Allocator> Drop for Box<T, A> {
     fn drop(&mut self) {
-        // drop is currently performed by compiler.
+        // inner value is dropped by compiler.
+        unsafe {
+            libc::free(self.0.pointer.0 as *mut u8);
+        }
     }
 }
 
@@ -521,11 +524,6 @@ unsafe fn allocate(size: usize, _align: usize) -> *mut u8 {
     libc::malloc(size)
 }
 
-#[lang = "box_free"]
-unsafe fn box_free<T: ?Sized>(ptr: Unique<T>, _alloc: ()) {
-    libc::free(ptr.pointer.0 as *mut u8);
-}
-
 #[lang = "drop"]
 pub trait Drop {
     fn drop(&mut self);
diff --git a/patches/0023-core-Ignore-failing-tests.patch b/patches/0023-core-Ignore-failing-tests.patch
deleted file mode 100644
index ee5ba449fb8..00000000000
--- a/patches/0023-core-Ignore-failing-tests.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From dd82e95c9de212524e14fc60155de1ae40156dfc Mon Sep 17 00:00:00 2001
-From: bjorn3 <bjorn3@users.noreply.github.com>
-Date: Sun, 24 Nov 2019 15:34:06 +0100
-Subject: [PATCH] [core] Ignore failing tests
-
----
- library/core/tests/iter.rs       |  4 ++++
- library/core/tests/num/bignum.rs | 10 ++++++++++
- library/core/tests/num/mod.rs    |  5 +++--
- library/core/tests/time.rs       |  1 +
- 4 files changed, 18 insertions(+), 2 deletions(-)
-
-diff --git a/library/core/tests/array.rs b/library/core/tests/array.rs
-index 4bc44e9..8e3c7a4 100644
---- a/library/core/tests/array.rs
-+++ b/library/core/tests/array.rs
-@@ -242,6 +242,7 @@ fn iterator_drops() {
-     assert_eq!(i.get(), 5);
- }
- 
-+/*
- // This test does not work on targets without panic=unwind support.
- // To work around this problem, test is marked is should_panic, so it will
- // be automagically skipped on unsuitable targets, such as
-@@ -283,6 +284,7 @@ fn array_default_impl_avoids_leaks_on_panic() {
-     assert_eq!(COUNTER.load(Relaxed), 0);
-     panic!("test succeeded")
- }
-+*/
- 
- #[test]
- fn empty_array_is_always_default() {
-@@ -304,6 +304,7 @@ fn array_map() {
-     assert_eq!(b, [1, 2, 3]);
- }
- 
-+/*
- // See note on above test for why `should_panic` is used.
- #[test]
- #[should_panic(expected = "test succeeded")]
-@@ -332,6 +333,7 @@ fn array_map_drop_safety() {
-     assert_eq!(DROPPED.load(Ordering::SeqCst), num_to_create);
-     panic!("test succeeded")
- }
-+*/
- 
- #[test]
- fn cell_allows_array_cycle() {
--- 2.21.0 (Apple Git-122)
diff --git a/rust-toolchain b/rust-toolchain
index 2614fa081a8..ebb04d0069c 100644
--- a/rust-toolchain
+++ b/rust-toolchain
@@ -1,3 +1,3 @@
 [toolchain]
-channel = "nightly-2023-06-10"
+channel = "nightly-2023-06-19"
 components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
diff --git a/src/common.rs b/src/common.rs
index 7fa986e2737..b62f4676f70 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -108,6 +108,10 @@ impl<'gcc, 'tcx> ConstMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
         self.const_uint(self.type_u64(), i)
     }
 
+    fn const_u128(&self, i: u128) -> RValue<'gcc> {
+        self.const_uint_big(self.type_u128(), i)
+    }
+
     fn const_usize(&self, i: u64) -> RValue<'gcc> {
         let bit_size = self.data_layout().pointer_size.bits();
         if bit_size < 64 {
diff --git a/test.sh b/test.sh
index 2e485b92739..d12fe718a96 100755
--- a/test.sh
+++ b/test.sh
@@ -209,13 +209,10 @@ function setup_rustc() {
     cd rust
     git fetch
     git checkout $(rustc -V | cut -d' ' -f3 | tr -d '(')
-    git am ../0001-Allow-overwriting-the-sysroot-compile-flag-via-rustc.patch
     export RUSTFLAGS=
 
     rm config.toml || true
 
-    my_toolchain_dir=$HOME/.rustup/toolchains/codegen_gcc_ui_tests-$rust_toolchain-$TARGET_TRIPLE
-
     cat > config.toml <<EOF
 changelog-seen = 2
 
@@ -223,12 +220,9 @@ changelog-seen = 2
 codegen-backends = []
 deny-warnings = false
 
-# FIXME: it works with the original rustc and cargo.
 [build]
-#cargo = "$my_toolchain_dir/bin/cargo"
 cargo = "$(rustup which cargo)"
 local-rebuild = true
-#rustc = "$my_toolchain_dir/bin/rustc"
 rustc = "$HOME/.rustup/toolchains/$rust_toolchain-$TARGET_TRIPLE/bin/rustc"
 
 [target.x86_64-unknown-linux-gnu]
@@ -394,7 +388,6 @@ function test_rustc() {
     fi
 
     echo "[TEST] rustc test suite"
-    # FIXME: the problem seems like an ABI incompatibility between cg_gcc sysroot and cg_llvm.
     COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 tests/ui --rustc-args "$RUSTC_ARGS"
 }