Browse Source

- reverted r31664, it causes crashes with some ld versions :/

git-svn-id: trunk@31670 -
Jonas Maebe 10 years ago
parent
commit
e06a759e20
6 changed files with 32 additions and 63 deletions
  1. 1 2
      compiler/globtype.pas
  2. 0 1
      compiler/msg/errore.msg
  3. 1 1
      compiler/msgidx.inc
  4. 18 21
      compiler/msgtxt.inc
  5. 0 12
      compiler/options.pas
  6. 12 26
      compiler/systems/t_linux.pas

+ 1 - 2
compiler/globtype.pas

@@ -194,8 +194,7 @@ interface
          cs_link_strip,cs_link_staticflag,cs_link_on_target,cs_link_extern,cs_link_opt_vtable,
          cs_link_strip,cs_link_staticflag,cs_link_on_target,cs_link_extern,cs_link_opt_vtable,
          cs_link_opt_used_sections,cs_link_separate_dbg_file,
          cs_link_opt_used_sections,cs_link_separate_dbg_file,
          cs_link_map,cs_link_pthread,cs_link_no_default_lib_order,
          cs_link_map,cs_link_pthread,cs_link_no_default_lib_order,
-	 cs_link_native,
-         cs_link_pre_binutils_2_19
+	 cs_link_native
        );
        );
        tglobalswitches = set of tglobalswitch;
        tglobalswitches = set of tglobalswitch;
 
 

+ 0 - 1
compiler/msg/errore.msg

@@ -3880,7 +3880,6 @@ A*2WR_Generate relocation code (Windows)
 P*2WT_Specify MPW tool type application (Classic Mac OS)
 P*2WT_Specify MPW tool type application (Classic Mac OS)
 **2WX_Enable executable stack (Linux)
 **2WX_Enable executable stack (Linux)
 **1X_Executable options:
 **1X_Executable options:
-**2X9_Generate linkerscript for GNU Binutils ld older than version 2.19.1 (Linux)
 **2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Linux)
 **2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Linux)
 **2Xd_Do not search default library path (sometimes required for cross-compiling when not using -XR)
 **2Xd_Do not search default library path (sometimes required for cross-compiling when not using -XR)
 **2Xe_Use external linker
 **2Xe_Use external linker

+ 1 - 1
compiler/msgidx.inc

@@ -1017,7 +1017,7 @@ const
   option_info=11024;
   option_info=11024;
   option_help_pages=11025;
   option_help_pages=11025;
 
 
