Skip to content

arch/sim: Add dependencies for Rust cargo in make builds#19037

Open
toku-mac wants to merge 1 commit into
apache:masterfrom
toku-mac:add_rust_depends_make
Open

arch/sim: Add dependencies for Rust cargo in make builds#19037
toku-mac wants to merge 1 commit into
apache:masterfrom
toku-mac:add_rust_depends_make

Conversation

@toku-mac
Copy link
Copy Markdown
Contributor

@toku-mac toku-mac commented Jun 4, 2026

Summary

This updates the simulator link rule so nuttx$(EXEEXT) depends on $(EXTRA_LIBS).

With this dependency in place, changes to extra application libraries, including Rust static libraries rebuilt by Cargo, cause the simulator nuttx binary to be relinked.

Testing

I confirm that changes are verified on local setup and works as intended:

  • Build Host(s): OS (macOS 26.5), CPU(Apple M1), compiler(Apple clang version 21.0.0)
  • Target(s): arch(sim)
  • Ensure your PATH environment variable is properly configured to allow execution of: menuconfig, olddefconfig, savedefconfig, and setconfig.
  • Use the Rust toolchain version prior to nightly-2026-04-29 to avoid errors related to lib/rustlib/src/rust/library/std/src/sys/net/connection/socket/unix.rs.
  • Depends on the corresponding apps-side PR. #3522

PR verification Self-Check

  • My PR adheres to Contributing Guidelines and Documentation (git commit title and message, coding standard, etc).
  • My PR is ready for review and can be safely merged into a codebase.

@toku-mac toku-mac requested a review from xiaoxiang781216 as a code owner June 4, 2026 04:50
@github-actions github-actions Bot added Arch: simulator Issues related to the SIMulator Size: XS The size of the change in this PR is very small labels Jun 4, 2026
xiaoxiang781216
xiaoxiang781216 previously approved these changes Jun 4, 2026
Add `EXTRA_LIB_DEPS` to the simulator nuttx target prerequisites.

This lets Make notice when an extra application library, such as a Rust
static library rebuilt by Cargo, has changed and ensures the final
simulator binary is relinked.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
@toku-mac
Copy link
Copy Markdown
Contributor Author

toku-mac commented Jun 4, 2026

In commit 8899369, I fixed a build error in sim/module.
The fix keeps EXTRA_LIBS as linker input only, and adds a separate dependency list for actual files.

EXTRA_LIBS may contain both real library paths and linker options such as -ltest. If the whole variable is used as a Make prerequisite, Make treats -ltest as a file target and fails with “No rule to make target '-ltest'”. The new EXTRA_LIB_DEPS filters out option-style entries and expands only existing file paths with wildcard, so the nuttx target still relinks when real extra library files change without misinterpreting linker options as build targets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: simulator Issues related to the SIMulator Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants