mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 13:19:12 +02:00
* Implement use of solaris linker for libraries
git-svn-id: trunk@14272 -
This commit is contained in:
parent
e2387a5ac5
commit
f5938d771f
@ -216,7 +216,7 @@ const
|
|||||||
{$else}
|
{$else}
|
||||||
const
|
const
|
||||||
gld = 'gld ';
|
gld = 'gld ';
|
||||||
solaris_ld = 'ld ';
|
solaris_ld = '/usr/bin/ld ';
|
||||||
{$endif}
|
{$endif}
|
||||||
begin
|
begin
|
||||||
Glibc2:=false;
|
Glibc2:=false;
|
||||||
@ -228,6 +228,7 @@ begin
|
|||||||
ExeCmd[2]:=solaris_ld + '$OPT $DYNLINK $STATIC $STRIP -L . -o $EXE $RESDATA';
|
ExeCmd[2]:=solaris_ld + '$OPT $DYNLINK $STATIC $STRIP -L . -o $EXE $RESDATA';
|
||||||
DllCmd[1]:=gld + '$OPT -shared -L. -o $EXE $RES';
|
DllCmd[1]:=gld + '$OPT -shared -L. -o $EXE $RES';
|
||||||
DllCmd[2]:='gstrip --strip-unneeded $EXE';
|
DllCmd[2]:='gstrip --strip-unneeded $EXE';
|
||||||
|
DllCmd[3]:=solaris_ld + '$OPT -shared -L. -o $EXE $RES';
|
||||||
DynamicLinker:=''; { Gnu uses the default }
|
DynamicLinker:=''; { Gnu uses the default }
|
||||||
Glibc21:=false;
|
Glibc21:=false;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
@ -573,11 +574,30 @@ begin
|
|||||||
WriteResponseFile(true);
|
WriteResponseFile(true);
|
||||||
|
|
||||||
{ Call linker }
|
{ Call linker }
|
||||||
SplitBinCmd(Info.DllCmd[1],binstr,cmdstr);
|
if use_gnu_ld then
|
||||||
|
SplitBinCmd(Info.DllCmd[1],binstr,cmdstr)
|
||||||
|
else
|
||||||
|
SplitBinCmd(Info.DllCmd[3],binstr,cmdstr);
|
||||||
Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
|
Replace(cmdstr,'$EXE',maybequoted(current_module.sharedlibfilename^));
|
||||||
Replace(cmdstr,'$OPT',Info.ExtraOptions);
|
Replace(cmdstr,'$OPT',Info.ExtraOptions);
|
||||||
Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName));
|
if use_gnu_ld then
|
||||||
success:=DoExec(FindUtil(utilsprefix+binstr),cmdstr,true,false);
|
Replace(cmdstr,'$RES',maybequoted(outputexedir+Info.ResName))
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
linkstr:='';
|
||||||
|
while not linkres.data.Empty do
|
||||||
|
begin
|
||||||
|
s:=linkres.data.GetFirst;
|
||||||
|
linkstr:=linkstr+s+' ';
|
||||||
|
end;
|
||||||
|
linkres.free;
|
||||||
|
Replace(cmdstr,'$RESDATA',linkstr);
|
||||||
|
end;
|
||||||
|
if use_gnu_ld then
|
||||||
|
success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false)
|
||||||
|
else { Using utilsprefix has no sense on /usr/bin/ld }
|
||||||
|
success:=DoExec(FindUtil(BinStr),CmdStr,true,false);
|
||||||
|
|
||||||
|
|
||||||
{ Strip the library ? }
|
{ Strip the library ? }
|
||||||
if success and (cs_link_strip in current_settings.globalswitches) then
|
if success and (cs_link_strip in current_settings.globalswitches) then
|
||||||
|
Loading…
Reference in New Issue
Block a user