-  MsgTxtSize = 76087;
+  MsgTxtSize = 76005;
 
 
   MsgIdxMax : array[1..20] of longint=(
   MsgIdxMax : array[1..20] of longint=(
     26,99,342,124,96,58,127,32,207,64,
     26,99,342,124,96,58,127,32,207,64,

+ 18 - 21
compiler/msgtxt.inc

@@ -1,7 +1,7 @@
 {$ifdef Delphi}
 {$ifdef Delphi}
-const msgtxt : array[0..000317] of string[240]=(
+const msgtxt : array[0..000316] of string[240]=(
 {$else Delphi}
 {$else Delphi}
-const msgtxt : array[0..000317,1..240] of char=(
+const msgtxt : array[0..000316,1..240] of char=(
 {$endif Delphi}
 {$endif Delphi}
   '01000_T_Compiler: $1'#000+
   '01000_T_Compiler: $1'#000+
   '01001_D_Compiler OS: $1'#000+
   '01001_D_Compiler OS: $1'#000+
@@ -1722,39 +1722,36 @@ const msgtxt : array[0..000317,1..240] of char=(
   'P*2WT_Specify MPW tool type application (Classic Mac OS)'#010+
   'P*2WT_Specify MPW tool type application (Classic Mac OS)'#010+
   '**2WX_Enable executable stack (Linux)'#010+
   '**2WX_Enable executable stack (Linux)'#010+
   '**1X_Executable options:'#010+
   '**1X_Executable options:'#010+
-  '**2X9_Generate linkerscript for GNU Binutils ld older than versio','n 2'+
-  '.19.1 (Linux)'#010+
-  '**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Lin'+
-  'ux)'#010+
+  '**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD',', L'+
+  'inux)'#010+
   '**2Xd_Do not search default library path (sometimes required for cross'+
   '**2Xd_Do not search default library path (sometimes required for cross'+
   '-compiling when not using -XR)'#010+
   '-compiling when not using -XR)'#010+
   '**2Xe_Use external linker'#010+
   '**2Xe_Use external linker'#010+
-  '**2Xf_Substitute pthre','ad library name for linking (BSD)'#010+
-  '**2Xg_Create debuginfo in a separate file and add a debuglink section '+
-  'to executable'#010+
+  '**2Xf_Substitute pthread library name for linking (BSD)'#010+
+  '**2Xg_Create debuginfo in a separate file and ad','d a debuglink sectio'+
+  'n to executable'#010+
   '**2XD_Try to link units dynamically      (defines FPC_LINK_DYNAMIC)'#010+
   '**2XD_Try to link units dynamically      (defines FPC_LINK_DYNAMIC)'#010+
   '**2Xi_Use internal linker'#010+
   '**2Xi_Use internal linker'#010+
-  '**2XLA_Define library substi','tutions for linking'#010+
+  '**2XLA_Define library substitutions for linking'#010+
   '**2XLO_Define order of library linking'#010+
   '**2XLO_Define order of library linking'#010+
-  '**2XLD_Exclude default order of standard libraries'#010+
+  '**2XLD_Exclude default ','order of standard libraries'#010+
   '**2Xm_Generate link map'#010+
   '**2Xm_Generate link map'#010+
   '**2XM<x>_Set the name of the '#039'main'#039' program routine (default i'+
   '**2XM<x>_Set the name of the '#039'main'#039' program routine (default i'+
   's '#039'main'#039')'#010+
   's '#039'main'#039')'#010+
-  '**2Xn_Use target system native lin','ker instead of GNU ld (Solaris, AI'+
-  'X)'#010+
-  'F*2Xp<x>_First search for the compiler binary in the directory <x>'#010+
+  '**2Xn_Use target system native linker instead of GNU ld (Solaris, AIX)'+
+  #010+
+  'F*2Xp<x>_First search for the compiler binary',' in the directory <x>'#010+
   '**2XP<x>_Prepend the binutils names with the prefix <x>'#010+
   '**2XP<x>_Prepend the binutils names with the prefix <x>'#010+
   '**2Xr<x>_Set the linker'#039's rlink-path to <x> (needed for cross comp'+
   '**2Xr<x>_Set the linker'#039's rlink-path to <x> (needed for cross comp'+
-  'ile, see the l','d manual for more information) (BeOS, Linux)'#010+
-  '**2XR<x>_Prepend <x> to all linker search paths (BeOS, Darwin, FreeBSD'+
-  ', Linux, Mac OS, Solaris)'#010+
+  'ile, see the ld manual for more information) (BeOS, Linux)'#010+
+  '**2XR<x>_Prepend <x> to all linker se','arch paths (BeOS, Darwin, FreeB'+
+  'SD, Linux, Mac OS, Solaris)'#010+
   '**2Xs_Strip all symbols from executable'#010+
   '**2Xs_Strip all symbols from executable'#010+
-  '**2XS_Try to link units statically (default, defines FPC_LI','NK_STATIC'+
-  ')'#010+
+  '**2XS_Try to link units statically (default, defines FPC_LINK_STATIC)'#010+
   '**2Xt_Link with static libraries (-static is passed to linker)'#010+
   '**2Xt_Link with static libraries (-static is passed to linker)'#010+
-  '**2Xv_Generate table for Virtual Entry calls'#010+
+  '**2Xv_Ge','nerate table for Virtual Entry calls'#010+
   '**2XX_Try to smartlink units             (defines FPC_LINK_SMART)'#010+
   '**2XX_Try to smartlink units             (defines FPC_LINK_SMART)'#010+
   '**1*_'#010+
   '**1*_'#010+
   '**1?_Show this help'#010+
   '**1?_Show this help'#010+
-  '**1h_Shows this help without ','waiting'
+  '**1h_Shows this help without waiting'
 );
 );

+ 0 - 12
compiler/options.pas

@@ -2347,18 +2347,6 @@ begin
                while j<=length(more) do
                while j<=length(more) do
                 begin
                 begin
                   case More[j] of
                   case More[j] of
-                    '9' :
-                      begin
-                        if target_info.system in systems_linux then
-                          begin
-                            if UnsetBool(More, j, opt, false) then
-                              exclude(init_settings.globalswitches,cs_link_pre_binutils_2_19)
-                            else
-                              include(init_settings.globalswitches,cs_link_pre_binutils_2_19);
-                          end
-                        else
-                          IllegalPara(opt);
-                      end;
                     'c' : Cshared:=TRUE;
                     'c' : Cshared:=TRUE;
                     'd' : Dontlinkstdlibpath:=TRUE;
                     'd' : Dontlinkstdlibpath:=TRUE;
                     'e' :
                     'e' :

+ 12 - 26
compiler/systems/t_linux.pas

@@ -318,12 +318,8 @@ begin
    begin
    begin
      ExeCmd[1]:='ld '+platform_select+platformopt+' $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -L. -o $EXE';
      ExeCmd[1]:='ld '+platform_select+platformopt+' $OPT $DYNLINK $STATIC $GCSECTIONS $STRIP -L. -o $EXE';
      DllCmd[1]:='ld '+platform_select+' $OPT $INIT $FINI $SONAME -shared -L. -o $EXE';
      DllCmd[1]:='ld '+platform_select+' $OPT $INIT $FINI $SONAME -shared -L. -o $EXE';
-     { when we want to cross-link we need to override default library paths;
-       when targeting binutils 2.19 or later, we use the "INSERT" command to
-       augment the default linkerscript, which also requires -T (normally that
-       option means "completely replace the default linkerscript) }
-     if not(cs_link_pre_binutils_2_19 in current_settings.globalswitches) or
-       (length(sysrootpath)>0) then
+     { when we want to cross-link we need to override default library paths }
+     if length(sysrootpath) > 0 then
        begin
        begin
          ExeCmd[1]:=ExeCmd[1]+' -T';
          ExeCmd[1]:=ExeCmd[1]+' -T';
          DllCmd[1]:=DllCmd[1]+' -T';
          DllCmd[1]:=DllCmd[1]+' -T';
@@ -594,39 +590,29 @@ begin
           end;
           end;
        end;
        end;
 
 
-      { Entry point. Only needed for executables, as for shared lubraries we use
-        the -init command line option instead
-
-       The "ENTRY" linkerscript command does not have any effect when augmenting
-       a linker script, so use the command line parameter instead }
+      {Entry point. Only needed for executables, set on the linker command line for
+       shared libraries. }
       if (not isdll) then
       if (not isdll) then
-        if (linksToSharedLibFiles and not linklibc) then
-          info.ExeCmd[1]:=info.ExeCmd[1]+' -e _dynamic_start'
-        else
-          info.ExeCmd[1]:=info.ExeCmd[1]+' -e _start';
+       if (linksToSharedLibFiles and not linklibc) then
+        add('ENTRY(_dynamic_start)')
+       else
+        add('ENTRY(_start)');
 
 
       { If we are using the default sysroot, use the default linker script and
       { If we are using the default sysroot, use the default linker script and
-        just augment it with the FPC-specific parts.
+        just augment it with the FPC-specific parts. Ideally, we should add
+        "INSERT AFTER" at the end to explicitly tell ld to just augment the
+        built-in linker script, but that's only supported by ld 2.19 and later.
       }
       }
       if sysrootpath='' then
       if sysrootpath='' then
         begin
         begin
           add('SECTIONS');
           add('SECTIONS');
           add('{');
           add('{');
-          if not(cs_link_pre_binutils_2_19 in current_settings.globalswitches) then
-            { we can't use ".data", as that would hide the .data from the
-              original linker script in combination with the INSERT at the end }
-            add('  .fpcdata           :')
-          else
-            add('  .data           :');
+          add('  .data           :');
           add('  {');
           add('  {');
           add('    KEEP (*(.fpc .fpc.n_version .fpc.n_links))');
           add('    KEEP (*(.fpc .fpc.n_version .fpc.n_links))');
           add('  }');
           add('  }');
           add('  .threadvar _edata : { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }');
           add('  .threadvar _edata : { *(.threadvar .threadvar.* .gnu.linkonce.tv.*) }');
           add('}');
           add('}');
-          { this "INSERT" means "merge into the original linker script, even if
-            -T is used" }
-          if not(cs_link_pre_binutils_2_19 in current_settings.globalswitches) then
-            add('INSERT AFTER .data;');
         end
         end
       else
       else
         begin
         begin