mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 17:29:21 +02:00
haiku: linker support code for internal sysinit and make the x86_64 port use it
git-svn-id: trunk@40756 -
This commit is contained in:
parent
a6cd62b358
commit
0d8ef46195
@ -350,7 +350,8 @@ interface
|
||||
|
||||
systems_internal_sysinit = [system_i386_win32,system_x86_64_win64,
|
||||
system_i386_linux,system_powerpc64_linux,system_sparc64_linux,system_x86_64_linux,
|
||||
system_m68k_atari,system_m68k_palmos
|
||||
system_m68k_atari,system_m68k_palmos,
|
||||
system_x86_64_haiku
|
||||
]+systems_darwin+systems_amigalike;
|
||||
|
||||
{ all systems that use garbage collection for reference-counted types }
|
||||
|
@ -49,6 +49,7 @@ interface
|
||||
public
|
||||
constructor Create;override;
|
||||
procedure SetDefaultInfo;override;
|
||||
procedure InitSysInitUnitName;override;
|
||||
function MakeExecutable:boolean;override;
|
||||
function MakeSharedLibrary:boolean;override;
|
||||
end;
|
||||
@ -224,6 +225,14 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
procedure TLinkerHaiku.InitSysInitUnitName;
|
||||
const
|
||||
SysInitUnitNames: array[boolean] of string[15] = ( 'si_c', 'si_dllc' );
|
||||
begin
|
||||
sysinitunit:=SysInitUnitNames[current_module.islibrary];
|
||||
end;
|
||||
|
||||
|
||||
function TLinkerHaiku.WriteResponseFile(isdll:boolean;makelib:boolean) : Boolean;
|
||||
Var
|
||||
linkres : TLinkRes;
|
||||
@ -238,8 +247,6 @@ begin
|
||||
{ set special options for some targets }
|
||||
linklibc:=(SharedLibFiles.Find('root')<>nil);
|
||||
|
||||
prtobj:='prt0';
|
||||
cprtobj:='cprt0';
|
||||
if (cs_profile in current_settings.moduleswitches) or
|
||||
(not SharedLibFiles.Empty) then
|
||||
begin
|
||||
@ -247,6 +254,13 @@ begin
|
||||
linklibc:=true;
|
||||
end;
|
||||
|
||||
prtobj:='';
|
||||
cprtobj:='';
|
||||
if not (target_info.system in systems_internal_sysinit) then
|
||||
begin
|
||||
prtobj:='prt0';
|
||||
cprtobj:='cprt0';
|
||||
|
||||
if (not linklibc) and makelib then
|
||||
begin
|
||||
linklibc:=true;
|
||||
@ -257,7 +271,7 @@ begin
|
||||
// Making a dll with libc linking. Should be always the case under Haiku.
|
||||
cprtobj:='dllcprt0';
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
if linklibc then
|
||||
prtobj:=cprtobj;
|
||||
|
Loading…
Reference in New Issue
Block a user