This is an archive of the discontinued LLVM Phabricator instance.

Don't force -pie for Android.
ClosedPublic

Authored by danalbert on Mar 2 2015, 1:56 PM.

Details

Summary

There is no -no-pie flag that can override this, so making it default
to being on for Android means it is no longer possible to create
non-PIE executables on Android. While current versions of Android
support (and the most recent requires) PIE, ICS and earlier versions
of Android cannot run PIE executables, so this needs to be optional.

Diff Detail

Repository
rL LLVM

Event Timeline

danalbert updated this revision to Diff 21035.Mar 2 2015, 1:56 PM
danalbert retitled this revision from to Don't force -pie for Android..
danalbert updated this object.
danalbert edited the test plan for this revision. (Show Details)
danalbert added a reviewer: srhines.
danalbert set the repository for this revision to rL LLVM.
danalbert added subscribers: Unknown Object (MLST), volkalexey.

Alexey: you introduced this behavior in http://reviews.llvm.org/D2668

IMO it's the build system's job to pass -pie for Android, not the driver's. If this really needs to be in the driver then it needs to be guarded to only be forced on if LTO is being used.

srhines accepted this revision.Mar 2 2015, 3:42 PM
srhines edited edge metadata.

Looks good (and fixes the past release problem).

This revision is now accepted and ready to land.Mar 2 2015, 3:42 PM
thakis added a subscriber: thakis.Mar 2 2015, 3:53 PM

Thanks, this caused us grief at some point too. I think if you pass -Bsymbolic, -pie gets disabled (?), so iirc I saw a target that passed -Bsymbolic just to get rid of -pie. (My memory is hazy, but I'm sure that I wanted to remove this behavior at some point.)

This revision was automatically updated to reflect the committed changes.