Skip to content

Fixed doc build error in gen_symbol_vma on macOS#27

Merged
equation314 merged 1 commit intomainfrom
fix-macos
Mar 31, 2026
Merged

Fixed doc build error in gen_symbol_vma on macOS#27
equation314 merged 1 commit intomainfrom
fix-macos

Conversation

@equation314
Copy link
Copy Markdown
Member

@equation314 equation314 commented Mar 31, 2026

See https://github.com/arceos-org/arceos/actions/runs/23734525797/job/69135753043#step:4:430.

This implements gen_symbol_vma using 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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" fn to extern "C" static and use core::ptr::addr_of! for section boundary arithmetic/copying.
  • Update gen_symbol_vma to use a slower, PC-relative-safe address computation on macOS and keep the fast asm-based path for non-macOS.
  • Remove the unused cfg-if dependency from percpu_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.

Comment thread percpu_macros/src/arch.rs
Comment thread percpu_macros/src/arch.rs Outdated
Comment thread .github/workflows/deploy.yml
Copy link
Copy Markdown
Contributor

@aarkegz aarkegz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@equation314 equation314 merged commit 6ed9b20 into main Mar 31, 2026
28 checks passed
@equation314 equation314 deleted the fix-macos branch March 31, 2026 05:33
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