Allow CFI with crt-static
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I am working on enabling CFI on the Trusty OS. After adding "supported-sanitizers": ["cfi"], to a custom copy of aarch64-unknown-trusty I also needed to set "crt-static-default": false. Otherwise I would get an error about sanitizers being incompatible with static linking.
With the two target changes, CFI is working as intended on Trusty.
The check and error were introduced to fix https://github.com/rust-lang/rust/issues/85459, and the issue specifically mentions Linux. Could the check be relaxed to allow CFI (and maybe other sanitizers) together with crt-static outside of Linux?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the sanitizer and static-linking compatibility check introduced for issue #85459, then compare its Linux-specific rationale with the custom aarch64-unknown-trusty target settings described here. Reproduce the configuration with supported-sanitizers set to cfi and crt-static-default set to false; done means CFI and crt-static work together outside Linux without weakening the existing Linux restriction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100