Skip to content

Disable libunwind for RTEMS OS #665

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Sep 7, 2024

Conversation

thesummer
Copy link
Contributor

@thesummer thesummer commented Sep 5, 2024

In rust-lang/rust#127021 we added target support for RTEMS OS.

It has a POSIX interface, so we could reuse much of the unix backend, but currently libunwind is not supported.

Add a cfg switch to disable libunwind for RTEMS.

@thesummer
Copy link
Contributor Author

Seems to depend on #664 merged for the CI errors

@rustbot blocked

@rustbot
Copy link

rustbot commented Sep 5, 2024

Error: This repository is not enabled to use triagebot.
Add a triagebot.toml in the root of the default branch to enable it.

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

@workingjubilee
Copy link
Member

Your target is panic-abort, why does it even need this?

@workingjubilee
Copy link
Member

I'm not opposed to merging, I'm just confused, I wouldn't think this changes anything.

@thesummer
Copy link
Contributor Author

True, it's weird. Let me check again.

@thesummer
Copy link
Contributor Author

Ok. So the compiler itself builds fine. However, when I build my simple hello_world application for the target with cargo build -Z build-std=std,panic_abort --target armv7-rtems-eabihf the linking then fails due to unresolved references to libunwind (see below). If I apply the patch it works.

  = note: /tools/lib/gcc/arm-rtems6/13.2.1/../../../../arm-rtems6/bin/ld: /rtems-rust-toolchain/hello_cargo/target/armv7-rtems-eabihf/debug/deps/libstd-409a62e6aece35e6.rlib(std-409a62e6aece35e6.std.7a20a244cb6fd638-cgu.02.rcgu.o): in function `std::backtrace_rs::backtrace::libunwind::Frame::ip':
          /rtems-rust-toolchain/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/std/src/../../backtrace/src/backtrace/libunwind.rs:44:(.text._ZN3std12backtrace_rs9backtrace9libunwind5Frame2ip17hda06914ae821911cE+0x2c): undefined reference to `_Unwind_GetIP'
          collect2: error: ld returned 1 exit status

@workingjubilee
Copy link
Member

Huh. Something feels off here, but for now, merging this is okay!

@workingjubilee workingjubilee merged commit df56954 into rust-lang:master Sep 7, 2024
79 of 82 checks passed
@ChrisDenton ChrisDenton mentioned this pull request Nov 13, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants