]> granicus.if.org Git - clang/commit
Driver: warn on -fPIC/-fpic/-fPIE/-fpie on Windows
authorSaleem Abdulrasool <compnerd@compnerd.org>
Mon, 26 Dec 2016 03:35:24 +0000 (03:35 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Mon, 26 Dec 2016 03:35:24 +0000 (03:35 +0000)
commit71ec224e27b61d4f1998f7cd3aaf0981c6f09f9e
tree2c3b655e29ec1a25ee7c81c7f11d59bc524a78b8
parentc2f02d107c7fb2853a9084224c4adf27a2cab5b4
Driver: warn on -fPIC/-fpic/-fPIE/-fpie on Windows

Use of these flags would result in the use of ELF-style PIE/PIC code
which is incorrect on Windows.  Windows is inherently PIC by means of
the DLL slide that occurs at load.  This also mirrors the behaviour on
GCC for MinGW.  Currently, the Windows x86_64 forces the relocation
model to PIC (Level 2).  This is unchanged for now, though we should
remove any assumptions on that and change it to a static relocation
model.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290533 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Driver/Tools.cpp
test/Driver/windows-pic.cpp [new file with mode: 0644]