Skip to content

Commit

Permalink
Disable libstd and libtest dylib
Browse files Browse the repository at this point in the history
  • Loading branch information
antoyo committed Sep 28, 2023
1 parent 85bc611 commit 6998f65
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/m68k.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
39 changes: 39 additions & 0 deletions cross_patches/0001-Disable-libstd-and-libtest-dylib.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From 966beefe08be6045bfcca26079b76a7a80413080 Mon Sep 17 00:00:00 2001
From: None <[email protected]>
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

0 comments on commit 6998f65

Please sign in to comment.