Patchwork [09/25] Specs cleanup: CRIS

login
register
mail settings
Submitter Joseph S. Myers
Date Jan. 14, 2011, 12:08 a.m.
Message ID <Pine.LNX.4.64.1101140007520.6059@digraph.polyomino.org.uk>
Download mbox | patch
Permalink /patch/78836/
State New
Headers show

Comments

Joseph S. Myers - Jan. 14, 2011, 12:08 a.m.
This patch fixes some issues with the specs for CRIS targets.

* Various specs checked for a -cpu option that should have been
  -mcpu.  (These could probably be simplified further by making -mcpu=
  a .opt alias for -march=, after which specs wouldn't need to check
  for it at all, but I'm not doing that in this patch series.)

* cris/linux.h had specs passing -rpath-link options in some cases
  (-B, or not -nostdlib).  This is not needed for any properly
  configured cross toolchain (for GNU/Linux targets, that means using
  a sysroot).  And if it were appropriate, it should be done for all
  GNU/Linux targets since there is nothing meaningfully CRIS-specific
  about it.

* cris/link.h had a spec %{shlib:-Bdynamic} - that is, defining a
  -shlib option to mean that -Bdynamic is passed to the linker.
  Again, this is not logically CRIS-specific; if there were a need for
  such an option rather than -Wl,-Bdynamic (and -Bstatic and -Bdynamic
  are generally passed in pairs) it should be for all GNU/Linux
  targets.  This undocumented option is removed in this patch.

OK to commit?

2011-01-13  Joseph Myers  <joseph@codesourcery.com>

	* config/cris/cris.h (ASM_SPEC, CRIS_ASM_SUBTARGET_SPEC): Check
	for mcpu not cpu.
	* config/cris/linux.h (CRIS_CPP_SUBTARGET_SPEC,
	CRIS_CC1_SUBTARGET_SPEC, CRIS_ASM_SUBTARGET_SPEC): Check for mcpu
	not cpu.
	(CRIS_LINK_SUBTARGET_SPEC): Don't generate -rpath-link options.
	Don't handle -shlib.

Patch

diff -rupN --exclude=.svn gcc-mainline-8/gcc/config/cris/cris.h gcc-mainline/gcc/config/cris/cris.h
--- gcc-mainline-8/gcc/config/cris/cris.h	2010-12-20 12:57:45.000000000 -0800
+++ gcc-mainline/gcc/config/cris/cris.h	2011-01-12 14:16:34.000000000 -0800
@@ -193,12 +193,12 @@  extern int cris_cpu_version;
 #define ASM_SPEC \
  MAYBE_AS_NO_MUL_BUG_ABORT \
  "%(asm_subtarget)\
- %{march=*:%{cpu=*:%edo not specify both -march=... and -mcpu=...}}\
+ %{march=*:%{mcpu=*:%edo not specify both -march=... and -mcpu=...}}\
  %{march=v32:--march=v32} %{mcpu=v32:--march=v32}"
 
 /* For the cris-*-elf subtarget.  */
 #define CRIS_ASM_SUBTARGET_SPEC \
- "--em=criself %{!march=*:%{!cpu=*:" CRIS_DEFAULT_ASM_ARCH_OPTION "}}"
+ "--em=criself %{!march=*:%{!mcpu=*:" CRIS_DEFAULT_ASM_ARCH_OPTION "}}"
 
 /* FIXME: We should propagate the -melf option to make the criself
    "emulation" unless a linker script is provided (-T*), but I don't know
diff -rupN --exclude=.svn gcc-mainline-8/gcc/config/cris/linux.h gcc-mainline/gcc/config/cris/linux.h
--- gcc-mainline-8/gcc/config/cris/linux.h	2010-12-09 09:41:27.000000000 -0800
+++ gcc-mainline/gcc/config/cris/linux.h	2011-01-12 14:17:47.000000000 -0800
@@ -56,21 +56,21 @@  along with GCC; see the file COPYING3.  
 #if TARGET_CPU_DEFAULT == 32
 # define CRIS_CPP_SUBTARGET_SPEC \
   "%{pthread:-D_REENTRANT}\
-   %{!march=*:%{!cpu=*:-D__arch_v32 -D__CRIS_arch_version=32}}"
+   %{!march=*:%{!mcpu=*:-D__arch_v32 -D__CRIS_arch_version=32}}"
 #else
 # define CRIS_CPP_SUBTARGET_SPEC \
   "%{pthread:-D_REENTRANT}\
-   %{!march=*:%{!cpu=*:-D__arch_v10 -D__CRIS_arch_version=10}}"
+   %{!march=*:%{!mcpu=*:-D__arch_v10 -D__CRIS_arch_version=10}}"
 #endif
 
 #undef CRIS_CC1_SUBTARGET_SPEC
 #if TARGET_CPU_DEFAULT == 32
 # define CRIS_CC1_SUBTARGET_SPEC \
- "%{!march=*:%{!cpu=*:-march=v32}}"
+ "%{!march=*:%{!mcpu=*:-march=v32}}"
 #define CRIS_SUBTARGET_DEFAULT_ARCH MASK_AVOID_GOTPLT
 #else
 # define CRIS_CC1_SUBTARGET_SPEC \
- "%{!march=*:%{!cpu=*:-march=v10}}"
+ "%{!march=*:%{!mcpu=*:-march=v10}}"
 #define CRIS_SUBTARGET_DEFAULT_ARCH 0
 #endif
 
@@ -78,13 +78,13 @@  along with GCC; see the file COPYING3.  
 #if TARGET_CPU_DEFAULT == 32
 # define CRIS_ASM_SUBTARGET_SPEC \
  "--em=criself \
-  %{!march=*:%{!cpu=*:--march=v32}} \
+  %{!march=*:%{!mcpu=*:--march=v32}} \
   %{!fleading-underscore:--no-underscore}\
   %{fPIC|fpic|fPIE|fpie: --pic}"
 #else
 # define CRIS_ASM_SUBTARGET_SPEC \
  "--em=criself \
-  %{!march=*:%{!cpu=*:--march=v10}} \
+  %{!march=*:%{!mcpu=*:--march=v10}} \
   %{!fleading-underscore:--no-underscore}\
   %{fPIC|fpic|fPIE|fpie: --pic}"
 #endif
@@ -105,15 +105,11 @@  along with GCC; see the file COPYING3.  
 
 #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
 
-/* We need an -rpath-link to ld.so.1, and presumably to each directory
-   specified with -B.  */
 #undef CRIS_LINK_SUBTARGET_SPEC
 #define CRIS_LINK_SUBTARGET_SPEC \
  "-mcrislinux\
-  %{B*:-rpath-link %*}\
-  %{!nostdlib:-rpath-link ../sys-include/asm/../../lib%s}\
   %{shared} %{static}\
-  %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
+  %{symbolic:-Bdynamic} %{static:-Bstatic}\
   %{!shared:%{!static:\
               %{rdynamic:-export-dynamic}\
               -dynamic-linker " LINUX_DYNAMIC_LINKER "}}\