diff options
author | Brad Smith <brad@comstyle.com> | 2014-06-24 19:51:29 +0000 |
---|---|---|
committer | Brad Smith <brad@comstyle.com> | 2014-06-24 19:51:29 +0000 |
commit | 966b78f470606a5c7cb8e810d4aeeffe62f49979 (patch) | |
tree | 32edfa5b330b478edeef5e802f008ac6235d8196 /lib | |
parent | cd6ef194d0ede7c4cb23667d7cba19f0425183a6 (diff) | |
download | clang-966b78f470606a5c7cb8e810d4aeeffe62f49979.tar.gz clang-966b78f470606a5c7cb8e810d4aeeffe62f49979.tar.bz2 clang-966b78f470606a5c7cb8e810d4aeeffe62f49979.tar.xz |
Use appropriate default PIE settings for OpenBSD.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Driver/Tools.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index cbc6f2dd85..1488dc6955 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -2432,6 +2432,27 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, } } + // OpenBSD-specific defaults for PIE + if (getToolChain().getTriple().getOS() == llvm::Triple::OpenBSD) { + switch (getToolChain().getTriple().getArch()) { + case llvm::Triple::mips64: + case llvm::Triple::mips64el: + case llvm::Triple::sparc: + case llvm::Triple::x86: + case llvm::Triple::x86_64: + IsPICLevelTwo = false; // "-fpie" + break; + + case llvm::Triple::ppc: + case llvm::Triple::sparcv9: + IsPICLevelTwo = true; // "-fPIE" + break; + + default: + break; + } + } + // For the PIC and PIE flag options, this logic is different from the // legacy logic in very old versions of GCC, as that logic was just // a bug no one had ever fixed. This logic is both more rational and |