Browse Source

Merged revision 15761 and 15762 from
------------------------------------------------------------------------
r15761 | pierre | 2010-08-10 13:28:31 +0200 (Tue, 10 Aug 2010) | 1 line

* Add external linker possibility for windows x86_64 compiler
------------------------------------------------------------------------
r15762 | pierre | 2010-08-10 13:33:38 +0200 (Tue, 10 Aug 2010) | 1 line

* revert wrong commits

git-svn-id: branches/fixes_2_4@16720 -

pierre 14 years ago
parent
commit
27865099ad
1 changed files with 13 additions and 0 deletions
  1. 13 0
      compiler/systems/t_win.pas

+ 13 - 0
compiler/systems/t_win.pas

@@ -1089,10 +1089,14 @@ implementation
       begin
         with Info do
          begin
+{$ifdef x86_64}
+           targetopts:='-b pe-x86_64';
+{$else x86_64}
            if target_info.system=system_arm_wince then
              targetopts:='-m arm_wince_pe'
            else
              targetopts:='-b pe-i386 -m i386pe';
+{$endif not x86_64}
            ExeCmd[1]:='ld '+targetopts+' $OPT $GCSECTIONS $MAP $STRIP $APPTYPE $ENTRY  $IMAGEBASE $RELOC -o $EXE $RES';
            DllCmd[1]:='ld '+targetopts+' $OPT $GCSECTIONS $MAP $STRIP --dll $APPTYPE $ENTRY  $IMAGEBASE $RELOC -o $EXE $RES';
            { ExeCmd[2]:='dlltool --as $ASBIN --dllname $EXE --output-exp exp.$$$ $RELOC $DEF';
@@ -1191,7 +1195,11 @@ implementation
              end;
 
             Add('SEARCH_DIR("/usr/i686-pc-cygwin/lib"); SEARCH_DIR("/usr/lib"); SEARCH_DIR("/usr/lib/w32api");');
+{$ifdef x86_64}
+            Add('OUTPUT_FORMAT(pei-x86-64)');
+{$else not 86_64}
             Add('OUTPUT_FORMAT(pei-i386)');
+{$endif not x86_64}
             Add('ENTRY(_mainCRTStartup)');
             Add('SECTIONS');
             Add('{');
@@ -1202,6 +1210,9 @@ implementation
             Add('    *(.init)');
             add('    *(.text .stub .text.* .gnu.linkonce.t.*)');
             Add('    *(SORT(.text$*))');
+            Add('    *(.glue_7t)');
+            Add('    *(.glue_7)');
+            Add('    . = ALIGN(8);');
             Add('     ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;');
             Add('			LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*));  LONG (0);');
             Add('     ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;');
@@ -1216,6 +1227,7 @@ implementation
             add('    *(.data .data.* .gnu.linkonce.d.* .fpc*)');
             Add('    *(.data2)');
             Add('    *(SORT(.data$*))');
+            Add('    *(.jcr)');
             Add('    __data_end__ = . ;');
             Add('    *(.data_cygwin_nocopy)');
             Add('  }');
@@ -1769,6 +1781,7 @@ initialization
   RegisterTarget(system_i386_wince_info);
 {$endif i386}
 {$ifdef x86_64}
+  RegisterExternalLinker(system_x64_win64_info,TExternalLinkerWin);
   RegisterInternalLinker(system_x64_win64_info,TInternalLinkerWin);
   RegisterImport(system_x86_64_win64,TImportLibWin);
   RegisterExport(system_x86_64_win64,TExportLibWin);