Prechádzať zdrojové kódy

* set tf_dwarf_relative_addresses for win32
* switch to external assembler when using dwarf debug info for win32,
because the internal assembler doesn't work with
tf_dwarf_relative_addresses
(mantis #12872)

git-svn-id: trunk@12592 -

Jonas Maebe 16 rokov pred
rodič
commit
0768f82770
2 zmenil súbory, kde vykonal 22 pridanie a 1 odobranie
  1. 20 0
      compiler/options.pas
  2. 2 1
      compiler/systems/i_win.pas

+ 20 - 0
compiler/options.pas

@@ -58,6 +58,7 @@ Type
     procedure Read_Parameters;
     procedure parsecmd(cmd:string);
     procedure TargetOptions(def:boolean);
+    procedure CheckOptionsCompatibility;
   end;
 
   TOptionClass=class of toption;
@@ -2151,6 +2152,19 @@ begin
     features:=features+target_unsup_features;
 end;
 
+procedure TOption.checkoptionscompatibility;
+begin
+  { the internal assembler does not yet support tf_dwarf_relative_addresses,
+    which is required for dwarf on win32 (mantis 12872)
+  }
+  if (paratargetdbg in [dbg_dwarf2,dbg_dwarf3]) and
+     (target_info.system = system_i386_win32) then
+    begin
+     Message(option_switch_bin_to_src_assembler);
+     set_target_asm(target_info.assemextern);
+    end;
+end;
+
 
 constructor TOption.create;
 begin
@@ -2454,6 +2468,12 @@ begin
       if option.quickinfo<>'' then
         option.writequickinfo;
     end;
+
+  { check the compatibility of different options and adjust them if necessary
+    (and print possible errors)
+  }
+  option.checkoptionscompatibility;
+
   { Stop if errors in options }
   if ErrorCount>0 then
    StopOptions(1);

+ 2 - 1
compiler/systems/i_win.pas

@@ -37,7 +37,8 @@ unit i_win;
             flags        : [tf_files_case_aware,tf_has_dllscanner,tf_use_function_relative_addresses,tf_smartlink_library
                             ,tf_smartlink_sections{,tf_section_threadvars}{,tf_needs_dwarf_cfi},
                             tf_winlikewidestring,tf_no_pic_supported,
-                            tf_no_generic_stackcheck,tf_has_winlike_resources];
+                            tf_no_generic_stackcheck,tf_has_winlike_resources,
+                            tf_dwarf_relative_addresses];
             cpu          : cpu_i386;
             unit_env     : 'WIN32UNITS';
             extradefines : 'MSWINDOWS;WINDOWS';