This is an archive of the discontinued LLVM Phabricator instance.

Stop treating -static as overriding -fPIC: they are distinct.
ClosedPublic

Authored by jyknight on Aug 19 2015, 10:52 AM.

Details

Reviewers
joerg
rnk
Summary

For some reason, clang had been treating a command like:
clang -static -fPIC foo.c
as if it should be compiled without the PIC relocation model.

This was incorrect: -static should be affecting only the linking
model, and -fPIC only the compilation.

This new behavior also matches GCC.

This is a follow-up from a review comment on r245447.

Diff Detail

Event Timeline

jyknight updated this revision to Diff 32579.Aug 19 2015, 10:52 AM
jyknight retitled this revision from to Stop treating -static as overriding -fPIC: they are distinct..
jyknight updated this object.
jyknight added a reviewer: joerg.
jyknight added subscribers: rnk, jevinskie, tberghammer and 3 others.
danalbert added inline comments.Aug 19 2015, 10:59 AM
lib/Driver/Tools.cpp
3025

trump-card (singular)

joerg accepted this revision.Aug 19 2015, 2:38 PM
joerg edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Aug 19 2015, 2:38 PM
rnk accepted this revision.Aug 20 2015, 4:50 PM
rnk added a reviewer: rnk.

lgtm

jyknight closed this revision.Aug 24 2015, 8:44 AM

D'oh, I copy/pasted the wrong review link when submitting this. It was submitted as rL245667.