Skip to content

Instantly share code, notes, and snippets.

@citrus-it
Created December 17, 2019 11:48
Show Gist options
  • Save citrus-it/96d579c065c9497f1f4c8ca0cb342904 to your computer and use it in GitHub Desktop.
Save citrus-it/96d579c065c9497f1f4c8ca0cb342904 to your computer and use it in GitHub Desktop.
diff --git a/Makefile.in b/Makefile.in
index 9f26a859384..38774f542a6 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -544,7 +544,7 @@ STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS)
 STAGEautofeedback_CFLAGS = $(STAGE3_CFLAGS)
 STAGEautofeedback_TFLAGS = $(STAGE3_TFLAGS)

-do-compare = $(srcdir)/contrib/compare-debug $$f1 $$f2
+do-compare = @do_compare@
 do-compare3 = $(do-compare)

 # -----------------------------------------------
diff --git a/fixincludes/fixinc.in b/fixincludes/fixinc.in
index d148f4bec03..cd0b458b8f8 100755
--- a/fixincludes/fixinc.in
+++ b/fixincludes/fixinc.in
@@ -212,7 +212,7 @@ search_dirs=""

 while [ -n "$dirs" ] && [ $levels -gt 0 ]
 do
-  levels=`expr $levels - 1; true`
+  levels=`expr $levels - 1`
   newdirs=
   for d in $dirs
   do
@@ -341,7 +341,7 @@ if $LINKS; then
           cd $LIB
           while [ x$dirname != x ]; do
             component=`echo $dirname | sed -e 's|/.*$||'`
-            mkdir -p $component >/dev/null 2>&1
+            mkdir $component >/dev/null 2>&1
             cd $component
             dirmade=$dirmade/$component
             dirname=`echo $dirname | sed -e 's|[^/]*//*||'`
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 2e2474e2749..6801fefdae6 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -820,7 +820,7 @@ static unsigned int ix86_minimum_incoming_stack_boundary (bool);
 static enum calling_abi ix86_function_abi (const_tree);

 static int ix86_nsaved_args (void);
-static rtx pro_epilogue_adjust_stack (rtx, rtx, rtx, int, bool);
+static rtx_def* pro_epilogue_adjust_stack (rtx, rtx, rtx, int, bool);
 ^L
 #ifndef SUBTARGET32_DEFAULT_CPU
 #define SUBTARGET32_DEFAULT_CPU "i386"
@@ -10921,7 +10921,8 @@ indirect_thunk_name (char name[32], unsigned int regno,
   if (regno != INVALID_REGNUM && regno != CX_REG && ret_p)
     gcc_unreachable ();

-  if (USE_HIDDEN_LINKONCE)
+  if (USE_HIDDEN_LINKONCE ||
+      (cfun && cfun->machine->indirect_branch_type == indirect_branch_thunk_extern))
     {
       const char *prefix;

@@ -12028,7 +12029,6 @@ ix86_compute_frame_layout (void)
     }


-#ifdef DEBUG_FRAME_STUFF
   if (getenv("DEBUG_FRAME_STUFF") != NULL)
     {
       printf("nmsave_args: %d\n", frame->nmsave_args);
@@ -12044,7 +12044,6 @@ ix86_compute_frame_layout (void)
       printf("sse_reg_save_offset: %llx\n", frame->sse_reg_save_offset);

     }
-#endif
 }

 /* This is semi-inlined memory_address_length, but simplified
diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
index 7befb25b437..cce35b37b06 100644
--- a/gcc/config/sol2.h
+++ b/gcc/config/sol2.h
@@ -195,10 +195,14 @@ along with GCC; see the file COPYING3.  If not see
    first in ld.so.1's search path), we only link the values-*.o files into
    executable programs.  */
 #undef STARTFILE_ARCH_SPEC
-#define STARTFILE_ARCH_SPEC \
-  "%{!shared:%{!symbolic: \
-     %{ansi|std=c*|std=iso9899\\:199409:values-Xc.o%s; :values-Xa.o%s} \
-     %{std=c90|std=gnu90:values-xpg4.o%s; :values-xpg6.o%s}}}"
+#define STARTFILE_ARCH_SPEC "%{std=c1x|std=gnu1x:values-Xc.o%s values-xpg6.o%s; \
+                              std=c11|std=gnu11:values-Xc.o%s values-xpg6.o%s; \
+                              std=c99|std=gnu99:values-Xc.o%s values-xpg6.o%s; \
+                              std=c9x|std=gnu9x:values-Xc.o%s values-xpg6.o%s; \
+                              std=c++0x|std=gnu++0x:values-Xc.o%s; \
+                              std=c++11|std=gnu++11:values-Xc.o%s; \
+                              std=c++03|std=gnu++03:values-Xc.o%s; \
+                              :values-Xa.o%s}"

 #if defined(HAVE_LD_PIE) && defined(HAVE_SOLARIS_CRTS)
 #define STARTFILE_CRTBEGIN_SPEC "%{static:crtbegin.o%s; \
@@ -268,8 +272,8 @@ along with GCC; see the file COPYING3.  If not see
   "%{G:-G} \
    %{YP,*} \
    %{R*} \
-   %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp%R/lib:%R/usr/lib} \
-          %{!p:%{!pg:-Y P,%R/lib:%R/usr/lib}}}"
+   %{!YP,*:%{p|pg:-Y P,%R/usr/gcc/8/lib:%R/lib:%R/usr/lib -R %R/usr/gcc/8/lib -L %R/usr/gcc/8/lib} \
+          %{!p:%{!pg:-Y P,%R/usr/gcc/8/lib:%R/lib:%R/usr/lib -R %R/usr/gcc/8/lib -L %R/usr/gcc/8/lib}}}"

 #undef LINK_ARCH32_SPEC
 #define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE
@@ -281,8 +285,8 @@ along with GCC; see the file COPYING3.  If not see
   "%{G:-G} \
    %{YP,*} \
    %{R*} \
-   %{!YP,*:%{p|pg:-Y P,%R/usr/lib/libp/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "}        \
-          %{!p:%{!pg:-Y P,%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR "}}}"
+   %{!YP,*:%{p|pg:-Y P,%R/usr/gcc/8/lib/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR " -R %R/usr/gcc/8/lib/" ARCH64_SUBDIR " -L %R/usr/gcc/8/lib/" ARCH64_SUBDIR "}   \
+          %{!p:%{!pg:-Y P,%R/usr/gcc/8/lib/" ARCH64_SUBDIR ":%R/lib/" ARCH64_SUBDIR ":%R/usr/lib/" ARCH64_SUBDIR " -R %R/usr/gcc/8/lib/" ARCH64_SUBDIR " -L %R/usr/gcc/8/lib/" ARCH64_SUBDIR "}}}"

 #undef LINK_ARCH64_SPEC
 #ifndef USE_GLD
diff --git a/gcc/configure b/gcc/configure
index b8f515b6f3a..1ba738fe4b0 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -22808,8 +22808,8 @@ if test $in_tree_ld != yes ; then
        # linker is configured.
        ld_ver=`$gcc_cv_ld -V 2>&1`
        if echo "$ld_ver" | $EGREP 'Solaris Link Editors|Solaris ELF Utilities' > /dev/null; then
-         ld_vers=`echo $ld_ver | /bin/sed -n \
-           -E 's,^.*: (5|1[0-9])\.[0-9][0-9]*-([0-9]\.[0-9][0-9]*).*$,\2,p'`
+         ld_vers=`echo $ld_ver | gsed -n \
+           -e 's,^.*: \(5\|1[0-9]\)\.[0-9][0-9]*-\([0-9]\.[0-9][0-9]*\).*$,\2,p'`
          ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
          ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
          ld_vers_isillumos=`echo "$ld_ver" | grep '(illumos)'`
@@ -24008,6 +24008,7 @@ $as_echo "#define TLS_SECTION_ASM_FLAG 't'" >>confdefs.h
     fi
     case "$target" in
       i[34567]86-*-*)
+       tls_as_opt="$tls_as_opt --32"
        conftest_s="$conftest_s
 foo:   .long   25
        .text
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 5ce3ad18ecb..31b990c26ad 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2604,8 +2604,8 @@ if test $in_tree_ld != yes ; then
        # linker is configured.
        ld_ver=`$gcc_cv_ld -V 2>&1`
        if echo "$ld_ver" | $EGREP 'Solaris Link Editors|Solaris ELF Utilities' > /dev/null; then
-         ld_vers=`echo $ld_ver | /bin/sed -n \
-           -E 's,^.*: (5|1[0-9])\.[0-9][0-9]*-([0-9]\.[0-9][0-9]*).*$,\2,p'`
+         ld_vers=`echo $ld_ver | gsed -n \
+           -e 's,^.*: \(5\|1[0-9]\)\.[0-9][0-9]*-\([0-9]\.[0-9][0-9]*\).*$,\2,p'`
          ld_vers_major=`expr "$ld_vers" : '\([0-9]*\)'`
          ld_vers_minor=`expr "$ld_vers" : '[0-9]*\.\([0-9]*\)'`
          ld_vers_isillumos=`echo "$ld_ver" | grep '(illumos)'`
@@ -3247,6 +3247,7 @@ changequote(,)dnl
     fi
     case "$target" in
       i[34567]86-*-*)
+       tls_as_opt="$tls_as_opt --32"
        conftest_s="$conftest_s
 foo:   .long   25
        .text
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 280efce9461..2d741c73f7c 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -5195,6 +5195,12 @@ with multiple statement cases using flow-sensitive points-to information.
 Only warns when the converted pointer is dereferenced.
 Does not warn about incomplete types.

+@item -fstrict-calling-conventions
+@opindex fstrict-calling-conventions
+Use strict ABI calling conventions even with local functions.
+This disable certain optimizations that may cause GCC to call local
+functions in a manner other than that described by the ABI.
+
 @item -Wstrict-overflow
 @itemx -Wstrict-overflow=@var{n}
 @opindex Wstrict-overflow
@@ -9214,12 +9220,6 @@ int f() @{
 The @option{-fstrict-aliasing} option is enabled at levels
 @option{-O2}, @option{-O3}, @option{-Os}.

-@item -fstrict-calling-conventions
-@opindex fstrict-calling-conventions
-Use strict ABI calling conventions even with local functions.
-This disable certain optimizations that may cause GCC to call local
-functions in a manner other than that described by the ABI.
-
 @item -falign-functions
 @itemx -falign-functions=@var{n}
 @opindex falign-functions
diff --git a/gcc/gcc-ar.c b/gcc/gcc-ar.c
index 83a9e34b7af..35f4186cfc5 100644
--- a/gcc/gcc-ar.c
+++ b/gcc/gcc-ar.c
@@ -187,12 +187,12 @@ main (int ac, char **av)
     }

   /* Find the wrapped binutils program.  */
-  exe_name = find_a_file (&target_path, PERSONALITY, X_OK);
+  exe_name = find_a_file (&target_path, "g" PERSONALITY, X_OK);
   if (!exe_name)
     {
-      const char *real_exe_name = PERSONALITY;
+      const char *real_exe_name = "g" PERSONALITY;
 #ifdef CROSS_DIRECTORY_STRUCTURE
-      real_exe_name = concat (target_machine, "-", PERSONALITY, NULL);
+      real_exe_name = concat (target_machine, "-", "g" PERSONALITY, NULL);
 #endif
       exe_name = find_a_file (&path, real_exe_name, X_OK);
       if (!exe_name)
diff --git a/gcc/opts.c b/gcc/opts.c
index b3e235e0843..442f250f3af 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -476,7 +476,7 @@ static const struct default_options default_options_table[] =
     { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_ftree_pta, NULL, 1 },
     { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fssa_phiopt, NULL, 1 },
     { OPT_LEVELS_1_PLUS, OPT_ftree_builtin_call_dce, NULL, 1 },
-    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 0 },
+    { OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },

     /* -O2 optimizations.  */
     { OPT_LEVELS_2_PLUS, OPT_finline_small_functions, NULL, 1 },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment