mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-20 13:49:40 +02:00
+ some darwin i386 support
git-svn-id: trunk@2589 -
This commit is contained in:
parent
58433b83ed
commit
8808faf5c0
@ -260,7 +260,7 @@ Constructor TLinkerBSD.Create;
|
|||||||
begin
|
begin
|
||||||
Inherited Create;
|
Inherited Create;
|
||||||
if not Dontlinkstdlibpath Then
|
if not Dontlinkstdlibpath Then
|
||||||
if (target_info.system <> system_powerpc_darwin) then
|
if not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
|
||||||
LibrarySearchPath.AddPath('/lib;/usr/lib;/usr/X11R6/lib',true)
|
LibrarySearchPath.AddPath('/lib;/usr/lib;/usr/X11R6/lib',true)
|
||||||
else
|
else
|
||||||
{ Mac OS X doesn't have a /lib }
|
{ Mac OS X doesn't have a /lib }
|
||||||
@ -274,12 +274,12 @@ procedure TLinkerBSD.SetDefaultInfo;
|
|||||||
}
|
}
|
||||||
begin
|
begin
|
||||||
LibrarySuffix:=' ';
|
LibrarySuffix:=' ';
|
||||||
LdSupportsNoResponseFile := (target_info.system in [system_m68k_netbsd,system_powerpc_darwin]);
|
LdSupportsNoResponseFile := (target_info.system in [system_m68k_netbsd,system_powerpc_darwin,system_i386_darwin]);
|
||||||
with Info do
|
with Info do
|
||||||
begin
|
begin
|
||||||
if LdSupportsNoResponseFile then
|
if LdSupportsNoResponseFile then
|
||||||
begin
|
begin
|
||||||
if (target_info.system <> system_powerpc_darwin) then
|
if not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
|
||||||
begin
|
begin
|
||||||
ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -L. -o $EXE `cat $RES`';
|
ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -L. -o $EXE `cat $RES`';
|
||||||
DllCmd[1]:='ld $OPT -shared -L. -o $EXE `cat $RES`'
|
DllCmd[1]:='ld $OPT -shared -L. -o $EXE `cat $RES`'
|
||||||
@ -295,7 +295,7 @@ begin
|
|||||||
ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -L. -o $EXE $RES';
|
ExeCmd[1]:='ld $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -L. -o $EXE $RES';
|
||||||
DllCmd[1]:='ld $OPT $INIT $FINI $SONAME -shared -L. -o $EXE $RES';
|
DllCmd[1]:='ld $OPT $INIT $FINI $SONAME -shared -L. -o $EXE $RES';
|
||||||
end;
|
end;
|
||||||
if (target_info.system <> system_powerpc_darwin) then
|
if not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
|
||||||
DllCmd[2]:='strip --strip-unneeded $EXE'
|
DllCmd[2]:='strip --strip-unneeded $EXE'
|
||||||
else
|
else
|
||||||
DllCmd[2]:='strip -x $EXE';
|
DllCmd[2]:='strip -x $EXE';
|
||||||
@ -338,7 +338,7 @@ Var
|
|||||||
begin
|
begin
|
||||||
WriteResponseFile:=False;
|
WriteResponseFile:=False;
|
||||||
{ set special options for some targets }
|
{ set special options for some targets }
|
||||||
if target_info.system <> system_powerpc_darwin then
|
if not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
|
||||||
begin
|
begin
|
||||||
linkdynamic:=not(SharedLibFiles.empty);
|
linkdynamic:=not(SharedLibFiles.empty);
|
||||||
linklibc:=(SharedLibFiles.Find('c')<>nil);
|
linklibc:=(SharedLibFiles.Find('c')<>nil);
|
||||||
@ -417,7 +417,7 @@ begin
|
|||||||
LinkRes.AddFileName(FindObjectFile(prtobj,'',false));
|
LinkRes.AddFileName(FindObjectFile(prtobj,'',false));
|
||||||
{ try to add crti and crtbegin if linking to C }
|
{ try to add crti and crtbegin if linking to C }
|
||||||
if linklibc and
|
if linklibc and
|
||||||
(target_info.system <> system_powerpc_darwin) then
|
not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
|
||||||
begin
|
begin
|
||||||
if librarysearchpath.FindFile('crtbegin.o',s) then
|
if librarysearchpath.FindFile('crtbegin.o',s) then
|
||||||
LinkRes.AddFileName(s);
|
LinkRes.AddFileName(s);
|
||||||
@ -490,7 +490,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
{ objects which must be at the end }
|
{ objects which must be at the end }
|
||||||
if linklibc and
|
if linklibc and
|
||||||
(target_info.system <> system_powerpc_darwin) then
|
not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
|
||||||
begin
|
begin
|
||||||
Fl1:=librarysearchpath.FindFile('crtend.o',s1);
|
Fl1:=librarysearchpath.FindFile('crtend.o',s1);
|
||||||
Fl2:=librarysearchpath.FindFile('crtn.o',s2);
|
Fl2:=librarysearchpath.FindFile('crtn.o',s2);
|
||||||
@ -507,7 +507,7 @@ begin
|
|||||||
{ ignore the fact that our relocations are in non-writable sections, }
|
{ ignore the fact that our relocations are in non-writable sections, }
|
||||||
{ will be fixed once we have pic support }
|
{ will be fixed once we have pic support }
|
||||||
if isdll and
|
if isdll and
|
||||||
(target_info.system = system_powerpc_darwin) then
|
(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
|
||||||
LinkRes.Add('-read_only_relocs suppress');
|
LinkRes.Add('-read_only_relocs suppress');
|
||||||
{ Write and Close response }
|
{ Write and Close response }
|
||||||
linkres.writetodisk;
|
linkres.writetodisk;
|
||||||
@ -545,7 +545,7 @@ begin
|
|||||||
StaticStr:='-static';
|
StaticStr:='-static';
|
||||||
end;
|
end;
|
||||||
if (cs_link_strip in aktglobalswitches) then
|
if (cs_link_strip in aktglobalswitches) then
|
||||||
if (target_info.system <> system_powerpc_darwin) then
|
if not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
|
||||||
StripStr:='-s'
|
StripStr:='-s'
|
||||||
else
|
else
|
||||||
StripStr:='-x';
|
StripStr:='-x';
|
||||||
@ -560,7 +560,7 @@ begin
|
|||||||
|
|
||||||
if CShared Then
|
if CShared Then
|
||||||
begin
|
begin
|
||||||
if (target_info.system <> system_powerpc_darwin) then
|
if not(target_info.system in [system_powerpc_darwin,system_i386_darwin]) then
|
||||||
DynLinKStr:=DynLinkStr+' --shared'
|
DynLinKStr:=DynLinkStr+' --shared'
|
||||||
else
|
else
|
||||||
DynLinKStr:=DynLinkStr+' -dynamic'; // one dash!
|
DynLinKStr:=DynLinkStr+' -dynamic'; // one dash!
|
||||||
|
Loading…
Reference in New Issue
Block a user