* ignore pic directive/switch if the platform doesn't support pic, resolves #9281

git-svn-id: trunk@8157 -
This commit is contained in:
florian 2007-07-23 20:25:04 +00:00
parent 8b11f99765
commit 5e60b52f28
7 changed files with 233 additions and 220 deletions

View File

@ -345,8 +345,8 @@ scanner_e_illegal_warn_state=02079_E_Illegal state for $WARN directive
% Only ON and OFF can be used as state with a \$warn compiler directive % Only ON and OFF can be used as state with a \$warn compiler directive
scan_e_only_packset=02080_E_Illegal set packing value scan_e_only_packset=02080_E_Illegal set packing value
% Only 0, 1, 2, 4, 8, DEFAULT and NORMAL are allowed as packset parameter % Only 0, 1, 2, 4, 8, DEFAULT and NORMAL are allowed as packset parameter
scan_w_pic_ignored=02081_W_PIC directive ignored scan_w_pic_ignored=02081_W_PIC directive or switch ignored
% Several targets like windows do not support the PIC directive and need it to be % Several targets like windows do not support neither need PIC so the PIC directive and switch are
% ignored. % ignored.
scan_w_unsupported_switch_by_target=02082_W_The switch "$1" is not supported by the currently selected target scan_w_unsupported_switch_by_target=02082_W_The switch "$1" is not supported by the currently selected target
% Some compiler switches like $E are not supported by all targets. % Some compiler switches like $E are not supported by all targets.

View File

@ -729,7 +729,7 @@ const
option_info=11024; option_info=11024;
option_help_pages=11025; option_help_pages=11025;
MsgTxtSize = 43728; MsgTxtSize = 43738;
MsgIdxMax : array[1..20] of longint=( MsgIdxMax : array[1..20] of longint=(
24,83,237,83,63,49,107,22,135,60, 24,83,237,83,63,49,107,22,135,60,

File diff suppressed because it is too large Load Diff

View File

@ -496,7 +496,10 @@ begin
break; break;
end; end;
'g' : 'g' :
include(init_settings.moduleswitches,cs_create_pic); if tf_no_pic_supported in target_info.flags then
message(scan_w_pic_ignored)
else
include(init_settings.moduleswitches,cs_create_pic);
'h' : 'h' :
begin begin
val(copy(more,j+1,length(more)-j),heapsize,code); val(copy(more,j+1,length(more)-j),heapsize,code);
@ -672,7 +675,12 @@ begin
'f' : 'f' :
begin begin
if more='PIC' then if more='PIC' then
include(init_settings.moduleswitches,cs_create_pic) begin
if tf_no_pic_supported in target_info.flags then
message(scan_w_pic_ignored)
else
include(init_settings.moduleswitches,cs_create_pic)
end
else else
IllegalPara(opt); IllegalPara(opt);
end; end;

View File

@ -851,10 +851,10 @@ implementation
procedure dir_pic; procedure dir_pic;
begin begin
{ windows doesn't need/support pic } { windows doesn't need/support pic }
if not(target_info.system in system_windows+system_wince) then if tf_no_pic_supported in target_info.flags then
do_moduleswitch(cs_create_pic) message(scan_w_pic_ignored)
else else
message(scan_w_pic_ignored); do_moduleswitch(cs_create_pic);
end; end;
procedure dir_pop; procedure dir_pop;

View File

@ -313,7 +313,8 @@ interface
tf_winlikewidestring, 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_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
); );
psysteminfo = ^tsysteminfo; psysteminfo = ^tsysteminfo;

View File

@ -33,7 +33,7 @@ unit i_win;
name : 'Win32 for i386'; name : 'Win32 for i386';
shortname : 'Win32'; shortname : 'Win32';
flags : [tf_files_case_aware,tf_has_dllscanner,tf_use_function_relative_addresses flags : [tf_files_case_aware,tf_has_dllscanner,tf_use_function_relative_addresses
,tf_smartlink_sections{,tf_section_threadvars}{,tf_needs_dwarf_cfi},tf_winlikewidestring]; ,tf_smartlink_sections{,tf_section_threadvars}{,tf_needs_dwarf_cfi},tf_winlikewidestring,tf_no_pic_supported];
cpu : cpu_i386; cpu : cpu_i386;
unit_env : 'WIN32UNITS'; unit_env : 'WIN32UNITS';
extradefines : 'MSWINDOWS;WINDOWS'; extradefines : 'MSWINDOWS;WINDOWS';
@ -92,7 +92,8 @@ unit i_win;
system : system_x86_64_win64; system : system_x86_64_win64;
name : 'Win64 for x64'; name : 'Win64 for x64';
shortname : 'Win64'; shortname : 'Win64';
flags : [tf_files_case_aware,tf_has_dllscanner,tf_use_function_relative_addresses,tf_winlikewidestring]; flags : [tf_files_case_aware,tf_has_dllscanner,tf_use_function_relative_addresses,
tf_winlikewidestring,tf_no_pic_supported];
cpu : cpu_x86_64; cpu : cpu_x86_64;
unit_env : 'WIN64UNITS'; unit_env : 'WIN64UNITS';
extradefines : 'MSWINDOWS;WINDOWS'; extradefines : 'MSWINDOWS;WINDOWS';
@ -151,7 +152,8 @@ unit i_win;
system : system_arm_wince; system : system_arm_wince;
name : 'WinCE for ARM'; name : 'WinCE for ARM';
shortname : 'WinCE'; shortname : 'WinCE';
flags : [tf_files_case_aware,tf_use_function_relative_addresses{,tf_winlikewidestring},tf_smartlink_sections,tf_requires_proper_alignment]; flags : [tf_files_case_aware,tf_use_function_relative_addresses{,tf_winlikewidestring},
tf_smartlink_sections,tf_requires_proper_alignment,tf_no_pic_supported];
cpu : cpu_arm; cpu : cpu_arm;
unit_env : ''; unit_env : '';
extradefines : 'UNDER_CE;WINDOWS;UNICODE'; extradefines : 'UNDER_CE;WINDOWS;UNICODE';
@ -210,7 +212,8 @@ unit i_win;
system : system_i386_wince; system : system_i386_wince;
name : 'WinCE for i386'; name : 'WinCE for i386';
shortname : 'WinCE'; 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_no_pic_supported];
cpu : cpu_i386; cpu : cpu_i386;
unit_env : ''; unit_env : '';
extradefines : 'UNDER_CE;WINDOWS;UNICODE'; extradefines : 'UNDER_CE;WINDOWS;UNICODE';