diff mbox

Split parts of linux.h into gnu-user.h

Message ID Pine.LNX.4.64.1012312109210.17738@digraph.polyomino.org.uk
State New
Headers show

Commit Message

Joseph Myers Dec. 31, 2010, 9:11 p.m. UTC
This patch begins the process of fixing the problem that
config/linux.h mixes things relevant to systems with the Linux kernel
and things relevant to systems with GNU userspace (and because of the
latter is used by various configs not using the Linux kernel at all)
by splitting the GNU userspace parts into a separate header
gnu-user.h.

Four LINUX_* macros moved to the new header are renamed to GNU_USER_*,
but apart from that no changes are made in this patch to which macro
definitions are used for which target; every configuration using
linux.h, and only those configurations, now uses gnu-user.h as well.

Subsequent patches are intended to stop non-Linux targets from using
linux.h, adding any macros required from there to one of gnu.h,
knetbsd-gnu.h, kfreebsd-gnu.h and kopensolaris-gnu.h as applicable
(taking care to make sure not to break things for those targets that
currently use gnu.h but not linux.h; the other headers are only used
in conjunction with linux.h at present), to make similar fixes for
<arch>/linux.h headers used by non-Linux targets, and to rename
LINUX_TARGET_OS_CPP_BUILTINS to GNU_USER_TARGET_OS_CPP_BUILTINS since
a LINUX_* macro clearly should not be defined in gnu.h, knetbsd-gnu.h,
kfreebsd-gnu.h and kopensolaris-gnu.h as it is at present.

I'll also look at the other anomalies in this area: Linux kernel
targets not using linux.h (alpha*-*-linux* arm*-*-uclinux*
m68k-*-uclinuxoldabi* powerpc-*-linux* powerpc64-*-linux*), GNU
userspace targets not using gnu-user.h (after this patch, the targets
mentioned as not using linux.h, plus alpha*-*-gnu* powerpc64-*-gnu*
powerpc-*-gnu-gnualtivec* powerpc-*-gnu*).  Some of these may however
be hard to fix (powerpc*-* targets have their own system for selecting
specs based on -mcall-* options; this does not form a useful part of
any likely design for a multi-target compiler, is not sufficient for
reliably building code with a wrong-target compiler, and really should
be removed to make those targets more like other targets rather than
being different in ways that complicate many-target changes).

(Given that Stage 3 is ending very soon the patch series isn't likely
to be finished until 4.7.)

Bootstrapped with no regressions on x86_64-unknown-linux-gnu.  Also
tested building cc1 and xgcc for crosses to: arm-linux-gnueabi
bfin-uclinux bfin-linux-uclibc cris-linux-gnu frv-linux-gnu
moxie-uclinux hppa64-linux-gnu hppa-linux-gnu i686-linux-gnu
i686-kfreebsd-gnu i686-knetbsd-gnu i686-kopensolaris-gnu
x86_64-kfreebsd-gnu x86_64-knetbsd-gnu ia64-linux-gnu lm32-uclinux
m32r-linux-gnu m32rle-linux-gnu m68k-uclinux m68k-linux-gnu
microblaze-linux-gnu mips64-linux-gnu mips-linux-gnu s390-linux-gnu
s390x-linux-gnu sh-linux-gnu sparc-linux-gnu sparc64-linux-gnu
vax-linux-gnu xtensa-linux-gnu am33_2.0-linux-gnu.  OK to commit?

