* from Yury Sidorov:

+ Added new target WinCE for i386 (to be able compile and run programs in WinCE emulator)

git-svn-id: trunk@596 -
This commit is contained in:
florian 2005-07-09 09:31:57 +00:00
parent 25b79e9db3
commit 83c6b3aca2
9 changed files with 108 additions and 19 deletions

View File

@ -1780,9 +1780,22 @@ const go32v2stub : array[0..2047] of byte=(
comment : ''; comment : '';
); );
as_i386_pecoffwince_info : tasminfo =
(
id : as_i386_pecoffwince;
idtxt : 'PECOFFWINCE';
asmbin : '';
asmcmd : '';
supported_target : system_i386_wince;
flags : [af_outputbinary];
labelprefix : '.L';
comment : '';
);
initialization initialization
RegisterAssembler(as_i386_coff_info,TCoffAssembler); RegisterAssembler(as_i386_coff_info,TCoffAssembler);
RegisterAssembler(as_i386_pecoff_info,TPECoffAssembler); RegisterAssembler(as_i386_pecoff_info,TPECoffAssembler);
RegisterAssembler(as_i386_pecoffwdosx_info,TPECoffAssembler); RegisterAssembler(as_i386_pecoffwdosx_info,TPECoffAssembler);
RegisterAssembler(as_i386_pecoffwince_info,TPECoffAssembler);
end. end.

View File

@ -1920,7 +1920,7 @@ const
if not( if not(
assigned(pd.import_dll) and assigned(pd.import_dll) and
(target_info.system in [system_i386_win32,system_i386_wdosx, (target_info.system in [system_i386_win32,system_i386_wdosx,
system_i386_emx,system_i386_os2,system_arm_wince]) system_i386_emx,system_i386_os2,system_arm_wince,system_i386_wince])
) then ) then
begin begin
if not(pd.proccalloption in [pocall_cdecl,pocall_cppdecl]) then if not(pd.proccalloption in [pocall_cdecl,pocall_cppdecl]) then

View File

@ -871,7 +871,7 @@ implementation
{ address } { address }
else if is_constintnode(pt) and else if is_constintnode(pt) and
((target_info.system in [system_i386_go32v2,system_i386_watcom, ((target_info.system in [system_i386_go32v2,system_i386_watcom,
system_i386_wdosx,system_i386_win32,system_arm_wince]) or system_i386_wdosx,system_i386_win32,system_arm_wince,system_i386_wince]) or
(m_objfpc in aktmodeswitches) or (m_objfpc in aktmodeswitches) or
(m_delphi in aktmodeswitches)) then (m_delphi in aktmodeswitches)) then
begin begin

View File

@ -113,7 +113,7 @@ implementation
an underline } an underline }
if InternalProcName[1]='_' then if InternalProcName[1]='_' then
delete(InternalProcName,1,1) delete(InternalProcName,1,1)
else if (target_info.system in [system_i386_win32,system_i386_wdosx,system_arm_wince]) and UseDeffileForExports then else if (target_info.system in [system_i386_win32,system_i386_wdosx,system_arm_wince,system_i386_wince]) and UseDeffileForExports then
begin begin
Message(parser_e_dlltool_unit_var_problem); Message(parser_e_dlltool_unit_var_problem);
Message(parser_e_dlltool_unit_var_problem2); Message(parser_e_dlltool_unit_var_problem2);
@ -134,7 +134,7 @@ implementation
end; end;
hp.options:=hp.options or eo_index; hp.options:=hp.options or eo_index;
pt.free; pt.free;
if target_info.system in [system_i386_win32,system_i386_wdosx,system_arm_wince] then if target_info.system in [system_i386_win32,system_i386_wdosx,system_arm_wince,system_i386_wince] then
DefString:=srsym.realname+'='+InternalProcName+' @ '+tostr(hp.index) DefString:=srsym.realname+'='+InternalProcName+' @ '+tostr(hp.index)
else else
DefString:=srsym.realname+'='+InternalProcName; {Index ignored!} DefString:=srsym.realname+'='+InternalProcName; {Index ignored!}

View File

@ -107,7 +107,7 @@ implementation
begin begin
{ regenerate the importssection for win32 } { regenerate the importssection for win32 }
if assigned(importssection) and if assigned(importssection) and
(target_info.system in [system_i386_win32,system_i386_wdosx, system_arm_wince]) then (target_info.system in [system_i386_win32,system_i386_wdosx, system_arm_wince,system_i386_wince]) then
begin begin
importsSection.clear; importsSection.clear;
importlib.generatesmartlib; importlib.generatesmartlib;

View File

@ -1296,7 +1296,7 @@ implementation
not( not(
assigned(pd.import_dll) and assigned(pd.import_dll) and
(target_info.system in [system_i386_win32,system_i386_wdosx, (target_info.system in [system_i386_win32,system_i386_wdosx,
system_i386_emx,system_i386_os2,system_arm_wince]) system_i386_emx,system_i386_os2,system_arm_wince,system_i386_wince])
) then ) then
begin begin
s:=proc_get_importname(pd); s:=proc_get_importname(pd);

View File

@ -115,7 +115,8 @@ interface
system_powerpc_Amiga, { 36 } system_powerpc_Amiga, { 36 }
system_x86_64_win64, { 37 } system_x86_64_win64, { 37 }
system_arm_wince, { 38 } system_arm_wince, { 38 }
system_ia64_win64 { 39 } system_ia64_win64, { 39 }
system_i386_wince { 40 }
); );
tasm = (as_none tasm = (as_none
@ -139,6 +140,7 @@ interface
,as_darwin ,as_darwin
,as_x86_64_masm ,as_x86_64_masm
,as_x86_64_pecoff ,as_x86_64_pecoff
,as_i386_pecoffwince
); );
tar = (ar_none tar = (ar_none

View File

@ -218,6 +218,68 @@ unit i_win;
use_function_relative_addresses : true use_function_relative_addresses : true
); );
system_i386_wince_info : tsysteminfo =
(
system : system_i386_wince;
name : 'WinCE for i386';
shortname : 'WinCE';
flags : [];
cpu : cpu_i386;
unit_env : '';
extradefines : 'UNDER_CE';
exeext : '.exe';
defext : '.def';
scriptext : '.bat';
smartext : '.sl';
unitext : '.ppu';
unitlibext : '.ppl';
asmext : '.s';
objext : '.o';
resext : '.rc';
resobjext : '.or';
sharedlibext : '.dll';
staticlibext : '.a';
staticlibprefix : 'libp';
sharedlibprefix : '';
sharedClibext : '.dll';
staticClibext : '.a';
staticClibprefix : 'lib';
sharedClibprefix : '';
p_ext_support : false;
Cprefix : '_';
newline : #13#10;
dirsep : '\';
files_case_relevent : true;
assem : as_i386_pecoffwince;
assemextern : as_gas;
link : nil;
linkextern : nil;
ar : ar_gnu_ar;
res : res_gnu_windres;
script : script_dos;
endian : endian_little;
alignment :
(
procalign : 4;
loopalign : 4;
jumpalign : 0;
constalignmin : 0;
constalignmax : 4;
varalignmin : 0;
varalignmax : 4;
localalignmin : 4;
localalignmax : 4;
recordalignmin : 0;
recordalignmax : 4;
maxCrecordalign : 16
);
first_parm_offset : 8;
stacksize : 262144;
DllScanSupported:true;
use_function_relative_addresses : true
);
implementation implementation
initialization initialization
@ -227,6 +289,9 @@ initialization
set_source_info(system_i386_win32_info); set_source_info(system_i386_win32_info);
{$endif WDOSX} {$endif WDOSX}
{$endif WIN32} {$endif WIN32}
{$ifdef WINCE}
set_source_info(system_i386_wince_info);
{$endif WINCE}
{$endif CPU86} {$endif CPU86}
{$ifdef CPUX86_64} {$ifdef CPUX86_64}

View File

@ -1037,8 +1037,11 @@ begin
AsBinStr:=FindUtil(utilsprefix+'as'); AsBinStr:=FindUtil(utilsprefix+'as');
if RelocSection then if RelocSection then
RelocStr:='--base-file base.$$$'; RelocStr:='--base-file base.$$$';
if apptype=app_gui then if target_info.system in [system_arm_wince,system_i386_wince] then
AppTypeStr:='--subsystem windows'; AppTypeStr:='--subsystem wince'
else
if apptype=app_gui then
AppTypeStr:='--subsystem windows';
if assigned(DLLImageBase) then if assigned(DLLImageBase) then
ImageBaseStr:='--image-base=0x'+DLLImageBase^; ImageBaseStr:='--image-base=0x'+DLLImageBase^;
if (cs_link_strip in aktglobalswitches) then if (cs_link_strip in aktglobalswitches) then
@ -1273,10 +1276,6 @@ var
secroot,hsecroot : psecfill; secroot,hsecroot : psecfill;
zerobuf : pointer; zerobuf : pointer;
begin begin
{$ifdef ARM}
postprocessexecutable:=true;
exit;
{$endif ARM}
postprocessexecutable:=false; postprocessexecutable:=false;
{ when -s is used or it's a dll then quit } { when -s is used or it's a dll then quit }
if (cs_link_extern in aktglobalswitches) then if (cs_link_extern in aktglobalswitches) then
@ -1317,12 +1316,16 @@ begin
{ sub system } { sub system }
{ gui=2 } { gui=2 }
{ cui=3 } { cui=3 }
case apptype of { wincegui=9 }
app_gui : if target_info.system in [system_arm_wince,system_i386_wince] then
peheader.Subsystem:=2; peheader.Subsystem:=9
app_cui : else
peheader.Subsystem:=3; case apptype of
end; app_gui :
peheader.Subsystem:=2;
app_cui :
peheader.Subsystem:=3;
end;
if dllversion<>'' then if dllversion<>'' then
begin begin
peheader.MajorImageVersion:=dllmajor; peheader.MajorImageVersion:=dllmajor;
@ -1655,6 +1658,12 @@ initialization
RegisterDLLScanner(system_i386_win32,TDLLScannerWin32); RegisterDLLScanner(system_i386_win32,TDLLScannerWin32);
RegisterRes(res_gnu_windres_info); RegisterRes(res_gnu_windres_info);
RegisterTarget(system_i386_win32_info); RegisterTarget(system_i386_win32_info);
RegisterExternalLinker(system_i386_wince_info,TLinkerWin32);
RegisterImport(system_i386_wince,TImportLibWin32);
RegisterExport(system_i386_wince,TExportLibWin32);
RegisterDLLScanner(system_i386_wince,TDLLScannerWin32);
RegisterTarget(system_i386_wince_info);
{$endif i386} {$endif i386}
{$ifdef x86_64} {$ifdef x86_64}
RegisterExternalLinker(system_x64_win64_info,TLinkerWin32); RegisterExternalLinker(system_x64_win64_info,TLinkerWin32);