* sunos to solaris

This commit is contained in:
peter 2005-02-13 20:11:16 +00:00
parent ae8b7b153b
commit 97e28bd218
4 changed files with 82 additions and 70 deletions

View File

@ -196,9 +196,9 @@ uses
{$ifdef palmos}
,i_palmos
{$endif palmos}
{$ifdef sunos}
{$ifdef solaris}
,i_sunos
{$endif sunos}
{$endif solaris}
{$ifdef wdosx}
,i_wdosx
{$endif wdosx}
@ -435,7 +435,10 @@ end;
end.
{
$Log$
Revision 1.54 2005-02-13 18:55:19 florian
Revision 1.55 2005-02-13 20:11:16 peter
* sunos to solaris
Revision 1.54 2005/02/13 18:55:19 florian
+ overflow checking for the arm
Revision 1.53 2005/01/31 21:30:56 olle

View File

@ -92,14 +92,14 @@ interface
system_alpha_linux, { 12 }
system_powerpc_linux, { 13 }
system_powerpc_macos, { 14 }
system_i386_sunos, { 15 }
system_i386_solaris, { 15 }
system_i386_beos, { 16 }
system_i386_netbsd, { 17 }
system_m68k_netbsd, { 18 }
system_i386_Netware, { 19 }
system_i386_qnx, { 20 }
system_i386_wdosx, { 21 }
system_sparc_sunos, { 22 }
system_sparc_solaris, { 22 }
system_sparc_linux, { 23 }
system_i386_openbsd, { 24 }
system_m68k_openbsd, { 25 }
@ -718,7 +718,10 @@ finalization
end.
{
$Log$
Revision 1.101 2005-02-06 00:05:56 florian
Revision 1.102 2005-02-13 20:11:16 peter
* sunos to solaris
Revision 1.101 2005/02/06 00:05:56 florian
+ x86_64 pic draft
Revision 1.100 2005/01/25 18:48:15 peter

View File

@ -2,7 +2,7 @@
$Id$
Copyright (c) 1998-2002 by Peter Vreman
This unit implements support information structures for SunOS
This unit implements support information structures for solaris
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -19,7 +19,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
****************************************************************************
}
{ This unit implements support information structures for SunOS. }
{ This unit implements support information structures for solaris. }
unit i_sunos;
interface
@ -28,15 +28,15 @@ unit i_sunos;
systems;
const
system_i386_sunos_info : tsysteminfo =
system_i386_solaris_info : tsysteminfo =
(
system : system_i386_sunos;
name : 'SunOS/ELF for i386';
shortname : 'SunOS';
system : system_i386_solaris;
name : 'Solaris for i386';
shortname : 'solaris';
flags : [tf_under_development];
cpu : cpu_i386;
unit_env : 'SUNOSUNITS';
extradefines : 'UNIX;SOLARIS;LIBC';
unit_env : 'SOLARISUNITS';
extradefines : 'UNIX;LIBC';
sourceext : '.pp';
pasext : '.pas';
exeext : '';
@ -90,15 +90,15 @@ unit i_sunos;
use_function_relative_addresses : true
);
system_sparc_sunos_info : tsysteminfo =
system_sparc_solaris_info : tsysteminfo =
(
system : system_sparc_sunos;
name : 'SunOS for SPARC';
shortname : 'SunOS';
system : system_sparc_solaris;
name : 'Solaris for SPARC';
shortname : 'solaris';
flags : [tf_needs_symbol_size];
cpu : cpu_SPARC;
unit_env : 'SUNOSUNITS';
extradefines : 'UNIX;HASUNIX';
unit_env : 'SOLARISUNITS';
extradefines : 'UNIX;LIBC;';
sourceext : '.pp';
pasext : '.pas';
exeext : '';
@ -156,25 +156,28 @@ unit i_sunos;
initialization
{$ifdef CPU86}
{$ifdef sunos}
set_source_info(system_i386_sunos_info);
{$endif sunos}
{$ifdef solaris}
set_source_info(system_i386_solaris_info);
{$endif solaris}
{$endif CPU86}
{$ifdef CPUSparc}
{$ifdef sunos}
set_source_info(system_sparc_sunos_info);
{$endif sunos}
{$ifdef solaris}
set_source_info(system_sparc_solaris_info);
{$endif solaris}
{$endif CPUSparc}
end.
{
$Log$
Revision 1.5 2004-10-25 15:38:41 peter
Revision 1.6 2005-02-13 20:11:16 peter
* sunos to solaris
Revision 1.5 2004/10/25 15:38:41 peter
* heap and heapsize removed
* checkpointer fixes
Revision 1.4 2004/10/01 17:41:21 marco
* small updates to make playing with sparc/sunos easier
* small updates to make playing with sparc/solaris easier
Revision 1.3 2004/06/20 08:55:32 florian
* logs truncated

View File

@ -3,7 +3,7 @@
Copyright (c) 1998-2002 by Peter Vreman
This unit implements support import,export,link routines
for the (i386) sunos target
for the (i386) solaris target
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -39,24 +39,25 @@ implementation
verbose,systems,globtype,globals,
symconst,script,
fmodule,aasmbase,aasmtai,aasmcpu,cpubase,symsym,symdef,
cgobj,
import,export,link,i_sunos;
type
timportlibsunos=class(timportlib)
timportlibsolaris=class(timportlib)
procedure preparelib(const s:string);override;
procedure importprocedure(aprocdef:tprocdef;const module:string;index:longint;const name:string);override;
procedure importvariable(vs:tglobalvarsym;const name,module:string);override;
procedure generatelib;override;
end;
texportlibsunos=class(texportlib)
texportlibsolaris=class(texportlib)
procedure preparelib(const s : string);override;
procedure exportprocedure(hp : texported_item);override;
procedure exportvar(hp : texported_item);override;
procedure generatelib;override;
end;
tlinkersunos=class(texternallinker)
tlinkersolaris=class(texternallinker)
private
Glibc2,
Glibc21 : boolean;
@ -70,10 +71,10 @@ implementation
{*****************************************************************************
TIMPORTLIBsunos
TIMPORTLIBsolaris
*****************************************************************************}
procedure timportlibsunos.preparelib(const s : string);
procedure timportlibsolaris.preparelib(const s : string);
begin
{$ifDef LinkTest}
WriteLN('Prepare import: ',s);
@ -81,7 +82,7 @@ begin
end;
procedure timportlibsunos.importprocedure(aprocdef:tprocdef;const module:string;index:longint;const name:string);
procedure timportlibsolaris.importprocedure(aprocdef:tprocdef;const module:string;index:longint;const name:string);
begin
{ insert sharedlibrary }
{$ifDef LinkTest}
@ -91,7 +92,7 @@ begin
end;
procedure timportlibsunos.importvariable(vs:tglobalvarsym;const name,module:string);
procedure timportlibsolaris.importvariable(vs:tglobalvarsym;const name,module:string);
begin
{ insert sharedlibrary }
current_module.linkothersharedlibs.add(SplitName(module),link_allways);
@ -101,28 +102,28 @@ begin
end;
procedure timportlibsunos.generatelib;
procedure timportlibsolaris.generatelib;
begin
end;
{*****************************************************************************
TEXPORTLIBsunos
TEXPORTLIBsolaris
*****************************************************************************}
procedure texportlibsunos.preparelib(const s:string);
procedure texportlibsolaris.preparelib(const s:string);
begin
end;
procedure texportlibsunos.exportprocedure(hp : texported_item);
procedure texportlibsolaris.exportprocedure(hp : texported_item);
var
hp2 : texported_item;
begin
{ first test the index value }
if (hp.options and eo_index)<>0 then
begin
Message1(parser_e_no_export_with_index_for_target,'SunOS');
Message1(parser_e_no_export_with_index_for_target,'solaris');
exit;
end;
{ use pascal name is none specified }
@ -158,17 +159,18 @@ begin
end;
procedure texportlibsunos.exportvar(hp : texported_item);
procedure texportlibsolaris.exportvar(hp : texported_item);
begin
hp.is_var:=true;
exportprocedure(hp);
end;
procedure texportlibsunos.generatelib;
procedure texportlibsolaris.generatelib;
var
hp2 : texported_item;
begin
new_section(codesegment,sec_code,'',0);
hp2:=texported_item(current_module._exports.first);
while assigned(hp2) do
begin
@ -179,27 +181,25 @@ begin
is declared with cdecl }
if tprocsym(hp2.sym).first_procdef.mangledname<>hp2.name^ then
begin
{$ifdef i386}
{ place jump in codesegment }
codesegment.concat(Tai_align.Create_op(4,$90));
codesegment.concat(tai_align.create(target_info.alignment.procalign));
codeSegment.concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0));
codeSegment.concat(Taicpu.Op_sym(A_JMP,S_NO,objectlibrary.newasmsymbol(tprocsym(hp2.sym).first_procdef.mangledname,AB_EXTERNAL,AT_FUNCTION)));
cg.a_jmp_name(codesegment,tprocsym(hp2.sym).first_procdef.mangledname);
codeSegment.concat(Tai_symbol_end.Createname(hp2.name^));
{$endif i386}
end;
end
else
Message1(parser_e_no_export_of_variables_for_target,'SunOS');
Message1(parser_e_no_export_of_variables_for_target,'linux');
hp2:=texported_item(hp2.next);
end;
end;
{*****************************************************************************
TLINKERSUNOS
TLINKERsolaris
*****************************************************************************}
Constructor TLinkersunos.Create;
Constructor TLinkersolaris.Create;
begin
Inherited Create;
if NOT Dontlinkstdlibpath Then
@ -212,7 +212,7 @@ begin
end;
procedure TLinkersunos.SetDefaultInfo;
procedure TLinkersolaris.SetDefaultInfo;
{
This will also detect which libc version will be used
}
@ -249,7 +249,7 @@ begin
end;
Function TLinkersunos.WriteResponseFile(isdll:boolean) : Boolean;
Function TLinkersolaris.WriteResponseFile(isdll:boolean) : Boolean;
Var
linkres : TLinkRes;
i : longint;
@ -282,7 +282,7 @@ begin
if linklibc then
prtobj:=cprtobj
else
AddSharedLibrary('c'); { quick hack: this sunos implementation needs alwys libc }
AddSharedLibrary('c'); { quick hack: this solaris implementation needs alwys libc }
end;
{ Open link.res file }
@ -307,7 +307,7 @@ begin
if prtobj<>'' then
LinkRes.AddFileName(FindObjectFile(prtobj,'',false));
{ try to add crti and crtbegin if linking to C }
if linklibc then { Needed in sunos? }
if linklibc then { Needed in solaris? }
begin
{ if librarysearchpath.FindFile('crtbegin.o',s) then
LinkRes.AddFileName(s);}
@ -353,7 +353,7 @@ begin
else
begin
linklibc:=true;
linkdynamic:=false; { libc will include the ld-sunos (war ld-linux) for us }
linkdynamic:=false; { libc will include the ld-solaris (war ld-linux) for us }
end;
end;
{ be sure that libc is the last lib }
@ -363,12 +363,12 @@ begin
if (cs_link_staticflag in aktglobalswitches) then begin
LinkRes.Add('-lgcc');
end;
if linkdynamic and (Info.DynamicLinker<>'') then { gld has a default, DynamicLinker is not set in sunos }
if linkdynamic and (Info.DynamicLinker<>'') then { gld has a default, DynamicLinker is not set in solaris }
LinkRes.AddFileName(Info.DynamicLinker);
LinkRes.Add(')');
end;
{ objects which must be at the end }
if linklibc then {needed in sunos ? }
if linklibc then {needed in solaris ? }
begin
if {librarysearchpath.FindFile('crtend.o',s1) or}
librarysearchpath.FindFile('crtn.o',s2) then
@ -387,7 +387,7 @@ begin
end;
function TLinkersunos.MakeExecutable:boolean;
function TLinkersolaris.MakeExecutable:boolean;
var
binstr : String;
cmdstr : TCmdStr;
@ -410,7 +410,7 @@ begin
If (cs_profile in aktmoduleswitches) or
((Info.DynamicLinker<>'') and (not SharedLibFiles.Empty)) then
DynLinkStr:='-dynamic-linker='+Info.DynamicLinker;
{ sunos sets DynamicLinker, but gld will (hopefully) defaults to -Bdynamic and add the default-linker }
{ solaris sets DynamicLinker, but gld will (hopefully) defaults to -Bdynamic and add the default-linker }
{ Write used files and libraries }
WriteResponseFile(false);
@ -433,7 +433,7 @@ begin
end;
Function TLinkersunos.MakeSharedLibrary:boolean;
Function TLinkersolaris.MakeSharedLibrary:boolean;
var
binstr : String;
cmdstr : TCmdStr;
@ -476,22 +476,25 @@ end;
initialization
{$ifdef i386}
RegisterExternalLinker(system_i386_sunos_info,TLinkerSunos);
RegisterImport(system_i386_sunos,TImportLibSunos);
RegisterExport(system_i386_sunos,TExportLibSunos);
RegisterTarget(system_i386_sunos_info);
RegisterExternalLinker(system_i386_solaris_info,TLinkersolaris);
RegisterImport(system_i386_solaris,TImportLibsolaris);
RegisterExport(system_i386_solaris,TExportLibsolaris);
RegisterTarget(system_i386_solaris_info);
{$endif i386}
{$ifdef sparc}
RegisterExternalLinker(system_sparc_sunos_info,TLinkerSunos);
RegisterImport(system_sparc_sunos,TImportLibSunos);
RegisterExport(system_sparc_sunos,TExportLibSunos);
RegisterTarget(system_sparc_sunos_info);
RegisterExternalLinker(system_sparc_solaris_info,TLinkersolaris);
RegisterImport(system_sparc_solaris,TImportLibsolaris);
RegisterExport(system_sparc_solaris,TExportLibsolaris);
RegisterTarget(system_sparc_solaris_info);
{$endif sparc}
end.
{
$Log$
Revision 1.16 2004-12-22 16:32:46 peter
Revision 1.17 2005-02-13 20:11:16 peter
* sunos to solaris
Revision 1.16 2004/12/22 16:32:46 peter
* maybequoted() added
Revision 1.15 2004/11/19 16:30:24 peter
@ -508,7 +511,7 @@ end.
* Need to be optimized in performance
Revision 1.11 2004/10/01 17:41:21 marco
* small updates to make playing with sparc/sunos easier
* small updates to make playing with sparc/solaris easier
Revision 1.10 2004/09/22 15:25:14 mazen
* Fix error committing : previous version must be in branch USE_SYSUTILS