2010-12-31  Joseph Myers  <joseph@codesourcery.com>

	* config.gcc (arm*-*-linux*, bfin*-uclinux*, bfin*-linux-uclibc*,
	crisv32-*-linux* | cris-*-linux*, frv-*-*linux*, moxie-*-uclinux*,
	hppa*64*-*-linux*, hppa*-*-linux*, i[34567]86-*-linux* |
	i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu |
	i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu,
	x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu,
	ia64*-*-linux*, lm32-*-uclinux*, m32r-*-linux*, m32rle-*-linux*,
	m68k-*-uclinux*, m68k-*-linux*, microblaze*-linux*,
	mips64*-*-linux* | mipsisa64*-*-linux*, mips*-*-linux*,
	s390-*-linux*, s390x-*-linux*, sh*-*-linux*, sparc-*-linux*,
	sparc64-*-linux*, vax-*-linux*, xtensa*-*-linux*,
	am33_2.0-*-linux*): Use gnu-user.h before linux.h.
	* config/gnu-user.h: New.  Copied from linux.h.
	(LINUX_TARGET_STARTFILE_SPEC): Rename to
	GNU_USER_TARGET_STARTFILE_SPEC.
	(LINUX_TARGET_ENDFILE_SPEC): Rename to
	GNU_USER_TARGET_ENDFILE_SPEC.
	(LINUX_TARGET_CC1_SPEC): Rename to GNU_USER_TARGET_CC1_SPEC.
	(LINUX_TARGET_LIB_SPEC): Rename to GNU_USER_TARGET_LIB_SPEC.
	(OPTION_GLIBC, OPTION_UCLIBC, OPTION_BIONIC,
	LINUX_TARGET_OS_CPP_BUILTINS, CHOOSE_DYNAMIC_LINKER1,
	CHOOSE_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER,
	UCLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER64,
	BIONIC_DYNAMIC_LINKER, BIONIC_DYNAMIC_LINKER32,
	BIONIC_DYNAMIC_LINKER64, LINUX_DYNAMIC_LINKER,
	LINUX_DYNAMIC_LINKER32, LINUX_DYNAMIC_LINKER64,
	TARGET_C99_FUNCTIONS, TARGET_HAS_SINCOS): Remove.
	* config/arm/linux-eabi.h (CC1_SPEC): Use
	GNU_USER_TARGET_CC1_SPEC.
	(LIB_SPEC): Use GNU_USER_TARGET_LIB_SPEC.
	(STARTFILE_SPEC): Use GNU_USER_TARGET_STARTFILE_SPEC.
	(ENDFILE_SPEC): Use GNU_USER_TARGET_ENDFILE_SPEC
	* config/linux.h (NO_IMPLICIT_EXTERN_C, ASM_APP_ON, ASM_APP_OFF,
	LINUX_TARGET_STARTFILE_SPEC, STARTFILE_SPEC,
	LINUX_TARGET_ENDFILE_SPEC, ENDFILE_SPEC, LINUX_TARGET_CC1_SPEC,
	CC1_SPEC, CPLUSPLUS_CPP_SPEC, LINUX_TARGET_LIB_SPEC, LIB_SPEC,
	LINK_EH_SPEC, LINK_GCC_C_SEQUENCE_SPEC, USE_LD_AS_NEEDED): Remove.

Comments

Andreas Schwab Dec. 31, 2010, 9:51 p.m. UTC | #1
"Joseph S. Myers" <joseph@codesourcery.com> writes:

> Index: gcc/config/gnu-user.h
> ===================================================================
> --- gcc/config/gnu-user.h	(revision 168378)
> +++ gcc/config/gnu-user.h	(working copy)

> @@ -34,72 +36,50 @@ see the files COPYING3 and COPYING.RUNTI
>  #undef ASM_APP_OFF
>  #define ASM_APP_OFF "#NO_APP\n"
>  
> -/* Provide a STARTFILE_SPEC appropriate for GNU/Linux.  Here we add
> -   the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
> +/* Provide a STARTFILE_SPEC appropriate for GNU userspace.  Here we add
> +   the GNU userpsace magical crtbegin.o file (see crtstuff.c) which

s/userpsace/userspace/

Andreas.
Joseph Myers Jan. 6, 2011, 12:13 a.m. UTC | #2
Ping.  This patch 
<http://gcc.gnu.org/ml/gcc-patches/2010-12/msg02055.html> (with typo fix 
as noted in <http://gcc.gnu.org/ml/gcc-patches/2010-12/msg02056.html>) is 
pending review.
Joseph Myers Jan. 12, 2011, 12:44 p.m. UTC | #3
Ping^2.  This patch 
<http://gcc.gnu.org/ml/gcc-patches/2010-12/msg02055.html> (with typo fix 
as noted in <http://gcc.gnu.org/ml/gcc-patches/2010-12/msg02056.html>) is 
pending review.
Richard Biener Jan. 12, 2011, 1:25 p.m. UTC | #4
On Wed, Jan 12, 2011 at 1:44 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> Ping^2.  This patch
> <http://gcc.gnu.org/ml/gcc-patches/2010-12/msg02055.html> (with typo fix
> as noted in <http://gcc.gnu.org/ml/gcc-patches/2010-12/msg02056.html>) is
> pending review.

Ok.

Thanks,
Richard.

> --
> Joseph S. Myers
> joseph@codesourcery.com
>
Thomas Schwinge Feb. 6, 2011, 4:49 p.m. UTC | #5
Hallo!

On Fri, Dec 31, 2010 at 09:11:42PM +0000, Joseph S. Myers wrote:
> This patch begins the process of fixing the problem that
> config/linux.h mixes things relevant to systems with the Linux kernel
> and things relevant to systems with GNU userspace (and because of the
> latter is used by various configs not using the Linux kernel at all)
> by splitting the GNU userspace parts into a separate header
> gnu-user.h.
> 
> Four LINUX_* macros moved to the new header are renamed to GNU_USER_*,
> but apart from that no changes are made in this patch to which macro
> definitions are used for which target; every configuration using
> linux.h, and only those configurations, now uses gnu-user.h as well.
> 
> Subsequent patches are intended to stop non-Linux targets from using
> linux.h, adding any macros required from there to one of gnu.h,
> knetbsd-gnu.h, kfreebsd-gnu.h and kopensolaris-gnu.h as applicable
> (taking care to make sure not to break things for those targets that
> currently use gnu.h but not linux.h; the other headers are only used
> in conjunction with linux.h at present), to make similar fixes for
> <arch>/linux.h headers used by non-Linux targets, and to rename
> LINUX_TARGET_OS_CPP_BUILTINS to GNU_USER_TARGET_OS_CPP_BUILTINS since
> a LINUX_* macro clearly should not be defined in gnu.h, knetbsd-gnu.h,
> kfreebsd-gnu.h and kopensolaris-gnu.h as it is at present.

Thanks for this; I fully support this effort with my GNU/Hurd hat on.
Always feel free to CC me if you want something tested on / for GNU/Hurd,
or want me to comment -- I currently can't read gcc-patches regularely.


> I'll also look at the other anomalies in this area: Linux kernel
> targets not using linux.h (alpha*-*-linux* arm*-*-uclinux*
> m68k-*-uclinuxoldabi* powerpc-*-linux* powerpc64-*-linux*), GNU
> userspace targets not using gnu-user.h (after this patch, the targets
> mentioned as not using linux.h, plus alpha*-*-gnu* powerpc64-*-gnu*
> powerpc-*-gnu-gnualtivec* powerpc-*-gnu*).

If it simplifies life for you, we can quickly remove any GNU/Hurd
configurations apart from x86 -- these aren't usable, aren't maintained,
and will need substantial work before ever being usable.  (Thus, their
GCC support can later be re-introduced by people working on that.)


I'm about to leave right now, but will look at your ``Add GNU -bsd option
from specs to new gnu.opt'' email / patch later today.


Grüße,
 Thomas
Joseph Myers Feb. 6, 2011, 7:20 p.m. UTC | #6
On Sun, 6 Feb 2011, Thomas Schwinge wrote:

> If it simplifies life for you, we can quickly remove any GNU/Hurd
> configurations apart from x86 -- these aren't usable, aren't maintained,
> and will need substantial work before ever being usable.  (Thus, their
> GCC support can later be re-introduced by people working on that.)

If these targets aren't usable, I can add them to the deprecation list in 
<http://gcc.gnu.org/ml/gcc/2011-01/msg00391.html> when I prepare the 
deprecation patch for 4.6.
Thomas Schwinge Feb. 6, 2011, 10:12 p.m. UTC | #7
Hallo!

On Sun, 6 Feb 2011 19:20:56 +0000 (UTC), "Joseph S. Myers" <joseph@codesourcery.com> wrote:
> On Sun, 6 Feb 2011, Thomas Schwinge wrote:
> > If it simplifies life for you, we can quickly remove any GNU/Hurd
> > configurations apart from x86 -- these aren't usable, aren't maintained,
> > and will need substantial work before ever being usable.  (Thus, their
> > GCC support can later be re-introduced by people working on that.)
> 
> If these targets aren't usable, I can add them to the deprecation list in 
> <http://gcc.gnu.org/ml/gcc/2011-01/msg00391.html> when I prepare the 
> deprecation patch for 4.6.

Yes, please do so -- but I would have removed them right away (to save
you / us the effort of formally deprecating them first, etc., etc.).
Nobody is using anything but x86 on the GNU/Hurd side.


Grüße,
 Thomas
diff mbox

Patch

Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc	(revision 168380)
+++ gcc/config.gcc	(working copy)
@@ -788,7 +788,7 @@  arm*-*-netbsd*)
 	use_collect2=yes
 	;;
 arm*-*-linux*)			# ARM GNU/Linux with ELF
-	tm_file="dbxelf.h elfos.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
+	tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
 	case $target in
 	arm*b-*)
 		tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
@@ -909,12 +909,12 @@  bfin*-elf*)
 	use_collect2=no
 	;;
 bfin*-uclinux*)
-	tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h linux.h glibc-stdint.h bfin/uclinux.h"
+	tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h gnu-user.h linux.h glibc-stdint.h bfin/uclinux.h"
 	tmake_file=bfin/t-bfin-uclinux
 	use_collect2=no
 	;;
 bfin*-linux-uclibc*)
-	tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h linux.h glibc-stdint.h bfin/linux.h ./linux-sysroot-suffix.h"
+	tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h gnu-user.h linux.h glibc-stdint.h bfin/linux.h ./linux-sysroot-suffix.h"
 	tmake_file="t-slibgcc-elf-ver bfin/t-bfin-linux"
 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
 	use_collect2=no
@@ -945,7 +945,7 @@  cris-*-elf | cris-*-none)
 	use_gcc_stdint=wrap
 	;;
 crisv32-*-linux* | cris-*-linux*)
-	tm_file="dbxelf.h elfos.h ${tm_file} linux.h glibc-stdint.h cris/linux.h"
+	tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h cris/linux.h"
 	# We need to avoid using t-linux, so override default tmake_file
 	tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux"
 	extra_options="${extra_options} cris/linux.opt"
@@ -975,7 +975,7 @@  frv-*-elf)
 	;;
 frv-*-*linux*)
 	tm_file="dbxelf.h elfos.h ${tm_file} \
-	         linux.h glibc-stdint.h frv/linux.h"
+	         gnu-user.h linux.h glibc-stdint.h frv/linux.h"
 	tm_file="${tm_file} ../../libgcc/config/frv/frv-abi.h"
 	tmake_file="${tmake_file} frv/t-frv frv/t-linux"
 	;;
@@ -989,7 +989,7 @@  moxie-*-elf)
 moxie-*-uclinux*)
 	gas=yes
 	gnu_ld=yes
-	tm_file="dbxelf.h elfos.h ${tm_file} linux.h glibc-stdint.h moxie/uclinux.h"
+	tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h moxie/uclinux.h"
 	extra_parts="crti.o crtn.o crtbegin.o crtend.o"
 	tmake_file="${tmake_file} moxie/t-moxie moxie/t-moxie-softfp soft-fp/t-softfp"
 	;;
@@ -1007,7 +1007,7 @@  h8300-*-elf*)
 	;;
 hppa*64*-*-linux*)
 	target_cpu_default="MASK_PA_11|MASK_PA_20"
-	tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h linux.h \
+	tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h gnu-user.h linux.h \
 		 glibc-stdint.h pa/pa-linux.h pa/pa64-regs.h pa/pa-64.h \
 		 pa/pa64-linux.h"
 	tmake_file="${tmake_file} pa/t-linux64"
@@ -1016,7 +1016,7 @@  hppa*64*-*-linux*)
 	;;
 hppa*-*-linux*)
 	target_cpu_default="MASK_PA_11|MASK_NO_SPACE_REGS"
-	tm_file="${tm_file} dbxelf.h elfos.h linux.h glibc-stdint.h pa/pa-linux.h \
+	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h pa/pa-linux.h \
 		 pa/pa32-regs.h pa/pa32-linux.h"
 	tmake_file="${tmake_file} pa/t-linux t-slibgcc-libgcc"
 	# Set the libgcc version number
@@ -1224,7 +1224,7 @@  i[34567]86-*-openbsd*)
 i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
 			# Intel 80386's running GNU/*
 			# with ELF format using glibc 2
-	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h linux.h glibc-stdint.h"
+	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h"
 	case ${target} in
 	i[34567]86-*-linux*)
 		# Assume modern glibc
@@ -1261,7 +1261,7 @@  i[34567]86-*-linux* | i[34567]86-*-kfree
 	tmake_file="${tmake_file} i386/t-crtstuff i386/t-crtpc i386/t-crtfm t-dfprules"
 	;;
 x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
-	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h linux.h glibc-stdint.h \
+	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h \
 		 i386/x86-64.h i386/linux64.h"
 	case ${target} in
 	x86_64-*-linux*)
@@ -1559,7 +1559,7 @@  ia64*-*-freebsd*)
 	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
 	;;
 ia64*-*-linux*)
-	tm_file="${tm_file} dbxelf.h elfos.h linux.h glibc-stdint.h ia64/sysv4.h ia64/linux.h"
+	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ia64/sysv4.h ia64/linux.h"
 	tmake_file="${tmake_file} ia64/t-ia64 t-libunwind ia64/t-glibc"
 	if test x$with_system_libunwind != xyes ; then
 		tmake_file="${tmake_file} t-libunwind-elf ia64/t-glibc-libunwind"
@@ -1613,7 +1613,7 @@  lm32-*-rtems*)
 	tmake_file="${tmake_file} t-rtems"
          ;;
 lm32-*-uclinux*)
-        tm_file="dbxelf.h elfos.h ${tm_file} linux.h lm32/uclinux-elf.h"
+        tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h lm32/uclinux-elf.h"
 	tmake_file="${tmake_file} lm32/t-lm32 lm32/t-fprules-softfp soft-fp/t-softfp"
         ;;
 m32r-*-elf*)
@@ -1630,7 +1630,7 @@  m32r-*-rtems*)
 	extra_parts="crtinit.o crtfini.o"
  	;;
 m32r-*-linux*)
-	tm_file="dbxelf.h elfos.h linux.h glibc-stdint.h ${tm_file} m32r/linux.h"
+	tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} m32r/linux.h"
 	# We override the tmake_file for linux -- why?
 	tmake_file="t-slibgcc-elf-ver m32r/t-linux"
 	gnu_ld=yes
@@ -1639,7 +1639,7 @@  m32r-*-linux*)
 	fi
  	;;
 m32rle-*-linux*)
-	tm_file="dbxelf.h elfos.h linux.h glibc-stdint.h m32r/little.h ${tm_file} m32r/linux.h"
+	tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h m32r/little.h ${tm_file} m32r/linux.h"
 	# We override the tmake_file for linux -- why?
 	tmake_file="t-slibgcc-elf-ver m32r/t-linux"
 	gnu_ld=yes
@@ -1729,7 +1729,7 @@  m68k-*-uclinux*)		# Motorola m68k/ColdFi
 				# ABI.
 	default_m68k_cpu=68020
 	default_cf_cpu=5206
-	tm_file="${tm_file} dbxelf.h elfos.h linux.h glibc-stdint.h flat.h m68k/linux.h m68k/uclinux.h ./sysroot-suffix.h"
+	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h flat.h m68k/linux.h m68k/uclinux.h ./sysroot-suffix.h"
  	tm_defines="${tm_defines} MOTOROLA=1"
 	tmake_file="m68k/t-floatlib m68k/t-uclinux m68k/t-mlibs"
 	;;
@@ -1739,7 +1739,7 @@  m68k-*-linux*)		# Motorola m68k's runnin
 	default_m68k_cpu=68020
 	default_cf_cpu=5475
 	with_arch=${with_arch:-m68k}
-	tm_file="${tm_file} dbxelf.h elfos.h linux.h glibc-stdint.h m68k/linux.h ./sysroot-suffix.h"
+	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h m68k/linux.h ./sysroot-suffix.h"
 	extra_options="${extra_options} m68k/ieee.opt"
 	tm_defines="${tm_defines} MOTOROLA=1"
 	tmake_file="${tmake_file} m68k/t-floatlib m68k/t-linux m68k/t-mlibs"
@@ -1781,7 +1781,7 @@  mep-*-*)
 	use_gcc_stdint=wrap
 	;;
 microblaze*-linux*)
-	tm_file="${tm_file} dbxelf.h linux.h microblaze/linux.h"
+	tm_file="${tm_file} dbxelf.h gnu-user.h linux.h microblaze/linux.h"
 	c_target_objs="${c_target_objs} microblaze-c.o"
 	cxx_target_objs="${cxx_target_objs} microblaze-c.o"
 	tmake_file="${tmake_file} t-slibgcc-elf-ver t-slibgcc-nolc-override t-linux microblaze/t-microblaze"
@@ -1819,7 +1819,7 @@  mips*-*-netbsd*)			# NetBSD/mips, either
 	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
 	;;
 mips64*-*-linux* | mipsisa64*-*-linux*)
-	tm_file="dbxelf.h elfos.h linux.h glibc-stdint.h ${tm_file} mips/linux.h mips/linux64.h"
+	tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/linux.h mips/linux64.h"
 	tmake_file="${tmake_file} mips/t-linux64 mips/t-libgcc-mips16"
 	tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
 	case ${target} in
@@ -1841,7 +1841,7 @@  mips64*-*-linux* | mipsisa64*-*-linux*)
 	test x$with_llsc != x || with_llsc=yes
 	;;
 mips*-*-linux*)				# Linux MIPS, either endian.
-        tm_file="dbxelf.h elfos.h linux.h glibc-stdint.h ${tm_file} mips/linux.h"
+        tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/linux.h"
 	tmake_file="${tmake_file} mips/t-libgcc-mips16"
 	case ${target} in
         mipsisa32r2*)
@@ -2243,10 +2243,10 @@  rx-*-elf*)
 	tmake_file="${tmake_file} rx/t-rx"
 	;;
 s390-*-linux*)
-	tm_file="s390/s390.h dbxelf.h elfos.h linux.h glibc-stdint.h s390/linux.h"
+	tm_file="s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h"
 	;;
 s390x-*-linux*)
-	tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h linux.h glibc-stdint.h s390/linux.h"
+	tm_file="s390/s390x.h s390/s390.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h s390/linux.h"
 	tm_p_file=s390/s390-protos.h
 	md_file=s390/s390.md
 	extra_modes=s390/s390-modes.def
@@ -2301,7 +2301,7 @@  sh-*-symbianelf* | sh[12346l]*-*-symbian
 	tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h"
 	case ${target} in
 	sh*-*-linux*)	tmake_file="${tmake_file} sh/t-linux"
-			tm_file="${tm_file} linux.h glibc-stdint.h sh/linux.h" ;;
+			tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h sh/linux.h" ;;
 	sh*-*-netbsd*)
 			tm_file="${tm_file} netbsd.h netbsd-elf.h sh/netbsd-elf.h"
 			extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
@@ -2484,7 +2484,7 @@  sparc-*-rtems*)
 	extra_parts="crtbegin.o crtend.o"
 	;;
 sparc-*-linux*)
-	tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h linux.h glibc-stdint.h"
+	tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h"
 	extra_options="${extra_options} sparc/long-double-switch.opt"
 	case ${target} in
 	    *-leon-*)
@@ -2578,7 +2578,7 @@  sparc64-*-rtems*)
 	extra_parts="crtbegin.o crtend.o"
 	;;
 sparc64-*-linux*)
-	tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h linux.h glibc-stdint.h sparc/linux64.h"
+	tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/linux64.h"
 	extra_options="${extra_options} sparc/long-double-switch.opt"
 	tmake_file="${tmake_file} sparc/t-linux sparc/t-linux64 sparc/t-crtfm"
 	;;
@@ -2665,7 +2665,7 @@  v850-*-*)
 	use_gcc_stdint=wrap
 	;;
 vax-*-linux*)
-	tm_file="${tm_file} dbxelf.h elfos.h linux.h vax/elf.h vax/linux.h"
+	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h vax/elf.h vax/linux.h"
 	tmake_file="${tmake_file} vax/t-linux"
 	;;
 vax-*-netbsdelf*)
@@ -2699,11 +2699,11 @@  xtensa*-*-elf*)
 	tmake_file="xtensa/t-xtensa xtensa/t-elf"
 	;;
 xtensa*-*-linux*)
-	tm_file="${tm_file} dbxelf.h elfos.h linux.h glibc-stdint.h xtensa/linux.h"
+	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h"
 	tmake_file="${tmake_file} xtensa/t-xtensa xtensa/t-linux"
 	;;
 am33_2.0-*-linux*)
-	tm_file="mn10300/mn10300.h dbxelf.h elfos.h linux.h glibc-stdint.h mn10300/linux.h"
+	tm_file="mn10300/mn10300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h"
 	tmake_file="${tmake_file} mn10300/t-linux"
 	gas=yes gnu_ld=yes
 	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
Index: gcc/config/linux.h
===================================================================
--- gcc/config/linux.h	(revision 168380)
+++ gcc/config/linux.h	(working copy)
@@ -1,4 +1,7 @@ 
-/* Definitions for Linux-based GNU systems with ELF format
+/* Definitions for systems using the Linux kernel, with or without
+   MMU, using ELF at the compiler level but possibly FLT for final
+   linked executables and shared libraries in some no-MMU cases, and
+   possibly with a choice of libc implementations.
    Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004, 2005, 2006,
    2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Eric Youngdale.
@@ -25,60 +28,6 @@  a copy of the GCC Runtime Library Except
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
-/* Don't assume anything about the header files.  */
-#define NO_IMPLICIT_EXTERN_C
-
-#undef ASM_APP_ON
-#define ASM_APP_ON "#APP\n"
-
-#undef ASM_APP_OFF
-#define ASM_APP_OFF "#NO_APP\n"
-
-/* Provide a STARTFILE_SPEC appropriate for GNU/Linux.  Here we add
-   the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
-   provides part of the support for getting C++ file-scope static
-   object constructed before entering `main'.  */
-   
-#if defined HAVE_LD_PIE
-#define LINUX_TARGET_STARTFILE_SPEC \
-  "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
-   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
-#else
-#define LINUX_TARGET_STARTFILE_SPEC \
-  "%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
-   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
-#endif
-#undef  STARTFILE_SPEC
-#define STARTFILE_SPEC LINUX_TARGET_STARTFILE_SPEC
-
-/* Provide a ENDFILE_SPEC appropriate for GNU/Linux.  Here we tack on
-   the GNU/Linux magical crtend.o file (see crtstuff.c) which
-   provides part of the support for getting C++ file-scope static
-   object constructed before entering `main', followed by a normal
-   GNU/Linux "finalizer" file, `crtn.o'.  */
-
-#define LINUX_TARGET_ENDFILE_SPEC \
-  "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
-#undef  ENDFILE_SPEC
-#define ENDFILE_SPEC LINUX_TARGET_ENDFILE_SPEC
-
-/* This is for -profile to use -lc_p instead of -lc.  */
-#define LINUX_TARGET_CC1_SPEC "%{profile:-p}"
-#ifndef CC1_SPEC
-#define CC1_SPEC LINUX_TARGET_CC1_SPEC
-#endif
-
-/* The GNU C++ standard library requires that these macros be defined.  */
-#undef CPLUSPLUS_CPP_SPEC
-#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
-
-#define LINUX_TARGET_LIB_SPEC \
-  "%{pthread:-lpthread} \
-   %{shared:-lc} \
-   %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}"
-#undef  LIB_SPEC
-#define LIB_SPEC LINUX_TARGET_LIB_SPEC
-
 /* C libraries supported on Linux.  */
 #ifdef SINGLE_LIBC
 #define OPTION_GLIBC  (DEFAULT_LIBC == LIBC_GLIBC)
@@ -101,19 +50,6 @@  see the files COPYING3 and COPYING.RUNTI
 	builtin_assert ("system=posix");			\
     } while (0)
 
-#if defined(HAVE_LD_EH_FRAME_HDR)
-#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
-#endif
-
-#undef LINK_GCC_C_SEQUENCE_SPEC
-#define LINK_GCC_C_SEQUENCE_SPEC \
-  "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
-
-/* Use --as-needed -lgcc_s for eh support.  */
-#ifdef HAVE_LD_AS_NEEDED
-#define USE_LD_AS_NEEDED 1
-#endif
-
 /* Determine which dynamic linker to use depending on whether GLIBC or
    uClibc or Bionic is the default C library and whether
    -muclibc or -mglibc or -mbionic has been passed to change the default.  */
@@ -161,5 +97,3 @@  see the files COPYING3 and COPYING.RUNTI
 
 /* Whether we have sincos that follows the GNU extension.  */
 #define TARGET_HAS_SINCOS (OPTION_GLIBC || OPTION_BIONIC)
-
-#define TARGET_POSIX_IO
Index: gcc/config/gnu-user.h
===================================================================
--- gcc/config/gnu-user.h	(revision 168378)
+++ gcc/config/gnu-user.h	(working copy)
@@ -1,4 +1,6 @@ 
-/* Definitions for Linux-based GNU systems with ELF format
+/* Definitions for systems using, at least optionally, a GNU
+   (glibc-based) userspace or other userspace with libc derived from
+   glibc (e.g. uClibc) or for which similar specs are appropriate.
    Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004, 2005, 2006,
    2007, 2009, 2010 Free Software Foundation, Inc.
    Contributed by Eric Youngdale.
@@ -34,72 +36,50 @@  see the files COPYING3 and COPYING.RUNTI
 #undef ASM_APP_OFF
 #define ASM_APP_OFF "#NO_APP\n"
 
-/* Provide a STARTFILE_SPEC appropriate for GNU/Linux.  Here we add
-   the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
+/* Provide a STARTFILE_SPEC appropriate for GNU userspace.  Here we add
+   the GNU userpsace magical crtbegin.o file (see crtstuff.c) which
    provides part of the support for getting C++ file-scope static
    object constructed before entering `main'.  */
    
 #if defined HAVE_LD_PIE
-#define LINUX_TARGET_STARTFILE_SPEC \
+#define GNU_USER_TARGET_STARTFILE_SPEC \
   "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
    crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
 #else
-#define LINUX_TARGET_STARTFILE_SPEC \
+#define GNU_USER_TARGET_STARTFILE_SPEC \
   "%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
    crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
 #endif
 #undef  STARTFILE_SPEC
-#define STARTFILE_SPEC LINUX_TARGET_STARTFILE_SPEC
+#define STARTFILE_SPEC GNU_USER_TARGET_STARTFILE_SPEC
 
-/* Provide a ENDFILE_SPEC appropriate for GNU/Linux.  Here we tack on
-   the GNU/Linux magical crtend.o file (see crtstuff.c) which
+/* Provide a ENDFILE_SPEC appropriate for GNU userspace.  Here we tack on
+   the GNU userspace magical crtend.o file (see crtstuff.c) which
    provides part of the support for getting C++ file-scope static
    object constructed before entering `main', followed by a normal
-   GNU/Linux "finalizer" file, `crtn.o'.  */
+   GNU userspace "finalizer" file, `crtn.o'.  */
 
-#define LINUX_TARGET_ENDFILE_SPEC \
+#define GNU_USER_TARGET_ENDFILE_SPEC \
   "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
 #undef  ENDFILE_SPEC
-#define ENDFILE_SPEC LINUX_TARGET_ENDFILE_SPEC
+#define ENDFILE_SPEC GNU_USER_TARGET_ENDFILE_SPEC
 
 /* This is for -profile to use -lc_p instead of -lc.  */
-#define LINUX_TARGET_CC1_SPEC "%{profile:-p}"
+#define GNU_USER_TARGET_CC1_SPEC "%{profile:-p}"
 #ifndef CC1_SPEC
-#define CC1_SPEC LINUX_TARGET_CC1_SPEC
+#define CC1_SPEC GNU_USER_TARGET_CC1_SPEC
 #endif
 
 /* The GNU C++ standard library requires that these macros be defined.  */
 #undef CPLUSPLUS_CPP_SPEC
 #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
 
-#define LINUX_TARGET_LIB_SPEC \
+#define GNU_USER_TARGET_LIB_SPEC \
   "%{pthread:-lpthread} \
    %{shared:-lc} \
    %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}"
 #undef  LIB_SPEC
-#define LIB_SPEC LINUX_TARGET_LIB_SPEC
-
-/* C libraries supported on Linux.  */
-#ifdef SINGLE_LIBC
-#define OPTION_GLIBC  (DEFAULT_LIBC == LIBC_GLIBC)
-#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
-#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
-#else
-#define OPTION_GLIBC  (linux_libc == LIBC_GLIBC)
-#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
-#define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
-#endif
-
-#define LINUX_TARGET_OS_CPP_BUILTINS()				\
-    do {							\
-	if (OPTION_GLIBC)					\
-	  builtin_define ("__gnu_linux__");			\
-	builtin_define_std ("linux");				\
-	builtin_define_std ("unix");				\
-	builtin_assert ("system=linux");			\
-	builtin_assert ("system=unix");				\
-	builtin_assert ("system=posix");			\
-    } while (0)
+#define LIB_SPEC GNU_USER_TARGET_LIB_SPEC
 
 #if defined(HAVE_LD_EH_FRAME_HDR)
 #define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
@@ -114,52 +94,4 @@  see the files COPYING3 and COPYING.RUNTI
 #define USE_LD_AS_NEEDED 1
 #endif
 
-/* Determine which dynamic linker to use depending on whether GLIBC or
-   uClibc or Bionic is the default C library and whether
-   -muclibc or -mglibc or -mbionic has been passed to change the default.  */
-
-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3)	\
-  "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
-
-#if DEFAULT_LIBC == LIBC_GLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
-  CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
-#elif DEFAULT_LIBC == LIBC_UCLIBC
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
-  CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
-#elif DEFAULT_LIBC == LIBC_BIONIC
-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
-  CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
-#else
-#error "Unsupported DEFAULT_LIBC"
-#endif /* DEFAULT_LIBC */
-
-/* For most targets the following definitions suffice;
-   GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
-   GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets
-   supporting both 32-bit and 64-bit compilation.  */
-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
-#define BIONIC_DYNAMIC_LINKER "/system/bin/linker"
-#define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
-#define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
-
-#define LINUX_DYNAMIC_LINKER						\
-  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER,	\
-			 BIONIC_DYNAMIC_LINKER)
-#define LINUX_DYNAMIC_LINKER32						\
-  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
-			 BIONIC_DYNAMIC_LINKER32)
-#define LINUX_DYNAMIC_LINKER64						\
-  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
-			 BIONIC_DYNAMIC_LINKER64)
-
-/* Determine whether the entire c99 runtime
-   is present in the runtime library.  */
-#define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
-
-/* Whether we have sincos that follows the GNU extension.  */
-#define TARGET_HAS_SINCOS (OPTION_GLIBC || OPTION_BIONIC)
-
 #define TARGET_POSIX_IO
Index: gcc/config/arm/linux-eabi.h
===================================================================
--- gcc/config/arm/linux-eabi.h	(revision 168380)
+++ gcc/config/arm/linux-eabi.h	(working copy)
@@ -1,5 +1,5 @@ 
 /* Configuration file for ARM GNU/Linux EABI targets.
-   Copyright (C) 2004, 2005, 2006, 2007
+   Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010
    Free Software Foundation, Inc.
    Contributed by CodeSourcery, LLC   
 
@@ -72,25 +72,25 @@ 
 		       LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
 
 #undef  CC1_SPEC
-#define CC1_SPEC						\
-  LINUX_OR_ANDROID_CC (LINUX_TARGET_CC1_SPEC,			\
-		       LINUX_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC)
+#define CC1_SPEC							\
+  LINUX_OR_ANDROID_CC (GNU_USER_TARGET_CC1_SPEC,			\
+		       GNU_USER_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC)
 
 #define CC1PLUS_SPEC \
   LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC)
 
 #undef  LIB_SPEC
-#define LIB_SPEC						\
-  LINUX_OR_ANDROID_LD (LINUX_TARGET_LIB_SPEC,			\
-		       LINUX_TARGET_LIB_SPEC " " ANDROID_LIB_SPEC)
+#define LIB_SPEC							\
+  LINUX_OR_ANDROID_LD (GNU_USER_TARGET_LIB_SPEC,			\
+		       GNU_USER_TARGET_LIB_SPEC " " ANDROID_LIB_SPEC)
 
 #undef	STARTFILE_SPEC
 #define STARTFILE_SPEC \
-  LINUX_OR_ANDROID_LD (LINUX_TARGET_STARTFILE_SPEC, ANDROID_STARTFILE_SPEC)
+  LINUX_OR_ANDROID_LD (GNU_USER_TARGET_STARTFILE_SPEC, ANDROID_STARTFILE_SPEC)
 
 #undef	ENDFILE_SPEC
 #define ENDFILE_SPEC \
-  LINUX_OR_ANDROID_LD (LINUX_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
+  LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
 
 /* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
    do not use -lfloat.  */