File tree Expand file tree Collapse file tree 3 files changed +10
-0
lines changed
Expand file tree Collapse file tree 3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,12 @@ namespace utbot {
105105 });
106106 }
107107
108+ void CompileCommand::removeFPIE () {
109+ CollectionUtils::erase_if (commandLine, [](const std::string &arg) {
110+ return StringUtils::startsWith (arg, " -fPIE" );
111+ });
112+ }
113+
108114 void CompileCommand::initOutput () {
109115 auto it = findOutput ();
110116 if (it != commandLine.end ()) {
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ namespace utbot {
4646 void removeIncludeFlags ();
4747
4848 void removeWerror ();
49+
50+ void removeFPIE ();
4951 };
5052}
5153
Original file line number Diff line number Diff line change @@ -256,6 +256,7 @@ namespace printer {
256256 compileCommand.addFlagsToBegin (
257257 CompilationUtils::getCoverageCompileFlags (primaryCompilerName));
258258 compileCommand.addFlagsToBegin (SanitizerUtils::getSanitizeCompileFlags (compilerName));
259+ compileCommand.removeFPIE ();
259260
260261 fs::path temporaryDependencyFile = getTemporaryDependencyFile (sourcePath);
261262 fs::path dependencyFile = getDependencyFile (sourcePath);
@@ -327,6 +328,7 @@ namespace printer {
327328 }
328329 testCompilationCommand.addFlagToBegin (FPIC_FLAG);
329330 testCompilationCommand.addFlagsToBegin (SANITIZER_NEEDED_FLAGS);
331+ testCompilationCommand.removeFPIE ();
330332
331333 fs::path testSourcePath = Paths::sourcePathToTestPath (testGen->projectContext , sourcePath);
332334 fs::path compilationDirectory = compilationUnitInfo->getDirectory ();
You can’t perform that action at this time.
0 commit comments