Skip to content

Update rustflags for target configurations#60

Open
binary-signal wants to merge 1 commit intoapache:mainfrom
binary-signal:rust-build-targets
Open

Update rustflags for target configurations#60
binary-signal wants to merge 1 commit intoapache:mainfrom
binary-signal:rust-build-targets

Conversation

@binary-signal
Copy link
Contributor

@binary-signal binary-signal commented Nov 24, 2025

add targets for linux windows and apple

add targets for linux windows and apple
Copy link
Contributor

@leekeiabstraction leekeiabstraction left a comment

Choose a reason for hiding this comment

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

Hope you don't mind me reviewing this.

Can you include testing details if on the PR description if any?

Or alternatively, if this follows convention, would be helpful to point out where this is retrieved from.

@binary-signal
Copy link
Contributor Author

@leekeiabstraction
The PR modifies .cargo/config.toml to add platform-specific Rust compiler flags:

Linux target - Adds optimization flags for Linux:

--gc-sections - Remove unused sections
--as-needed - Only link needed libraries
-z,norelro - Disable relro (read-only relocations)
relocation-model=pic - Position-independent code

macOS targets - Separates into two distinct configs:
x86_64-apple-darwin (Intel Macs)
aarch64-apple-darwin (Apple Silicon)

Both use the same flags for dynamic library linking

Windows target - Adds static CRT linking:
target.x86_64-pc-windows-msvc with +crt-static feature

This enables the project to compile correctly across Linux, macOS (both Intel and ARM), and Windows with optimized settings for each platform.

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.

2 participants