This is an archive of the discontinued LLVM Phabricator instance.

[Clang driver, ARM] Do not add +long-calls in PIC mode
AbandonedPublic

Authored by iid_iunknown on Feb 4 2016, 2:13 PM.

Details

Summary

The driver resets the PIC / PIE flags to false if compiling for kernel/kext considering the OS and its version. From ParsePICArgs():

if (KernelOrKext && ((!Triple.isiOS() || Triple.isOSVersionLT(6)) && !Triple.isWatchOS()))
    PIC = PIE = false;

The condition for adding the +long-calls ARM feature in getARMTargetFeatures() is exactly the same.
Since +long-calls is not applicable for PIC, both conditions should be kept synchronized, otherwise one can get not working binaries.

This patch suggests to control the +long-calls option based on whether the code is PIC or not, which is a more natural way of doing this.

Diff Detail

Repository
rL LLVM

Event Timeline

iid_iunknown retitled this revision from to [Clang driver, ARM] Do not add +long-calls in PIC mode.
iid_iunknown updated this object.
iid_iunknown set the repository for this revision to rL LLVM.
iid_iunknown added a subscriber: cfe-commits.
rengolin edited edge metadata.Dec 12 2016, 1:47 AM

Was this abandoned?

iid_iunknown abandoned this revision.Dec 28 2016, 5:55 AM

Abandoning the patch as it is too old.