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

Use libc-test for horizon OS #8

Closed
wants to merge 12 commits into from

Conversation

ian-h-chamberlain
Copy link

@ian-h-chamberlain ian-h-chamberlain commented Feb 13, 2022

In the interest of Meziu/rust-horizon#6 – this takes a first pass at using the libc test runner to compare ABIs and type sizes, but could be improved to include function signatures, constants, etc.

My plan is not to merge this as-is, but break out the functional changes in libc and deliver them separately. Maybe we want a "testing" branch for this to run the tests?

Edit: a few instructions on how to actually run this, I forgot:

  • Use a horizon-std toolchain
  • Apply this patch for ctest2 to support the target:
diff --git a/src/lib.rs b/src/lib.rs
index c5c65ca..5126b8d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1122,6 +1122,8 @@ fn default_cfg(target: &str) -> Vec<(String, Option<String>)> {
         ("vxworks", "unix", "")
     } else if target.contains("haiku") {
         ("haiku", "unix", "")
+    } else if target.contains("nintendo-3ds") {
+        ("horizon", "unix", "newlib")
     } else {
         panic!("unknown os/family: {}", target)
     };
  • Set up patches in libc-test/.cargo/config.toml:
[patch.crates-io]
ctest2 = { path = "your/ctest2/fork" }

[patch."https://github.com/Meziu/libc.git"]
libc = { path = ".." }

[env]
CC_armv6k_nintendo_3ds = "/opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc"
AR_armv6k_nintendo_3ds = "/opt/devkitpro/devkitARM/bin/arm-none-eabi-ar"
  • cargo 3ds test --test main. Other tests have link errors currently

Let me know if anything looks off here or you have questions, but I think this is a decent point for us to test some ABI mismatches and stuff.

@Meziu @AzureMarker

@ian-h-chamberlain
Copy link
Author

Going through my old PRs and cleaning them up. This branch is pretty stale and I don't think it makes sense to upstream any of this, so just gonna close this, but it might be useful to dig up again if we ever run into ABI issues with libc in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants