mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-27 15:13:41 +02:00
* fixes to the compiler util exe search routines, which caused the compiler to
erroneusly find '/usr/bin/ld' instead of '/usr/bin/ld.bfd' on OpenBSD, which silently produced broken executables, which made this bug even more "fun" to find. :) git-svn-id: trunk@42128 -
This commit is contained in:
parent
0c471494e8
commit
40e6c06f67
@ -1284,8 +1284,16 @@ end;
|
||||
|
||||
|
||||
function FindExe(const bin:TCmdStr;allowcache:boolean;var foundfile:TCmdStr):boolean;
|
||||
var
|
||||
b : TCmdStr;
|
||||
begin
|
||||
FindExe:=FindFileInExeLocations(ChangeFileExt(bin,source_info.exeext),allowcache,foundfile);
|
||||
{ change extension only on platforms that use an exe extension, otherwise on OpenBSD
|
||||
'ld.bfd' gets converted to 'ld' }
|
||||
if source_info.exeext<>'' then
|
||||
b:=ChangeFileExt(bin,source_info.exeext)
|
||||
else
|
||||
b:=bin;
|
||||
FindExe:=FindFileInExeLocations(b,allowcache,foundfile);
|
||||
end;
|
||||
|
||||
|
||||
|
@ -681,10 +681,20 @@ Implementation
|
||||
if cs_link_on_target in current_settings.globalswitches then
|
||||
begin
|
||||
{ If linking on target, don't add any path PM }
|
||||
FindUtil:=ChangeFileExt(s,target_info.exeext);
|
||||
{ change extension only on platforms that use an exe extension, otherwise on OpenBSD 'ld.bfd' gets
|
||||
converted to 'ld' }
|
||||
if target_info.exeext<>'' then
|
||||
FindUtil:=ChangeFileExt(s,target_info.exeext)
|
||||
else
|
||||
FindUtil:=s;
|
||||
exit;
|
||||
end;
|
||||
UtilExe:=ChangeFileExt(s,source_info.exeext);
|
||||
{ change extension only on platforms that use an exe extension, otherwise on OpenBSD 'ld.bfd' gets converted
|
||||
to 'ld' }
|
||||
if source_info.exeext<>'' then
|
||||
UtilExe:=ChangeFileExt(s,source_info.exeext)
|
||||
else
|
||||
UtilExe:=s;
|
||||
FoundBin:='';
|
||||
Found:=false;
|
||||
if utilsdirectory<>'' then
|
||||
|
Loading…
Reference in New Issue
Block a user