bug 913442 - rewrite build-gcc.py r=glandium DONTBUILD because NPOTB

This commit is contained in:
Trevor Saunders 2013-09-12 01:14:32 -04:00
parent 990a620718
commit 7c26515c03
11 changed files with 66 additions and 1051 deletions

View File

@ -0,0 +1,41 @@
#!/bin/bash
gcc_version=4.7.3
binutils_version=2.23.1
gcc_bt_patch=$(readlink -f $(dirname $0))/gcc-bt.patch
make_flags='-j12'
root_dir=$(mktemp -d)
cd $root_dir
if test -z $TMPDIR; then
TMPDIR=/tmp/
fi
wget -c -P $TMPDIR ftp://ftp.gnu.org/gnu/binutils/binutils-$binutils_version.tar.bz2 || exit 1
tar xjf $TMPDIR/binutils-$binutils_version.tar.bz2
mkdir binutils-objdir
cd binutils-objdir
../binutils-$binutils_version/configure --prefix /tools/gcc/ --enable-gold --enable-plugins --disable-nls || exit 1
make $make_flags || exit 1
make install $make_flags DESTDIR=$root_dir || exit 1
cd ..
wget -c -P $TMPDIR ftp://ftp.gnu.org/gnu/gcc/gcc-$gcc_version/gcc-$gcc_version.tar.bz2 || exit 1
tar xjf $TMPDIR/gcc-$gcc_version.tar.bz2
cd gcc-$gcc_version
./contrib/download_prerequisites
# gcc 4.7 doesn't dump a stack on ICE so hack that in
patch -p1 < $gcc_bt_patch || exit 1
cd ..
mkdir gcc-objdir
cd gcc-objdir
../gcc-$gcc_version/configure --prefix=/tools/gcc --enable-languages=c,c++ --disable-nls --disable-gnu-unique-object --enable-__cxa_atexit --with-arch-32=pentiumpro || exit 1
make $make_flags || exit 1
make $make_flags install DESTDIR=$root_dir || exit 1
cd $root_dir/tools
tar caf $root_dir/gcc.tar.xz gcc/

View File

@ -0,0 +1,25 @@
--- gcc-4.7.3/gcc/diagnostic.c 2012-02-02 15:46:06.000000000 -0500
+++ gcc-patched/gcc/diagnostic.c 2013-05-23 14:07:10.756527912 -0400
@@ -31,6 +31,10 @@
#include "intl.h"
#include "diagnostic.h"
+#include <execinfo.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdio.h>
#define pedantic_warning_kind(DC) \
((DC)->pedantic_errors ? DK_ERROR : DK_WARNING)
#define permissive_error_kind(DC) ((DC)->permissive ? DK_WARNING : DK_ERROR)
@@ -237,6 +241,11 @@
if (context->abort_on_error)
real_abort ();
+ {
+ void *stack[100];
+ int count = backtrace(stack, 100);
+ backtrace_symbols_fd(stack, count, STDERR_FILENO);
+ }
fnotice (stderr, "Please submit a full bug report,\n"
"with preprocessed source if appropriate.\n"
"See %s for instructions.\n", bug_report_url);

View File

@ -1,22 +0,0 @@
diff -ru a/binutils/ar.c b/binutils/ar.c
--- a/binutils/ar.c 2011-03-16 04:35:58.000000000 -0400
+++ b/binutils/ar.c 2012-01-19 15:44:46.211226017 -0500
@@ -98,7 +98,7 @@
/* Operate in deterministic mode: write zero for timestamps, uids,
and gids for archive members and the archive symbol table, and write
consistent file modes. */
-int deterministic = 0;
+int deterministic = TRUE;
/* Nonzero means it's the name of an existing member; position new or moved
files with respect to this one. */
@@ -634,9 +634,6 @@
if (newer_only && operation != replace)
fatal (_("`u' is only meaningful with the `r' option."));
- if (newer_only && deterministic)
- fatal (_("`u' is not meaningful with the `D' option."));
-
if (postype != pos_default)
posname = argv[arg_index++];

View File

@ -1,315 +0,0 @@
#!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# The directories end up in the debug info, so the easy way of getting
# a reproducible build is to run it in a know absolute directory.
# We use a directory in /builds/slave because the mozilla infrastructure
# cleans it up automatically.
base_dir = "/builds/slave/moz-toolchain"
source_dir = base_dir + "/src"
build_dir = base_dir + "/build"
aux_inst_dir = build_dir + '/aux_inst'
old_make = aux_inst_dir + '/bin/make'
##############################################
import urllib
import os
import os.path
import shutil
import tarfile
import subprocess
def download_uri(uri):
fname = uri.split('/')[-1]
if (os.path.exists(fname)):
return fname
urllib.urlretrieve(uri, fname)
return fname
def extract(tar, path):
t = tarfile.open(tar)
t.extractall(path)
def check_run(args):
r = subprocess.call(args)
assert r == 0
def run_in(path, args):
d = os.getcwd()
os.chdir(path)
check_run(args)
os.chdir(d)
def patch(patch, plevel, srcdir):
patch = os.path.realpath(patch)
check_run(['patch', '-d', srcdir, '-p%s' % plevel, '-i', patch, '--fuzz=0',
'-s'])
def build_package(package_source_dir, package_build_dir, configure_args,
make = old_make):
if not os.path.exists(package_build_dir):
os.mkdir(package_build_dir)
run_in(package_build_dir,
["%s/configure" % package_source_dir] + configure_args)
run_in(package_build_dir, [make, "-j8"])
run_in(package_build_dir, [make, "install"])
def build_aux_tools(base_dir):
make_build_dir = base_dir + '/make_build'
build_package(make_source_dir, make_build_dir,
["--prefix=%s" % aux_inst_dir], "make")
run_in(unifdef_source_dir, ["make"])
run_in(unifdef_source_dir, ["make", "prefix=%s" % aux_inst_dir, "install"])
tar_build_dir = base_dir + '/tar_build'
build_package(tar_source_dir, tar_build_dir,
["--prefix=%s" % aux_inst_dir])
gawk_build_dir = base_dir + '/gawk_build'
build_package(gawk_source_dir, gawk_build_dir,
["--prefix=%s" % aux_inst_dir])
def with_env(env, f):
old_env = os.environ.copy()
os.environ.update(env)
f()
os.environ.clear()
os.environ.update(old_env)
def build_glibc(env, stage_dir, inst_dir):
def f():
build_glibc_aux(stage_dir, inst_dir)
with_env(env, f)
def build_glibc_aux(stage_dir, inst_dir):
glibc_build_dir = stage_dir + '/glibc'
build_package(glibc_source_dir, glibc_build_dir,
["--disable-profile",
"--enable-add-ons=nptl",
"--without-selinux",
"--enable-kernel=%s" % linux_version,
"--libdir=%s/lib64" % inst_dir,
"--prefix=%s" % inst_dir])
def build_linux_headers_aux(inst_dir):
run_in(linux_source_dir, [old_make, "headers_check"])
run_in(linux_source_dir, [old_make, "INSTALL_HDR_PATH=dest",
"headers_install"])
shutil.move(linux_source_dir + "/dest/include", inst_dir + '/include')
def build_linux_headers(inst_dir):
def f():
build_linux_headers_aux(inst_dir)
with_env({"PATH" : aux_inst_dir + "/bin:%s" % os.environ["PATH"]}, f)
def build_gcc(stage_dir, is_stage_one):
gcc_build_dir = stage_dir + '/gcc'
tool_inst_dir = stage_dir + '/inst'
lib_inst_dir = stage_dir + '/libinst'
gcc_configure_args = ["--prefix=%s" % tool_inst_dir,
"--enable-__cxa_atexit",
"--with-gmp=%s" % lib_inst_dir,
"--with-mpfr=%s" % lib_inst_dir,
"--with-mpc=%s" % lib_inst_dir,
"--enable-languages=c,c++",
"--disable-lto",
"--disable-multilib",
"--disable-bootstrap"]
if is_stage_one:
# We build the stage1 gcc without shared libraries. Otherwise its
# libgcc.so would depend on the system libc.so, which causes problems
# when it tries to use that libgcc.so and the libc we are about to
# build.
gcc_configure_args.append("--disable-shared")
build_package(gcc_source_dir, gcc_build_dir, gcc_configure_args)
if is_stage_one:
# The glibc build system uses -lgcc_eh, but at least in this setup
# libgcc.a has all it needs.
d = tool_inst_dir + "/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/"
os.symlink(d + "libgcc.a", d + "libgcc_eh.a")
def build_one_stage(env, stage_dir, is_stage_one):
def f():
build_one_stage_aux(stage_dir, is_stage_one)
with_env(env, f)
def build_one_stage_aux(stage_dir, is_stage_one):
os.mkdir(stage_dir)
lib_inst_dir = stage_dir + '/libinst'
gmp_build_dir = stage_dir + '/gmp'
build_package(gmp_source_dir, gmp_build_dir,
["--prefix=%s" % lib_inst_dir, "--disable-shared"])
mpfr_build_dir = stage_dir + '/mpfr'
build_package(mpfr_source_dir, mpfr_build_dir,
["--prefix=%s" % lib_inst_dir, "--disable-shared",
"--with-gmp=%s" % lib_inst_dir])
mpc_build_dir = stage_dir + '/mpc'
build_package(mpc_source_dir, mpc_build_dir,
["--prefix=%s" % lib_inst_dir, "--disable-shared",
"--with-gmp=%s" % lib_inst_dir,
"--with-mpfr=%s" % lib_inst_dir])
tool_inst_dir = stage_dir + '/inst'
os.mkdir(tool_inst_dir)
os.mkdir(tool_inst_dir + '/lib64')
os.symlink('lib64', tool_inst_dir + '/lib')
build_linux_headers(tool_inst_dir)
# zlib's configure only works if run from the source dir, copy the source
zlib_build_dir = stage_dir + '/zlib'
shutil.copytree(zlib_source_dir, zlib_build_dir)
build_package(zlib_build_dir, zlib_build_dir,
["--prefix=%s" % tool_inst_dir])
binutils_build_dir = stage_dir + '/binutils'
build_package(binutils_source_dir, binutils_build_dir,
["--prefix=%s" % tool_inst_dir,
"--without-zlib"])
# During stage one we have to build gcc first, this glibc doesn't even
# build with gcc 4.6. During stage two, we have to build glibc first.
# The problem is that libstdc++ is built with xgcc and if glibc has
# not been built yet xgcc will use the system one.
if is_stage_one:
build_gcc(stage_dir, is_stage_one)
build_glibc({"CC" : tool_inst_dir + "/bin/gcc",
"CXX" : tool_inst_dir + "/bin/g++"},
stage_dir, tool_inst_dir)
else:
build_glibc({}, stage_dir, tool_inst_dir)
build_gcc(stage_dir, is_stage_one)
def build_tar_package(tar, name, base, directory):
name = os.path.realpath(name)
run_in(base, [tar, "-cf", name, "--mtime=2012-01-01", "--owner=root",
directory])
##############################################
def build_source_dir(prefix, version):
return source_dir + '/' + prefix + version
binutils_version = "2.21.1"
glibc_version = "2.5.1"
linux_version = "2.6.18"
tar_version = "1.26"
gawk_version = "3.1.5"
make_version = "3.81"
gcc_version = "4.5.2"
mpfr_version = "2.4.2"
zlib_version = "1.2.3"
gmp_version = "5.0.1"
mpc_version = "0.8.1"
unifdef_version = "2.6"
binutils_source_uri = "http://ftp.gnu.org/gnu/binutils/binutils-%sa.tar.bz2" % \
binutils_version
glibc_source_uri = "http://ftp.gnu.org/gnu/glibc/glibc-%s.tar.bz2" % \
glibc_version
linux_source_uri = "http://www.kernel.org/pub/linux/kernel/v2.6/linux-%s.tar.bz2" % \
linux_version
tar_source_uri = "http://ftp.gnu.org/gnu/tar/tar-%s.tar.bz2" % \
tar_version
gawk_source_uri = "http://ftp.gnu.org/gnu/gawk/gawk-%s.tar.bz2" % \
gawk_version
make_source_uri = "http://ftp.gnu.org/gnu/make/make-%s.tar.bz2" % \
make_version
unifdef_source_uri = "http://dotat.at/prog/unifdef/unifdef-%s.tar.gz" % \
unifdef_version
gcc_source_uri = "http://ftp.gnu.org/gnu/gcc/gcc-%s/gcc-%s.tar.bz2" % \
(gcc_version, gcc_version)
mpfr_source_uri = "http://www.mpfr.org/mpfr-%s/mpfr-%s.tar.bz2" % \
(mpfr_version, mpfr_version)
zlib_source_uri = "http://iweb.dl.sourceforge.net/project/libpng/zlib/%s/zlib-%s.tar.bz2" % (zlib_version, zlib_version)
gmp_source_uri = "http://ftp.gnu.org/gnu/gmp/gmp-%s.tar.bz2" % gmp_version
mpc_source_uri = "http://www.multiprecision.org/mpc/download/mpc-%s.tar.gz" % \
mpc_version
binutils_source_tar = download_uri(binutils_source_uri)
glibc_source_tar = download_uri(glibc_source_uri)
linux_source_tar = download_uri(linux_source_uri)
tar_source_tar = download_uri(tar_source_uri)
gawk_source_tar = download_uri(gawk_source_uri)
make_source_tar = download_uri(make_source_uri)
unifdef_source_tar = download_uri(unifdef_source_uri)
mpc_source_tar = download_uri(mpc_source_uri)
mpfr_source_tar = download_uri(mpfr_source_uri)
zlib_source_tar = download_uri(zlib_source_uri)
gmp_source_tar = download_uri(gmp_source_uri)
gcc_source_tar = download_uri(gcc_source_uri)
binutils_source_dir = build_source_dir('binutils-', binutils_version)
glibc_source_dir = build_source_dir('glibc-', glibc_version)
linux_source_dir = build_source_dir('linux-', linux_version)
tar_source_dir = build_source_dir('tar-', tar_version)
gawk_source_dir = build_source_dir('gawk-', gawk_version)
make_source_dir = build_source_dir('make-', make_version)
unifdef_source_dir = build_source_dir('unifdef-', unifdef_version)
mpc_source_dir = build_source_dir('mpc-', mpc_version)
mpfr_source_dir = build_source_dir('mpfr-', mpfr_version)
zlib_source_dir = build_source_dir('zlib-', zlib_version)
gmp_source_dir = build_source_dir('gmp-', gmp_version)
gcc_source_dir = build_source_dir('gcc-', gcc_version)
if not os.path.exists(source_dir):
os.makedirs(source_dir)
extract(binutils_source_tar, source_dir)
patch('binutils-deterministic.patch', 1, binutils_source_dir)
extract(glibc_source_tar, source_dir)
extract(linux_source_tar, source_dir)
patch('glibc-deterministic.patch', 1, glibc_source_dir)
run_in(glibc_source_dir, ["autoconf"])
extract(tar_source_tar, source_dir)
extract(gawk_source_tar, source_dir)
extract(make_source_tar, source_dir)
extract(unifdef_source_tar, source_dir)
extract(mpc_source_tar, source_dir)
extract(mpfr_source_tar, source_dir)
extract(zlib_source_tar, source_dir)
extract(gmp_source_tar, source_dir)
extract(gcc_source_tar, source_dir)
patch('plugin_finish_decl.diff', 0, gcc_source_dir)
patch('libtool-74c8993c178a1386ea5e2363a01d919738402f30.patch', 1, gcc_source_dir)
patch('pr49911.diff', 1, gcc_source_dir)
patch('r159628-r163231-r171807.patch', 1, gcc_source_dir)
patch('gcc-fixinc.patch', 1, gcc_source_dir)
patch('gcc-include.patch', 1, gcc_source_dir)
if os.path.exists(build_dir):
shutil.rmtree(build_dir)
os.makedirs(build_dir)
build_aux_tools(build_dir)
basic_path = aux_inst_dir + "/bin:/bin:/usr/bin"
stage1_dir = build_dir + '/stage1'
build_one_stage({"PATH" : basic_path,
"CC" : "gcc",
"CXX" : "g++" },
stage1_dir, True)
for stage_num in range(2, 4):
prev_stage_dir = build_dir + '/stage' + str(stage_num - 1)
prev_stage_inst_dir = prev_stage_dir + '/inst'
cur_stage_dir = build_dir + '/stage' + str(stage_num)
build_one_stage({"PATH" : prev_stage_inst_dir + "/bin:" + basic_path,
"CC" : "gcc -fgnu89-inline",
"CXX" : "g++",
"RANLIB" : "true" },
cur_stage_dir, False)
stage3_dir = build_dir + '/stage3'
build_tar_package(aux_inst_dir + "/bin/tar",
"toolchain.tar", stage3_dir, "inst")

View File

@ -1,12 +0,0 @@
diff -ru a/fixincludes/Makefile.in b/fixincludes/Makefile.in
--- a/fixincludes/Makefile.in 2009-07-30 18:33:49.000000000 -0400
+++ b/fixincludes/Makefile.in 2012-02-27 14:59:09.371875951 -0500
@@ -126,7 +126,7 @@
fixlib.o : fixlib.c
fixinc.sh : fixinc.in mkfixinc.sh Makefile
- srcdir="$(srcdir)" $(SHELL) $(srcdir)/mkfixinc.sh $(target)
+ echo "#!/bin/sh" > $@
$(srcdir)/fixincl.x: @MAINT@ fixincl.tpl inclhack.def
cd $(srcdir) ; $(SHELL) ./genfixes

View File

@ -1,24 +0,0 @@
diff -ru a/configure b/configure
--- a/configure 2010-10-06 06:29:55.000000000 -0400
+++ b/configure 2012-02-27 20:46:26.303460301 -0500
@@ -8047,7 +8047,7 @@
# being built; programs in there won't even run.
if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
# Search for pre-installed headers if nothing else fits.
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(exec_prefix)/bin/ -B$(exec_prefix)/lib/ -isystem $(exec_prefix)/include -isystem $(exec_prefix)/sys-include'
fi
if test "x${use_gnu_ld}" = x &&
diff -ru a/configure.ac b/configure.ac
--- a/configure.ac 2010-10-06 06:29:55.000000000 -0400
+++ b/configure.ac 2012-02-27 20:46:22.587442745 -0500
@@ -3100,7 +3100,7 @@
# being built; programs in there won't even run.
if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
# Search for pre-installed headers if nothing else fits.
- FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
+ FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(exec_prefix)/bin/ -B$(exec_prefix)/lib/ -isystem $(exec_prefix)/include -isystem $(exec_prefix)/sys-include'
fi
if test "x${use_gnu_ld}" = x &&

View File

@ -1,115 +0,0 @@
diff -ru a/configure.in b/configure.in
--- a/configure.in 2011-01-17 23:34:07.000000000 -0500
+++ b/configure.in 2012-01-25 20:40:27.919485606 -0500
@@ -841,14 +841,6 @@
LIBC_PROG_BINUTILS
AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in
-# Accept binutils 2.13 or newer.
-AC_CHECK_PROG_VER(AS, $AS, --version,
- [GNU assembler.* \([0-9]*\.[0-9.]*\)],
- [2.1[3-9]*], AS=: critic_missing="$critic_missing as")
-AC_CHECK_PROG_VER(LD, $LD, --version,
- [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
- [2.1[3-9]*], LD=: critic_missing="$critic_missing ld")
-
# We need the physical current working directory. We cannot use the
# "pwd -P" shell builtin since that's not portable. Instead we try to
# find a pwd binary. Note that assigning to the PWD environment
@@ -2175,6 +2167,7 @@
fi
AC_SUBST(old_glibc_headers)
+libc_cv_slibdir=${prefix}/lib64
AC_SUBST(libc_cv_slibdir)
AC_SUBST(libc_cv_localedir)
AC_SUBST(libc_cv_sysconfdir)
diff -ru a/csu/Makefile b/csu/Makefile
--- a/csu/Makefile 2011-01-17 23:34:07.000000000 -0500
+++ b/csu/Makefile 2012-01-23 13:58:28.957792633 -0500
@@ -223,8 +223,7 @@
if [ -z "$$os" ]; then \
os=Linux; \
fi; \
- printf '"Compiled on a %s %s system on %s.\\n"\n' \
- "$$os" "$$version" "`date +%Y-%m-%d`";; \
+ ;; \
*) ;; \
esac; \
files="$(all-Banner-files)"; \
diff -ru a/elf/Makefile b/elf/Makefile
--- a/elf/Makefile 2008-10-31 16:35:11.000000000 -0400
+++ b/elf/Makefile 2012-02-16 12:20:00.038593752 -0500
@@ -295,18 +295,11 @@
z-now-yes = -Wl,-z,now
$(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
- @rm -f $@.lds
- $(LINK.o) -nostdlib -nostartfiles -shared $(z-now-$(bind-now)) \
- $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 | \
- LC_ALL=C \
- sed -e '/^=========/,/^=========/!d;/^=========/d' \
- -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
- > $@.lds
$(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
$(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now)) \
$(filter-out $(map-file),$^) $(load-map-file) \
- -Wl,-soname=$(rtld-installed-name) -T $@.lds
- rm -f $@.lds
+ -Wl,-soname=$(rtld-installed-name) \
+ -Wl,-defsym=_begin=0
# interp.c exists just to get this string into the libraries.
CFLAGS-interp.c = -D'RUNTIME_LINKER="$(slibdir)/$(rtld-installed-name)"' \
diff -ru a/localedata/Makefile b/localedata/Makefile
--- a/localedata/Makefile 2006-04-26 01:14:03.000000000 -0400
+++ b/localedata/Makefile 2012-02-17 10:31:24.592345047 -0500
@@ -113,7 +113,7 @@
$(make-target-directory)
rm -f $(@:.gz=) $@
$(INSTALL_DATA) $< $(@:.gz=)
- gzip -9 $(@:.gz=)
+ gzip -9n $(@:.gz=)
# Install the locale source files in the appropriate directory.
$(inst_i18ndir)/locales/%: locales/% $(+force); $(do-install)
diff -ru a/Makeconfig b/Makeconfig
--- a/Makeconfig 2006-07-10 17:42:27.000000000 -0400
+++ b/Makeconfig 2012-02-17 08:28:31.859584817 -0500
@@ -674,7 +674,7 @@
$(foreach lib,$(libof-$(basename $(@F))) \
$(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
$(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
-override CFLAGS = -std=gnu99 \
+override CFLAGS = -std=gnu99 -fgnu89-inline \
$(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
$(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
$(CFLAGS-$(@F))
diff -ru a/Makerules b/Makerules
--- a/Makerules 2011-01-17 23:34:07.000000000 -0500
+++ b/Makerules 2012-01-30 08:47:56.565068903 -0500
@@ -977,9 +977,9 @@
echo ' Use the shared library, but some functions are only in';\
echo ' the static library, so try that secondarily. */';\
cat $<; \
- echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \
- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
- ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \
+ echo 'GROUP ( libc.so$(libc.so-version)' \
+ '$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\
+ ' AS_NEEDED (' $(rtld-installed-name) ') )' \
) > $@.new
mv -f $@.new $@
diff -ru a/nscd/nscd_stat.c b/nscd/nscd_stat.c
--- a/nscd/nscd_stat.c 2011-01-17 23:34:07.000000000 -0500
+++ b/nscd/nscd_stat.c 2012-01-23 15:54:45.231607606 -0500
@@ -38,7 +38,7 @@
/* We use this to make sure the receiver is the same. */
-static const char compilation[21] = __DATE__ " " __TIME__;
+static const char compilation[21] = "don't need this";
/* Statistic data for one database. */
struct dbstat

View File

@ -1,12 +0,0 @@
diff -ruN a/ltmain.sh b/ltmain.sh
--- a/ltmain.sh 2009-12-05 12:18:53.000000000 -0500
+++ b/ltmain.sh 2012-05-07 16:19:31.871827967 -0400
@@ -2932,7 +2932,7 @@
func_extract_an_archive "$my_xdir" "$my_xabs"
;;
esac
- my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
done
func_extract_archives_result="$my_oldobjs"

View File

@ -1,179 +0,0 @@
Index: gcc/doc/plugins.texi
===================================================================
--- gcc/doc/plugins.texi (revision 162126)
+++ gcc/doc/plugins.texi (working copy)
@@ -144,6 +144,7 @@
@{
PLUGIN_PASS_MANAGER_SETUP, /* To hook into pass manager. */
PLUGIN_FINISH_TYPE, /* After finishing parsing a type. */
+ PLUGIN_FINISH_DECL, /* After finishing parsing a declaration. */
PLUGIN_FINISH_UNIT, /* Useful for summary processing. */
PLUGIN_PRE_GENERICIZE, /* Allows to see low level AST in C and C++ frontends. */
PLUGIN_FINISH, /* Called before GCC exits. */
Index: gcc/plugin.def
===================================================================
--- gcc/plugin.def (revision 162126)
+++ gcc/plugin.def (working copy)
@@ -24,6 +24,9 @@
/* After finishing parsing a type. */
DEFEVENT (PLUGIN_FINISH_TYPE)
+/* After finishing parsing a declaration. */
+DEFEVENT (PLUGIN_FINISH_DECL)
+
/* Useful for summary processing. */
DEFEVENT (PLUGIN_FINISH_UNIT)
Index: gcc/testsuite/g++.dg/plugin/plugin.exp
===================================================================
--- gcc/testsuite/g++.dg/plugin/plugin.exp (revision 162126)
+++ gcc/testsuite/g++.dg/plugin/plugin.exp (working copy)
@@ -51,7 +51,8 @@
{ pragma_plugin.c pragma_plugin-test-1.C } \
{ selfassign.c self-assign-test-1.C self-assign-test-2.C self-assign-test-3.C } \
{ dumb_plugin.c dumb-plugin-test-1.C } \
- { header_plugin.c header-plugin-test.C } ]
+ { header_plugin.c header-plugin-test.C } \
+ { decl_plugin.c decl-plugin-test.C } ]
foreach plugin_test $plugin_test_list {
# Replace each source file with its full-path name
Index: gcc/testsuite/g++.dg/plugin/decl-plugin-test.C
===================================================================
--- gcc/testsuite/g++.dg/plugin/decl-plugin-test.C (revision 0)
+++ gcc/testsuite/g++.dg/plugin/decl-plugin-test.C (revision 0)
@@ -0,0 +1,32 @@
+
+
+extern int global; // { dg-warning "Decl Global global" }
+int global_array[] = { 1, 2, 3 }; // { dg-warning "Decl Global global_array" }
+
+int takes_args(int arg1, int arg2)
+{
+ int local = arg1 + arg2 + global; // { dg-warning "Decl Local local" }
+ return local + 1;
+}
+
+int global = 12; // { dg-warning "Decl Global global" }
+
+struct test_str {
+ int field; // { dg-warning "Decl Field field" }
+};
+
+class test_class {
+ int class_field1; // { dg-warning "Decl Field class_field1" }
+ int class_field2; // { dg-warning "Decl Field class_field2" }
+
+ test_class() // { dg-warning "Decl Function test_class" }
+ : class_field1(0), class_field2(0)
+ {}
+
+ void swap_fields(int bias) // { dg-warning "Decl Function swap_fields" }
+ {
+ int temp = class_field1 + bias; // { dg-warning "Decl Local temp" }
+ class_field1 = class_field2 - bias;
+ class_field2 = temp;
+ }
+};
Index: gcc/testsuite/g++.dg/plugin/decl_plugin.c
===================================================================
--- gcc/testsuite/g++.dg/plugin/decl_plugin.c (revision 0)
+++ gcc/testsuite/g++.dg/plugin/decl_plugin.c (revision 0)
@@ -0,0 +1,51 @@
+/* A plugin example that shows which declarations are caught by FINISH_DECL */
+
+#include "gcc-plugin.h"
+#include <stdlib.h>
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tree.h"
+#include "tree-pass.h"
+#include "intl.h"
+
+int plugin_is_GPL_compatible;
+
+/* Callback function to invoke after GCC finishes a declaration. */
+
+void plugin_finish_decl (void *event_data, void *data)
+{
+ tree decl = (tree) event_data;
+
+ const char *kind = NULL;
+ switch (TREE_CODE(decl)) {
+ case FUNCTION_DECL:
+ kind = "Function"; break;
+ case PARM_DECL:
+ kind = "Parameter"; break;
+ case VAR_DECL:
+ if (DECL_CONTEXT(decl) != NULL)
+ kind = "Local";
+ else
+ kind = "Global";
+ break;
+ case FIELD_DECL:
+ kind = "Field"; break;
+ default:
+ kind = "Unknown";
+ }
+
+ warning (0, G_("Decl %s %s"),
+ kind, IDENTIFIER_POINTER (DECL_NAME (decl)));
+}
+
+int
+plugin_init (struct plugin_name_args *plugin_info,
+ struct plugin_gcc_version *version)
+{
+ const char *plugin_name = plugin_info->base_name;
+
+ register_callback (plugin_name, PLUGIN_FINISH_DECL,
+ plugin_finish_decl, NULL);
+ return 0;
+}
Index: gcc/cp/decl.c
===================================================================
--- gcc/cp/decl.c (revision 162126)
+++ gcc/cp/decl.c (working copy)
@@ -5967,6 +5967,8 @@
/* If this was marked 'used', be sure it will be output. */
if (lookup_attribute ("used", DECL_ATTRIBUTES (decl)))
mark_decl_referenced (decl);
+
+ invoke_plugin_callbacks (PLUGIN_FINISH_DECL, decl);
}
/* Returns a declaration for a VAR_DECL as if:
Index: gcc/c-decl.c
===================================================================
--- gcc/c-decl.c (revision 162126)
+++ gcc/c-decl.c (working copy)
@@ -4392,6 +4392,8 @@
&& DECL_INITIAL (decl) == NULL_TREE)
warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wc___compat,
"uninitialized const %qD is invalid in C++", decl);
+
+ invoke_plugin_callbacks (PLUGIN_FINISH_DECL, decl);
}
/* Given a parsed parameter declaration, decode it into a PARM_DECL. */
Index: gcc/plugin.c
===================================================================
--- gcc/plugin.c (revision 162126)
+++ gcc/plugin.c (working copy)
@@ -400,6 +400,7 @@
}
/* Fall through. */
case PLUGIN_FINISH_TYPE:
+ case PLUGIN_FINISH_DECL:
case PLUGIN_START_UNIT:
case PLUGIN_FINISH_UNIT:
case PLUGIN_PRE_GENERICIZE:
@@ -481,6 +482,7 @@
gcc_assert (event < event_last);
/* Fall through. */
case PLUGIN_FINISH_TYPE:
+ case PLUGIN_FINISH_DECL:
case PLUGIN_START_UNIT:
case PLUGIN_FINISH_UNIT:
case PLUGIN_PRE_GENERICIZE:

View File

@ -1,274 +0,0 @@
diff -ru gcc-4.5.2/gcc/double-int.c gcc-4.5.2-new/gcc/double-int.c
--- gcc-4.5.2/gcc/double-int.c 2009-11-25 05:55:54.000000000 -0500
+++ gcc-4.5.2-new/gcc/double-int.c 2011-11-29 10:20:27.625583810 -0500
@@ -296,7 +296,12 @@
tree
double_int_to_tree (tree type, double_int cst)
{
- cst = double_int_ext (cst, TYPE_PRECISION (type), TYPE_UNSIGNED (type));
+ /* Size types *are* sign extended. */
+ bool sign_extended_type = (!TYPE_UNSIGNED (type)
+ || (TREE_CODE (type) == INTEGER_TYPE
+ && TYPE_IS_SIZETYPE (type)));
+
+ cst = double_int_ext (cst, TYPE_PRECISION (type), !sign_extended_type);
return build_int_cst_wide (type, cst.low, cst.high);
}
diff -ru gcc-4.5.2/gcc/tree.c gcc-4.5.2-new/gcc/tree.c
--- gcc-4.5.2/gcc/tree.c 2010-07-07 11:24:27.000000000 -0400
+++ gcc-4.5.2-new/gcc/tree.c 2011-11-29 10:20:27.626583813 -0500
@@ -9750,7 +9750,7 @@
tree
upper_bound_in_type (tree outer, tree inner)
{
- unsigned HOST_WIDE_INT lo, hi;
+ double_int high;
unsigned int det = 0;
unsigned oprec = TYPE_PRECISION (outer);
unsigned iprec = TYPE_PRECISION (inner);
@@ -9797,18 +9797,18 @@
/* Compute 2^^prec - 1. */
if (prec <= HOST_BITS_PER_WIDE_INT)
{
- hi = 0;
- lo = ((~(unsigned HOST_WIDE_INT) 0)
+ high.high = 0;
+ high.low = ((~(unsigned HOST_WIDE_INT) 0)
>> (HOST_BITS_PER_WIDE_INT - prec));
}
else
{
- hi = ((~(unsigned HOST_WIDE_INT) 0)
+ high.high = ((~(unsigned HOST_WIDE_INT) 0)
>> (2 * HOST_BITS_PER_WIDE_INT - prec));
- lo = ~(unsigned HOST_WIDE_INT) 0;
+ high.low = ~(unsigned HOST_WIDE_INT) 0;
}
- return build_int_cst_wide (outer, lo, hi);
+ return double_int_to_tree (outer, high);
}
/* Returns the smallest value obtainable by casting something in INNER type to
diff -ru gcc-4.5.2/gcc/tree-vrp.c gcc-4.5.2-new/gcc/tree-vrp.c
--- gcc-4.5.2/gcc/tree-vrp.c 2010-06-14 11:23:31.000000000 -0400
+++ gcc-4.5.2-new/gcc/tree-vrp.c 2011-11-29 10:20:27.628583820 -0500
@@ -127,10 +127,10 @@
static inline tree
vrp_val_max (const_tree type)
{
- if (!INTEGRAL_TYPE_P (type))
- return NULL_TREE;
+ if (INTEGRAL_TYPE_P (type))
+ return upper_bound_in_type (CONST_CAST_TREE (type), CONST_CAST_TREE (type));
- return TYPE_MAX_VALUE (type);
+ return NULL_TREE;
}
/* Return the minimum value for TYPE. */
@@ -138,10 +138,10 @@
static inline tree
vrp_val_min (const_tree type)
{
- if (!INTEGRAL_TYPE_P (type))
- return NULL_TREE;
+ if (INTEGRAL_TYPE_P (type))
+ return lower_bound_in_type (CONST_CAST_TREE (type), CONST_CAST_TREE (type));
- return TYPE_MIN_VALUE (type);
+ return NULL_TREE;
}
/* Return whether VAL is equal to the maximum value of its type. This
@@ -539,7 +539,7 @@
set_value_range (vr, VR_RANGE, zero,
(overflow_infinity
? positive_overflow_infinity (type)
- : TYPE_MAX_VALUE (type)),
+ : vrp_val_max (type)),
vr->equiv);
}
@@ -1595,7 +1595,7 @@
}
else if (cond_code == LE_EXPR || cond_code == LT_EXPR)
{
- min = TYPE_MIN_VALUE (type);
+ min = vrp_val_min (type);
if (limit_vr == NULL || limit_vr->type == VR_ANTI_RANGE)
max = limit;
@@ -1630,7 +1630,7 @@
}
else if (cond_code == GE_EXPR || cond_code == GT_EXPR)
{
- max = TYPE_MAX_VALUE (type);
+ max = vrp_val_max (type);
if (limit_vr == NULL || limit_vr->type == VR_ANTI_RANGE)
min = limit;
@@ -2047,11 +2047,11 @@
|| code == ROUND_DIV_EXPR)
return (needs_overflow_infinity (TREE_TYPE (res))
? positive_overflow_infinity (TREE_TYPE (res))
- : TYPE_MAX_VALUE (TREE_TYPE (res)));
+ : vrp_val_max (TREE_TYPE (res)));
else
return (needs_overflow_infinity (TREE_TYPE (res))
? negative_overflow_infinity (TREE_TYPE (res))
- : TYPE_MIN_VALUE (TREE_TYPE (res)));
+ : vrp_val_min (TREE_TYPE (res)));
}
return res;
@@ -2750,8 +2750,8 @@
&& TYPE_PRECISION (inner_type) < TYPE_PRECISION (outer_type))
{
vr0.type = VR_RANGE;
- vr0.min = TYPE_MIN_VALUE (inner_type);
- vr0.max = TYPE_MAX_VALUE (inner_type);
+ vr0.min = vrp_val_min (inner_type);
+ vr0.max = vrp_val_max (inner_type);
}
/* If VR0 is a constant range or anti-range and the conversion is
@@ -2836,7 +2836,7 @@
}
}
else
- min = TYPE_MIN_VALUE (type);
+ min = vrp_val_min (type);
if (is_positive_overflow_infinity (vr0.min))
max = negative_overflow_infinity (type);
@@ -2855,7 +2855,7 @@
}
}
else
- max = TYPE_MIN_VALUE (type);
+ max = vrp_val_min (type);
}
else if (code == NEGATE_EXPR
&& TYPE_UNSIGNED (type))
@@ -2897,7 +2897,7 @@
else if (!vrp_val_is_min (vr0.min))
min = fold_unary_to_constant (code, type, vr0.min);
else if (!needs_overflow_infinity (type))
- min = TYPE_MAX_VALUE (type);
+ min = vrp_val_max (type);
else if (supports_overflow_infinity (type))
min = positive_overflow_infinity (type);
else
@@ -2911,7 +2911,7 @@
else if (!vrp_val_is_min (vr0.max))
max = fold_unary_to_constant (code, type, vr0.max);
else if (!needs_overflow_infinity (type))
- max = TYPE_MAX_VALUE (type);
+ max = vrp_val_max (type);
else if (supports_overflow_infinity (type)
/* We shouldn't generate [+INF, +INF] as set_value_range
doesn't like this and ICEs. */
@@ -2941,7 +2941,7 @@
TYPE_MIN_VALUE, remember -TYPE_MIN_VALUE = TYPE_MIN_VALUE. */
if (TYPE_OVERFLOW_WRAPS (type))
{
- tree type_min_value = TYPE_MIN_VALUE (type);
+ tree type_min_value = vrp_val_min (type);
min = (vr0.min != type_min_value
? int_const_binop (PLUS_EXPR, type_min_value,
@@ -2953,7 +2953,7 @@
if (overflow_infinity_range_p (&vr0))
min = negative_overflow_infinity (type);
else
- min = TYPE_MIN_VALUE (type);
+ min = vrp_val_min (type);
}
}
else
@@ -2974,7 +2974,7 @@
}
}
else
- max = TYPE_MAX_VALUE (type);
+ max = vrp_val_max (type);
}
}
@@ -3258,11 +3258,11 @@
if (POINTER_TYPE_P (type) || !TYPE_MIN_VALUE (type))
tmin = lower_bound_in_type (type, type);
else
- tmin = TYPE_MIN_VALUE (type);
+ tmin = vrp_val_min (type);
if (POINTER_TYPE_P (type) || !TYPE_MAX_VALUE (type))
tmax = upper_bound_in_type (type, type);
else
- tmax = TYPE_MAX_VALUE (type);
+ tmax = vrp_val_max (type);
if (vr->type == VR_VARYING || vr->type == VR_UNDEFINED)
{
@@ -4146,8 +4146,8 @@
if ((comp_code == GT_EXPR || comp_code == LT_EXPR)
&& INTEGRAL_TYPE_P (TREE_TYPE (val)))
{
- tree min = TYPE_MIN_VALUE (TREE_TYPE (val));
- tree max = TYPE_MAX_VALUE (TREE_TYPE (val));
+ tree min = vrp_val_min (TREE_TYPE (val));
+ tree max = vrp_val_max (TREE_TYPE (val));
if (comp_code == GT_EXPR
&& (!max
@@ -6426,13 +6426,13 @@
VARYING. Same if the previous max value was invalid for
the type and we'd end up with vr_result.min > vr_result.max. */
if (vrp_val_is_max (vr_result.max)
- || compare_values (TYPE_MIN_VALUE (TREE_TYPE (vr_result.min)),
+ || compare_values (vrp_val_min (TREE_TYPE (vr_result.min)),
vr_result.max) > 0)
goto varying;
if (!needs_overflow_infinity (TREE_TYPE (vr_result.min))
|| !vrp_var_may_overflow (lhs, phi))
- vr_result.min = TYPE_MIN_VALUE (TREE_TYPE (vr_result.min));
+ vr_result.min = vrp_val_min (TREE_TYPE (vr_result.min));
else if (supports_overflow_infinity (TREE_TYPE (vr_result.min)))
vr_result.min =
negative_overflow_infinity (TREE_TYPE (vr_result.min));
@@ -6448,13 +6448,13 @@
VARYING. Same if the previous min value was invalid for
the type and we'd end up with vr_result.max < vr_result.min. */
if (vrp_val_is_min (vr_result.min)
- || compare_values (TYPE_MAX_VALUE (TREE_TYPE (vr_result.max)),
+ || compare_values (vrp_val_max (TREE_TYPE (vr_result.max)),
vr_result.min) < 0)
goto varying;
if (!needs_overflow_infinity (TREE_TYPE (vr_result.max))
|| !vrp_var_may_overflow (lhs, phi))
- vr_result.max = TYPE_MAX_VALUE (TREE_TYPE (vr_result.max));
+ vr_result.max = vrp_val_max (TREE_TYPE (vr_result.max));
else if (supports_overflow_infinity (TREE_TYPE (vr_result.max)))
vr_result.max =
positive_overflow_infinity (TREE_TYPE (vr_result.max));
@@ -6782,7 +6782,7 @@
{
/* This should not be negative infinity; there is no overflow
here. */
- min = TYPE_MIN_VALUE (TREE_TYPE (op0));
+ min = vrp_val_min (TREE_TYPE (op0));
max = op1;
if (cond_code == LT_EXPR && !is_overflow_infinity (max))
@@ -6797,7 +6797,7 @@
{
/* This should not be positive infinity; there is no overflow
here. */
- max = TYPE_MAX_VALUE (TREE_TYPE (op0));
+ max = vrp_val_max (TREE_TYPE (op0));
min = op1;
if (cond_code == GT_EXPR && !is_overflow_infinity (min))

View File

@ -1,98 +0,0 @@
diff -ru gcc-4.5.2/libstdc++-v3/include/bits/stl_pair.h gcc-4.5.2-new/libstdc++-v3/include/bits/stl_pair.h
--- gcc-4.5.2/libstdc++-v3/include/bits/stl_pair.h 2010-06-10 06:26:14.000000000 -0400
+++ gcc-4.5.2-new/libstdc++-v3/include/bits/stl_pair.h 2011-11-29 10:25:51.203597393 -0500
@@ -88,6 +88,8 @@
: first(__a), second(__b) { }
#ifdef __GXX_EXPERIMENTAL_CXX0X__
+ pair(const pair&) = default;
+
// DR 811.
template<class _U1, class = typename
std::enable_if<std::is_convertible<_U1, _T1>::value>::type>
@@ -131,6 +133,15 @@
template<class _U1, class _U2>
pair&
+ operator=(const pair<_U1, _U2>& __p)
+ {
+ first = __p.first;
+ second = __p.second;
+ return *this;
+ }
+
+ template<class _U1, class _U2>
+ pair&
operator=(pair<_U1, _U2>&& __p)
{
first = std::move(__p.first);
diff -ru gcc-4.5.2/libstdc++-v3/include/bits/stl_queue.h gcc-4.5.2-new/libstdc++-v3/include/bits/stl_queue.h
--- gcc-4.5.2/libstdc++-v3/include/bits/stl_queue.h 2010-02-04 13:20:34.000000000 -0500
+++ gcc-4.5.2-new/libstdc++-v3/include/bits/stl_queue.h 2011-11-29 10:26:22.511695475 -0500
@@ -1,6 +1,6 @@
// Queue implementation -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -137,16 +137,6 @@
explicit
queue(_Sequence&& __c = _Sequence())
: c(std::move(__c)) { }
-
- queue(queue&& __q)
- : c(std::move(__q.c)) { }
-
- queue&
- operator=(queue&& __q)
- {
- c = std::move(__q.c);
- return *this;
- }
#endif
/**
@@ -451,17 +441,6 @@
c.insert(c.end(), __first, __last);
std::make_heap(c.begin(), c.end(), comp);
}
-
- priority_queue(priority_queue&& __pq)
- : c(std::move(__pq.c)), comp(std::move(__pq.comp)) { }
-
- priority_queue&
- operator=(priority_queue&& __pq)
- {
- c = std::move(__pq.c);
- comp = std::move(__pq.comp);
- return *this;
- }
#endif
/**
diff -ru gcc-4.5.2/libstdc++-v3/libsupc++/exception_ptr.h gcc-4.5.2-new/libstdc++-v3/libsupc++/exception_ptr.h
--- gcc-4.5.2/libstdc++-v3/libsupc++/exception_ptr.h 2009-11-09 17:09:30.000000000 -0500
+++ gcc-4.5.2-new/libstdc++-v3/libsupc++/exception_ptr.h 2011-11-29 10:26:10.878659023 -0500
@@ -129,7 +129,7 @@
operator==(const exception_ptr&, const exception_ptr&) throw()
__attribute__ ((__pure__));
- const type_info*
+ const class type_info*
__cxa_exception_type() const throw() __attribute__ ((__pure__));
};
diff -ru gcc-4.5.2/libstdc++-v3/libsupc++/nested_exception.h gcc-4.5.2-new/libstdc++-v3/libsupc++/nested_exception.h
--- gcc-4.5.2/libstdc++-v3/libsupc++/nested_exception.h 2010-02-18 12:20:16.000000000 -0500
+++ gcc-4.5.2-new/libstdc++-v3/libsupc++/nested_exception.h 2011-11-29 10:26:10.879659026 -0500
@@ -119,7 +119,7 @@
// with a type that has an accessible nested_exception base.
template<typename _Ex>
inline void
- __throw_with_nested(_Ex&& __ex, const nested_exception* = 0)
+ __throw_with_nested(_Ex&& __ex, const nested_exception*)
{ throw __ex; }
template<typename _Ex>