Bug 15584

Summary: Audit use of -fPIE in -native libraries
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Randy MacLeod <randy.macleod>
Component: devtools / tool chainAssignee: Unassigned <unassigned>
Status: RESOLVED OBSOLETE QA Contact:
Severity: normal    
Priority: Medium CC: meta.mr.watcher, meta.watcher, raj.khem, sundeep.kokkonda
Version: 5.99   
Target Milestone: 5.99   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Randy MacLeod 2024-08-29 13:46:26 UTC
When updating Rust to 1.78, a problem was found on an alma9 build (1) that appears to be due to libz.a being compiled without -fPIE. A patch has been sent to fix that issue (2).

Are there other static or shared libraries that are not using -fPIE and if so, should we require and test that all -native objects are using -fPIE?




1) https://lists.openembedded.org/g/openembedded-core/message/203837?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3ACreated%2C%2Crust%3A+Upgrade+1.78.0-%3E1.79.0%2C20%2C1%2C0%2C108090372

2) https://lists.openembedded.org/g/openembedded-core/message/203882?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3Acreated%2C%2Crust%3A+Upgrade+1.78.0-%3E1.79.0%2C20%2C2%2C0%2C108090372
Comment 1 Randy MacLeod 2024-08-29 14:40:17 UTC
Apparently you can't just add -fPIE everywhere as on override since things will break in weird and wonderful ways.

Khem, Do you have any words of wisdom to share?
Comment 2 Randy MacLeod 2026-02-10 19:23:18 UTC
This is a very general concern and it seems that we can't 
apply a generic rule for -native code so closing the bug.

If there is a specific problem related to lack of: -fPIE for -native code,
please open a new bug.