diff --git a/.github/workflows/m68k.yml b/.github/workflows/m68k.yml index a7cad2df335..f6fd18037a5 100644 --- a/.github/workflows/m68k.yml +++ b/.github/workflows/m68k.yml @@ -67,14 +67,9 @@ jobs: - name: Setup path to libgccjit run: | sudo dpkg -i gcc-m68k-13.deb - echo "*********************" - ls /usr/bin - echo "*********************" - ls /bin - echo "*********************" - ls /lib - echo "*********************" - ls /usr/lib + # Make a symlink so that rustc uses our cross-gcc as a linker. + # TODO: remove. + #sudo ln -s /usr/bin/m68k-unknown-linux-gnu-gcc /usr/bin/cc echo /usr/lib/ > gcc_path - name: Set env @@ -148,6 +143,10 @@ jobs: - name: Build run: | ./y.sh prepare --only-libcore + # TODO: move into prepare command under a flag --cross-patches? + pushd build_sysroot/sysroot_src + git am ../../cross_patches/*.patch + popd ./build.sh cargo test ./clean_all.sh diff --git a/config.sh b/config.sh index 46568c95254..f5b62952172 100644 --- a/config.sh +++ b/config.sh @@ -28,6 +28,7 @@ RUN_WRAPPER='' if [[ "$HOST_TRIPLE" != "$TARGET_TRIPLE" ]]; then if [[ "$TARGET_TRIPLE" == "m68k-unknown-linux-gnu" ]]; then #TARGET_TRIPLE="mips-unknown-linux-gnu" + # TODO: figure a better way for the user to do that automatically for any target. linker='-Clinker=m68k-unknown-linux-gnu-gcc' elif [[ "$TARGET_TRIPLE" == "aarch64-unknown-linux-gnu" ]]; then # We are cross-compiling for aarch64. Use the correct linker and run tests in qemu. diff --git a/cross_patches/0001-Disable-libstd-and-libtest-dylib.patch b/cross_patches/0001-Disable-libstd-and-libtest-dylib.patch new file mode 100644 index 00000000000..74d9c208a05 --- /dev/null +++ b/cross_patches/0001-Disable-libstd-and-libtest-dylib.patch @@ -0,0 +1,39 @@ +From 966beefe08be6045bfcca26079b76a7a80413080 Mon Sep 17 00:00:00 2001 +From: None +Date: Thu, 28 Sep 2023 17:37:38 -0400 +Subject: [PATCH] Disable libstd and libtest dylib + +--- + library/std/Cargo.toml | 2 +- + library/test/Cargo.toml | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml +index 5b21355..cb0c49b 100644 +--- a/library/std/Cargo.toml ++++ b/library/std/Cargo.toml +@@ -9,7 +9,7 @@ description = "The Rust Standard Library" + edition = "2021" + + [lib] +-crate-type = ["dylib", "rlib"] ++crate-type = ["rlib"] + + [dependencies] + alloc = { path = "../alloc", public = true } +diff --git a/library/test/Cargo.toml b/library/test/Cargo.toml +index 91a1abd..a58c160 100644 +--- a/library/test/Cargo.toml ++++ b/library/test/Cargo.toml +@@ -4,7 +4,7 @@ version = "0.0.0" + edition = "2021" + + [lib] +-crate-type = ["dylib", "rlib"] ++crate-type = ["rlib"] + + [dependencies] + getopts = { version = "0.2.21", features = ['rustc-dep-of-std'] } +-- +2.42.0 +