* make PIC generation default on Darwin (ppc and i386; ppc64 will be

done in next commit to ease merging)

git-svn-id: trunk@8872 -
This commit is contained in:
Jonas Maebe 2007-10-21 10:34:01 +00:00
parent 575406dbc9
commit ff3b455a59
3 changed files with 16 additions and 8 deletions

View File

@ -56,7 +56,7 @@ Type
procedure Interpret_file(const filename : string); procedure Interpret_file(const filename : string);
procedure Read_Parameters; procedure Read_Parameters;
procedure parsecmd(cmd:string); procedure parsecmd(cmd:string);
procedure TargetDefines(def:boolean); procedure TargetOptions(def:boolean);
end; end;
TOptionClass=class of toption; TOptionClass=class of toption;
@ -1195,7 +1195,7 @@ begin
if paratarget=system_none then if paratarget=system_none then
begin begin
{ remove old target define } { remove old target define }
TargetDefines(false); TargetOptions(false);
{ load new target } { load new target }
paratarget:=find_system_by_string(More); paratarget:=find_system_by_string(More);
if paratarget<>system_none then if paratarget<>system_none then
@ -1203,7 +1203,7 @@ begin
else else
IllegalPara(opt); IllegalPara(opt);
{ set new define } { set new define }
TargetDefines(true); TargetOptions(true);
end end
else else
if More<>upper(target_info.shortname) then if More<>upper(target_info.shortname) then
@ -1895,7 +1895,7 @@ begin
end; end;
procedure TOption.TargetDefines(def:boolean); procedure TOption.TargetOptions(def:boolean);
var var
s : string; s : string;
i : integer; i : integer;
@ -1985,6 +1985,13 @@ begin
def_system_macro('FPC_CPUCROSSCOMPILING') def_system_macro('FPC_CPUCROSSCOMPILING')
else else
def_system_macro('FPC_CPUCROSSCOMPILING'); def_system_macro('FPC_CPUCROSSCOMPILING');
{ Code generation flags }
if def and
(tf_pic_default in target_info.flags) then
include(init_settings.moduleswitches,cs_create_pic)
else
exclude(init_settings.moduleswitches,cs_create_pic);
end; end;
@ -2078,7 +2085,7 @@ begin
disable_configfile:=false; disable_configfile:=false;
{ Non-core target defines } { Non-core target defines }
Option.TargetDefines(true); Option.TargetOptions(true);
{ get default messagefile } { get default messagefile }
msgfilename:=GetEnvironmentVariable('PPC_ERROR_FILE'); msgfilename:=GetEnvironmentVariable('PPC_ERROR_FILE');

View File

@ -311,7 +311,8 @@ interface
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_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, tf_requires_proper_alignment,
tf_no_pic_supported tf_no_pic_supported,
tf_pic_default
); );
psysteminfo = ^tsysteminfo; psysteminfo = ^tsysteminfo;

View File

@ -399,7 +399,7 @@ unit i_bsd;
system : system_powerpc_darwin; system : system_powerpc_darwin;
name : 'Darwin for PowerPC'; name : 'Darwin for PowerPC';
shortname : 'Darwin'; shortname : 'Darwin';
flags : [tf_p_ext_support,tf_files_case_aware,tf_smartlink_sections,tf_dwarf_relative_addresses,tf_dwarf_only_local_labels]; flags : [tf_p_ext_support,tf_files_case_aware,tf_smartlink_sections,tf_dwarf_relative_addresses,tf_dwarf_only_local_labels,tf_pic_default];
cpu : cpu_powerpc; cpu : cpu_powerpc;
unit_env : 'BSDUNITS'; unit_env : 'BSDUNITS';
extradefines : 'UNIX;BSD;HASUNIX'; extradefines : 'UNIX;BSD;HASUNIX';
@ -460,7 +460,7 @@ unit i_bsd;
system : system_i386_darwin; system : system_i386_darwin;
name : 'Darwin for i386'; name : 'Darwin for i386';
shortname : 'Darwin'; shortname : 'Darwin';
flags : [tf_p_ext_support,tf_files_case_aware,tf_smartlink_sections,tf_dwarf_relative_addresses,tf_dwarf_only_local_labels,tf_pic_uses_got]; flags : [tf_p_ext_support,tf_files_case_aware,tf_smartlink_sections,tf_dwarf_relative_addresses,tf_dwarf_only_local_labels,tf_pic_uses_got,tf_pic_default];
cpu : cpu_i386; cpu : cpu_i386;
unit_env : 'BSDUNITS'; unit_env : 'BSDUNITS';
extradefines : 'UNIX;BSD;HASUNIX'; extradefines : 'UNIX;BSD;HASUNIX';