Fixed doc build error in gen_symbol_vma on macOS#27
Merged
equation314 merged 1 commit intomainfrom Mar 31, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a macOS documentation build failure related to gen_symbol_vma by avoiding problematic symbol-address generation on macOS and aligning linker symbol usage with addr_of!-based address taking.
Changes:
- Switch linker symbol declarations from
extern "C" fntoextern "C" staticand usecore::ptr::addr_of!for section boundary arithmetic/copying. - Update
gen_symbol_vmato use a slower, PC-relative-safe address computation on macOS and keep the fast asm-based path for non-macOS. - Remove the unused
cfg-ifdependency frompercpu_macros, adjust test gating, and broaden the deploy workflow trigger.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
percpu/tests/test_percpu.rs |
Adjusts cfg gating so sp-naive tests can build on non-Linux hosts. |
percpu/src/imp.rs |
Uses addr_of! + extern static for percpu linker symbols to avoid incorrect casts. |
percpu_macros/src/arch.rs |
Changes macOS symbol-VMA generation to avoid the fast asm path on macOS; updates symbol declaration style. |
percpu_macros/Cargo.toml |
Drops unused cfg-if dependency. |
Cargo.lock |
Removes cfg-if from the resolved dependency graph for percpu_macros. |
.github/workflows/deploy.yml |
Expands workflow triggers from main-only to all push/pull_request events. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See https://github.com/arceos-org/arceos/actions/runs/23734525797/job/69135753043#step:4:430.
This implements
gen_symbol_vmausing PC-relative addressing on macOS. The test code (test_percpu.rs) can now be successfully compiled on macOS (arm64), but the executable file still cannot be generated due to lack of support for linker scripts.