aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2006-02-16 23:29:10 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2006-02-16 23:29:10 +0000
commit464aea985957cde55ba4c6a3781293441b89119f (patch)
tree2c090d6408195e6db383a030c30ebbadea6777e4 /gcc
parent6429d58f83a1ee1334942d419c078a1fcd962c18 (diff)
downloadgcc-464aea985957cde55ba4c6a3781293441b89119f.zip
gcc-464aea985957cde55ba4c6a3781293441b89119f.tar.gz
gcc-464aea985957cde55ba4c6a3781293441b89119f.tar.bz2
re PR target/20353 (uclibc does not provide C99 math functions)
gcc: PR target/20353 PR target/24578 PR target/24837 * config/linux.opt: New file. * config/linux.h (CHOOSE_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, LINUX_DYNAMIC_LINKER): Define. (TARGET_C99_FUNCTIONS): Define depending on TARGET_GLIBC. * config.gcc (*-*-linux*): Define extra_options. (*-*-*uclibc*): Define UCLIBC_DEFAULT. (arm*-*-linux-gnueabi): Change to arm*-*-linux-*eabi. * config/arm/linux-eabi.h (LINUX_TARGET_INTERPRETER): Change to GLIBC_DYNAMIC_LINKER. * config/arm/linux-elf.h (LINUX_TARGET_INTERPRETER): Likewise. (LINUX_TARGET_LINK_SPEC): Use LINUX_DYNAMIC_LINKER. * config/mips/linux.h (GLIBC_DYNAMIC_LINKER): Define. (LINK_SPEC): Use LINUX_DYNAMIC_LINKER. * doc/invoke.texi (GNU/Linux Options): New section. gcc/testsuite: * gcc.dg/builtins-config.h (HAVE_C99_RUNTIME): Don't define if __UCLIBC__ is defined. libstdc++-v3: PR libstdc++/14939 * config/os/uclibc/ctype_base.h, config/os/uclibc/ctype_inline.h, config/os/uclibc/ctype_noninline.h, config/os/uclibc/os_defines.h: New. * acinclude.m4 (GLIBCXX_CONFIGURE): Test whether using uClibc. * configure.host: Use os/uclibc for uClibc. * crossconfig.m4 (*-linux*): Use link tests. Don't hardcode presence of math functions. * configure: Regenerate. From-SVN: r111160
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog20
-rw-r--r--gcc/config.gcc10
-rw-r--r--gcc/config/arm/linux-eabi.h6
-rw-r--r--gcc/config/arm/linux-elf.h6
-rw-r--r--gcc/config/linux.h20
-rw-r--r--gcc/config/linux.opt29
-rw-r--r--gcc/config/mips/linux.h6
-rw-r--r--gcc/doc/invoke.texi22
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.dg/builtins-config.h7
10 files changed, 118 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 127e35c..e1dfcd9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,23 @@
+2006-02-16 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR target/20353
+ PR target/24578
+ PR target/24837
+ * config/linux.opt: New file.
+ * config/linux.h (CHOOSE_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER,
+ LINUX_DYNAMIC_LINKER): Define.
+ (TARGET_C99_FUNCTIONS): Define depending on TARGET_GLIBC.
+ * config.gcc (*-*-linux*): Define extra_options.
+ (*-*-*uclibc*): Define UCLIBC_DEFAULT.
+ (arm*-*-linux-gnueabi): Change to arm*-*-linux-*eabi.
+ * config/arm/linux-eabi.h (LINUX_TARGET_INTERPRETER): Change to
+ GLIBC_DYNAMIC_LINKER.
+ * config/arm/linux-elf.h (LINUX_TARGET_INTERPRETER): Likewise.
+ (LINUX_TARGET_LINK_SPEC): Use LINUX_DYNAMIC_LINKER.
+ * config/mips/linux.h (GLIBC_DYNAMIC_LINKER): Define.
+ (LINK_SPEC): Use LINUX_DYNAMIC_LINKER.
+ * doc/invoke.texi (GNU/Linux Options): New section.
+
2006-02-16 Eric Botcazou <ebotcazou@libertysurf.fr>
* config/sparc/sparc.md (setjmp): Rewrite.
diff --git a/gcc/config.gcc b/gcc/config.gcc
index b5c7251..3d02543 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1,5 +1,5 @@
# GCC target-specific configuration file.
-# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
#This file is part of GCC.
@@ -446,12 +446,18 @@ case ${target} in
*-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
# Must come before *-*-gnu* (because of *-*-linux-gnu* systems).
extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
+ extra_options="${extra_options} linux.opt"
gas=yes
gnu_ld=yes
case ${enable_threads} in
"" | yes | posix) thread_file='posix' ;;
esac
tmake_file="t-slibgcc-elf-ver t-linux"
+ case ${target} in
+ *-*-*uclibc*)
+ tm_defines="${tm_defines} UCLIBC_DEFAULT"
+ ;;
+ esac
;;
*-*-gnu*)
# On the Hurd, the setup is just about the same on
@@ -674,7 +680,7 @@ arm*-*-linux*) # ARM GNU/Linux with ELF
tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
tmake_file="${tmake_file} t-linux arm/t-arm"
case ${target} in
- arm*-*-linux-gnueabi)
+ arm*-*-linux-*eabi)
tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
# The BPABI long long divmod functions return a 128-bit value in
diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
index 6cd0989..6612f74 100644
--- a/gcc/config/arm/linux-eabi.h
+++ b/gcc/config/arm/linux-eabi.h
@@ -1,5 +1,5 @@
/* Configuration file for ARM GNU/Linux EABI targets.
- Copyright (C) 2004, 2005
+ Copyright (C) 2004, 2005, 2006
Free Software Foundation, Inc.
Contributed by CodeSourcery, LLC
@@ -52,8 +52,8 @@
/* Use ld-linux.so.3 so that it will be possible to run "classic"
GNU/Linux binaries on an EABI system. */
-#undef LINUX_TARGET_INTERPRETER
-#define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.3"
+#undef GLIBC_DYNAMIC_LINKER
+#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3"
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
use the GNU/Linux version, not the generic BPABI version. */
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
index c3ae2be..acb13cd 100644
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -1,6 +1,6 @@
/* Definitions for ARM running Linux-based GNU systems using ELF
Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005
+ 2005, 2006
Free Software Foundation, Inc.
Contributed by Philip Blundell <philb@gnu.org>
@@ -51,7 +51,7 @@
#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
-#define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.2"
+#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
#define LINUX_TARGET_LINK_SPEC "%{h*} %{version:-v} \
%{b} \
@@ -59,7 +59,7 @@
%{shared:-shared} \
%{symbolic:-Bsymbolic} \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker " LINUX_TARGET_INTERPRETER "} \
+ %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
-X \
%{mbig-endian:-EB}" \
SUBTARGET_EXTRA_LINK_SPEC
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index d452726..e5707d3 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -1,5 +1,5 @@
/* Definitions for Linux-based GNU systems with ELF format
- Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Contributed by Eric Youngdale.
Modified for stabs-in-ELF by H.J. Lu (hjl@lucon.org).
@@ -99,8 +99,24 @@ Boston, MA 02110-1301, USA. */
#define USE_LD_AS_NEEDED 1
#endif
+/* Determine which dynamic linker to use depending on whether GLIBC or
+ uClibc is the default C library and whether -muclibc or -mglibc has
+ been passed to change the default. */
+#ifdef UCLIBC_DEFAULT
+#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+#else
+#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
+#endif
+
+/* For most targets with a single dynamic linker the following
+ definitions suffice; GLIBC_DYNAMIC_LINKER must be defined for each
+ target using them. */
+#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#define LINUX_DYNAMIC_LINKER \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
+
/* Determine whether the entire c99 runtime
is present in the runtime library. */
-#define TARGET_C99_FUNCTIONS 1
+#define TARGET_C99_FUNCTIONS (TARGET_GLIBC)
#define TARGET_POSIX_IO
diff --git a/gcc/config/linux.opt b/gcc/config/linux.opt
new file mode 100644
index 0000000..2cb04b2
--- /dev/null
+++ b/gcc/config/linux.opt
@@ -0,0 +1,29 @@
+; Processor-independent options for GNU/Linux.
+;
+; Copyright (C) 2006 Free Software Foundation, Inc.
+; Contributed by CodeSourcery.
+;
+; This file is part of GCC.
+;
+; GCC is free software; you can redistribute it and/or modify it under
+; the terms of the GNU General Public License as published by the Free
+; Software Foundation; either version 2, or (at your option) any later
+; version.
+;
+; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+; for more details.
+;
+; You should have received a copy of the GNU General Public License
+; along with GCC; see the file COPYING. If not, write to the Free
+; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+; 02110-1301, USA.
+
+muclibc
+Target RejectNegative Report Mask(UCLIBC)
+Use uClibc instead of GNU libc
+
+mglibc
+Target RejectNegative Report InverseMask(UCLIBC, GLIBC)
+Use GNU libc instead of uClibc
diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
index a135bba..5ed427d 100644
--- a/gcc/config/mips/linux.h
+++ b/gcc/config/mips/linux.h
@@ -1,5 +1,5 @@
/* Definitions for MIPS running Linux-based GNU systems with ELF format.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GCC.
@@ -98,6 +98,8 @@ Boston, MA 02110-1301, USA. */
#undef MIPS_DEFAULT_GVALUE
#define MIPS_DEFAULT_GVALUE 0
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+
/* Borrowed from sparc/linux.h */
#undef LINK_SPEC
#define LINK_SPEC \
@@ -107,7 +109,7 @@ Boston, MA 02110-1301, USA. */
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "}} \
%{static:-static}}}"
#undef SUBTARGET_ASM_SPEC
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index c62aa7b..5889b96 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -503,6 +503,9 @@ Objective-C and Objective-C++ Dialects}.
-mTLS -mtls @gol
-mcpu=@var{cpu}}
+@emph{GNU/Linux Options}
+@gccoptlist{-muclibc}
+
@emph{H8/300 Options}
@gccoptlist{-mrelax -mh -ms -mn -mint32 -malign-300}
@@ -7193,6 +7196,7 @@ platform.
* DEC Alpha Options::
* DEC Alpha/VMS Options::
* FRV Options::
+* GNU/Linux Options::
* H8/300 Options::
* HPPA Options::
* i386 and x86-64 Options::
@@ -8783,6 +8787,24 @@ Select the processor type for which to generate code. Possible values are
@end table
+@node GNU/Linux Options
+@subsection GNU/Linux Options
+
+These @samp{-m} options are defined for GNU/Linux targets:
+
+@table @gcctabopt
+@item -mglibc
+@opindex mglibc
+Use the GNU C library instead of uClibc. This is the default except
+on @samp{*-*-linux-*uclibc*} targets.
+
+@item -muclibc
+@opindex muclibc
+Use uClibc instead of the GNU C library. This is the default on
+@samp{*-*-linux-*uclibc*} targets. GCC currently only supports uClibc
+on ARM and 32-bit MIPS targets.
+@end table
+
@node H8/300 Options
@subsection H8/300 Options
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 621adda..ffacb6a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2006-02-16 Joseph S. Myers <joseph@codesourcery.com>
+
+ PR target/20353
+ PR target/24578
+ * gcc.dg/builtins-config.h (HAVE_C99_RUNTIME): Don't define if
+ __UCLIBC__ is defined.
+
2006-02-16 Jakub Jelinek <jakub@redhat.com>
PR fortran/26224
diff --git a/gcc/testsuite/gcc.dg/builtins-config.h b/gcc/testsuite/gcc.dg/builtins-config.h
index 6335b5b..6554f46 100644
--- a/gcc/testsuite/gcc.dg/builtins-config.h
+++ b/gcc/testsuite/gcc.dg/builtins-config.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation.
+/* Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation.
Define macros useful in tests for bulitin functions. */
@@ -38,9 +38,10 @@
too, but the GLIBC math inlines cause us to generate inferior code,
which causes the test to fail, so it is not safe. Including <limits.h>
also fails because the include search paths are ordered such that GCC's
- version will be found before the newlib version. */
+ version will be found before the newlib version. Similarly, uClibc
+ lacks the C99 functions. */
#include <sys/types.h>
-#ifdef _NEWLIB_VERSION
+#if defined(_NEWLIB_VERSION) || defined(__UCLIBC__)
#else
#define HAVE_C99_RUNTIME
#endif