ndk-build uses -fpic while cmake uses -fPIC
- Dominant language
- No language data
- Stars
- 2.3k
- Forks
- 310
- PR merge metrics
- No merged PRs in 30d
Description
As per title, ndk-build based builds use -fpic and -fpie while cmake ones use -fPIC and -fPIE.
This is usually of no consequence... until you attempt to use static libraries from those builds together with LTO, which then produces error messages related to PIC Level.
The setting should be unified for each platform.
Tested with NDK r16.
Contributor guide
Research direction
Start by comparing the ndk-build and CMake configuration entry points that set PIC and PIE flags, then reproduce the mismatch with static libraries and LTO using the NDK r16 scenario described. Done means both build systems use the same platform-specific PIC settings and the LTO combination no longer reports a PIC-level error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, cmake
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100