mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 05:49:23 +02:00
* librarysuffix + profiling
This commit is contained in:
parent
4b58f5bdce
commit
0d72eee09e
@ -58,6 +58,7 @@ implementation
|
|||||||
Glibc2,
|
Glibc2,
|
||||||
Glibc21,
|
Glibc21,
|
||||||
LdSupportsNoResponseFile : boolean;
|
LdSupportsNoResponseFile : boolean;
|
||||||
|
LibrarySuffix : Char;
|
||||||
Function WriteResponseFile(isdll:boolean) : Boolean;
|
Function WriteResponseFile(isdll:boolean) : Boolean;
|
||||||
public
|
public
|
||||||
constructor Create;override;
|
constructor Create;override;
|
||||||
@ -205,8 +206,7 @@ procedure TLinkerBSD.SetDefaultInfo;
|
|||||||
This will also detect which libc version will be used
|
This will also detect which libc version will be used
|
||||||
}
|
}
|
||||||
begin
|
begin
|
||||||
Glibc2:=false;
|
LibrarySuffix:=' ';
|
||||||
Glibc21:=false;
|
|
||||||
{$ifdef NETBSD}
|
{$ifdef NETBSD}
|
||||||
{$ifdef M68K}
|
{$ifdef M68K}
|
||||||
LdSupportsNoResponseFile:=true;
|
LdSupportsNoResponseFile:=true;
|
||||||
@ -279,9 +279,12 @@ begin
|
|||||||
if cs_profile in aktmoduleswitches then
|
if cs_profile in aktmoduleswitches then
|
||||||
begin
|
begin
|
||||||
prtobj:=gprtobj;
|
prtobj:=gprtobj;
|
||||||
|
{
|
||||||
if not glibc2 then
|
if not glibc2 then
|
||||||
AddSharedLibrary('gmon');
|
AddSharedLibrary('gmon');
|
||||||
|
}
|
||||||
AddSharedLibrary('c');
|
AddSharedLibrary('c');
|
||||||
|
LibrarySuffix:='p';
|
||||||
linklibc:=true;
|
linklibc:=true;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -374,7 +377,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
{ be sure that libc is the last lib }
|
{ be sure that libc is the last lib }
|
||||||
if linklibc then
|
if linklibc then
|
||||||
LinkRes.Add('-lc');
|
Begin
|
||||||
|
If LibrarySuffix=' ' Then
|
||||||
|
LinkRes.Add('-lc')
|
||||||
|
else
|
||||||
|
LinkRes.Add('-lc_'+LibrarySuffix)
|
||||||
|
end;
|
||||||
{ when we have -static for the linker the we also need libgcc }
|
{ when we have -static for the linker the we also need libgcc }
|
||||||
if (cs_link_staticflag in aktglobalswitches) then
|
if (cs_link_staticflag in aktglobalswitches) then
|
||||||
LinkRes.Add('-lgcc');
|
LinkRes.Add('-lgcc');
|
||||||
@ -437,6 +445,8 @@ begin
|
|||||||
((Info.DynamicLinker<>'') and (not SharedLibFiles.Empty)) then
|
((Info.DynamicLinker<>'') and (not SharedLibFiles.Empty)) then
|
||||||
DynLinkStr:='-dynamic-linker='+Info.DynamicLinker;
|
DynLinkStr:='-dynamic-linker='+Info.DynamicLinker;
|
||||||
|
|
||||||
|
if CShared Then
|
||||||
|
DynLinKStr:=DynLinkStr+' --shared';
|
||||||
{ Write used files and libraries }
|
{ Write used files and libraries }
|
||||||
WriteResponseFile(false);
|
WriteResponseFile(false);
|
||||||
|
|
||||||
@ -530,7 +540,10 @@ initialization
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.4 2003-10-11 19:32:04 marco
|
Revision 1.5 2003-10-30 18:35:30 marco
|
||||||
|
* librarysuffix + profiling
|
||||||
|
|
||||||
|
Revision 1.4 2003/10/11 19:32:04 marco
|
||||||
* -Xd
|
* -Xd
|
||||||
|
|
||||||
Revision 1.3 2003/10/03 14:16:48 marco
|
Revision 1.3 2003/10/03 14:16:48 marco
|
||||||
|
@ -435,7 +435,13 @@ begin
|
|||||||
StripStr:='-s';
|
StripStr:='-s';
|
||||||
If (cs_profile in aktmoduleswitches) or
|
If (cs_profile in aktmoduleswitches) or
|
||||||
((Info.DynamicLinker<>'') and (not SharedLibFiles.Empty)) then
|
((Info.DynamicLinker<>'') and (not SharedLibFiles.Empty)) then
|
||||||
DynLinkStr:='-dynamic-linker='+Info.DynamicLinker;
|
begin
|
||||||
|
DynLinkStr:='-dynamic-linker='+Info.DynamicLinker;
|
||||||
|
if cshared Then
|
||||||
|
DynLinkStr:='--shared ' + DynLinkStr;
|
||||||
|
if rlinkpath<>'' Then
|
||||||
|
DynLinkStr:='--rpath-link '+rlinkpath + ' '+ DynLinkStr;
|
||||||
|
End;
|
||||||
|
|
||||||
{ Write used files and libraries }
|
{ Write used files and libraries }
|
||||||
WriteResponseFile(false);
|
WriteResponseFile(false);
|
||||||
@ -556,7 +562,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.11 2003-10-11 19:32:04 marco
|
Revision 1.12 2003-10-30 18:35:30 marco
|
||||||
|
* librarysuffix + profiling
|
||||||
|
|
||||||
|
Revision 1.11 2003/10/11 19:32:04 marco
|
||||||
* -Xd
|
* -Xd
|
||||||
|
|
||||||
Revision 1.10 2003/10/03 14:16:48 marco
|
Revision 1.10 2003/10/03 14:16:48 marco
|
||||||
|
Loading…
Reference in New Issue
Block a user