aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorAndrzej Warzynski <andrzej.warzynski@arm.com>2022-06-22 10:29:57 +0000
committerAndrzej Warzynski <andrzej.warzynski@arm.com>2022-06-29 07:53:06 +0000
commitb405407a489902c0acfcf936bfda9821a1deb170 (patch)
treedcd0c43e30f2e6675909fefbfe5263468fa936c1 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent3d9ce9e43d07bbd3ab5c25ee36f417e3d372b94b (diff)
downloadllvm-b405407a489902c0acfcf936bfda9821a1deb170.zip
llvm-b405407a489902c0acfcf936bfda9821a1deb170.tar.gz
llvm-b405407a489902c0acfcf936bfda9821a1deb170.tar.bz2
[clang][flang] Disable defaulting to `-fpie` for LLVM Flang
In, https://reviews.llvm.org/D120305, CLANG_DEFAULT_PIE_ON_LINUX was set to `On` by default. However, neither `-fpie` nor `-fpic` are currently supported in LLVM Flang. Hence, in this patch the behaviour controlled with CLANG_DEFAULT_PIE_ON_LINUX is refined not to apply to Flang. Another way to look at this is that CLANG_DEFAULT_PIE_ON_LINUX is currently affecting both Clang and Flang. IIUC, the intention for this CMake variable has always been to only affect Clang. This patch makes sure that that's the case. Without this change, you might see errors like this on X86_64: ``` /usr/bin/ld: main.o: relocation R_X86_64_32 against `.bss' can not be used when making a PIE object; recompile with -fPIC ``` I've not experienced any issues on AArch64. That's probably because on AArch64 some object files happen to be position independent without needing -fpie or -fpic. Differential Revision: https://reviews.llvm.org/D128333
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions