nuke unneeded patchsets as well

SVN-Revision: 25145
v19.07.3_mercusys_ac12_duma
Imre Kaloz 14 years ago
parent 25fb11cf89
commit b255026bd1

@ -1,14 +0,0 @@
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -5339,7 +5339,10 @@ extract_muldiv_1 (tree t, tree c, enum t
}
break;
}
- /* FALLTHROUGH */
+ /* If the constant is negative, we cannot simplify this. */
+ if (tree_int_cst_sgn (c) == -1)
+ break;
+ /* FALLTHROUGH */
case NEGATE_EXPR:
if ((t1 = extract_muldiv (op0, c, code, wide_type)) != 0)
return fold_build1 (tcode, ctype, fold_convert (ctype, t1));

@ -1,544 +0,0 @@
--- /dev/null
+++ b/gcc/config/t-linux-uclibc
@@ -0,0 +1,5 @@
+# Remove glibc specific files added in t-linux
+SHLIB_MAPFILES := $(filter-out $(srcdir)/config/libgcc-glibc.ver, $(SHLIB_MAPFILES))
+
+# Use unwind-dw2-fde instead of unwind-dw2-fde-glibc
+LIB2ADDEH := $(subst unwind-dw2-fde-glibc.c,unwind-dw2-fde.c,$(LIB2ADDEH))
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1884,7 +1884,7 @@ s390x-ibm-tpf*)
;;
sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
- sh-*-linux* | sh[346lbe]*-*-linux* | \
+ sh*-*-linux* | sh[346lbe]*-*-linux* | \
sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
sh64-*-netbsd* | sh64l*-*-netbsd*)
tmake_file="${tmake_file} sh/t-sh sh/t-elf"
@@ -2338,6 +2338,12 @@ m32c-*-elf*)
;;
esac
+# Rather than hook into each target, just do it after all the linux
+# targets have been processed
+case ${target} in
+*-linux-uclibc*) tm_defines="${tm_defines} USE_UCLIBC" ; tmake_file="${tmake_file} t-linux-uclibc"
+esac
+
case ${target} in
i[34567]86-*-linux*aout* | i[34567]86-*-linux*libc1)
tmake_file="${tmake_file} i386/t-gmm_malloc"
--- a/boehm-gc/configure
+++ b/boehm-gc/configure
@@ -4320,6 +4320,11 @@ linux-gnu*)
lt_cv_deplibs_check_method=pass_all
;;
+linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+ ;;
+
netbsd* | knetbsd*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
--- a/configure
+++ b/configure
@@ -1133,7 +1133,7 @@ no)
;;
"")
case "${target}" in
- *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu)
+ *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*)
# Enable libmudflap by default in GNU and friends.
;;
*-*-freebsd*)
--- a/configure.in
+++ b/configure.in
@@ -341,7 +341,7 @@ no)
;;
"")
case "${target}" in
- *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu)
+ *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*)
# Enable libmudflap by default in GNU and friends.
;;
*-*-freebsd*)
--- a/contrib/regression/objs-gcc.sh
+++ b/contrib/regression/objs-gcc.sh
@@ -105,6 +105,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H
then
make all-gdb all-dejagnu all-ld || exit 1
make install-gdb install-dejagnu install-ld || exit 1
+elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
make bootstrap || exit 1
make install || exit 1
--- a/gcc/config/alpha/linux-elf.h
+++ b/gcc/config/alpha/linux-elf.h
@@ -27,7 +27,11 @@ Boston, MA 02110-1301, USA. */
#define SUBTARGET_EXTRA_SPECS \
{ "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
+#if defined USE_UCLIBC
+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#else
#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#endif
#define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
%{O*:-O3} %{!O*:-O1} \
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -51,7 +51,11 @@
#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
+#ifdef USE_UCLIBC
+#define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0"
+#else
#define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.2"
+#endif
#define LINUX_TARGET_LINK_SPEC "%{h*} %{version:-v} \
%{b} \
--- a/gcc/config/cris/linux.h
+++ b/gcc/config/cris/linux.h
@@ -73,6 +73,25 @@ Boston, MA 02110-1301, USA. */
#undef CRIS_DEFAULT_CPU_VERSION
#define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
+#ifdef USE_UCLIBC
+
+#undef CRIS_SUBTARGET_VERSION
+#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
+
+#undef CRIS_LINK_SUBTARGET_SPEC
+#define CRIS_LINK_SUBTARGET_SPEC \
+ "-mcrislinux\
+ -rpath-link include/asm/../..%s\
+ %{shared} %{static}\
+ %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
+ %{!shared: \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \
+ %{!r:%{O2|O3: --gc-sections}}"
+
+#else /* USE_UCLIBC */
+
#undef CRIS_SUBTARGET_VERSION
#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
@@ -87,6 +106,8 @@ Boston, MA 02110-1301, USA. */
%{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
%{!r:%{O2|O3: --gc-sections}}"
+#endif /* USE_UCLIBC */
+
/* Node: Run-time Target */
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -107,6 +107,11 @@ Boston, MA 02110-1301, USA. */
#define LINK_EMULATION "elf_i386"
#define DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#if defined USE_UCLIBC
+#undef DYNAMIC_LINKER
+#define DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#endif
+
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
{ "link_emulation", LINK_EMULATION },\
--- a/gcc/config/i386/linux64.h
+++ b/gcc/config/i386/linux64.h
@@ -54,14 +54,21 @@ Boston, MA 02110-1301, USA. */
When the -shared link option is used a final link is not being
done. */
+#ifdef USE_UCLIBC
+#define ELF32_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
+#else
+#define ELF32_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#define ELF64_DYNAMIC_LINKER "/lib64/ld-linux-x86-64.so.2"
+#endif
#undef LINK_SPEC
#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
%{shared:-shared} \
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
- %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
+ %{m32:%{!dynamic-linker:-dynamic-linker " ELF32_DYNAMIC_LINKER "}} \
+ %{!m32:%{!dynamic-linker:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}} \
%{static:-static}}"
/* Similar to standard Linux, but adding -ffast-math support. */
--- a/gcc/config/ia64/linux.h
+++ b/gcc/config/ia64/linux.h
@@ -37,13 +37,18 @@ do { \
/* Define this for shared library support because it isn't in the main
linux.h file. */
+#ifdef USE_UCLIBC
+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#else
+#define ELF_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
+#endif
#undef LINK_SPEC
#define LINK_SPEC "\
%{shared:-shared} \
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
+ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
%{static:-static}}"
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
--- a/gcc/config/m68k/linux.h
+++ b/gcc/config/m68k/linux.h
@@ -123,12 +123,17 @@ Boston, MA 02110-1301, USA. */
/* If ELF is the default format, we should not use /lib/elf. */
+#ifdef USE_UCLIBC
+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#else
+#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
+#endif
#undef LINK_SPEC
#define LINK_SPEC "-m m68kelf %{shared} \
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker*:-dynamic-linker /lib/ld.so.1}} \
+ %{!dynamic-linker*:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
%{static}}"
/* For compatibility with linux/a.out */
--- a/gcc/config/mips/linux.h
+++ b/gcc/config/mips/linux.h
@@ -105,6 +105,11 @@ Boston, MA 02110-1301, USA. */
/* Borrowed from sparc/linux.h */
#undef LINK_SPEC
+#ifdef USE_UCLIBC
+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#else
+#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
+#endif
#define LINK_SPEC \
"%(endian_spec) \
%{shared:-shared} \
@@ -112,7 +117,7 @@ Boston, MA 02110-1301, USA. */
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
%{static:-static}}}"
#undef SUBTARGET_ASM_SPEC
--- a/gcc/config/pa/pa-linux.h
+++ b/gcc/config/pa/pa-linux.h
@@ -49,13 +49,18 @@ Boston, MA 02110-1301, USA. */
/* Define this for shared library support because it isn't in the main
linux.h file. */
+#ifdef USE_UCLIBC
+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#else
+#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
+#endif
#undef LINK_SPEC
#define LINK_SPEC "\
%{shared:-shared} \
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
+ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
%{static:-static}}"
/* glibc's profiling functions don't need gcc to allocate counters. */
--- a/gcc/config/rs6000/linux.h
+++ b/gcc/config/rs6000/linux.h
@@ -72,7 +72,11 @@
#define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
#undef LINK_OS_DEFAULT_SPEC
+#ifdef USE_UCLIBC
+#define LINK_OS_DEFAULT_SPEC "%(link_os_linux_uclibc)"
+#else
#define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
+#endif
#define LINK_GCC_C_SEQUENCE_SPEC \
"%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -866,6 +866,7 @@ extern int fixuplabelno;
mcall-linux : %(link_os_linux) ; \
mcall-gnu : %(link_os_gnu) ; \
mcall-netbsd : %(link_os_netbsd) ; \
+ mcall-linux-uclibc : %(link_os_linux_uclibc); \
mcall-openbsd: %(link_os_openbsd) ; \
: %(link_os_default) }"
@@ -1043,6 +1044,10 @@ extern int fixuplabelno;
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
+#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}"
+
#if defined(HAVE_LD_EH_FRAME_HDR)
# define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
#endif
@@ -1209,6 +1214,7 @@ ncrtn.o%s"
{ "link_os_sim", LINK_OS_SIM_SPEC }, \
{ "link_os_freebsd", LINK_OS_FREEBSD_SPEC }, \
{ "link_os_linux", LINK_OS_LINUX_SPEC }, \
+ { "link_os_linux_uclibc", LINK_OS_LINUX_UCLIBC_SPEC }, \
{ "link_os_gnu", LINK_OS_GNU_SPEC }, \
{ "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \
{ "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
--- a/gcc/config/s390/linux.h
+++ b/gcc/config/s390/linux.h
@@ -77,6 +77,13 @@ Software Foundation, 51 Franklin Street,
#define MULTILIB_DEFAULTS { "m31" }
#endif
+#ifdef USE_UCLIBC
+#define ELF31_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
+#else
+#define ELF31_DYNAMIC_LINKER "/lib/ld.so.1"
+#define ELF64_DYNAMIC_LINKER "/lib/ld64.so.1"
+#endif
#undef LINK_SPEC
#define LINK_SPEC \
"%{m31:-m elf_s390}%{m64:-m elf64_s390} \
@@ -86,8 +93,8 @@ Software Foundation, 51 Franklin Street,
%{!static: \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker: \
- %{m31:-dynamic-linker /lib/ld.so.1} \
- %{m64:-dynamic-linker /lib/ld64.so.1}}}}"
+ %{m31:-dynamic-linker " ELF31_DYNAMIC_LINKER "} \
+ %{m64:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}}}"
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
--- a/gcc/config/sh/linux.h
+++ b/gcc/config/sh/linux.h
@@ -56,12 +56,21 @@ Boston, MA 02110-1301, USA. */
#undef SUBTARGET_LINK_EMUL_SUFFIX
#define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
#undef SUBTARGET_LINK_SPEC
+#ifdef USE_UCLIBC
+#define SUBTARGET_LINK_SPEC \
+ "%{shared:-shared} \
+ %{!static: \
+ %{rdynamic:-export-dynamic} \
+ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
+ %{static:-static}"
+#else
#define SUBTARGET_LINK_SPEC \
"%{shared:-shared} \
%{!static: \
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
%{static:-static}"
+#endif
/* Output assembler code to STREAM to call the profiler. */
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -125,6 +125,11 @@ Boston, MA 02110-1301, USA. */
/* If ELF is the default format, we should not use /lib/elf. */
+#ifdef USE_UCLIBC
+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#else
+#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#endif
#undef LINK_SPEC
#define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
%{!mno-relax:%{!r:-relax}} \
@@ -132,7 +137,7 @@ Boston, MA 02110-1301, USA. */
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
%{static:-static}}}"
/* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -162,12 +162,17 @@ Boston, MA 02110-1301, USA. */
{ "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
{ "link_arch", LINK_ARCH_SPEC },
+#ifdef USE_UCLIBC
+#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#else
+#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#endif
#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
%{static:-static}}} \
"
--- a/libffi/configure
+++ b/libffi/configure
@@ -3457,6 +3457,11 @@ linux-gnu*)
lt_cv_deplibs_check_method=pass_all
;;
+linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+ ;;
+
netbsd* | knetbsd*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -3699,6 +3699,11 @@ linux-gnu*)
lt_cv_deplibs_check_method=pass_all
;;
+linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+ ;;
+
netbsd* | knetbsd*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
--- a/libjava/configure
+++ b/libjava/configure
@@ -5137,6 +5137,11 @@ linux-gnu*)
lt_cv_deplibs_check_method=pass_all
;;
+linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+ ;;
+
netbsd* | knetbsd*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
--- a/libmudflap/configure
+++ b/libmudflap/configure
@@ -5382,6 +5382,11 @@ linux-gnu*)
lt_cv_deplibs_check_method=pass_all
;;
+linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+ ;;
+
netbsd* | knetbsd*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
--- a/libobjc/configure
+++ b/libobjc/configure
@@ -3312,6 +3312,11 @@ linux-gnu*)
lt_cv_deplibs_check_method=pass_all
;;
+linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+ ;;
+
netbsd* | knetbsd*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
--- a/libtool.m4
+++ b/libtool.m4
@@ -743,6 +743,11 @@ linux-gnu*)
lt_cv_deplibs_check_method=pass_all
;;
+linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+ ;;
+
netbsd* | knetbsd*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
[lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
--- a/ltconfig
+++ b/ltconfig
@@ -603,6 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
case $host_os in
+linux-uclibc*) ;;
linux-gnu*) ;;
linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
esac
@@ -1274,6 +1275,23 @@ linux-gnu*)
dynamic_linker='GNU/Linux ld.so'
;;
+linux-uclibc*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+ soname_spec='${libname}${release}.so$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+ # Assume using the uClibc dynamic linker.
+ dynamic_linker="uClibc ld.so"
+ ;;
+
netbsd*)
need_lib_prefix=no
need_version=no
--- a/zlib/configure
+++ b/zlib/configure
@@ -3426,6 +3426,11 @@ linux-gnu*)
lt_cv_deplibs_check_method=pass_all
;;
+linux-uclibc*)
+ lt_cv_deplibs_check_method=pass_all
+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+ ;;
+
netbsd* | knetbsd*-gnu)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'

@ -1,25 +0,0 @@
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -674,7 +674,7 @@ arm*-*-linux*) # ARM GNU/Linux with EL
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-gnueabi | arm*-*-linux-uclibcgnueabi)
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
--- a/gcc/config/arm/linux-eabi.h
+++ b/gcc/config/arm/linux-eabi.h
@@ -53,7 +53,11 @@
/* 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
+#ifdef USE_UCLIBC
+#define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0"
+#else
#define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.3"
+#endif
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
use the GNU/Linux version, not the generic BPABI version. */

@ -1,9 +0,0 @@
--- a/gcc/config/cris/t-linux
+++ b/gcc/config/cris/t-linux
@@ -1,6 +1,2 @@
TARGET_LIBGCC2_CFLAGS += -fPIC
CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS)
-
-# We *know* we have a limits.h in the glibc library, with extra
-# definitions needed for e.g. libgfortran.
-LIMITS_H_TEST = :

File diff suppressed because it is too large Load Diff

@ -1,50 +0,0 @@
# DP: Build and install libstdc++_pic.a library.
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -234,6 +234,12 @@ CXXLINK = $(LIBTOOL) --tag CXX --mode=li
$(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LDFLAGS) -o $@
+install-exec-local:
+ifeq ($(enable_shared),yes)
+ $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
+endif
+
# Added bits to build debug library.
if GLIBCXX_BUILD_DEBUG
all-local: build_debug
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/Makefile.in
@@ -627,7 +627,7 @@ info-am:
install-data-am: install-data-local
-install-exec-am: install-toolexeclibLTLIBRARIES
+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
install-info: install-info-am
@@ -660,6 +660,7 @@ uninstall-am: uninstall-info-am uninstal
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-data-local install-exec \
+ install-exec-local \
install-exec-am install-info install-info-am install-man \
install-strip install-toolexeclibLTLIBRARIES installcheck \
installcheck-am installdirs maintainer-clean \
@@ -760,6 +761,13 @@ build_debug: stamp-debug
install_debug:
(cd ${debugdir} && $(MAKE) \
toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
+
+install-exec-local:
+ifeq ($(enable_shared),yes)
+ $(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
+endif
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

@ -1,11 +0,0 @@
--- a/boehm-gc/include/gc.h
+++ b/boehm-gc/include/gc.h
@@ -500,7 +500,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_of
#ifdef __linux__
# include <features.h>
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
- && !defined(__ia64__)
+ && !defined(__ia64__) && !defined(__UCLIBC__)
# ifndef GC_HAVE_BUILTIN_BACKTRACE
# define GC_HAVE_BUILTIN_BACKTRACE
# endif

@ -1,11 +0,0 @@
--- a/libstdc++-v3/include/c_std/std_cstdio.h
+++ b/libstdc++-v3/include/c_std/std_cstdio.h
@@ -143,7 +143,7 @@ namespace std
using ::vsprintf;
}
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
#undef snprintf
#undef vfscanf

@ -1,12 +0,0 @@
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -7324,6 +7324,9 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <complex.h>
+#ifdef __UCLIBC__
+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
+#endif
int
main ()
{

@ -1,24 +0,0 @@
--- a/libstdc++-v3/include/ext/rope
+++ b/libstdc++-v3/include/ext/rope
@@ -57,6 +57,9 @@
#include <bits/allocator.h>
#include <ext/hash_fun.h>
+/* cope w/ index defined as macro, SuSv3 proposal */
+#undef index
+
# ifdef __GC
# define __GC_CONST const
# else
--- a/libstdc++-v3/include/ext/ropeimpl.h
+++ b/libstdc++-v3/include/ext/ropeimpl.h
@@ -53,6 +53,9 @@
#include <ext/memory> // For uninitialized_copy_n
#include <ext/numeric> // For power
+/* cope w/ index defined as macro, SuSv3 proposal */
+#undef index
+
namespace __gnu_cxx
{
using std::size_t;

File diff suppressed because it is too large Load Diff

@ -1,20 +0,0 @@
--- a/fastjar/Makefile.in
+++ b/fastjar/Makefile.in
@@ -79,7 +79,7 @@ CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(fastjar_SOURCES) $(grepjar_SOURCES)
DIST_SOURCES = $(fastjar_SOURCES) $(grepjar_SOURCES)
-INFO_DEPS = fastjar.info
+INFO_DEPS =
am__TEXINFO_TEX_DIR = $(srcdir)/../gcc/doc/include
DVIS = fastjar.dvi
PDFS = fastjar.pdf
@@ -773,7 +773,7 @@ distcleancheck: distclean
exit 1; } >&2
check-am: all-am
check: check-am
-all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(MANS) config.h all-local
+all-am: Makefile $(PROGRAMS) $(MANS) config.h all-local
installdirs:
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \

@ -1,25 +0,0 @@
http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24836
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2435,7 +2435,7 @@ foo: .long 25
tls_first_minor=14
tls_as_opt="-m64 -Aesame --fatal-warnings"
;;
- sh-*-* | sh[34]-*-*)
+ sh-*-* | sh[34]*-*-*)
conftest_s='
.section ".tdata","awT",@progbits
foo: .long 25
--- a/gcc/configure
+++ b/gcc/configure
@@ -14762,7 +14762,7 @@ foo: .long 25
tls_first_minor=14
tls_as_opt="-m64 -Aesame --fatal-warnings"
;;
- sh-*-* | sh[34]-*-*)
+ sh-*-* | sh[34]*-*-*)
conftest_s='
.section ".tdata","awT",@progbits
foo: .long 25

@ -1,119 +0,0 @@
By Lennert Buytenhek <buytenh@wantstofly.org>
Adds support for arm*b-linux* big-endian ARM targets
See http://gcc.gnu.org/PR16350
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -28,19 +28,33 @@
#undef TARGET_VERSION
#define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr);
+/*
+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
+ * (big endian) configurations.
+ */
+#if TARGET_BIG_ENDIAN_DEFAULT
+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
+#define TARGET_ENDIAN_OPTION "mbig-endian"
+#define TARGET_LINKER_EMULATION "armelfb_linux"
+#else
+#define TARGET_ENDIAN_DEFAULT 0
+#define TARGET_ENDIAN_OPTION "mlittle-endian"
+#define TARGET_LINKER_EMULATION "armelf_linux"
+#endif
+
#undef TARGET_DEFAULT_FLOAT_ABI
#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
#undef TARGET_DEFAULT
-#define TARGET_DEFAULT (0)
+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
#undef MULTILIB_DEFAULTS
#define MULTILIB_DEFAULTS \
- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
+ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
/* Now we define the strings used to build the spec file. */
#undef LIB_SPEC
@@ -65,7 +79,7 @@
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker " LINUX_TARGET_INTERPRETER "} \
-X \
- %{mbig-endian:-EB}" \
+ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
SUBTARGET_EXTRA_LINK_SPEC
#undef LINK_SPEC
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -672,6 +672,11 @@ arm*-*-netbsd*)
;;
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"
+ case $target in
+ arm*b-*)
+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
+ ;;
+ esac
tmake_file="${tmake_file} t-linux arm/t-arm"
case ${target} in
arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
--- a/gcc/config/arm/linux-eabi.h
+++ b/gcc/config/arm/linux-eabi.h
@@ -20,6 +20,17 @@
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
+/*
+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
+ * (big endian) configurations.
+ */
+#undef TARGET_LINKER_EMULATION
+#if TARGET_BIG_ENDIAN_DEFAULT
+#define TARGET_LINKER_EMULATION "armelfb_linux_eabi"
+#else
+#define TARGET_LINKER_EMULATION "armelf_linux_eabi"
+#endif
+
/* On EABI GNU/Linux, we want both the BPABI builtins and the
GNU/Linux builtins. */
#undef TARGET_OS_CPP_BUILTINS
@@ -48,7 +59,7 @@
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
#undef SUBTARGET_EXTRA_LINK_SPEC
-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION
/* Use ld-linux.so.3 so that it will be possible to run "classic"
GNU/Linux binaries on an EABI system. */
--- a/gcc/config/arm/bpabi.h
+++ b/gcc/config/arm/bpabi.h
@@ -33,9 +33,19 @@
#undef FPUTYPE_DEFAULT
#define FPUTYPE_DEFAULT FPUTYPE_VFP
+/*
+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
+ * (big endian) configurations.
+ */
+#if TARGET_BIG_ENDIAN_DEFAULT
+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
+#else
+#define TARGET_ENDIAN_DEFAULT 0
+#endif
+
/* EABI targets should enable interworking by default. */
#undef TARGET_DEFAULT
-#define TARGET_DEFAULT MASK_INTERWORK
+#define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT)
/* The ARM BPABI functions return a boolean; they use no special
calling convention. */

@ -1,18 +0,0 @@
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -15371,6 +15371,15 @@ arm_unwind_emit_set (FILE * asm_out_file
/* Move from sp to reg. */
asm_fprintf (asm_out_file, "\t.movsp %r\n", REGNO (e0));
}
+ else if (GET_CODE (e1) == PLUS
+ && GET_CODE (XEXP (e1, 0)) == REG
+ && REGNO (XEXP (e1, 0)) == SP_REGNUM
+ && GET_CODE (XEXP (e1, 1)) == CONST_INT)
+ {
+ /* Set reg to offset from sp. */
+ asm_fprintf (asm_out_file, "\t.movsp %r, #%d\n",
+ REGNO (e0), (int)INTVAL(XEXP (e1, 1)));
+ }
else
abort ();
break;

@ -1,99 +0,0 @@
--- a/gcc/mklibgcc.in
+++ b/gcc/mklibgcc.in
@@ -195,6 +195,7 @@ for ml in $MULTILIBS; do
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
shlib_slibdir_qual=
libgcc_a=$dir/libgcc.a
+ libgcc_pic_a=$dir/libgcc_pic.a
libgcov_a=$dir/libgcov.a
libgcc_eh_a=
libgcc_s_so=
@@ -261,6 +262,7 @@ for ml in $MULTILIBS; do
echo "${outV}: ${outS}; \$(gen-hide-list)"
echo $libgcc_a: $out
+ echo $libgcc_pic_a: $outS
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
@@ -301,6 +303,7 @@ for ml in $MULTILIBS; do
-c '$(srcdir)/libgcc2.c' -o $out
echo $libgcc_a: $out
+ echo $libgcc_pic_a: $outS
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
@@ -336,6 +339,7 @@ for ml in $MULTILIBS; do
-fexceptions -fnon-call-exceptions -c '$(srcdir)/libgcc2.c' -o $out
echo $libgcc_a: $out
+ echo $libgcc_pic_a: $outS
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
@@ -369,6 +373,7 @@ for ml in $MULTILIBS; do
'$(vis_hide)' -c $FPBIT -o $out
echo $libgcc_a: $out
+ echo $libgcc_pic_a: $outS
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
@@ -400,6 +405,7 @@ for ml in $MULTILIBS; do
'$(vis_hide)' -c $DPBIT -o $out
echo $libgcc_a: $out
+ echo $libgcc_pic_a: $outS
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
@@ -430,6 +436,7 @@ for ml in $MULTILIBS; do
'$(vis_hide)' -c $TPBIT -o $out
echo $libgcc_a: $out
+ echo $libgcc_pic_a: $outS
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
@@ -482,6 +489,7 @@ for ml in $MULTILIBS; do
esac
echo $libgcc_a: $out
+ echo $libgcc_pic_a: $outS
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
@@ -601,6 +609,7 @@ for ml in $MULTILIBS; do
*) echo "Unhandled extension: $file">&2; exit 1 ;;
esac
+ echo $libgcc_pic_a: $outS
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
@@ -773,6 +782,13 @@ EOF
echo "all: $libgcc_a"
echo ""
+ echo "$libgcc_pic_a: stmp-dirs"
+ echo " -rm -f $libgcc_pic_a"
+ echo ' $(AR_CREATE_FOR_TARGET)' $libgcc_pic_a '$(objects)'
+ echo ' $(RANLIB_FOR_TARGET)' $libgcc_pic_a
+ echo "all: $libgcc_pic_a"
+
+ echo ""
echo "$libgcov_a: stmp-dirs"
echo " -rm -f $libgcov_a"
echo ' $(AR_CREATE_FOR_TARGET)' $libgcov_a '$(objects)'
@@ -874,6 +890,10 @@ for ml in $MULTILIBS; do
echo ' chmod 644' ${ldir}/libgcc_eh.a
echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc_eh.a
+ echo ' $(INSTALL_DATA)' ${dir}/libgcc_pic.a ${mapfile} ${ldir}/
+ echo ' chmod 644' ${ldir}/libgcc_pic.a
+ echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc_pic.a
+
shlib_slibdir_qual=
os_multilib_dir=`$GCC_FOR_TARGET $flags --print-multi-os-directory`
if [ "$os_multilib_dir" != . ]; then

@ -1,11 +0,0 @@
--- a/gcc/config/arm/linux-eabi.h
+++ b/gcc/config/arm/linux-eabi.h
@@ -56,7 +56,7 @@
The ARM10TDMI core is the default for armv5t, so set
SUBTARGET_CPU_DEFAULT to achieve this. */
#undef SUBTARGET_CPU_DEFAULT
-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
#undef SUBTARGET_EXTRA_LINK_SPEC
#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION

@ -1,277 +0,0 @@
This patch brings over a few features from MirBSD:
* -fhonour-copts
If this option is not given, it's warned (depending
on environment variables). This is to catch errors
of misbuilt packages which override CFLAGS themselves.
* -Werror-maybe-reset
Has the effect of -Wno-error if GCC_NO_WERROR is
set and not '0', a no-operation otherwise. This is
to be able to use -Werror in "make" but prevent
GNU autoconf generated configure scripts from
freaking out.
* Make -fno-strict-aliasing and -fno-delete-null-pointer-checks
the default for -O2/-Os, because they trigger gcc bugs
and can delete code with security implications.
This patch was authored by Thorsten Glaser <tg@mirbsd.de>
with copyright assignment to the FSF in effect.
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -103,6 +103,9 @@ static size_t deferred_count;
/* Number of deferred options scanned for -include. */
static size_t include_cursor;
+/* Check if a port honours COPTS. */
+static int honour_copts = 0;
+
static void set_Wimplicit (int);
static void handle_OPT_d (const char *);
static void set_std_cxx98 (int);
@@ -448,6 +451,14 @@ c_common_handle_option (size_t scode, co
mesg_implicit_function_declaration = 2;
break;
+ case OPT_Werror_maybe_reset:
+ {
+ char *ev = getenv ("GCC_NO_WERROR");
+ if ((ev != NULL) && (*ev != '0'))
+ cpp_opts->warnings_are_errors = 0;
+ }
+ break;
+
case OPT_Wformat:
set_Wformat (value);
break;
@@ -691,6 +702,12 @@ c_common_handle_option (size_t scode, co
flag_exceptions = value;
break;
+ case OPT_fhonour_copts:
+ if (c_language == clk_c) {
+ honour_copts++;
+ }
+ break;
+
case OPT_fimplement_inlines:
flag_implement_inlines = value;
break;
@@ -1121,6 +1138,47 @@ c_common_init (void)
/* Has to wait until now so that cpplib has its hash table. */
init_pragma ();
+ if (c_language == clk_c) {
+ char *ev = getenv ("GCC_HONOUR_COPTS");
+ int evv;
+ if (ev == NULL)
+ evv = -1;
+ else if ((*ev == '0') || (*ev == '\0'))
+ evv = 0;
+ else if (*ev == '1')
+ evv = 1;
+ else if (*ev == '2')
+ evv = 2;
+ else if (*ev == 's')
+ evv = -1;
+ else {
+ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1");
+ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */
+ }
+ if (evv == 1) {
+ if (honour_copts == 0) {
+ error ("someone does not honour COPTS at all in lenient mode");
+ return false;
+ } else if (honour_copts != 1) {
+ warning (0, "someone does not honour COPTS correctly, passed %d times",
+ honour_copts);
+ }
+ } else if (evv == 2) {
+ if (honour_copts == 0) {
+ error ("someone does not honour COPTS at all in strict mode");
+ return false;
+ } else if (honour_copts != 1) {
+ error ("someone does not honour COPTS correctly, passed %d times",
+ honour_copts);
+ return false;
+ }
+ } else if (evv == 0) {
+ if (honour_copts != 1)
+ inform ("someone does not honour COPTS correctly, passed %d times",
+ honour_copts);
+ }
+ }
+
return true;
}
--- a/gcc/c.opt
+++ b/gcc/c.opt
@@ -185,6 +185,10 @@ Werror-implicit-function-declaration
C ObjC RejectNegative
Make implicit function declarations an error
+Werror-maybe-reset
+C ObjC C++ ObjC++
+; Documented in common.opt
+
Wfloat-equal
C ObjC C++ ObjC++ Var(warn_float_equal)
Warn if testing floating point numbers for equality
@@ -541,6 +545,9 @@ C++ ObjC++
fhonor-std
C++ ObjC++
+fhonour-copts
+C ObjC C++ ObjC++ RejectNegative
+
fhosted
C ObjC
Assume normal C execution environment
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -77,6 +77,10 @@ Werror
Common Var(warnings_are_errors)
Treat all warnings as errors
+Werror-maybe-reset
+Common
+If environment variable GCC_NO_WERROR is set, act as -Wno-error
+
Wextra
Common
Print extra (possibly unwanted) warnings
@@ -451,6 +455,9 @@ fguess-branch-probability
Common Report Var(flag_guess_branch_prob)
Enable guessing of branch probabilities
+fhonour-copts
+Common RejectNegative
+
; Nonzero means ignore `#ident' directives. 0 means handle them.
; Generate position-independent code for executables if possible
; On SVR4 targets, it also controls whether or not to emit a
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -569,8 +569,6 @@ decode_options (unsigned int argc, const
flag_schedule_insns_after_reload = 1;
#endif
flag_regmove = 1;
- flag_strict_aliasing = 1;
- flag_delete_null_pointer_checks = 1;
flag_reorder_blocks = 1;
flag_reorder_functions = 1;
flag_tree_store_ccp = 1;
@@ -586,6 +584,9 @@ decode_options (unsigned int argc, const
if (optimize >= 3)
{
+ flag_strict_aliasing = 1;
+ flag_delete_null_pointer_checks = 1;
+
flag_inline_functions = 1;
flag_unswitch_loops = 1;
flag_gcse_after_reload = 1;
@@ -759,6 +760,17 @@ common_handle_option (size_t scode, cons
set_Wextra (value);
break;
+ case OPT_Werror_maybe_reset:
+ {
+ char *ev = getenv ("GCC_NO_WERROR");
+ if ((ev != NULL) && (*ev != '0'))
+ warnings_are_errors = 0;
+ }
+ break;
+
+ case OPT_fhonour_copts:
+ break;
+
case OPT_Wextra:
set_Wextra (value);
break;
--- a/gcc/doc/cppopts.texi
+++ b/gcc/doc/cppopts.texi
@@ -166,6 +166,11 @@ in older programs. This warning is on b
Make all warnings into hard errors. Source code which triggers warnings
will be rejected.
+@item -Werror-maybe-reset
+@opindex Werror-maybe-reset
+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
+variable is set to anything other than 0 or empty.
+
@item -Wsystem-headers
@opindex Wsystem-headers
Issue warnings for code in system headers. These are normally unhelpful
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -222,7 +222,7 @@ Objective-C and Objective-C++ Dialects}.
-Wc++-compat -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment @gol
-Wconversion -Wno-deprecated-declarations @gol
-Wdisabled-optimization -Wno-div-by-zero -Wno-endif-labels @gol
--Werror -Werror-implicit-function-declaration @gol
+-Werror -Werror-maybe-reset -Werror-implicit-function-declaration @gol
-Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol
-Wno-format-extra-args -Wformat-nonliteral @gol
-Wformat-security -Wformat-y2k @gol
@@ -3390,6 +3390,22 @@ This option is only supported for C and
@opindex Werror
Make all warnings into errors.
+@item -Werror-maybe-reset
+@opindex Werror-maybe-reset
+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
+variable is set to anything other than 0 or empty.
+
+@item -fhonour-copts
+@opindex fhonour-copts
+If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not
+given at least once, and warn if it is given more than once.
+If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not
+given exactly once.
+If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option
+is not given exactly once.
+The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}.
+This flag and environment variable only affect the C language.
+
@item -Wstack-protector
This option is only active when @option{-fstack-protector} is active. It
warns about functions that will not be protected against stack smashing.
@@ -4679,7 +4695,7 @@ erroneously read data to propagate withi
Perform the optimizations of loop strength reduction and
elimination of iteration variables.
-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
+Enabled at levels @option{-O3}.
@item -fthread-jumps
@opindex fthread-jumps
@@ -4826,7 +4842,7 @@ safely dereference null pointers. Use
@option{-fno-delete-null-pointer-checks} to disable this optimization
for programs which depend on that behavior.
-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
+Enabled at levels @option{-O3}.
@item -fexpensive-optimizations
@opindex fexpensive-optimizations
@@ -5234,7 +5250,7 @@ node, an alias set for the node. Nodes
allowed to alias. For an example, see the C front-end function
@code{c_get_alias_set}.
-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
+Enabled at levels @option{-O3}.
@item -falign-functions
@itemx -falign-functions=@var{n}
--- a/gcc/java/jvspec.c
+++ b/gcc/java/jvspec.c
@@ -620,6 +620,7 @@ lang_specific_pre_link (void)
class name. Append dummy `.c' that can be stripped by set_input so %b
is correct. */
set_input (concat (main_class_name, "main.c", NULL));
+ putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */
err = do_spec (jvgenmain_spec);
if (err == 0)
{

@ -1,25 +0,0 @@
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -63,7 +63,7 @@
%{shared:-lc} \
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"
-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
+#define LIBGCC_SPEC "-lgcc"
#ifdef USE_UCLIBC
#define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0"
--- a/gcc/config/arm/t-linux
+++ b/gcc/config/arm/t-linux
@@ -4,7 +4,10 @@ TARGET_LIBGCC2_CFLAGS = -fomit-frame-poi
LIBGCC2_DEBUG_CFLAGS = -g0
LIB1ASMSRC = arm/lib1funcs.asm
-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
+ _fixsfsi _fixunssfsi _floatdidf _floatundidf _floatdisf _floatundisf
# MULTILIB_OPTIONS = mhard-float/msoft-float
# MULTILIB_DIRNAMES = hard-float soft-float

@ -1,54 +0,0 @@
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33256
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -1252,6 +1252,20 @@ mips_split_const (rtx x, rtx *base, HOST
*base = x;
}
+/* Classify symbolic expression X, given that it appears in context
+ CONTEXT. */
+
+static enum mips_symbol_type
+mips_classify_symbolic_expression (rtx x)
+{
+ HOST_WIDE_INT offset;
+
+ mips_split_const (x, &x, &offset);
+ if (UNSPEC_ADDRESS_P (x))
+ return UNSPEC_ADDRESS_TYPE (x);
+
+ return mips_classify_symbol (x);
+}
/* Return true if SYMBOL is a SYMBOL_REF and OFFSET + SYMBOL points
to the same object as SYMBOL. */
@@ -1493,8 +1507,17 @@ mips_classify_address (struct mips_addre
info->type = ADDRESS_LO_SUM;
info->reg = XEXP (x, 0);
info->offset = XEXP (x, 1);
+ /* We have to trust the creator of the LO_SUM to do something vaguely
+ sane. Target-independent code that creates a LO_SUM should also
+ create and verify the matching HIGH. Target-independent code that
+ adds an offset to a LO_SUM must prove that the offset will not
+ induce a carry. Failure to do either of these things would be
+ a bug, and we are not required to check for it here. The MIPS
+ backend itself should only create LO_SUMs for valid symbolic
+ constants, with the high part being either a HIGH or a copy
+ of _gp. */
+ info->symbol_type = mips_classify_symbolic_expression (info->offset);
return (mips_valid_base_register_p (info->reg, mode, strict)
- && mips_symbolic_constant_p (info->offset, &info->symbol_type)
&& mips_symbolic_address_p (info->symbol_type, mode)
&& mips_lo_relocs[info->symbol_type] != 0);
@@ -5575,7 +5598,8 @@ print_operand_reloc (FILE *file, rtx op,
rtx base;
HOST_WIDE_INT offset;
- if (!mips_symbolic_constant_p (op, &symbol_type) || relocs[symbol_type] == 0)
+ symbol_type = mips_classify_symbolic_expression (op);
+ if (relocs[symbol_type] == 0)
fatal_insn ("PRINT_OPERAND, invalid operand for relocation", op);
/* If OP uses an UNSPEC address, we want to print the inner symbol. */

@ -1,232 +0,0 @@
Index: gcc-4.2.3/libgomp/configure
===================================================================
--- gcc-4.2.3.orig/libgomp/configure 2008-02-01 18:06:50.000000000 +0100
+++ gcc-4.2.3/libgomp/configure 2008-05-21 13:45:41.641289283 +0200
@@ -3893,7 +3893,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux*)
lt_cv_deplibs_check_method=pass_all
;;
Index: gcc-4.2.3/gcc/config/cris/linux.h
===================================================================
--- gcc-4.2.3.orig/gcc/config/cris/linux.h 2007-09-01 17:28:30.000000000 +0200
+++ gcc-4.2.3/gcc/config/cris/linux.h 2008-05-21 13:45:41.641289283 +0200
@@ -73,7 +73,11 @@
#define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
#undef CRIS_SUBTARGET_VERSION
-#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
+#if UCLIBC_DEFAULT
+# define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
+#else
+# define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
+#endif
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
Index: gcc-4.2.3/libstdc++-v3/configure
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/configure 2007-06-29 01:02:05.000000000 +0200
+++ gcc-4.2.3/libstdc++-v3/configure 2008-05-21 13:45:41.725287971 +0200
@@ -4283,7 +4283,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux*)
lt_cv_deplibs_check_method=pass_all
;;
Index: gcc-4.2.3/zlib/configure
===================================================================
--- gcc-4.2.3.orig/zlib/configure 2007-01-17 19:10:26.000000000 +0100
+++ gcc-4.2.3/zlib/configure 2008-05-21 13:45:41.753288186 +0200
@@ -3429,7 +3429,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux*)
lt_cv_deplibs_check_method=pass_all
;;
Index: gcc-4.2.3/libobjc/configure
===================================================================
--- gcc-4.2.3.orig/libobjc/configure 2006-10-15 09:42:57.000000000 +0200
+++ gcc-4.2.3/libobjc/configure 2008-05-21 13:45:41.773288499 +0200
@@ -3314,7 +3314,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux*)
lt_cv_deplibs_check_method=pass_all
;;
Index: gcc-4.2.3/libgfortran/configure
===================================================================
--- gcc-4.2.3.orig/libgfortran/configure 2008-02-01 18:06:49.000000000 +0100
+++ gcc-4.2.3/libgfortran/configure 2008-05-21 13:45:41.789288861 +0200
@@ -3721,7 +3721,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux*)
lt_cv_deplibs_check_method=pass_all
;;
Index: gcc-4.2.3/libmudflap/configure
===================================================================
--- gcc-4.2.3.orig/libmudflap/configure 2006-12-04 12:13:07.000000000 +0100
+++ gcc-4.2.3/libmudflap/configure 2008-05-21 13:45:41.809288615 +0200
@@ -5394,7 +5394,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux*)
lt_cv_deplibs_check_method=pass_all
;;
Index: gcc-4.2.3/boehm-gc/configure
===================================================================
--- gcc-4.2.3.orig/boehm-gc/configure 2008-02-01 18:06:49.000000000 +0100
+++ gcc-4.2.3/boehm-gc/configure 2008-05-21 13:45:41.833288320 +0200
@@ -4323,7 +4323,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux*)
lt_cv_deplibs_check_method=pass_all
;;
Index: gcc-4.2.3/libffi/configure
===================================================================
--- gcc-4.2.3.orig/libffi/configure 2008-02-01 18:06:49.000000000 +0100
+++ gcc-4.2.3/libffi/configure 2008-05-21 13:45:41.869288157 +0200
@@ -3460,7 +3460,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux*)
lt_cv_deplibs_check_method=pass_all
;;
Index: gcc-4.2.3/libssp/configure
===================================================================
--- gcc-4.2.3.orig/libssp/configure 2006-10-15 09:42:57.000000000 +0200
+++ gcc-4.2.3/libssp/configure 2008-05-21 13:45:41.897286416 +0200
@@ -4480,7 +4480,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux*)
lt_cv_deplibs_check_method=pass_all
;;
Index: gcc-4.2.3/contrib/regression/objs-gcc.sh
===================================================================
--- gcc-4.2.3.orig/contrib/regression/objs-gcc.sh 2005-08-15 02:41:31.000000000 +0200
+++ gcc-4.2.3/contrib/regression/objs-gcc.sh 2008-05-21 13:45:41.897286416 +0200
@@ -105,6 +105,10 @@
then
make all-gdb all-dejagnu all-ld || exit 1
make install-gdb install-dejagnu install-ld || exit 1
+elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
+ then
+ make all-gdb all-dejagnu all-ld || exit 1
+ make install-gdb install-dejagnu install-ld || exit 1
elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
make bootstrap || exit 1
make install || exit 1
Index: gcc-4.2.3/libjava/classpath/ltconfig
===================================================================
--- gcc-4.2.3.orig/libjava/classpath/ltconfig 2006-08-07 22:37:50.000000000 +0200
+++ gcc-4.2.3/libjava/classpath/ltconfig 2008-05-21 13:45:41.897286416 +0200
@@ -603,7 +603,7 @@
# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
case $host_os in
-linux-gnu*) ;;
+linux-gnu*|linux-uclibc*) ;;
linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
esac
@@ -1251,7 +1251,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux*)
version_type=linux
need_lib_prefix=no
need_version=no
Index: gcc-4.2.3/libjava/classpath/configure
===================================================================
--- gcc-4.2.3.orig/libjava/classpath/configure 2007-01-17 19:10:26.000000000 +0100
+++ gcc-4.2.3/libjava/classpath/configure 2008-05-21 13:45:41.921288635 +0200
@@ -5307,7 +5307,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux*)
lt_cv_deplibs_check_method=pass_all
;;
Index: gcc-4.2.3/libjava/configure
===================================================================
--- gcc-4.2.3.orig/libjava/configure 2008-02-01 18:06:50.000000000 +0100
+++ gcc-4.2.3/libjava/configure 2008-05-21 13:45:41.933288487 +0200
@@ -5424,7 +5424,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux*)
lt_cv_deplibs_check_method=pass_all
;;
Index: gcc-4.2.3/libtool.m4
===================================================================
--- gcc-4.2.3.orig/libtool.m4 2005-07-16 04:30:53.000000000 +0200
+++ gcc-4.2.3/libtool.m4 2008-05-21 13:45:41.949288291 +0200
@@ -739,7 +739,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux*)
lt_cv_deplibs_check_method=pass_all
;;
Index: gcc-4.2.3/ltconfig
===================================================================
--- gcc-4.2.3.orig/ltconfig 2007-02-14 18:08:35.000000000 +0100
+++ gcc-4.2.3/ltconfig 2008-05-21 13:45:41.961288143 +0200
@@ -603,7 +603,7 @@
# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
case $host_os in
-linux-gnu*) ;;
+linux-gnu*|linux-uclibc*) ;;
linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
esac
@@ -1251,7 +1251,7 @@
;;
# This must be Linux ELF.
-linux-gnu*)
+linux*)
version_type=linux
need_lib_prefix=no
need_version=no

@ -1,13 +0,0 @@
Index: gcc-4.2.3/gcc/config.gcc
===================================================================
--- gcc-4.2.3.orig/gcc/config.gcc 2007-12-27 10:45:20.000000000 +0100
+++ gcc-4.2.3/gcc/config.gcc 2008-05-21 13:45:43.333288320 +0200
@@ -1967,7 +1967,7 @@
;;
sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
- sh-*-linux* | sh[346lbe]*-*-linux* | \
+ sh*-*-linux* | sh[346lbe]*-*-linux* | \
sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
sh64-*-netbsd* | sh64l*-*-netbsd*)
tmake_file="${tmake_file} sh/t-sh sh/t-elf"

File diff suppressed because it is too large Load Diff

@ -1,233 +0,0 @@
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-05-21 13:45:43.925289703 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-05-21 13:45:45.253289024 +0200
@@ -60,4 +60,49 @@
extern "C" __typeof(wctype_l) __wctype_l;
#endif
+# define __nl_langinfo_l nl_langinfo_l
+# define __strcoll_l strcoll_l
+# define __strftime_l strftime_l
+# define __strtod_l strtod_l
+# define __strtof_l strtof_l
+# define __strtold_l strtold_l
+# define __strxfrm_l strxfrm_l
+# define __newlocale newlocale
+# define __freelocale freelocale
+# define __duplocale duplocale
+# define __uselocale uselocale
+
+# ifdef _GLIBCXX_USE_WCHAR_T
+# define __iswctype_l iswctype_l
+# define __towlower_l towlower_l
+# define __towupper_l towupper_l
+# define __wcscoll_l wcscoll_l
+# define __wcsftime_l wcsftime_l
+# define __wcsxfrm_l wcsxfrm_l
+# define __wctype_l wctype_l
+# endif
+
+#else
+# define __nl_langinfo_l(N, L) nl_langinfo((N))
+# define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
+# define __strtod_l(S, E, L) strtod((S), (E))
+# define __strtof_l(S, E, L) strtof((S), (E))
+# define __strtold_l(S, E, L) strtold((S), (E))
+# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
+# warning should dummy __newlocale check for C|POSIX ?
+# define __newlocale(a, b, c) NULL
+# define __freelocale(a) ((void)0)
+# define __duplocale(a) __c_locale()
+//# define __uselocale ?
+//
+# ifdef _GLIBCXX_USE_WCHAR_T
+# define __iswctype_l(C, M, L) iswctype((C), (M))
+# define __towlower_l(C, L) towlower((C))
+# define __towupper_l(C, L) towupper((C))
+# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
+//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T))
+# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
+# define __wctype_l(S, L) wctype((S))
+# endif
+
#endif // GLIBC 2.3 and later
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.cc
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-05-21 13:45:43.925289703 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-05-21 13:45:45.253289024 +0200
@@ -39,20 +39,6 @@
#include <langinfo.h>
#include <bits/c++locale_internal.h>
-#ifndef __UCLIBC_HAS_XLOCALE__
-#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
-#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
-#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
-#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
-#define __strtof_l(S, E, L) strtof((S), (E))
-#define __strtod_l(S, E, L) strtod((S), (E))
-#define __strtold_l(S, E, L) strtold((S), (E))
-#warning should dummy __newlocale check for C|POSIX ?
-#define __newlocale(a, b, c) NULL
-#define __freelocale(a) ((void)0)
-#define __duplocale(a) __c_locale()
-#endif
-
namespace std
{
template<>
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/collate_members.cc
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-05-21 13:45:43.929287698 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-05-21 13:45:45.253289024 +0200
@@ -36,13 +36,6 @@
#include <locale>
#include <bits/c++locale_internal.h>
-#ifndef __UCLIBC_HAS_XLOCALE__
-#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
-#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
-#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
-#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
-#endif
-
namespace std
{
// These are basically extensions to char_traits, and perhaps should
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/monetary_members.cc
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-05-21 13:45:43.933287929 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-05-21 13:45:45.257288137 +0200
@@ -43,10 +43,6 @@
#warning tailor for stub locale support
#endif
-#ifndef __UCLIBC_HAS_XLOCALE__
-#define __nl_langinfo_l(N, L) nl_langinfo((N))
-#endif
-
namespace std
{
// Construct and return valid pattern consisting of some combination of:
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/numeric_members.cc
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-05-21 13:45:43.933287929 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-05-21 13:45:45.257288137 +0200
@@ -41,9 +41,6 @@
#ifdef __UCLIBC_MJN3_ONLY__
#warning tailor for stub locale support
#endif
-#ifndef __UCLIBC_HAS_XLOCALE__
-#define __nl_langinfo_l(N, L) nl_langinfo((N))
-#endif
namespace std
{
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/time_members.cc
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-05-21 13:45:43.933287929 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-05-21 13:45:45.257288137 +0200
@@ -40,9 +40,6 @@
#ifdef __UCLIBC_MJN3_ONLY__
#warning tailor for stub locale support
#endif
-#ifndef __UCLIBC_HAS_XLOCALE__
-#define __nl_langinfo_l(N, L) nl_langinfo((N))
-#endif
namespace std
{
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/ctype_members.cc
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-05-21 13:45:43.929287698 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-05-21 13:45:45.257288137 +0200
@@ -38,13 +38,6 @@
#undef _LIBC
#include <bits/c++locale_internal.h>
-#ifndef __UCLIBC_HAS_XLOCALE__
-#define __wctype_l(S, L) wctype((S))
-#define __towupper_l(C, L) towupper((C))
-#define __towlower_l(C, L) towlower((C))
-#define __iswctype_l(C, M, L) iswctype((C), (M))
-#endif
-
namespace std
{
// NB: The other ctype<char> specializations are in src/locale.cc and
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.cc
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-05-21 13:45:43.929287698 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-05-21 13:45:45.257288137 +0200
@@ -39,13 +39,10 @@
#ifdef __UCLIBC_MJN3_ONLY__
#warning fix gettext stuff
#endif
-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-extern "C" char *__dcgettext(const char *domainname,
- const char *msgid, int category);
#undef gettext
-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
#else
-#undef gettext
#define gettext(msgid) (msgid)
#endif
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.h
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-05-21 13:45:43.929287698 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-05-21 13:45:45.257288137 +0200
@@ -36,15 +36,11 @@
#ifdef __UCLIBC_MJN3_ONLY__
#warning fix prototypes for *textdomain funcs
#endif
-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-extern "C" char *__textdomain(const char *domainname);
-extern "C" char *__bindtextdomain(const char *domainname,
- const char *dirname);
-#else
-#undef __textdomain
-#undef __bindtextdomain
-#define __textdomain(D) ((void)0)
-#define __bindtextdomain(D,P) ((void)0)
+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
+#undef textdomain
+#undef bindtextdomain
+#define textdomain(D) ((void)0)
+#define bindtextdomain(D,P) ((void)0)
#endif
// Non-virtual member functions.
@@ -70,7 +66,7 @@
messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
const char* __dir) const
{
- __bindtextdomain(__s.c_str(), __dir);
+ bindtextdomain(__s.c_str(), __dir);
return this->do_open(__s, __loc);
}
@@ -90,7 +86,7 @@
{
// No error checking is done, assume the catalog exists and can
// be used.
- __textdomain(__s.c_str());
+ textdomain(__s.c_str());
return 0;
}
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.h
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-05-21 13:45:43.925289703 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-05-21 13:45:45.257288137 +0200
@@ -68,6 +68,7 @@
{
extern "C" __typeof(uselocale) __uselocale;
}
+#define __uselocale uselocale
#endif
namespace std

@ -1,52 +0,0 @@
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/monetary_members.cc
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-05-21 13:45:45.257288137 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-05-21 13:45:46.105290284 +0200
@@ -401,7 +401,7 @@
# ifdef __UCLIBC_HAS_XLOCALE__
_M_data->_M_decimal_point = __cloc->decimal_point_wc;
_M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
-# else
+# elif defined __UCLIBC_HAS_LOCALE__
_M_data->_M_decimal_point = __global_locale->decimal_point_wc;
_M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
# endif
@@ -556,7 +556,7 @@
# ifdef __UCLIBC_HAS_XLOCALE__
_M_data->_M_decimal_point = __cloc->decimal_point_wc;
_M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
-# else
+# elif defined __UCLIBC_HAS_LOCALE__
_M_data->_M_decimal_point = __global_locale->decimal_point_wc;
_M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
# endif
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/numeric_members.cc
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-05-21 13:45:45.257288137 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-05-21 13:45:46.105290284 +0200
@@ -127,12 +127,25 @@
{
// Named locale.
// NB: In the GNU model wchar_t is always 32 bit wide.
+#ifdef __UCLIBC_MJN3_ONLY__
+#warning fix this... should be numeric
+#endif
+#ifdef __UCLIBC__
+# ifdef __UCLIBC_HAS_XLOCALE__
+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
+# elif defined __UCLIBC_HAS_LOCALE__
+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
+# endif
+#else
union { char *__s; wchar_t __w; } __u;
__u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
_M_data->_M_decimal_point = __u.__w;
__u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
_M_data->_M_thousands_sep = __u.__w;
+#endif
if (_M_data->_M_thousands_sep == L'\0')
_M_data->_M_grouping = "";

@ -1,361 +0,0 @@
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.cc
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-05-21 13:45:45.253289024 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-05-21 13:45:46.729290157 +0200
@@ -46,16 +46,13 @@
__convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
const __c_locale& __cloc)
{
- if (!(__err & ios_base::failbit))
- {
- char* __sanity;
- errno = 0;
- float __f = __strtof_l(__s, &__sanity, __cloc);
- if (__sanity != __s && errno != ERANGE)
- __v = __f;
- else
- __err |= ios_base::failbit;
- }
+ char* __sanity;
+ errno = 0;
+ float __f = __strtof_l(__s, &__sanity, __cloc);
+ if (__sanity != __s && errno != ERANGE)
+ __v = __f;
+ else
+ __err |= ios_base::failbit;
}
template<>
@@ -63,16 +60,13 @@
__convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
const __c_locale& __cloc)
{
- if (!(__err & ios_base::failbit))
- {
- char* __sanity;
- errno = 0;
- double __d = __strtod_l(__s, &__sanity, __cloc);
- if (__sanity != __s && errno != ERANGE)
- __v = __d;
- else
- __err |= ios_base::failbit;
- }
+ char* __sanity;
+ errno = 0;
+ double __d = __strtod_l(__s, &__sanity, __cloc);
+ if (__sanity != __s && errno != ERANGE)
+ __v = __d;
+ else
+ __err |= ios_base::failbit;
}
template<>
@@ -80,16 +74,13 @@
__convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
const __c_locale& __cloc)
{
- if (!(__err & ios_base::failbit))
- {
- char* __sanity;
- errno = 0;
- long double __ld = __strtold_l(__s, &__sanity, __cloc);
- if (__sanity != __s && errno != ERANGE)
- __v = __ld;
- else
- __err |= ios_base::failbit;
- }
+ char* __sanity;
+ errno = 0;
+ long double __ld = __strtold_l(__s, &__sanity, __cloc);
+ if (__sanity != __s && errno != ERANGE)
+ __v = __ld;
+ else
+ __err |= ios_base::failbit;
}
void
@@ -110,7 +101,7 @@
void
locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
{
- if (_S_get_c_locale() != __cloc)
+ if (__cloc && _S_get_c_locale() != __cloc)
__freelocale(__cloc);
}
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/ctype_members.cc
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-05-21 13:45:45.257288137 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-05-21 13:45:46.729290157 +0200
@@ -33,9 +33,14 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
+#include <features.h>
+#ifdef __UCLIBC_HAS_LOCALE__
#define _LIBC
#include <locale>
#undef _LIBC
+#else
+#include <locale>
+#endif
#include <bits/c++locale_internal.h>
namespace std
@@ -138,20 +143,34 @@
ctype<wchar_t>::
do_is(mask __m, wchar_t __c) const
{
- // Highest bitmask in ctype_base == 10, but extra in "C"
- // library for blank.
+ // The case of __m == ctype_base::space is particularly important,
+ // due to its use in many istream functions. Therefore we deal with
+ // it first, exploiting the knowledge that on GNU systems _M_bit[5]
+ // is the mask corresponding to ctype_base::space. NB: an encoding
+ // change would not affect correctness!
bool __ret = false;
- const size_t __bitmasksize = 11;
- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
- if (__m & _M_bit[__bitcur]
- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
- {
- __ret = true;
- break;
- }
+ if (__m == _M_bit[5])
+ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
+ else
+ {
+ // Highest bitmask in ctype_base == 10, but extra in "C"
+ // library for blank.
+ const size_t __bitmasksize = 11;
+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
+ if (__m & _M_bit[__bitcur])
+ {
+ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
+ {
+ __ret = true;
+ break;
+ }
+ else if (__m == _M_bit[__bitcur])
+ break;
+ }
+ }
return __ret;
}
-
+
const wchar_t*
ctype<wchar_t>::
do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.h
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-05-21 13:45:45.257288137 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-05-21 13:45:46.729290157 +0200
@@ -47,18 +47,21 @@
template<typename _CharT>
messages<_CharT>::messages(size_t __refs)
: facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
- _M_name_messages(_S_get_c_name())
+ _M_name_messages(_S_get_c_name())
{ }
template<typename _CharT>
messages<_CharT>::messages(__c_locale __cloc, const char* __s,
size_t __refs)
- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
- _M_name_messages(__s)
+ : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
{
- char* __tmp = new char[std::strlen(__s) + 1];
- std::strcpy(__tmp, __s);
+ const size_t __len = std::strlen(__s) + 1;
+ char* __tmp = new char[__len];
+ std::memcpy(__tmp, __s, __len);
_M_name_messages = __tmp;
+
+ // Last to avoid leaking memory if new throws.
+ _M_c_locale_messages = _S_clone_c_locale(__cloc);
}
template<typename _CharT>
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/monetary_members.cc
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-05-21 13:45:46.105290284 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-05-21 13:45:46.729290157 +0200
@@ -33,9 +33,14 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
+#include <features.h>
+#ifdef __UCLIBC_HAS_LOCALE__
#define _LIBC
#include <locale>
#undef _LIBC
+#else
+#include <locale>
+#endif
#include <bits/c++locale_internal.h>
#ifdef __UCLIBC_MJN3_ONLY__
@@ -206,7 +211,7 @@
}
break;
default:
- ;
+ __ret = pattern();
}
return __ret;
}
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/numeric_members.cc
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-05-21 13:45:46.105290284 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-05-21 13:45:46.733288711 +0200
@@ -33,9 +33,14 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
+#include <features.h>
+#ifdef __UCLIBC_HAS_LOCALE__
#define _LIBC
#include <locale>
#undef _LIBC
+#else
+#include <locale>
+#endif
#include <bits/c++locale_internal.h>
#ifdef __UCLIBC_MJN3_ONLY__
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/time_members.h
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-05-21 13:45:43.933287929 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/time_members.h 2008-05-21 13:45:46.733288711 +0200
@@ -37,25 +37,33 @@
template<typename _CharT>
__timepunct<_CharT>::__timepunct(size_t __refs)
: facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
- _M_name_timepunct(_S_get_c_name())
+ _M_name_timepunct(_S_get_c_name())
{ _M_initialize_timepunct(); }
template<typename _CharT>
__timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
: facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
- _M_name_timepunct(_S_get_c_name())
+ _M_name_timepunct(_S_get_c_name())
{ _M_initialize_timepunct(); }
template<typename _CharT>
__timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
size_t __refs)
: facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
- _M_name_timepunct(__s)
+ _M_name_timepunct(NULL)
{
- char* __tmp = new char[std::strlen(__s) + 1];
- std::strcpy(__tmp, __s);
+ const size_t __len = std::strlen(__s) + 1;
+ char* __tmp = new char[__len];
+ std::memcpy(__tmp, __s, __len);
_M_name_timepunct = __tmp;
- _M_initialize_timepunct(__cloc);
+
+ try
+ { _M_initialize_timepunct(__cloc); }
+ catch(...)
+ {
+ delete [] _M_name_timepunct;
+ __throw_exception_again;
+ }
}
template<typename _CharT>
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.h
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-05-21 13:45:45.257288137 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-05-21 13:45:46.733288711 +0200
@@ -39,21 +39,23 @@
#pragma GCC system_header
#include <cstring> // get std::strlen
-#include <cstdio> // get std::snprintf or std::sprintf
+#include <cstdio> // get std::vsnprintf or std::vsprintf
#include <clocale>
#include <langinfo.h> // For codecvt
#ifdef __UCLIBC_MJN3_ONLY__
#warning fix this
#endif
-#ifdef __UCLIBC_HAS_LOCALE__
+#ifdef _GLIBCXX_USE_ICONV
#include <iconv.h> // For codecvt using iconv, iconv_t
#endif
-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-#include <libintl.h> // For messages
+#ifdef HAVE_LIBINTL_H
+#include <libintl.h> // For messages
#endif
+#include <cstdarg>
#ifdef __UCLIBC_MJN3_ONLY__
#warning what is _GLIBCXX_C_LOCALE_GNU for
+// psm: used in os/gnu-linux/ctype_noninline.h
#endif
#define _GLIBCXX_C_LOCALE_GNU 1
@@ -62,7 +64,7 @@
#endif
// #define _GLIBCXX_NUM_CATEGORIES 6
#define _GLIBCXX_NUM_CATEGORIES 0
-
+
#ifdef __UCLIBC_HAS_XLOCALE__
namespace __gnu_cxx
{
@@ -79,22 +81,24 @@
typedef int* __c_locale;
#endif
- // Convert numeric value of type _Tv to string and return length of
- // string. If snprintf is available use it, otherwise fall back to
- // the unsafe sprintf which, in general, can be dangerous and should
+ // Convert numeric value of type double to string and return length of
+ // string. If vsnprintf is available use it, otherwise fall back to
+ // the unsafe vsprintf which, in general, can be dangerous and should
// be avoided.
- template<typename _Tv>
- int
- __convert_from_v(char* __out,
- const int __size __attribute__ ((__unused__)),
- const char* __fmt,
-#ifdef __UCLIBC_HAS_XCLOCALE__
- _Tv __v, const __c_locale& __cloc, int __prec)
+ inline int
+ __convert_from_v(const __c_locale&
+#ifndef __UCLIBC_HAS_XCLOCALE__
+ __cloc __attribute__ ((__unused__))
+#endif
+ ,
+ char* __out,
+ const int __size,
+ const char* __fmt, ...)
{
+ va_list __args;
+#ifdef __UCLIBC_HAS_XCLOCALE__
__c_locale __old = __gnu_cxx::__uselocale(__cloc);
#else
- _Tv __v, const __c_locale&, int __prec)
- {
# ifdef __UCLIBC_HAS_LOCALE__
char* __old = std::setlocale(LC_ALL, NULL);
char* __sav = new char[std::strlen(__old) + 1];
@@ -103,7 +107,9 @@
# endif
#endif
- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
+ va_start(__args, __fmt);
+ const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
+ va_end(__args);
#ifdef __UCLIBC_HAS_XCLOCALE__
__gnu_cxx::__uselocale(__old);

@ -1,54 +0,0 @@
# DP: Build and install libstdc++_pic.a library.
Index: gcc-4.2.3/libstdc++-v3/src/Makefile.am
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/src/Makefile.am 2006-07-28 06:57:34.000000000 +0200
+++ gcc-4.2.3/libstdc++-v3/src/Makefile.am 2008-05-21 13:45:47.465287535 +0200
@@ -257,6 +257,12 @@
$(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
+install-exec-local:
+ifeq ($(enable_shared),yes)
+ $(AR) cru libstdc++_pic.a .libs/*.o $(top_builddir)/libsupc++/*.o
+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
+endif
+
# Added bits to build debug library.
if GLIBCXX_BUILD_DEBUG
all-local: build_debug
Index: gcc-4.2.3/libstdc++-v3/src/Makefile.in
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/src/Makefile.in 2006-10-16 21:08:22.000000000 +0200
+++ gcc-4.2.3/libstdc++-v3/src/Makefile.in 2008-05-21 13:45:47.465287535 +0200
@@ -657,7 +657,7 @@
install-data-am: install-data-local
-install-exec-am: install-toolexeclibLTLIBRARIES
+install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
install-info: install-info-am
@@ -690,6 +690,7 @@
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-data-local install-exec \
+ install-exec-local \
install-exec-am install-info install-info-am install-man \
install-strip install-toolexeclibLTLIBRARIES installcheck \
installcheck-am installdirs maintainer-clean \
@@ -799,6 +800,13 @@
install_debug:
(cd ${debugdir} && $(MAKE) \
toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install)
+
+install-exec-local:
+ifeq ($(enable_shared),yes)
+ $(AR) cru libstdc++_pic.a *.o $(top_builddir)/libsupc++/*.o
+ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir)
+endif
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

@ -1,13 +0,0 @@
Index: gcc-4.2.3/boehm-gc/include/gc.h
===================================================================
--- gcc-4.2.3.orig/boehm-gc/include/gc.h 2006-09-18 20:45:08.000000000 +0200
+++ gcc-4.2.3/boehm-gc/include/gc.h 2008-05-21 13:45:48.073288722 +0200
@@ -502,7 +502,7 @@
#if defined(__linux__) || defined(__GLIBC__)
# include <features.h>
# if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
- && !defined(__ia64__)
+ && !defined(__ia64__) && !defined(__UCLIBC__)
# ifndef GC_HAVE_BUILTIN_BACKTRACE
# define GC_HAVE_BUILTIN_BACKTRACE
# endif

@ -1,13 +0,0 @@
Index: gcc-4.2.3/libstdc++-v3/include/c_std/std_cstdio.h
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/include/c_std/std_cstdio.h 2006-12-07 10:33:51.000000000 +0100
+++ gcc-4.2.3/libstdc++-v3/include/c_std/std_cstdio.h 2008-05-21 13:45:48.645288116 +0200
@@ -144,7 +144,7 @@
_GLIBCXX_END_NAMESPACE
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
#undef snprintf
#undef vfscanf

@ -1,14 +0,0 @@
Index: gcc-4.2.3/libstdc++-v3/configure
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/configure 2008-05-21 13:45:44.017287734 +0200
+++ gcc-4.2.3/libstdc++-v3/configure 2008-05-21 13:45:49.305288105 +0200
@@ -7514,6 +7514,9 @@
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <complex.h>
+#ifdef __UCLIBC__
+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
+#endif
int
main ()
{

@ -1,28 +0,0 @@
Index: gcc-4.2.3/libstdc++-v3/include/ext/rope
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/include/ext/rope 2006-10-17 13:56:21.000000000 +0200
+++ gcc-4.2.3/libstdc++-v3/include/ext/rope 2008-05-21 13:45:50.017288293 +0200
@@ -58,6 +58,9 @@
#include <bits/allocator.h>
#include <ext/hash_fun.h>
+/* cope w/ index defined as macro, SuSv3 proposal */
+#undef index
+
# ifdef __GC
# define __GC_CONST const
# else
Index: gcc-4.2.3/libstdc++-v3/include/ext/ropeimpl.h
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/include/ext/ropeimpl.h 2006-10-17 13:56:21.000000000 +0200
+++ gcc-4.2.3/libstdc++-v3/include/ext/ropeimpl.h 2008-05-21 13:45:50.017288293 +0200
@@ -54,6 +54,9 @@
#include <ext/memory> // For uninitialized_copy_n
#include <ext/numeric> // For power
+/* cope w/ index defined as macro, SuSv3 proposal */
+#undef index
+
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
using std::size_t;

@ -1,49 +0,0 @@
Index: gcc-4.2.3/libmudflap/mf-hooks2.c
===================================================================
--- gcc-4.2.3.orig/libmudflap/mf-hooks2.c 2005-09-23 23:58:39.000000000 +0200
+++ gcc-4.2.3/libmudflap/mf-hooks2.c 2008-05-21 13:45:50.653288577 +0200
@@ -427,7 +427,7 @@
{
TRACE ("%s\n", __PRETTY_FUNCTION__);
MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
- bzero (s, n);
+ memset (s, 0, n);
}
@@ -437,7 +437,7 @@
TRACE ("%s\n", __PRETTY_FUNCTION__);
MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
- bcopy (src, dest, n);
+ memmove (dest, src, n);
}
@@ -447,7 +447,7 @@
TRACE ("%s\n", __PRETTY_FUNCTION__);
MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
- return bcmp (s1, s2, n);
+ return n == 0 ? 0 : memcmp (s1, s2, n);
}
@@ -456,7 +456,7 @@
size_t n = strlen (s);
TRACE ("%s\n", __PRETTY_FUNCTION__);
MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
- return index (s, c);
+ return strchr (s, c);
}
@@ -465,7 +465,7 @@
size_t n = strlen (s);
TRACE ("%s\n", __PRETTY_FUNCTION__);
MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
- return rindex (s, c);
+ return strrchr (s, c);
}
/* XXX: stpcpy, memccpy */

@ -1,38 +0,0 @@
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.h
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-05-21 13:45:46.729290157 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-05-21 13:45:51.249287676 +0200
@@ -32,7 +32,8 @@
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
-
+namespace std
+{
#ifdef __UCLIBC_MJN3_ONLY__
#warning fix prototypes for *textdomain funcs
#endif
@@ -115,3 +116,4 @@
this->_S_create_c_locale(this->_M_c_locale_messages, __s);
}
}
+}
Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/time_members.h
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-05-21 13:45:46.733288711 +0200
+++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/time_members.h 2008-05-21 13:45:51.249287676 +0200
@@ -33,7 +33,8 @@
//
// Written by Benjamin Kosnik <bkoz@redhat.com>
-
+namespace std
+{
template<typename _CharT>
__timepunct<_CharT>::__timepunct(size_t __refs)
: facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
@@ -74,3 +75,4 @@
delete _M_data;
_S_destroy_c_locale(_M_c_locale_timepunct);
}
+}

@ -1,28 +0,0 @@
This patch fixes a bug into ostream::operator<<(double) due to the wrong size
passed into the __convert_from_v method. The wrong size is then passed to
std::snprintf function, that, on uClibc, doens't handle sized 0 buffer.
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Index: gcc-4.2.3/libstdc++-v3/include/bits/locale_facets.tcc
===================================================================
--- gcc-4.2.3.orig/libstdc++-v3/include/bits/locale_facets.tcc 2008-01-05 12:04:43.000000000 +0100
+++ gcc-4.2.3/libstdc++-v3/include/bits/locale_facets.tcc 2008-05-21 13:45:51.877288338 +0200
@@ -1145,7 +1145,7 @@
const int __cs_size = __fixed ? __max_exp + __prec + 4
: __max_digits * 2 + __prec;
char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
- __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, __fbuf,
+ __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, __fbuf,
__prec, __v);
#endif
@@ -1779,7 +1779,7 @@
// max_exponent10 + 1 for the integer part, + 2 for sign and '\0'.
const int __cs_size = numeric_limits<long double>::max_exponent10 + 3;
char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
- int __len = std::__convert_from_v(_S_get_c_locale(), __cs, 0, "%.*Lf",
+ int __len = std::__convert_from_v(_S_get_c_locale(), __cs, __cs_size, "%.*Lf",
0, __units);
#endif
string_type __digits(__len, char_type());

@ -1,13 +0,0 @@
Index: gcc-4.2.3/gcc/Makefile.in
===================================================================
--- gcc-4.2.3.orig/gcc/Makefile.in 2007-10-31 17:32:06.000000000 +0100
+++ gcc-4.2.3/gcc/Makefile.in 2008-05-21 13:45:52.537289723 +0200
@@ -2660,7 +2660,7 @@
# FIXME: writing proper dependencies for this is a *LOT* of work.
libbackend.o : $(OBJS-common:.o=.c) $(out_file) \
insn-config.h insn-flags.h insn-codes.h insn-constants.h \
- insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE)
+ insn-attr.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) gcov-iov.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
-DTARGET_NAME=\"$(target_noncanonical)\" \
-DLOCALEDIR=\"$(localedir)\" \

@ -1,71 +0,0 @@
By Lennert Buytenhek <buytenh@wantstofly.org>
Adds support for arm*b-linux* big-endian ARM targets
See http://gcc.gnu.org/PR16350
Index: gcc-4.2.3/gcc/config/arm/linux-elf.h
===================================================================
--- gcc-4.2.3.orig/gcc/config/arm/linux-elf.h 2007-09-01 17:28:30.000000000 +0200
+++ gcc-4.2.3/gcc/config/arm/linux-elf.h 2008-05-21 13:45:53.349289241 +0200
@@ -27,19 +27,33 @@
#undef TARGET_VERSION
#define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr);
+/*
+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-*
+ * (big endian) configurations.
+ */
+#if TARGET_BIG_ENDIAN_DEFAULT
+#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
+#define TARGET_ENDIAN_OPTION "mbig-endian"
+#define TARGET_LINKER_EMULATION "armelfb_linux"
+#else
+#define TARGET_ENDIAN_DEFAULT 0
+#define TARGET_ENDIAN_OPTION "mlittle-endian"
+#define TARGET_LINKER_EMULATION "armelf_linux"
+#endif
+
#undef TARGET_DEFAULT_FLOAT_ABI
#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
#undef TARGET_DEFAULT
-#define TARGET_DEFAULT (0)
+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT)
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6
-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p"
+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p"
#undef MULTILIB_DEFAULTS
#define MULTILIB_DEFAULTS \
- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
+ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }
/* Now we define the strings used to build the spec file. */
#undef LIB_SPEC
@@ -60,7 +74,7 @@
%{rdynamic:-export-dynamic} \
%{!dynamic-linker:-dynamic-linker " LINUX_DYNAMIC_LINKER "} \
-X \
- %{mbig-endian:-EB}" \
+ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \
SUBTARGET_EXTRA_LINK_SPEC
#undef LINK_SPEC
Index: gcc-4.2.3/gcc/config.gcc
===================================================================
--- gcc-4.2.3.orig/gcc/config.gcc 2008-05-21 13:45:43.333288320 +0200
+++ gcc-4.2.3/gcc/config.gcc 2008-05-21 13:45:53.353287795 +0200
@@ -708,6 +708,11 @@
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*b-*)
+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
+ ;;
+ esac
+ case ${target} in
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"

@ -1,75 +0,0 @@
--- a/gcc/mklibgcc.in
+++ b/gcc/mklibgcc.in
@@ -214,6 +214,7 @@ for ml in $MULTILIBS; do
flags=`echo ${ml} | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`;
shlib_slibdir_qual=
libgcc_a=$dir/libgcc.a
+ libgcc_pic_a=$dir/libgcc_pic.a
libgcov_a=$dir/libgcov.a
libgcc_eh_a=
libgcc_s_so=
@@ -320,6 +321,7 @@ for ml in $MULTILIBS; do
-c '$(srcdir)/libgcc2.c' -o $out
echo $libgcc_a: $out
+ echo $libgcc_pic_a: $outS
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
@@ -355,6 +357,7 @@ for ml in $MULTILIBS; do
-fexceptions -fnon-call-exceptions -c '$(srcdir)/libgcc2.c' -o $out
echo $libgcc_a: $out
+ echo $libgcc_pic_a: $outS
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
@@ -397,6 +400,7 @@ for ml in $MULTILIBS; do
'$(vis_hide)' -c $fpbit -o $out
echo $libgcc_a: $out
+ echo $libgcc_pic_a: $outS
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
@@ -502,6 +506,7 @@ for ml in $MULTILIBS; do
esac
echo $libgcc_a: $out
+ echo $libgcc_pic_a: $outS
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
@@ -621,6 +626,7 @@ for ml in $MULTILIBS; do
*) echo "Unhandled extension: $file">&2; exit 1 ;;
esac
+ echo $libgcc_pic_a: $outS
echo $libgcc_s_so: $outS
if [ "$SHLIB_MKMAP" ]; then
echo libgcc/${dir}/libgcc.map: $outS
@@ -793,6 +799,13 @@ EOF
echo "all: $libgcc_a"
echo ""
+ echo "$libgcc_pic_a: stmp-dirs"
+ echo " -rm -f $libgcc_pic_a"
+ echo ' $(AR_CREATE_FOR_TARGET)' $libgcc_pic_a '$(objects)'
+ echo ' $(RANLIB_FOR_TARGET)' $libgcc_pic_a
+ echo "all: $libgcc_pic_a"
+
+ echo ""
echo "$libgcov_a: stmp-dirs"
echo " -rm -f $libgcov_a"
echo ' $(AR_CREATE_FOR_TARGET)' $libgcov_a '$(objects)'
@@ -894,6 +907,10 @@ for ml in $MULTILIBS; do
echo ' chmod 644' ${ldir}/libgcc_eh.a
echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc_eh.a
+ echo ' $(INSTALL_DATA)' ${dir}/libgcc_pic.a ${mapfile} ${ldir}/
+ echo ' chmod 644' ${ldir}/libgcc_pic.a
+ echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc_pic.a
+
shlib_slibdir_qual=
os_multilib_dir=`$GCC_FOR_TARGET $flags --print-multi-os-directory`
if [ "$os_multilib_dir" != . ]; then

File diff suppressed because it is too large Load Diff

@ -1,19 +0,0 @@
--- a/gcc/config/avr32/lib1funcs.S
+++ b/gcc/config/avr32/lib1funcs.S
@@ -1,6 +1,6 @@
/* Macro for moving immediate value to register. */
.macro mov_imm reg, imm
-.if (((\imm & 0xfffff) == \imm) || ((\imm | 0xfff00000) == \imm))
+.if ((\imm & 0xfffff) == \imm)
mov \reg, \imm
#if __AVR32_UC__ >= 2
.elseif ((\imm & 0xffff) == 0)
@@ -547,7 +547,7 @@
#endif
__avr32_f64_mul_res_inf: /* Return INF. */
- mov r11, 0xfff00000
+ mov_imm r11, 0xfff00000
bld lr, 31
bst r11, 31
mov r10, 0

@ -1,74 +0,0 @@
Hi,
The attached patch makes sure that we create smaller object code for
simple switch statements. We just make sure to flatten the switch
statement into an if-else chain, basically.
This fixes a size-regression as compared to gcc-3.4, as can be seen
below.
2007-04-15 Bernhard Fischer <..>
* stmt.c (expand_case): Do not create a complex binary tree when
optimizing for size but rather use the simple ordered list.
(emit_case_nodes): do not emit jumps to the default_label when
optimizing for size.
Not regtested so far.
Comments?
Attached is the test switch.c mentioned below.
$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
gcc-$i -DCHAIN -Os -o switch-CHAIN-$i.o -c switch.c ;done
$ for i in 2.95 3.3 3.4 4.0 4.1 4.2.orig-HEAD 4.3.orig-HEAD 4.3-HEAD;do
gcc-$i -UCHAIN -Os -o switch-$i.o -c switch.c ;done
$ size switch-*.o
text data bss dec hex filename
169 0 0 169 a9 switch-2.95.o
115 0 0 115 73 switch-3.3.o
103 0 0 103 67 switch-3.4.o
124 0 0 124 7c switch-4.0.o
124 0 0 124 7c switch-4.1.o
124 0 0 124 7c switch-4.2.orig-HEAD.o
95 0 0 95 5f switch-4.3-HEAD.o
124 0 0 124 7c switch-4.3.orig-HEAD.o
166 0 0 166 a6 switch-CHAIN-2.95.o
111 0 0 111 6f switch-CHAIN-3.3.o
95 0 0 95 5f switch-CHAIN-3.4.o
95 0 0 95 5f switch-CHAIN-4.0.o
95 0 0 95 5f switch-CHAIN-4.1.o
95 0 0 95 5f switch-CHAIN-4.2.orig-HEAD.o
95 0 0 95 5f switch-CHAIN-4.3-HEAD.o
95 0 0 95 5f switch-CHAIN-4.3.orig-HEAD.o
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="gcc-4.3.gcc-flatten-switch-stmt.00.diff"
Index: gcc-4.2.3/gcc/stmt.c
===================================================================
--- gcc-4.2.3.orig/gcc/stmt.c 2007-09-01 17:28:30.000000000 +0200
+++ gcc-4.2.3/gcc/stmt.c 2008-05-21 13:45:59.137288494 +0200
@@ -2511,7 +2511,11 @@
use_cost_table
= (TREE_CODE (orig_type) != ENUMERAL_TYPE
&& estimate_case_costs (case_list));
- balance_case_nodes (&case_list, NULL);
+ /* When optimizing for size, we want a straight list to avoid
+ jumps as much as possible. This basically creates an if-else
+ chain. */
+ if (!optimize_size)
+ balance_case_nodes (&case_list, NULL);
emit_case_nodes (index, case_list, default_label, index_type);
emit_jump (default_label);
}
@@ -3069,6 +3073,7 @@
{
if (!node_has_low_bound (node, index_type))
{
+ if (!optimize_size) /* don't jl to the .default_label. */
emit_cmp_and_jump_insns (index,
convert_modes
(mode, imode,

@ -1,293 +0,0 @@
This patch brings over a few features from MirBSD:
* -fhonour-copts
If this option is not given, it's warned (depending
on environment variables). This is to catch errors
of misbuilt packages which override CFLAGS themselves.
* -Werror-maybe-reset
Has the effect of -Wno-error if GCC_NO_WERROR is
set and not '0', a no-operation otherwise. This is
to be able to use -Werror in "make" but prevent
GNU autoconf generated configure scripts from
freaking out.
* Make -fno-strict-aliasing and -fno-delete-null-pointer-checks
the default for -O2/-Os, because they trigger gcc bugs
and can delete code with security implications.
This patch was authored by Thorsten Glaser <tg@mirbsd.de>
with copyright assignment to the FSF in effect.
Index: gcc-4.2.3/gcc/c-opts.c
===================================================================
--- gcc-4.2.3.orig/gcc/c-opts.c 2008-01-27 19:36:59.000000000 +0100
+++ gcc-4.2.3/gcc/c-opts.c 2008-05-21 13:46:01.550289703 +0200
@@ -106,6 +106,9 @@
/* Number of deferred options scanned for -include. */
static size_t include_cursor;
+/* Check if a port honours COPTS. */
+static int honour_copts = 0;
+
static void set_Wimplicit (int);
static void handle_OPT_d (const char *);
static void set_std_cxx98 (int);
@@ -450,6 +453,14 @@
mesg_implicit_function_declaration = 2;
break;
+ case OPT_Werror_maybe_reset:
+ {
+ char *ev = getenv ("GCC_NO_WERROR");
+ if ((ev != NULL) && (*ev != '0'))
+ cpp_opts->warnings_are_errors = 0;
+ }
+ break;
+
case OPT_Wformat:
set_Wformat (value);
break;
@@ -692,6 +703,12 @@
flag_exceptions = value;
break;
+ case OPT_fhonour_copts:
+ if (c_language == clk_c) {
+ honour_copts++;
+ }
+ break;
+
case OPT_fimplement_inlines:
flag_implement_inlines = value;
break;
@@ -1157,6 +1174,47 @@
/* Has to wait until now so that cpplib has its hash table. */
init_pragma ();
+ if (c_language == clk_c) {
+ char *ev = getenv ("GCC_HONOUR_COPTS");
+ int evv;
+ if (ev == NULL)
+ evv = -1;
+ else if ((*ev == '0') || (*ev == '\0'))
+ evv = 0;
+ else if (*ev == '1')
+ evv = 1;
+ else if (*ev == '2')
+ evv = 2;
+ else if (*ev == 's')
+ evv = -1;
+ else {
+ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1");
+ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */
+ }
+ if (evv == 1) {
+ if (honour_copts == 0) {
+ error ("someone does not honour COPTS at all in lenient mode");
+ return false;
+ } else if (honour_copts != 1) {
+ warning (0, "someone does not honour COPTS correctly, passed %d times",
+ honour_copts);
+ }
+ } else if (evv == 2) {
+ if (honour_copts == 0) {
+ error ("someone does not honour COPTS at all in strict mode");
+ return false;
+ } else if (honour_copts != 1) {
+ error ("someone does not honour COPTS correctly, passed %d times",
+ honour_copts);
+ return false;
+ }
+ } else if (evv == 0) {
+ if (honour_copts != 1)
+ inform ("someone does not honour COPTS correctly, passed %d times",
+ honour_copts);
+ }
+ }
+
return true;
}
Index: gcc-4.2.3/gcc/c.opt
===================================================================
--- gcc-4.2.3.orig/gcc/c.opt 2007-09-01 17:28:30.000000000 +0200
+++ gcc-4.2.3/gcc/c.opt 2008-05-21 13:46:01.550289703 +0200
@@ -188,6 +188,10 @@
C ObjC RejectNegative
Make implicit function declarations an error
+Werror-maybe-reset
+C ObjC C++ ObjC++
+; Documented in common.opt
+
Wfloat-equal
C ObjC C++ ObjC++ Var(warn_float_equal)
Warn if testing floating point numbers for equality
@@ -543,6 +547,9 @@
fhonor-std
C++ ObjC++
+fhonour-copts
+C ObjC C++ ObjC++ RejectNegative
+
fhosted
C ObjC
Assume normal C execution environment
Index: gcc-4.2.3/gcc/common.opt
===================================================================
--- gcc-4.2.3.orig/gcc/common.opt 2008-01-27 19:36:59.000000000 +0100
+++ gcc-4.2.3/gcc/common.opt 2008-05-21 13:46:01.550289703 +0200
@@ -80,6 +80,10 @@
Common Joined
Treat specified warning as error
+Werror-maybe-reset
+Common
+If environment variable GCC_NO_WERROR is set, act as -Wno-error
+
Wextra
Common
Print extra (possibly unwanted) warnings
@@ -480,6 +484,9 @@
Common Report Var(flag_guess_branch_prob)
Enable guessing of branch probabilities
+fhonour-copts
+Common RejectNegative
+
; Nonzero means ignore `#ident' directives. 0 means handle them.
; Generate position-independent code for executables if possible
; On SVR4 targets, it also controls whether or not to emit a
Index: gcc-4.2.3/gcc/opts.c
===================================================================
--- gcc-4.2.3.orig/gcc/opts.c 2008-01-27 19:36:59.000000000 +0100
+++ gcc-4.2.3/gcc/opts.c 2008-05-21 13:46:01.562288718 +0200
@@ -483,9 +483,6 @@
flag_schedule_insns_after_reload = 1;
#endif
flag_regmove = 1;
- flag_strict_aliasing = 1;
- flag_strict_overflow = 1;
- flag_delete_null_pointer_checks = 1;
flag_reorder_blocks = 1;
flag_reorder_functions = 1;
flag_tree_store_ccp = 1;
@@ -501,6 +498,10 @@
if (optimize >= 3)
{
+ flag_strict_aliasing = 1;
+ flag_strict_overflow = 1;
+ flag_delete_null_pointer_checks = 1;
+
flag_inline_functions = 1;
flag_unswitch_loops = 1;
flag_gcse_after_reload = 1;
@@ -702,6 +703,17 @@
}
break;
+ case OPT_Werror_maybe_reset:
+ {
+ char *ev = getenv ("GCC_NO_WERROR");
+ if ((ev != NULL) && (*ev != '0'))
+ warnings_are_errors = 0;
+ }
+ break;
+
+ case OPT_fhonour_copts:
+ break;
+
case OPT_Wextra:
set_Wextra (value);
break;
Index: gcc-4.2.3/gcc/doc/cppopts.texi
===================================================================
--- gcc-4.2.3.orig/gcc/doc/cppopts.texi 2006-08-16 22:36:23.000000000 +0200
+++ gcc-4.2.3/gcc/doc/cppopts.texi 2008-05-21 13:46:01.570286943 +0200
@@ -166,6 +166,11 @@
Make all warnings into hard errors. Source code which triggers warnings
will be rejected.
+@item -Werror-maybe-reset
+@opindex Werror-maybe-reset
+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
+variable is set to anything other than 0 or empty.
+
@item -Wsystem-headers
@opindex Wsystem-headers
Issue warnings for code in system headers. These are normally unhelpful
Index: gcc-4.2.3/gcc/doc/invoke.texi
===================================================================
--- gcc-4.2.3.orig/gcc/doc/invoke.texi 2008-05-21 13:45:54.274288067 +0200
+++ gcc-4.2.3/gcc/doc/invoke.texi 2008-05-21 13:46:01.582288192 +0200
@@ -226,7 +226,7 @@
-Wc++-compat -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment @gol
-Wconversion -Wno-deprecated-declarations @gol
-Wdisabled-optimization -Wno-div-by-zero -Wno-endif-labels @gol
--Werror -Werror=* -Werror-implicit-function-declaration @gol
+-Werror -Werror-maybe-reset -Werror=* -Werror-implicit-function-declaration @gol
-Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol
-Wno-format-extra-args -Wformat-nonliteral @gol
-Wformat-security -Wformat-y2k @gol
@@ -3566,6 +3566,22 @@
@option{-W}@var{foo}. However, @option{-Wno-error=}@var{foo} does not
imply anything.
+@item -Werror-maybe-reset
+@opindex Werror-maybe-reset
+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
+variable is set to anything other than 0 or empty.
+
+@item -fhonour-copts
+@opindex fhonour-copts
+If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not
+given at least once, and warn if it is given more than once.
+If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not
+given exactly once.
+If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option
+is not given exactly once.
+The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}.
+This flag and environment variable only affect the C language.
+
@item -Wstack-protector
@opindex Wstack-protector
This option is only active when @option{-fstack-protector} is active. It
@@ -4893,7 +4909,7 @@
second branch or a point immediately following it, depending on whether
the condition is known to be true or false.
-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
+Enabled at levels @option{-O3}.
@item -fcse-follow-jumps
@opindex fcse-follow-jumps
@@ -5011,7 +5027,7 @@
@option{-fno-delete-null-pointer-checks} to disable this optimization
for programs which depend on that behavior.
-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
+Enabled at levels @option{-O3}.
@item -fexpensive-optimizations
@opindex fexpensive-optimizations
@@ -5460,7 +5476,7 @@
allowed to alias. For an example, see the C front-end function
@code{c_get_alias_set}.
-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
+Enabled at levels @option{-O3}.
@item -fstrict-overflow
@opindex fstrict-overflow
Index: gcc-4.2.3/gcc/java/jvspec.c
===================================================================
--- gcc-4.2.3.orig/gcc/java/jvspec.c 2007-08-31 10:27:50.000000000 +0200
+++ gcc-4.2.3/gcc/java/jvspec.c 2008-05-21 13:46:01.582288192 +0200
@@ -631,6 +631,7 @@
class name. Append dummy `.c' that can be stripped by set_input so %b
is correct. */
set_input (concat (main_class_name, "main.c", NULL));
+ putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */
err = do_spec (jvgenmain_spec);
if (err == 0)
{

@ -1,29 +0,0 @@
Index: gcc-4.2.3/gcc/config/arm/linux-elf.h
===================================================================
--- gcc-4.2.3.orig/gcc/config/arm/linux-elf.h 2008-05-21 13:45:53.349289241 +0200
+++ gcc-4.2.3/gcc/config/arm/linux-elf.h 2008-05-21 13:46:02.426288993 +0200
@@ -62,7 +62,7 @@
%{shared:-lc} \
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"
-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
+#define LIBGCC_SPEC "-lgcc"
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
Index: gcc-4.2.3/gcc/config/arm/t-linux
===================================================================
--- gcc-4.2.3.orig/gcc/config/arm/t-linux 2004-05-15 14:41:35.000000000 +0200
+++ gcc-4.2.3/gcc/config/arm/t-linux 2008-05-21 13:46:02.426288993 +0200
@@ -4,7 +4,10 @@
LIBGCC2_DEBUG_CFLAGS = -g0
LIB1ASMSRC = arm/lib1funcs.asm
-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \
+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
+ _fixsfsi _fixunssfsi _floatdidf _floatundidf _floatdisf _floatundisf
# MULTILIB_OPTIONS = mhard-float/msoft-float
# MULTILIB_DIRNAMES = hard-float soft-float

@ -1,23 +0,0 @@
http://bugs.uclibc.org/view.php?id=1588
diff -uNpr gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c
--- gcc-4.2.1_orig/gcc/config/rs6000/darwin-ldouble.c 2007-03-05 11:54:00.000000000 -0500
+++ gcc-4.2.1/gcc/config/rs6000/darwin-ldouble.c 2008-01-31 17:51:24.000000000 -0500
@@ -70,6 +70,8 @@ Software Foundation, 51 Franklin Street,
but GCC currently generates poor code when a union is used to turn
a long double into a pair of doubles. */
+#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
+
long double __gcc_qadd (double, double, double, double);
long double __gcc_qsub (double, double, double, double);
long double __gcc_qmul (double, double, double, double);
@@ -219,8 +221,6 @@ __gcc_qdiv (double a, double b, double c
return z.ldval;
}
-#if defined (_SOFT_FLOAT) && defined (__LONG_DOUBLE_128__)
-
long double __gcc_qneg (double, double);
int __gcc_qeq (double, double, double, double);
int __gcc_qne (double, double, double, double);

@ -1,36 +0,0 @@
Index: gcc-4.2.3/gcc/config.gcc
===================================================================
--- gcc-4.2.3.orig/gcc/config.gcc 2008-05-21 13:45:54.181287953 +0200
+++ gcc-4.2.3/gcc/config.gcc 2008-05-21 13:46:03.094289162 +0200
@@ -704,7 +704,7 @@
extra_parts=""
use_collect2=yes
;;
-arm*-*-linux*) # ARM GNU/Linux with ELF
+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
@@ -713,7 +713,7 @@
;;
esac
case ${target} in
- arm*-*-linux-*eabi)
+ 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
Index: gcc-4.2.3/gcc/config/arm/linux-eabi.h
===================================================================
--- gcc-4.2.3.orig/gcc/config/arm/linux-eabi.h 2007-09-01 17:28:30.000000000 +0200
+++ gcc-4.2.3/gcc/config/arm/linux-eabi.h 2008-05-21 13:46:03.094289162 +0200
@@ -47,7 +47,8 @@
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
#undef SUBTARGET_EXTRA_LINK_SPEC
-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux_eabi"
+#define SUBTARGET_EXTRA_LINK_SPEC \
+ " %{mbig-endian:-m armelfb_linux_eabi} %{mlittle-endian:-m armelf_linux_eabi} "
/* Use ld-linux.so.3 so that it will be possible to run "classic"
GNU/Linux binaries on an EABI system. */

@ -1,76 +0,0 @@
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37014
--- a/gcc/dojump.c
+++ b/gcc/dojump.c
@@ -307,8 +307,6 @@
break;
}
- case TRUTH_ANDIF_EXPR:
- case TRUTH_ORIF_EXPR:
case COMPOUND_EXPR:
/* Lowered by gimplify.c. */
gcc_unreachable ();
@@ -518,6 +516,7 @@
if (BRANCH_COST >= 4 || TREE_SIDE_EFFECTS (TREE_OPERAND (exp, 1)))
goto normal;
+ case TRUTH_ANDIF_EXPR:
if (if_false_label == NULL_RTX)
{
drop_through_label = gen_label_rtx ();
@@ -538,6 +537,7 @@
if (BRANCH_COST >= 4 || TREE_SIDE_EFFECTS (TREE_OPERAND (exp, 1)))
goto normal;
+ case TRUTH_ORIF_EXPR:
if (if_true_label == NULL_RTX)
{
drop_through_label = gen_label_rtx ();
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -8556,7 +8556,10 @@
/* If no set-flag instruction, must generate a conditional store
into a temporary variable. Drop through and handle this
like && and ||. */
-
+ /* Although TRUTH_{AND,OR}IF_EXPR aren't present in GIMPLE, they
+ are occassionally created by folding during expansion. */
+ case TRUTH_ANDIF_EXPR:
+ case TRUTH_ORIF_EXPR:
if (! ignore
&& (target == 0
|| modifier == EXPAND_STACK_PARM
@@ -8754,8 +8767,6 @@
case POSTDECREMENT_EXPR:
case LOOP_EXPR:
case EXIT_EXPR:
- case TRUTH_ANDIF_EXPR:
- case TRUTH_ORIF_EXPR:
/* Lowered by gimplify.c. */
gcc_unreachable ();
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20080812-1.c
@@ -0,0 +1,21 @@
+/* PR middle-end/37014 */
+
+void bar (signed char *);
+
+void
+foo (int x, int y)
+{
+ int i;
+ signed char a[123], b[123], c;
+ for (i = 0; i < 123; i++)
+ {
+ int e = y - x;
+ int d = e < 0 ? -e : e;
+ c = d < 75;
+ a[y] = c;
+ b[y] = c;
+ y--;
+ }
+ bar (b);
+ bar (a);
+}

@ -1,49 +0,0 @@
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34762
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -4789,7 +4789,7 @@ find_reloads_address (enum machine_mode
find_reloads_address (GET_MODE (tem), &tem, XEXP (tem, 0),
&XEXP (tem, 0), opnum,
ADDR_TYPE (type), ind_levels, insn);
- if (tem != orig)
+ if (!rtx_equal_p (tem, orig))
push_reg_equiv_alt_mem (regno, tem);
}
/* We can avoid a reload if the register's equivalent memory
@@ -5589,7 +5589,7 @@ find_reloads_address_1 (enum machine_mod
RELOAD_OTHER,
ind_levels, insn);
- if (tem != orig)
+ if (!rtx_equal_p (tem, orig))
push_reg_equiv_alt_mem (regno, tem);
/* Then reload the memory location into a base
@@ -5656,7 +5656,7 @@ find_reloads_address_1 (enum machine_mod
find_reloads_address (GET_MODE (tem), &tem, XEXP (tem, 0),
&XEXP (tem, 0), opnum, type,
ind_levels, insn);
- if (tem != orig)
+ if (!rtx_equal_p (tem, orig))
push_reg_equiv_alt_mem (regno, tem);
/* Put this inside a new increment-expression. */
x = gen_rtx_fmt_e (GET_CODE (x), GET_MODE (x), tem);
@@ -5848,7 +5848,7 @@ find_reloads_address_1 (enum machine_mod
find_reloads_address (GET_MODE (x), &x, XEXP (x, 0),
&XEXP (x, 0), opnum, ADDR_TYPE (type),
ind_levels, insn);
- if (x != tem)
+ if (!rtx_equal_p (x, tem))
push_reg_equiv_alt_mem (regno, x);
}
}
@@ -6076,7 +6076,7 @@ find_reloads_subreg_address (rtx x, int
XEXP (tem, 0), &XEXP (tem, 0),
opnum, type, ind_levels, insn);
/* ??? Do we need to handle nonzero offsets somehow? */
- if (!offset && tem != orig)
+ if (!offset && !rtx_equal_p (tem, orig))
push_reg_equiv_alt_mem (regno, tem);
/* For some processors an address may be valid in the
Loading…
Cancel
Save