diff options
author | Ed Schouten <ed@nuxi.nl> | 2016-08-11 20:03:22 +0000 |
---|---|---|
committer | Ed Schouten <ed@nuxi.nl> | 2016-08-11 20:03:22 +0000 |
commit | 610adaeec4557013b441960dc6ba1b6a72c1d337 (patch) | |
tree | ea411136a261d92b6c72c25d39d42043c190e403 /clang/lib/Driver/Tools.cpp | |
parent | 38eea4a76f015d6ee7afdb3a7a02ac6789104815 (diff) | |
download | bcm5719-llvm-610adaeec4557013b441960dc6ba1b6a72c1d337.tar.gz bcm5719-llvm-610adaeec4557013b441960dc6ba1b6a72c1d337.zip |
Don't enable PIE on i686-unknown-cloudabi.
We're only going to provide support for using PIE on architectures that
provide PC-relative addressing. i686 is not one of those, so add the
necessary bits for only passing in -pie -zrelro conditionally.
llvm-svn: 278395
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 6011a7fa31a..0efda4858f1 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -7523,11 +7523,13 @@ void cloudabi::Linker::ConstructJob(Compilation &C, const JobAction &JA, // CloudABI only supports static linkage. CmdArgs.push_back("-Bstatic"); - - // CloudABI uses Position Independent Executables exclusively. - CmdArgs.push_back("-pie"); CmdArgs.push_back("--no-dynamic-linker"); - CmdArgs.push_back("-zrelro"); + + // Provide PIE linker flags in case PIE is default for the architecture. + if (ToolChain.isPIEDefault()) { + CmdArgs.push_back("-pie"); + CmdArgs.push_back("-zrelro"); + } CmdArgs.push_back("--eh-frame-hdr"); CmdArgs.push_back("--gc-sections"); |