This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Make -mno-shared the default for MIPS GNU/Linux


In:

    http://gcc.gnu.org/ml/gcc-patches/2006-03/msg01346.html

one the changes I promised (threatened?) for 4.3 was to make -mno-shared
the default for MIPS GNU/Linux if gcc is configured to use a version of
binutils that supports -mno-shared.  See the link above for the rationale.

The patch below does this.  Regression tested on mips64-linux-gnu
(all three ABIs).  I also built a new cross sysroot with this patch,
and it was that sysroot I used for the gcc regression tests.  Everything
seemed to go well.  Applied to trunk.

If you find any fallout from this patch, please do let me know.

Richard


gcc/
	* configure.ac (HAVE_AS_NO_SHARED): New AC_DEFINE.  Test for the
	-mno-shared assembler option on mips targets.
	* configure, config.in: Regenerate.
	* config/mips/linux.h (NO_SHARED_SPECS): New macro.
	(DRIVER_SELF_SPECS): Define to NO_SHARED_SPECS if non-empty.
	* config/mips/linux64.h (DRIVER_SELF_SPECS): Include NO_SHARED_SPECS.

Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac	(revision 118136)
+++ gcc/configure.ac	(working copy)
@@ -2952,6 +2952,10 @@ LCF0:
        then target_cpu_default=MASK_EXPLICIT_RELOCS
        else target_cpu_default="($target_cpu_default)|MASK_EXPLICIT_RELOCS"
        fi])
+    gcc_GAS_CHECK_FEATURE([-mno-shared support],
+      gcc_cv_as_mips_no_shared, [2,16,0], [-mno-shared], [nop],,
+      [AC_DEFINE(HAVE_AS_NO_SHARED, 1,
+		 [Define if the assembler understands -mno-shared.])])
     ;;
 esac
 
Index: gcc/config/mips/linux.h
===================================================================
--- gcc/config/mips/linux.h	(revision 118136)
+++ gcc/config/mips/linux.h	(working copy)
@@ -179,3 +179,12 @@ #define LIB_SPEC "\
   %{profile:-lc_p} %{!profile: -lc}}"
 
 #define MD_UNWIND_SUPPORT "config/mips/linux-unwind.h"
+
+#ifdef HAVE_AS_NO_SHARED
+/* Default to -mno-shared for non-PIC.  */
+#define NO_SHARED_SPECS \
+  "%{mshared|mno-shared|fpic|fPIC|fpie|fPIE:;:-mno-shared}",
+#define DRIVER_SELF_SPECS NO_SHARED_SPECS
+#else
+#define NO_SHARED_SPECS
+#endif
Index: gcc/config/mips/linux64.h
===================================================================
--- gcc/config/mips/linux64.h	(revision 118136)
+++ gcc/config/mips/linux64.h	(working copy)
@@ -21,7 +21,9 @@ the Free Software Foundation; either ver
 
 /* Force the default endianness and ABI flags onto the command line
    in order to make the other specs easier to write.  */
+#undef DRIVER_SELF_SPECS
 #define DRIVER_SELF_SPECS \
+NO_SHARED_SPECS \
 "%{!EB:%{!EL:%(endian_spec)}}", \
 "%{!mabi=*: -mabi=n32}"
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]