mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 15:29:16 +02:00
* changed cpurequiresproperalignment from a compile-time define into
a target flag, since some kernels may be able to handle alignment problems, and the alignment requirements may not be absolute (e.g. on ppc64, only 8 byte values need alignment, and only to 4 byte boundaries) -> linux/ppc64 has tf_requires_proper_alignment set in its target flags, darwin/ppc64 hasn't git-svn-id: trunk@6745 -
This commit is contained in:
parent
eae0ba86e7
commit
4c1d540a21
@ -1150,11 +1150,12 @@ implementation
|
||||
begin
|
||||
intloadsize := packedbitsloadsize(sref.bitlen);
|
||||
|
||||
{$if defined(cpurequiresproperalignment) and not defined(arm)}
|
||||
{$if not defined(arm)}
|
||||
{ may need to be split into several smaller loads/stores }
|
||||
if intloadsize <> sref.ref.alignment then
|
||||
internalerror(2006082011);
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) and
|
||||
(intloadsize <> sref.ref.alignment) then
|
||||
internalerror(2006082011);
|
||||
{$endif not defined(arm)}
|
||||
|
||||
if (intloadsize = 0) then
|
||||
internalerror(2006081310);
|
||||
|
@ -74,7 +74,6 @@
|
||||
{$ifdef sparc}
|
||||
{$define cpuflags}
|
||||
{$define cputargethasfixedstack}
|
||||
{$define cpurequiresproperalignment}
|
||||
{$endif sparc}
|
||||
|
||||
{$ifdef powerpc}
|
||||
@ -88,7 +87,6 @@
|
||||
{$define cpuflags}
|
||||
{$define cputargethasfixedstack}
|
||||
{$define cpumm}
|
||||
{$define cpurequiresproperalignment}
|
||||
{$endif powerpc64}
|
||||
|
||||
{$ifdef arm}
|
||||
@ -96,7 +94,6 @@
|
||||
{$define cpufpemu}
|
||||
{$define cpuneedsdiv32helper}
|
||||
{$define cputargethasfixedstack}
|
||||
{$define cpurequiresproperalignment}
|
||||
{$endif arm}
|
||||
|
||||
{$ifdef m68k}
|
||||
|
@ -63,7 +63,7 @@ implementation
|
||||
|
||||
uses
|
||||
cutils,
|
||||
globals,globtype,verbose,
|
||||
globals,globtype,verbose,systems,
|
||||
fmodule,
|
||||
symsym,
|
||||
aasmtai,aasmdata
|
||||
@ -334,9 +334,8 @@ implementation
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(proctypesinfo));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(length(tpropertysym(sym).realname)));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_string.Create(tpropertysym(sym).realname));
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -378,9 +377,8 @@ implementation
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(tkSString));
|
||||
write_rtti_name(def);
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(def.len));
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -391,9 +389,8 @@ implementation
|
||||
begin
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(tkEnumeration));
|
||||
write_rtti_name(def);
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(Cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(Cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
case longint(def.size) of
|
||||
1 :
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(otUByte));
|
||||
@ -402,9 +399,8 @@ implementation
|
||||
4 :
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(otULong));
|
||||
end;
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(Cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(Cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_32bit(def.min));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_32bit(def.max));
|
||||
if assigned(def.basedef) then
|
||||
@ -433,13 +429,11 @@ implementation
|
||||
otUByte,otUWord,otUByte);
|
||||
begin
|
||||
write_rtti_name(def);
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(byte(trans[def.ordtype])));
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_32bit(longint(def.low)));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_32bit(longint(def.high)));
|
||||
end;
|
||||
@ -450,9 +444,8 @@ implementation
|
||||
begin
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(tkInt64));
|
||||
write_rtti_name(def);
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{ low }
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_64bit(int64($80000000) shl 32));
|
||||
{ high }
|
||||
@ -462,9 +455,8 @@ implementation
|
||||
begin
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(tkQWord));
|
||||
write_rtti_name(def);
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{ low }
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_64bit(0));
|
||||
{ high }
|
||||
@ -502,9 +494,8 @@ implementation
|
||||
begin
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(tkFloat));
|
||||
write_rtti_name(def);
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(translate[def.floattype]));
|
||||
end;
|
||||
|
||||
@ -513,13 +504,11 @@ implementation
|
||||
begin
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(tkSet));
|
||||
write_rtti_name(def);
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(otULong));
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_sym(ref_rtti(def.elementdef,rt)));
|
||||
end;
|
||||
|
||||
@ -531,9 +520,8 @@ implementation
|
||||
else
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(tkarray));
|
||||
write_rtti_name(def);
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{ size of elements }
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_aint(def.elesize));
|
||||
if not(ado_IsDynamicArray in def.arrayoptions) then
|
||||
@ -550,9 +538,8 @@ implementation
|
||||
begin
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(tkrecord));
|
||||
write_rtti_name(def);
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_32bit(def.size));
|
||||
fieldcnt:=fields_count(def.symtable,rt);
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_32bit(fieldcnt));
|
||||
@ -594,9 +581,8 @@ implementation
|
||||
{ write method id and name }
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(tkmethod));
|
||||
write_rtti_name(def);
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
|
||||
{ write kind of method (can only be function or procedure)}
|
||||
if def.returndef = voidtype then
|
||||
@ -670,15 +656,13 @@ implementation
|
||||
{ write unit name }
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(length(current_module.realmodulename^)));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_string.Create(current_module.realmodulename^));
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
|
||||
{ write published properties for this object }
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_16bit(published_properties_count(def.symtable)));
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
published_properties_write_rtti_data(propnamelist,def.symtable);
|
||||
|
||||
propnamelist.free;
|
||||
@ -714,9 +698,8 @@ implementation
|
||||
ifDispInterface,
|
||||
ifDispatch, }
|
||||
));
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_32bit(longint(def.iidguid^.D1)));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_16bit(def.iidguid^.D2));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_16bit(def.iidguid^.D3));
|
||||
@ -726,9 +709,8 @@ implementation
|
||||
{ write unit name }
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(length(current_module.realmodulename^)));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_string.Create(current_module.realmodulename^));
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
|
||||
{ write iidstr }
|
||||
if assigned(def.iidstr) then
|
||||
@ -738,9 +720,8 @@ implementation
|
||||
end
|
||||
else
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(0));
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
|
||||
{ write published properties for this object }
|
||||
published_properties_write_rtti_data(propnamelist,def.symtable);
|
||||
@ -765,9 +746,8 @@ implementation
|
||||
{ generate the name }
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_8bit(length(def.objrealname^)));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_string.Create(def.objrealname^));
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
|
||||
case rt of
|
||||
initrtti :
|
||||
@ -908,13 +888,11 @@ implementation
|
||||
inc(st,length(def.typesym.realname)+1)
|
||||
else
|
||||
inc(st);
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
align(st,sizeof(Tconstptruint));
|
||||
{$endif}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
align(st,sizeof(Tconstptruint));
|
||||
inc(st);
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
align(st,sizeof(Tconstptruint));
|
||||
{$endif}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
align(st,sizeof(Tconstptruint));
|
||||
inc(st,8+sizeof(aint));
|
||||
{ write rtti data }
|
||||
with current_asmdata do
|
||||
@ -1016,13 +994,11 @@ implementation
|
||||
inc(st,length(def.typesym.realname)+1)
|
||||
else
|
||||
inc(st);
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
align(st,sizeof(Tconstptruint));
|
||||
{$endif}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
align(st,sizeof(Tconstptruint));
|
||||
inc(st);
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
align(st,sizeof(Tconstptruint));
|
||||
{$endif}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
align(st,sizeof(Tconstptruint));
|
||||
inc(st,8+sizeof(aint));
|
||||
{ write rtti data }
|
||||
with current_asmdata do
|
||||
|
@ -1118,9 +1118,8 @@ implementation
|
||||
{ write fields }
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_label.Create(fieldtable));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_16bit(fieldcount));
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_sym(classtable));
|
||||
for i:=0 to _class.symtable.SymList.Count-1 do
|
||||
begin
|
||||
@ -1128,9 +1127,8 @@ implementation
|
||||
if (tsym(sym).typ=fieldvarsym) and
|
||||
(sp_published in tsym(sym).symoptions) then
|
||||
begin
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(AInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(AInt)));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_aint(tfieldvarsym(sym).fieldoffset));
|
||||
classindex:=classtablelist.IndexOf(tfieldvarsym(sym).vardef);
|
||||
if classindex=-1 then
|
||||
@ -1145,9 +1143,8 @@ implementation
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.create(const_align(sizeof(aint))));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_label.Create(classtable));
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Create_16bit(classtablelist.count));
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
current_asmdata.asmlists[al_rtti].concat(cai_align.Create(sizeof(TConstPtrUInt)));
|
||||
for i:=0 to classtablelist.Count-1 do
|
||||
current_asmdata.asmlists[al_rtti].concat(Tai_const.Createname(tobjectdef(classtablelist[i]).vmt_mangledname,0));
|
||||
|
||||
|
@ -2018,7 +2018,6 @@ begin
|
||||
def_system_macro('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE');
|
||||
def_system_macro('FPC_CURRENCY_IS_INT64');
|
||||
def_system_macro('FPC_COMP_IS_INT64');
|
||||
def_system_macro('FPC_REQUIRES_PROPER_ALIGNMENT');
|
||||
{$endif}
|
||||
{$ifdef iA64}
|
||||
def_system_macro('CPUIA64');
|
||||
@ -2053,7 +2052,6 @@ begin
|
||||
def_system_macro('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE');
|
||||
def_system_macro('FPC_CURRENCY_IS_INT64');
|
||||
def_system_macro('FPC_COMP_IS_INT64');
|
||||
def_system_macro('FPC_REQUIRES_PROPER_ALIGNMENT');
|
||||
{$endif}
|
||||
{$ifdef vis}
|
||||
def_system_macro('CPUVIS');
|
||||
@ -2068,7 +2066,6 @@ begin
|
||||
def_system_macro('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE');
|
||||
def_system_macro('FPC_CURRENCY_IS_INT64');
|
||||
def_system_macro('FPC_COMP_IS_INT64');
|
||||
def_system_macro('FPC_REQUIRES_PROPER_ALIGNMENT');
|
||||
{$endif arm}
|
||||
|
||||
if source_info.system<>target_info.system then
|
||||
@ -2080,6 +2077,9 @@ begin
|
||||
if tf_winlikewidestring in target_info.flags then
|
||||
def_system_macro('FPC_WINLIKEWIDESTRING');
|
||||
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
def_system_macro('FPC_REQUIRES_PROPER_ALIGNMENT');
|
||||
|
||||
{ read configuration file }
|
||||
if (not disable_configfile) and
|
||||
(ppccfg<>'') then
|
||||
@ -2093,6 +2093,17 @@ begin
|
||||
else
|
||||
read_configfile := false;
|
||||
|
||||
{ the config file may have changed the target }
|
||||
if (tf_winlikewidestring in target_info.flags) then
|
||||
def_system_macro('FPC_WINLIKEWIDESTRING')
|
||||
else
|
||||
undef_system_macro('FPC_WINLIKEWIDESTRING');
|
||||
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
def_system_macro('FPC_REQUIRES_PROPER_ALIGNMENT')
|
||||
else
|
||||
undef_system_macro('FPC_REQUIRES_PROPER_ALIGNMENT');
|
||||
|
||||
{ Read commandline and configfile }
|
||||
param_file:='';
|
||||
|
||||
|
@ -1232,12 +1232,11 @@ implementation
|
||||
alignment:=size_2_align(savesize);
|
||||
st_longstring,
|
||||
st_shortstring:
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
{ char to string accesses byte 0 and 1 with one word access }
|
||||
alignment:=size_2_align(2);
|
||||
{$else cpurequiresproperalignment}
|
||||
alignment:=size_2_align(1);
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
{ char to string accesses byte 0 and 1 with one word access }
|
||||
alignment:=size_2_align(2)
|
||||
else
|
||||
alignment:=size_2_align(1);
|
||||
else
|
||||
internalerror(200412301);
|
||||
end;
|
||||
@ -3856,9 +3855,8 @@ implementation
|
||||
tObjectSymtable(symtable).datasize:=align(tObjectSymtable(symtable).datasize,
|
||||
tObjectSymtable(symtable).fieldalignment);
|
||||
|
||||
{$ifdef cpurequiresproperalignment}
|
||||
tObjectSymtable(symtable).datasize:=align(tObjectSymtable(symtable).datasize,sizeof(aint));
|
||||
{$endif cpurequiresproperalignment}
|
||||
if (tf_requires_proper_alignment in target_info.flags) then
|
||||
tObjectSymtable(symtable).datasize:=align(tObjectSymtable(symtable).datasize,sizeof(aint));
|
||||
|
||||
vmt_offset:=tObjectSymtable(symtable).datasize;
|
||||
inc(tObjectSymtable(symtable).datasize,sizeof(aint));
|
||||
|
@ -306,7 +306,8 @@ interface
|
||||
tf_use_function_relative_addresses,
|
||||
tf_winlikewidestring,
|
||||
tf_dwarf_relative_addresses, // use offsets where the Dwarf spec requires this instead of absolute addresses (the latter is needed by Linux binutils)
|
||||
tf_dwarf_only_local_labels // only use local labels inside the Dwarf debug_info section (needed for e.g. Darwin)
|
||||
tf_dwarf_only_local_labels, // only use local labels inside the Dwarf debug_info section (needed for e.g. Darwin)
|
||||
tf_requires_proper_alignment
|
||||
);
|
||||
|
||||
psysteminfo = ^tsysteminfo;
|
||||
|
@ -32,7 +32,7 @@ unit i_embedded;
|
||||
name : 'Embedded';
|
||||
shortname : 'embedded';
|
||||
flags : [tf_needs_symbol_size,tf_files_case_sensitive,tf_use_function_relative_addresses
|
||||
,tf_smartlink_sections];
|
||||
,tf_smartlink_sections,tf_requires_proper_alignment ];
|
||||
cpu : cpu_arm;
|
||||
unit_env : '';
|
||||
extradefines : '';
|
||||
|
@ -33,7 +33,7 @@ unit i_gba;
|
||||
name : 'GameBoy Advance';
|
||||
shortname : 'gba';
|
||||
flags : [tf_needs_symbol_size,tf_files_case_sensitive,tf_use_function_relative_addresses
|
||||
,tf_smartlink_sections];
|
||||
,tf_smartlink_sections,tf_requires_proper_alignment];
|
||||
cpu : cpu_arm;
|
||||
unit_env : '';
|
||||
extradefines : '';
|
||||
|
@ -287,7 +287,7 @@ unit i_linux;
|
||||
system : system_powerpc64_LINUX;
|
||||
name : 'Linux for PowerPC64';
|
||||
shortname : 'Linux';
|
||||
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses];
|
||||
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_requires_proper_alignment];
|
||||
cpu : cpu_powerpc64;
|
||||
unit_env : '';
|
||||
extradefines : 'UNIX;HASUNIX';
|
||||
@ -465,7 +465,7 @@ unit i_linux;
|
||||
system : system_SPARC_Linux;
|
||||
name : 'Linux for SPARC';
|
||||
shortname : 'Linux';
|
||||
flags : [tf_needs_symbol_size,tf_library_needs_pic,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses];
|
||||
flags : [tf_needs_symbol_size,tf_library_needs_pic,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_requires_proper_alignment];
|
||||
cpu : cpu_SPARC;
|
||||
unit_env : 'LINUXUNITS';
|
||||
extradefines : 'UNIX;HASUNIX';
|
||||
@ -524,7 +524,7 @@ unit i_linux;
|
||||
system : system_arm_Linux;
|
||||
name : 'Linux for ARM';
|
||||
shortname : 'Linux';
|
||||
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses];
|
||||
flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_requires_proper_alignment];
|
||||
cpu : cpu_arm;
|
||||
unit_env : 'LINUXUNITS';
|
||||
extradefines : 'UNIX;HASUNIX';
|
||||
|
@ -1,98 +1,98 @@
|
||||
{
|
||||
This unit implements support information structures for GameBoy Advance
|
||||
|
||||
Copyright (c) 1998-2002 by Peter Vreman
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
****************************************************************************
|
||||
}
|
||||
{ This unit implements support information structures for nds. }
|
||||
unit i_nds;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
systems;
|
||||
|
||||
const
|
||||
system_arm_nds_info : tsysteminfo =
|
||||
(
|
||||
system : system_arm_nds;
|
||||
name : 'Nintendo DS';
|
||||
shortname : 'nds';
|
||||
flags : [tf_needs_symbol_size,tf_files_case_sensitive,tf_use_function_relative_addresses
|
||||
,tf_smartlink_sections];
|
||||
cpu : cpu_arm;
|
||||
unit_env : '';
|
||||
extradefines : '';
|
||||
exeext : '.bin';
|
||||
defext : '.def';
|
||||
scriptext : '.sh';
|
||||
smartext : '.sl';
|
||||
unitext : '.ppu';
|
||||
unitlibext : '.ppl';
|
||||
asmext : '.s';
|
||||
objext : '.o';
|
||||
resext : '.res';
|
||||
resobjext : '.or';
|
||||
sharedlibext : '.so';
|
||||
staticlibext : '.a';
|
||||
staticlibprefix : 'libp';
|
||||
sharedlibprefix : 'lib';
|
||||
sharedClibext : '.so';
|
||||
staticClibext : '.a';
|
||||
staticClibprefix : 'lib';
|
||||
sharedClibprefix : 'lib';
|
||||
Cprefix : '';
|
||||
newline : #10;
|
||||
dirsep : '/';
|
||||
assem : as_gas;
|
||||
assemextern : as_gas;
|
||||
link : nil;
|
||||
linkextern : nil;
|
||||
ar : ar_gnu_ar;
|
||||
res : res_none;
|
||||
dbg : dbg_stabs;
|
||||
script : script_unix;
|
||||
endian : endian_little;
|
||||
alignment :
|
||||
(
|
||||
procalign : 4;
|
||||
loopalign : 4;
|
||||
jumpalign : 0;
|
||||
constalignmin : 0;
|
||||
constalignmax : 4;
|
||||
varalignmin : 0;
|
||||
varalignmax : 4;
|
||||
localalignmin : 4;
|
||||
localalignmax : 8;
|
||||
recordalignmin : 0;
|
||||
recordalignmax : 4;
|
||||
maxCrecordalign : 4
|
||||
);
|
||||
first_parm_offset : 8;
|
||||
stacksize : 262144;
|
||||
abi : abi_default
|
||||
);
|
||||
|
||||
implementation
|
||||
|
||||
initialization
|
||||
{$ifdef arm}
|
||||
{$ifdef nds}
|
||||
set_source_info(system_arm_nds_info);
|
||||
{$endif nds}
|
||||
{$endif arm}
|
||||
end.
|
||||
{
|
||||
This unit implements support information structures for GameBoy Advance
|
||||
|
||||
Copyright (c) 1998-2002 by Peter Vreman
|
||||
|
||||
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
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
****************************************************************************
|
||||
}
|
||||
{ This unit implements support information structures for nds. }
|
||||
unit i_nds;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
systems;
|
||||
|
||||
const
|
||||
system_arm_nds_info : tsysteminfo =
|
||||
(
|
||||
system : system_arm_nds;
|
||||
name : 'Nintendo DS';
|
||||
shortname : 'nds';
|
||||
flags : [tf_needs_symbol_size,tf_files_case_sensitive,tf_use_function_relative_addresses
|
||||
,tf_smartlink_sections,tf_requires_proper_alignment];
|
||||
cpu : cpu_arm;
|
||||
unit_env : '';
|
||||
extradefines : '';
|
||||
exeext : '.bin';
|
||||
defext : '.def';
|
||||
scriptext : '.sh';
|
||||
smartext : '.sl';
|
||||
unitext : '.ppu';
|
||||
unitlibext : '.ppl';
|
||||
asmext : '.s';
|
||||
objext : '.o';
|
||||
resext : '.res';
|
||||
resobjext : '.or';
|
||||
sharedlibext : '.so';
|
||||
staticlibext : '.a';
|
||||
staticlibprefix : 'libp';
|
||||
sharedlibprefix : 'lib';
|
||||
sharedClibext : '.so';
|
||||
staticClibext : '.a';
|
||||
staticClibprefix : 'lib';
|
||||
sharedClibprefix : 'lib';
|
||||
Cprefix : '';
|
||||
newline : #10;
|
||||
dirsep : '/';
|
||||
assem : as_gas;
|
||||
assemextern : as_gas;
|
||||
link : nil;
|
||||
linkextern : nil;
|
||||
ar : ar_gnu_ar;
|
||||
res : res_none;
|
||||
dbg : dbg_stabs;
|
||||
script : script_unix;
|
||||
endian : endian_little;
|
||||
alignment :
|
||||
(
|
||||
procalign : 4;
|
||||
loopalign : 4;
|
||||
jumpalign : 0;
|
||||
constalignmin : 0;
|
||||
constalignmax : 4;
|
||||
varalignmin : 0;
|
||||
varalignmax : 4;
|
||||
localalignmin : 4;
|
||||
localalignmax : 8;
|
||||
recordalignmin : 0;
|
||||
recordalignmax : 4;
|
||||
maxCrecordalign : 4
|
||||
);
|
||||
first_parm_offset : 8;
|
||||
stacksize : 262144;
|
||||
abi : abi_default
|
||||
);
|
||||
|
||||
implementation
|
||||
|
||||
initialization
|
||||
{$ifdef arm}
|
||||
{$ifdef nds}
|
||||
set_source_info(system_arm_nds_info);
|
||||
{$endif nds}
|
||||
{$endif arm}
|
||||
end.
|
||||
|
@ -98,7 +98,7 @@ unit i_palmos;
|
||||
system : system_arm_PalmOS;
|
||||
name : 'PalmOS';
|
||||
shortname : 'PalmOS';
|
||||
flags : [tf_code_small,tf_static_reg_based,tf_smartlink_sections];
|
||||
flags : [tf_code_small,tf_static_reg_based,tf_smartlink_sections,tf_requires_proper_alignment];
|
||||
cpu : cpu_arm;
|
||||
unit_env : 'PALMUNITS';
|
||||
extradefines : '';
|
||||
|
@ -91,7 +91,7 @@ unit i_sunos;
|
||||
system : system_sparc_solaris;
|
||||
name : 'Solaris for SPARC';
|
||||
shortname : 'solaris';
|
||||
flags : [tf_needs_symbol_size,tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses];
|
||||
flags : [tf_needs_symbol_size,tf_under_development,tf_files_case_sensitive,tf_use_function_relative_addresses,tf_requires_proper_alignment];
|
||||
cpu : cpu_SPARC;
|
||||
unit_env : 'SOLARISUNITS';
|
||||
extradefines : 'UNIX;LIBC;SUNOS;HASUNIX';
|
||||
|
@ -151,7 +151,7 @@ unit i_win;
|
||||
system : system_arm_wince;
|
||||
name : 'WinCE for ARM';
|
||||
shortname : 'WinCE';
|
||||
flags : [tf_files_case_aware,tf_use_function_relative_addresses{,tf_winlikewidestring},tf_smartlink_sections];
|
||||
flags : [tf_files_case_aware,tf_use_function_relative_addresses{,tf_winlikewidestring},tf_smartlink_sections,tf_requires_proper_alignment];
|
||||
cpu : cpu_arm;
|
||||
unit_env : '';
|
||||
extradefines : 'UNDER_CE;WINDOWS;UNICODE';
|
||||
|
Loading…
Reference in New Issue
Block a user