Skip to content

Commit 78938d8

Browse files
committed
Add -pie flag to clang++ linker invocation.
1 parent c36cb57 commit 78938d8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Driver/ToolChains.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,6 +1562,10 @@ toolchains::GenericUnix::constructInvocation(const LinkJobAction &job,
15621562
Arguments.push_back(context.Args.MakeArgString(A->getValue()));
15631563
}
15641564

1565+
if (getTriple().getOS() == llvm::Triple::Linux) {
1566+
Arguments.push_back("-pie");
1567+
}
1568+
15651569
std::string Target = getTargetForLinker();
15661570
if (!Target.empty()) {
15671571
Arguments.push_back("-target");

0 commit comments

Comments
 (0)