diff --git a/ide/checkcompileropts.pas b/ide/checkcompileropts.pas index 4ddef1b6f2..5b26226b23 100644 --- a/ide/checkcompileropts.pas +++ b/ide/checkcompileropts.pas @@ -391,8 +391,8 @@ begin try // create compiler command line options CmdLineParams:=Options.MakeOptionsString(BogusFilename,nil, - [ccloAddVerboseAll,ccloDoNotAppendOutFileOption]) - +' '+BogusFilename; + [ccloAddVerboseAll,ccloDoNotAppendOutFileOption,cclAbsolutePaths]) + +' '+BogusFilename; CompileTool:=TExternalToolOptions.Create; CompileTool.Title:=dlgCCOTestToolCompilingEmptyFile; diff --git a/ide/compileroptions.pp b/ide/compileroptions.pp index 5ccde8e80a..88affd4df4 100644 --- a/ide/compileroptions.pp +++ b/ide/compileroptions.pp @@ -2125,7 +2125,8 @@ begin // inherited Linker options if (not (ccloNoLinkerOpts in Flags)) then begin - InhLinkerOpts:=GetInheritedOption(icoLinkerOptions,true,coptParsed); + InhLinkerOpts:=GetInheritedOption(icoLinkerOptions, + not (cclAbsolutePaths in Flags),coptParsed); if InhLinkerOpts<>'' then switches := switches + ' ' + ConvertOptionsToCmdLine(' ','-k', InhLinkerOpts); end; diff --git a/ide/main.pp b/ide/main.pp index 8b3774d055..9046008766 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -9285,9 +9285,10 @@ begin CompilerFilename:=Project1.GetCompilerFilename; //DebugLn(['TMainIDE.DoBuildProject CompilerFilename="',CompilerFilename,'" CompilerPath="',Project1.CompilerOptions.CompilerPath,'"']); + // Note: use absolute paths, because some external tools resolve symlinked directories CompilerParams := - Project1.CompilerOptions.MakeOptionsString(SrcFilename,nil,[]) + ' ' + - PrepareCmdLineOption(SrcFilename); + Project1.CompilerOptions.MakeOptionsString(SrcFilename,nil,[cclAbsolutePaths]) + + ' ' + PrepareCmdLineOption(SrcFilename); //DebugLn('TMainIDE.DoBuildProject WorkingDir="',WorkingDir,'" SrcFilename="',SrcFilename,'" CompilerFilename="',CompilerFilename,'" CompilerParams="',CompilerParams,'"'); // warn for ambiguous files diff --git a/packager/packagesystem.pas b/packager/packagesystem.pas index 10da2d86f1..7fec919651 100644 --- a/packager/packagesystem.pas +++ b/packager/packagesystem.pas @@ -2851,9 +2851,10 @@ begin SrcFilename:=APackage.GetSrcFilename; CompilerFilename:=APackage.GetCompilerFilename; + // Note: use absolute paths, because some external tools resolve symlinked directories CompilerParams:=APackage.CompilerOptions.MakeOptionsString(Globals, - APackage.CompilerOptions.DefaultMakeOptionsFlags) - +' '+CreateRelativePath(SrcFilename,APackage.Directory); + APackage.CompilerOptions.DefaultMakeOptionsFlags+[cclAbsolutePaths]) + +' '+CreateRelativePath(SrcFilename,APackage.Directory); //DebugLn(['TLazPackageGraph.CompilePackage SrcFilename="',SrcFilename,'" CompilerFilename="',CompilerFilename,'" CompilerParams="',CompilerParams,'" TargetCPU=',Globals.TargetCPU,' TargetOS=',Globals.TargetOS]); // check if compilation is needed and if a clean build is needed