Skip to content

Commit e74f2a6

Browse files
authored
Merge pull request #15801 from compnerd/pics
2 parents 0bfe250 + c8a8723 commit e74f2a6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,11 @@ getNormalInvocationArguments(std::vector<std::string> &invocationArgStrs,
439439
SHIMS_INCLUDE_FLAG, searchPathOpts.RuntimeResourcePath,
440440
});
441441

442+
// Enable Position Independence. `-fPIC` is not supported on Windows, which
443+
// is implicitly position independent.
444+
if (!triple.isOSWindows())
445+
invocationArgStrs.insert(invocationArgStrs.end(), {"-fPIC"});
446+
442447
// Enable modules.
443448
invocationArgStrs.insert(invocationArgStrs.end(), {
444449
"-fmodules",

0 commit comments

Comments
 (0)