]> granicus.if.org Git - clang/commit
Stop treating -static as overriding -fPIC: they are distinct.
authorJames Y Knight <jyknight@google.com>
Fri, 21 Aug 2015 04:14:55 +0000 (04:14 +0000)
committerJames Y Knight <jyknight@google.com>
Fri, 21 Aug 2015 04:14:55 +0000 (04:14 +0000)
commit2163e6004de9ba2566711bef00f168ca6404eaed
tree1e04016d5a599cf181de00d627fa5a46b0fa997d
parent772a90ee5096e15998ff90025b87c5ca4ab796d5
Stop treating -static as overriding -fPIC: they are distinct.

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.

Differential Revision: http://reviews.llvm.org/D12208

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@245667 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Driver/Tools.cpp
test/Driver/pic.c