diff --git a/repos/libports/include/stdcxx/bits/c++config.h b/repos/libports/include/stdcxx/bits/c++config.h index 3040d3056..9b8c776a2 100644 --- a/repos/libports/include/stdcxx/bits/c++config.h +++ b/repos/libports/include/stdcxx/bits/c++config.h @@ -59,6 +59,14 @@ # endif #endif +#ifndef _GLIBCXX_THROW_OR_ABORT +# if __EXCEPTIONS +# define _GLIBCXX_THROW_OR_ABORT(_EXC) (throw (_EXC)) +# else +# define _GLIBCXX_THROW_OR_ABORT(_EXC) (__builtin_abort()) +# endif +#endif + // Macros for visibility attributes. // _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY // _GLIBCXX_VISIBILITY @@ -85,6 +93,11 @@ # define _GLIBCXX_DEPRECATED #endif +// Macros for ABI tag attributes. +#ifndef _GLIBCXX_ABI_TAG_CXX11 +# define _GLIBCXX_ABI_TAG_CXX11 __attribute ((__abi_tag__ ("cxx11"))) +#endif + #if __cplusplus // Macro for constexpr, to support in mixed 03/0x mode. diff --git a/repos/libports/include/stdcxx/bits/gthr.h b/repos/libports/include/stdcxx/bits/gthr.h index 357528ad1..7e6ad697f 100644 --- a/repos/libports/include/stdcxx/bits/gthr.h +++ b/repos/libports/include/stdcxx/bits/gthr.h @@ -1,7 +1,6 @@ /* Threads compatibility routines for libgcc2 and libobjc. */ /* Compile this one with gcc. */ -/* Copyright (C) 1997, 1999, 2000, 2004, 2008, 2009 - Free Software Foundation, Inc. +/* Copyright (C) 1997-2013 Free Software Foundation, Inc. This file is part of GCC. @@ -36,6 +35,7 @@ typedef int __gthread_recursive_mutex_t; #define __GTHREAD_ONCE_INIT 0 #define __GTHREAD_MUTEX_INIT 0 +#define __GTHREAD_MUTEX_INIT_FUNCTION(mx) #define __GTHREAD_RECURSIVE_MUTEX_INIT 0 #define UNUSED __attribute__((unused)) @@ -285,6 +285,12 @@ __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex) return __gthread_mutex_unlock (__mutex); } +static inline int +__gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *__mutex) +{ + return __gthread_mutex_destroy (__mutex); +} + #endif /* _LIBOBJC */ #undef UNUSED diff --git a/repos/libports/include/stdcxx/bits/opt_random.h b/repos/libports/include/stdcxx/bits/opt_random.h new file mode 100644 index 000000000..76c91556b --- /dev/null +++ b/repos/libports/include/stdcxx/bits/opt_random.h @@ -0,0 +1,38 @@ +// Optimizations for random number handling, generic version -*- C++ -*- + +// Copyright (C) 2012-2013 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +/** @file bits/opt_random.h + * This is an internal header file, included by other library headers. + * Do not attempt to use it directly. @headername{random} + */ + +#ifndef _BITS_OPT_RANDOM_H +#define _BITS_OPT_RANDOM_H 1 + +#pragma GCC system_header + + + + +#endif // _BITS_OPT_RANDOM_H diff --git a/repos/libports/ports/stdcxx.hash b/repos/libports/ports/stdcxx.hash index a9c97142c..a5ab374b2 100644 --- a/repos/libports/ports/stdcxx.hash +++ b/repos/libports/ports/stdcxx.hash @@ -1 +1 @@ -fadf4f6ba436fe4846572f00bf057c5ef290c25b +e84c87de80e973ef43e93d8da733585461be4bc8 diff --git a/repos/libports/ports/stdcxx.port b/repos/libports/ports/stdcxx.port index 372a24b76..8675618be 100644 --- a/repos/libports/ports/stdcxx.port +++ b/repos/libports/ports/stdcxx.port @@ -1,9 +1,9 @@ LICENSE := LGPL -VERSION := 4.7.4 +VERSION := 4.8.4 DOWNLOADS := gcc.archive URL(gcc) := ftp://ftp.fu-berlin.de/gnu/gcc/gcc-$(VERSION)/gcc-$(VERSION).tar.bz2 -SHA(gcc) := f3359a157b3536f289c155363f1736a2c9b414db +SHA(gcc) := 40867a9ac74a054b1cee855988fd680cabf42006 DIR(gcc) := src/lib/stdcxx SIG(gcc) := ${URL(gcc)} KEY(gcc) := GNU diff --git a/repos/ports/ports/gcc.hash b/repos/ports/ports/gcc.hash index 3eed54450..a7d15682e 100644 --- a/repos/ports/ports/gcc.hash +++ b/repos/ports/ports/gcc.hash @@ -1 +1 @@ -d396d536dec018b4199b12437f1e9d563b4330d0 +2194bf9e9cc57f15d820e3d4a1388af3cfe49449 diff --git a/repos/ports/ports/gcc.port b/repos/ports/ports/gcc.port index 8d105ddbb..b863bab7b 100644 --- a/repos/ports/ports/gcc.port +++ b/repos/ports/ports/gcc.port @@ -1,9 +1,9 @@ LICENSE := GPLv3 -VERSION := 4.7.4 +VERSION := 4.8.4 DOWNLOADS := gcc.archive URL(gcc) := ftp://ftp.fu-berlin.de/gnu/gcc/gcc-$(VERSION)/gcc-$(VERSION).tar.bz2 -SHA(gcc) := f3359a157b3536f289c155363f1736a2c9b414db +SHA(gcc) := 40867a9ac74a054b1cee855988fd680cabf42006 SIG(gcc) := ${URL(gcc)}.sig KEY(gcc) := GNU DIR(gcc) := src/noux-pkg/gcc diff --git a/repos/ports/run/gdb_monitor.inc b/repos/ports/run/gdb_monitor.inc index 026916aef..5a59e9fd2 100644 --- a/repos/ports/run/gdb_monitor.inc +++ b/repos/ports/run/gdb_monitor.inc @@ -35,7 +35,7 @@ proc gdb_main_breakpoint_cmds { target_binary_name } { append gdb_cmds "-ex \"symbol-file bin/$target_binary_name\" " # set a breakpoint in the application's 'main()' function - append gdb_cmds {-ex "b main()" } + append gdb_cmds {-ex "b main" } # set search path for "sharedlibrary" to bin append gdb_cmds {-ex "set solib-search-path bin" } diff --git a/repos/ports/run/gdb_monitor.run b/repos/ports/run/gdb_monitor.run index dbb0ae33c..b959b7dab 100644 --- a/repos/ports/run/gdb_monitor.run +++ b/repos/ports/run/gdb_monitor.run @@ -194,8 +194,8 @@ if {![regexp {Breakpoint 3, puts (.*)} $gdb_output]} { } if {![regexp {#0 puts} $gdb_output] || - ![regexp {in func2 ()} $gdb_output] || - ![regexp {in func1 ()} $gdb_output] || + ![regexp {in func2()} $gdb_output] || + ![regexp {in func1()} $gdb_output] || ![regexp {in main ()} $gdb_output]} { puts stderr "Error: Stack trace when not in syscall is not as expected" @@ -230,7 +230,7 @@ if {![regexp {\* 2 Thread 2 Test_thread::entry} $gdb_output] || exit -1 } -if {![regexp {46 func()} $gdb_output]} { +if {![regexp {38 static Timer::Connection timer} $gdb_output]} { puts stderr "Error: Single stepping didn't result in the expected output" exit -1 } @@ -240,9 +240,8 @@ if {![regexp {Program received signal SIGSEGV, Segmentation fault.} $gdb_output] exit -1 } -if {![regexp {thread_stop_myself \(\)} $gdb_output] || - ![regexp {Genode::Cancelable_lock::lock \(this=} $gdb_output] || - ![regexp {Genode::Thread_base::join \(this=} $gdb_output] || +if {![regexp {Genode::Cancelable_lock::lock\(\)} $gdb_output] || + ![regexp {Genode::Thread_base::join\(\)} $gdb_output] || ![regexp {in main \(\)} $gdb_output]} { puts stderr "Error: Stack trace when in syscall is not as expected" diff --git a/repos/ports/run/noux_tool_chain.inc b/repos/ports/run/noux_tool_chain.inc index ac3faa683..fed27e247 100644 --- a/repos/ports/run/noux_tool_chain.inc +++ b/repos/ports/run/noux_tool_chain.inc @@ -293,7 +293,7 @@ install_config $config # generic modules set boot_modules { core init timer ld.lib.so noux terminal ram_fs - libc.lib.so libm.lib.so libc_noux.lib.so ncurses.lib.so } + libc.lib.so libm.lib.so libc_noux.lib.so ncurses.lib.so stdcxx.lib.so } append boot_modules { gmp.lib.so mpfr.lib.so mpc.lib.so } diff --git a/repos/ports/src/noux-pkg/gcc/build.patch b/repos/ports/src/noux-pkg/gcc/build.patch index 8a83e2e6b..cb44537c9 100644 --- a/repos/ports/src/noux-pkg/gcc/build.patch +++ b/repos/ports/src/noux-pkg/gcc/build.patch @@ -6,18 +6,19 @@ From: Christian Prochaska --- Makefile.def | 1 + Makefile.tpl | 6 ++++++ - fixincludes/Makefile.in | 4 ++-- + fixincludes/Makefile.in | 5 +++-- gcc/Makefile.in | 6 +++--- - gcc/configure.ac | 1 + + gcc/config.host | 2 +- + gcc/configure.ac | 4 ++-- gcc/gengtype-lex.c | 1 - libgcc/Makefile.in | 2 +- - 7 files changed, 14 insertions(+), 7 deletions(-) + 8 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Makefile.def b/Makefile.def -index ae2689d..2569010 100644 +index 90d9653..642f637 100644 --- a/Makefile.def +++ b/Makefile.def -@@ -256,6 +256,7 @@ flags_to_pass = { flag= GOCFLAGS_FOR_TARGET ; }; +@@ -263,6 +263,7 @@ flags_to_pass = { flag= GOCFLAGS_FOR_TARGET ; }; flags_to_pass = { flag= LD_FOR_TARGET ; }; flags_to_pass = { flag= LIPO_FOR_TARGET ; }; flags_to_pass = { flag= LDFLAGS_FOR_TARGET ; }; @@ -26,7 +27,7 @@ index ae2689d..2569010 100644 flags_to_pass = { flag= LIBCXXFLAGS_FOR_TARGET ; }; flags_to_pass = { flag= NM_FOR_TARGET ; }; diff --git a/Makefile.tpl b/Makefile.tpl -index 685756c..45fe31e 100644 +index e81c095..92c10b8 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -156,6 +156,8 @@ BUILD_EXPORTS = \ @@ -47,7 +48,7 @@ index 685756c..45fe31e 100644 GCJ="$(GCJ)"; export GCJ; \ GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \ GOC="$(GOC)"; export GOC; \ -@@ -280,6 +284,7 @@ BASE_TARGET_EXPORTS = \ +@@ -278,6 +282,7 @@ BASE_TARGET_EXPORTS = \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ @@ -55,7 +56,7 @@ index 685756c..45fe31e 100644 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ GCJ="$(GCJ_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GCJ; \ GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \ -@@ -650,6 +655,7 @@ EXTRA_TARGET_FLAGS = \ +@@ -644,6 +649,7 @@ EXTRA_TARGET_FLAGS = \ 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \ 'CXX=$$(CXX_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \ @@ -64,10 +65,18 @@ index 685756c..45fe31e 100644 'GCJ=$$(GCJ_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ 'GFORTRAN=$$(GFORTRAN_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ diff --git a/fixincludes/Makefile.in b/fixincludes/Makefile.in -index b9857b9..0229f70 100644 +index ce850ff..437d3f4 100644 --- a/fixincludes/Makefile.in +++ b/fixincludes/Makefile.in -@@ -107,11 +107,11 @@ oneprocess : full-stamp +@@ -28,6 +28,7 @@ STAMP = echo timestamp > + + CC = @CC@ + CFLAGS = @CFLAGS@ ++CPPFLAGS = @CPPFLAGS@ + WARN_CFLAGS = @WARN_CFLAGS@ @WARN_PEDANTIC@ @WERROR@ + LDFLAGS = @LDFLAGS@ + INCLUDES = -I. -I$(srcdir) -I../include -I$(srcdir)/../include +@@ -107,11 +108,11 @@ oneprocess : full-stamp twoprocess : test-stamp $(AF) full-stamp : $(ALLOBJ) $(LIBIBERTY) @@ -82,43 +91,59 @@ index b9857b9..0229f70 100644 $(AF): $(FIXOBJ) $(LIBIBERTY) diff --git a/gcc/Makefile.in b/gcc/Makefile.in -index f3cc49f..6baecb8 100644 +index 2a4475b..98c6235 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in -@@ -760,7 +760,7 @@ BUILD_LINKERFLAGS = $(BUILD_CFLAGS) - +@@ -748,7 +748,7 @@ BUILD_LINKERFLAGS = $(BUILD_CXXFLAGS) # Native linker and preprocessor flags. For x-fragment overrides. BUILD_LDFLAGS=@BUILD_LDFLAGS@ --BUILD_CPPFLAGS=$(ALL_CPPFLAGS) -+BUILD_CPPFLAGS=$(INCLUDES) $(CPPFLAGS_FOR_BUILD) + BUILD_CPPFLAGS= -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \ +- -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(CPPFLAGS) ++ -I$(srcdir)/../include @INCINTL@ $(CPPINC) $(INCLUDES) $(CPPFLAGS_FOR_BUILD) # Actual name to use when installing a native compiler. GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)') -@@ -1030,8 +1030,8 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY) +@@ -1019,8 +1019,8 @@ BUILD_LIBDEPS= $(BUILD_LIBIBERTY) # How to link with both our special library facilities # and the system's installed libraries. --LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) \ -- $(LIBDECNUMBER) $(HOST_LIBS) -+LIBS = libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBIBERTY) \ -+ $(LIBDECNUMBER) $(HOST_LIBS) @LIBS@ - BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \ +-LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) \ +- $(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS) ++LIBS = libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) \ ++ $(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS) @LIBS@ + BACKENDLIBS = $(CLOOGLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \ $(ZLIB) # Any system libraries needed just for GNAT. +diff --git a/gcc/config.host b/gcc/config.host +index 1196ec5..414d5ff 100644 +--- a/gcc/config.host ++++ b/gcc/config.host +@@ -99,7 +99,7 @@ case ${host} in + esac + + case ${host} in +- arm*-*-linux*) ++ arm*-*-*) + case ${target} in + arm*-*-*) + host_extra_gcc_objs="driver-arm.o" diff --git a/gcc/configure.ac b/gcc/configure.ac -index a78a1d7..5baf340 100644 +index 3ee1d67..004a185 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac -@@ -1540,6 +1540,7 @@ else - saved_CFLAGS="${CFLAGS}" +@@ -1521,8 +1521,8 @@ else + # system.h from including gmp.h. CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ - LDFLAGS="${LDFLAGS_FOR_BUILD}" \ -+ LIBS="${LIBS_FOR_BUILD}" CPPFLAGS="${CPPFLAGS_FOR_BUILD}" \ + CXX="${CXX_FOR_BUILD}" CXXFLAGS="${CXXFLAGS_FOR_BUILD}" \ +- LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" \ +- GMPINC="" CPPFLAGS="${CPPFLAGS} -DGENERATOR_FILE" \ ++ LD="${LD_FOR_BUILD}" LDFLAGS="${LDFLAGS_FOR_BUILD}" LIBS="${LIBS_FOR_BUILD}" \ ++ GMPINC="" CPPFLAGS="${CPPFLAGS_FOR_BUILD} -DGENERATOR_FILE" \ ${realsrcdir}/configure \ --enable-languages=${enable_languages-all} \ --target=$target_alias --host=$build_alias --build=$build_alias diff --git a/gcc/gengtype-lex.c b/gcc/gengtype-lex.c -index 39d6357..731de55 100644 +index 244dd0d..ee29879 100644 --- a/gcc/gengtype-lex.c +++ b/gcc/gengtype-lex.c @@ -1,4 +1,3 @@ @@ -127,7 +152,7 @@ index 39d6357..731de55 100644 #line 4 "gengtype-lex.c" diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in -index a2cb98f..84b34c7 100644 +index db9b1b2..594fc6d 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -225,7 +225,7 @@ endif diff --git a/repos/ports/src/noux-pkg/gcc/target.inc b/repos/ports/src/noux-pkg/gcc/target.inc index a9280cb2b..52fe51bd2 100644 --- a/repos/ports/src/noux-pkg/gcc/target.inc +++ b/repos/ports/src/noux-pkg/gcc/target.inc @@ -51,7 +51,7 @@ libgmp.a libmpfr.a libmpc.a libc.a: Makefile: dummy_libs -LIBS += libc libm libc_noux +LIBS += libc libm libc_noux stdcxx include $(REP_DIR)/mk/noux.mk diff --git a/repos/ports/src/noux-pkg/gdb/target.inc b/repos/ports/src/noux-pkg/gdb/target.inc index 729c5f404..b165738d7 100644 --- a/repos/ports/src/noux-pkg/gdb/target.inc +++ b/repos/ports/src/noux-pkg/gdb/target.inc @@ -6,6 +6,7 @@ NOUX_CONFIGURE_ARGS += --program-prefix=$(PROGRAM_PREFIX) \ # the configure script calls the linker with "-lexpat", which fails NOUX_CONFIGURE_ARGS += --without-expat NOUX_CPPFLAGS += -DHAVE_LIBEXPAT=1 +NOUX_CFLAGS += -Wno-error=sizeof-pointer-memaccess LIBS += ncurses expat diff --git a/tool/patches/gcc-4.8.4/caf62483f30035efca2958615a466f73cc99880e.patch b/tool/patches/gcc-4.8.4/caf62483f30035efca2958615a466f73cc99880e.patch new file mode 100644 index 000000000..b226fc628 --- /dev/null +++ b/tool/patches/gcc-4.8.4/caf62483f30035efca2958615a466f73cc99880e.patch @@ -0,0 +1,105 @@ +From caf62483f30035efca2958615a466f73cc99880e Mon Sep 17 00:00:00 2001 + +From: glisse + +Subject: [PATCH] 2014-02-03 Marc Glisse + + PR c++/53017 + PR c++/59211 +gcc/c-family/ + * c-common.c (handle_aligned_attribute, handle_alloc_size_attribute, + handle_vector_size_attribute, handle_nonnull_attribute): Call + default_conversion on the attribute argument. + (handle_nonnull_attribute): Increment the argument number. +gcc/cp/ + * tree.c (handle_init_priority_attribute): Call default_conversion on + the attribute argument. +gcc/ + * doc/extend.texi (Function Attributes): Typo. +gcc/testsuite/ + * c-c++-common/attributes-1.c: New testcase. + * g++.dg/cpp0x/constexpr-attribute2.C: Likewise. + + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207436 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + gcc/c-family/c-common.c | 26 ++++++++++++++++++++++---- + gcc/cp/tree.c | 1 + + 2 files changed, 23 insertions(+), 4 deletions(-) + +diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c +index 86f64ec..5f43074 100644 +--- a/gcc/c-family/c-common.c ++++ b/gcc/c-family/c-common.c +@@ -7414,10 +7414,18 @@ handle_aligned_attribute (tree *node, tree ARG_UNUSED (name), tree args, + tree decl = NULL_TREE; + tree *type = NULL; + int is_type = 0; +- tree align_expr = (args ? TREE_VALUE (args) +- : size_int (ATTRIBUTE_ALIGNED_VALUE / BITS_PER_UNIT)); ++ tree align_expr; + int i; + ++ if (args) ++ { ++ align_expr = TREE_VALUE (args); ++ if (align_expr && TREE_CODE (align_expr) != IDENTIFIER_NODE) ++ align_expr = default_conversion (align_expr); ++ } ++ else ++ align_expr = size_int (ATTRIBUTE_ALIGNED_VALUE / BITS_PER_UNIT); ++ + if (DECL_P (*node)) + { + decl = *node; +@@ -7923,6 +7931,9 @@ handle_alloc_size_attribute (tree *node, tree ARG_UNUSED (name), tree args, + for (; args; args = TREE_CHAIN (args)) + { + tree position = TREE_VALUE (args); ++ if (position && TREE_CODE (position) != IDENTIFIER_NODE ++ && TREE_CODE (position) != FUNCTION_DECL) ++ position = default_conversion (position); + + if (TREE_CODE (position) != INTEGER_CST + || TREE_INT_CST_HIGH (position) +@@ -8328,6 +8339,8 @@ handle_vector_size_attribute (tree *node, tree name, tree args, + *no_add_attrs = true; + + size = TREE_VALUE (args); ++ if (size && TREE_CODE (size) != IDENTIFIER_NODE) ++ size = default_conversion (size); + + if (!host_integerp (size, 1)) + { +@@ -8421,11 +8434,16 @@ handle_nonnull_attribute (tree *node, tree ARG_UNUSED (name), + + /* Argument list specified. Verify that each argument number references + a pointer argument. */ +- for (attr_arg_num = 1; args; args = TREE_CHAIN (args)) ++ for (attr_arg_num = 1; args; attr_arg_num++, args = TREE_CHAIN (args)) + { + unsigned HOST_WIDE_INT arg_num = 0, ck_num; + +- if (!get_nonnull_operand (TREE_VALUE (args), &arg_num)) ++ tree arg = TREE_VALUE (args); ++ if (arg && TREE_CODE (arg) != IDENTIFIER_NODE ++ && TREE_CODE (arg) != FUNCTION_DECL) ++ arg = default_conversion (arg); ++ ++ if (!get_nonnull_operand (arg, &arg_num)) + { + error ("nonnull argument has invalid operand number (argument %lu)", + (unsigned long) attr_arg_num); +diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c +index c7502d6..775e94e 100644 +--- a/gcc/cp/tree.c ++++ b/gcc/cp/tree.c +@@ -3216,6 +3216,7 @@ handle_init_priority_attribute (tree* node, + int pri; + + STRIP_NOPS (initp_expr); ++ initp_expr = default_conversion (initp_expr); + + if (!initp_expr || TREE_CODE (initp_expr) != INTEGER_CST) + { diff --git a/tool/patches/gcc-4.7.4/config.patch b/tool/patches/gcc-4.8.4/config.patch similarity index 87% rename from tool/patches/gcc-4.7.4/config.patch rename to tool/patches/gcc-4.8.4/config.patch index 73af0f787..3396fbc56 100644 --- a/tool/patches/gcc-4.7.4/config.patch +++ b/tool/patches/gcc-4.8.4/config.patch @@ -11,10 +11,10 @@ From: Christian Prochaska 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/gcc/config.gcc b/gcc/config.gcc -index 9503b96..b8d6ce1 100644 +index 57a415b..87c0a72 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc -@@ -914,7 +914,7 @@ arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems*) +@@ -919,7 +919,7 @@ arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems*) case ${target} in arm*-*-eabi*) tm_file="$tm_file newlib-stdint.h" @@ -23,7 +23,7 @@ index 9503b96..b8d6ce1 100644 use_gcc_stdint=wrap ;; arm*-*-rtems*) -@@ -2641,7 +2641,7 @@ i[34567]86-*-linux* | x86_64-*-linux*) +@@ -2690,7 +2690,7 @@ i[34567]86-*-linux* | x86_64-*-linux*) tmake_file="${tmake_file} i386/t-pmm_malloc i386/t-i386" ;; i[34567]86-*-* | x86_64-*-*) @@ -33,10 +33,10 @@ index 9503b96..b8d6ce1 100644 powerpc*-*-* | rs6000-*-*) tm_file="${tm_file} rs6000/option-defaults.h" diff --git a/gcc/config/arm/unknown-elf.h b/gcc/config/arm/unknown-elf.h -index d5df624..6766c5f 100644 +index 9d776b0..68faf5b 100644 --- a/gcc/config/arm/unknown-elf.h +++ b/gcc/config/arm/unknown-elf.h -@@ -95,3 +95,19 @@ +@@ -94,3 +94,19 @@ which will depend on abort, which is defined in libc. */ #undef LINK_GCC_C_SEQUENCE_SPEC #define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L --end-group" @@ -57,13 +57,13 @@ index d5df624..6766c5f 100644 +/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57699 */ +#define NO_IMPLICIT_EXTERN_C diff --git a/gcc/config/i386/x86-64.h b/gcc/config/i386/x86-64.h -index d20f326..0cc4dd0 100644 +index 66f96d9..7ccf6ea 100644 --- a/gcc/config/i386/x86-64.h +++ b/gcc/config/i386/x86-64.h -@@ -104,3 +104,22 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +@@ -106,3 +106,22 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - #undef TARGET_ASM_UNIQUE_SECTION - #define TARGET_ASM_UNIQUE_SECTION x86_64_elf_unique_section + #undef TARGET_SECTION_TYPE_FLAGS + #define TARGET_SECTION_TYPE_FLAGS x86_64_elf_section_type_flags + +/* genode64.h */ + @@ -84,10 +84,10 @@ index d20f326..0cc4dd0 100644 +/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57699 */ +#define NO_IMPLICIT_EXTERN_C diff --git a/libgcc/config.host b/libgcc/config.host -index b64da4a..096d5b6 100644 +index 4a76998..05bae91 100644 --- a/libgcc/config.host +++ b/libgcc/config.host -@@ -261,7 +261,7 @@ case ${host} in +@@ -263,7 +263,7 @@ case ${host} in tmake_file=t-vxworks ;; *-*-elf) @@ -96,7 +96,7 @@ index b64da4a..096d5b6 100644 ;; esac -@@ -363,8 +363,12 @@ arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems*) +@@ -342,8 +342,12 @@ arm*-*-eabi* | arm*-*-symbianelf* | arm*-*-rtems*) tm_file="$tm_file arm/bpabi-lib.h" case ${host} in arm*-*-eabi* | arm*-*-rtems*) @@ -110,7 +110,7 @@ index b64da4a..096d5b6 100644 ;; arm*-*-symbianelf*) tmake_file="${tmake_file} arm/t-symbian t-slibgcc-nolc-override" -@@ -524,6 +528,10 @@ i[34567]86-*-elf*) +@@ -499,6 +503,10 @@ i[34567]86-*-elf*) tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic" ;; x86_64-*-elf*) diff --git a/tool/patches/gcc-4.8.4/go_libbacktrace.patch b/tool/patches/gcc-4.8.4/go_libbacktrace.patch new file mode 100644 index 000000000..2c2c75c4f --- /dev/null +++ b/tool/patches/gcc-4.8.4/go_libbacktrace.patch @@ -0,0 +1,22 @@ +go_libbacktrace.patch + +From: Christian Prochaska + +Remove the dependency on libbacktrace, which needs a libc. +--- + gcc/go/config-lang.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/go/config-lang.in b/gcc/go/config-lang.in +index fe9bb75..f965921 100644 +--- a/gcc/go/config-lang.in ++++ b/gcc/go/config-lang.in +@@ -28,7 +28,7 @@ language="go" + + compilers="go1\$(exeext)" + +-target_libs="target-libgo target-libffi target-libbacktrace" ++target_libs="target-libgo target-libffi" + + # The Go frontend is written in C++, so we need to build the C++ + # compiler during stage 1. diff --git a/tool/patches/gcc-4.7.4/host_target_combination.patch b/tool/patches/gcc-4.8.4/host_target_combination.patch similarity index 92% rename from tool/patches/gcc-4.7.4/host_target_combination.patch rename to tool/patches/gcc-4.8.4/host_target_combination.patch index 5b40cc2ce..84cd8f81a 100644 --- a/tool/patches/gcc-4.7.4/host_target_combination.patch +++ b/tool/patches/gcc-4.8.4/host_target_combination.patch @@ -14,10 +14,10 @@ compiler as much as possible. 1 file changed, 1 deletion(-) diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4 -index 361ed0b..98d68ec 100644 +index 943ea67..d379010 100644 --- a/libstdc++-v3/crossconfig.m4 +++ b/libstdc++-v3/crossconfig.m4 -@@ -264,7 +264,6 @@ case "${host}" in +@@ -270,7 +270,6 @@ case "${host}" in AC_DEFINE(HAVE_TANHF) ;; *) diff --git a/tool/patches/gcc-4.7.4/libgcc_s.patch b/tool/patches/gcc-4.8.4/libgcc_s.patch similarity index 85% rename from tool/patches/gcc-4.7.4/libgcc_s.patch rename to tool/patches/gcc-4.8.4/libgcc_s.patch index ec46b71cc..29dbb4ad8 100644 --- a/tool/patches/gcc-4.7.4/libgcc_s.patch +++ b/tool/patches/gcc-4.8.4/libgcc_s.patch @@ -8,10 +8,10 @@ From: Christian Prochaska 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in -index 9f45475..a2cb98f 100644 +index 31740cb..db9b1b2 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in -@@ -893,7 +893,7 @@ libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) +@@ -891,7 +891,7 @@ libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) endif ifeq ($(enable_shared),yes) @@ -20,7 +20,7 @@ index 9f45475..a2cb98f 100644 ifneq ($(LIBUNWIND),) all: libunwind$(SHLIB_EXT) endif -@@ -1060,10 +1060,6 @@ install-shared: +@@ -1058,10 +1058,6 @@ install-shared: chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a diff --git a/tool/patches/gcc-4.7.4/libstdcxx_without_libc.patch b/tool/patches/gcc-4.8.4/libstdcxx_without_libc.patch similarity index 90% rename from tool/patches/gcc-4.7.4/libstdcxx_without_libc.patch rename to tool/patches/gcc-4.8.4/libstdcxx_without_libc.patch index 0ff93ab9b..d2b15dff7 100644 --- a/tool/patches/gcc-4.7.4/libstdcxx_without_libc.patch +++ b/tool/patches/gcc-4.8.4/libstdcxx_without_libc.patch @@ -8,7 +8,7 @@ From: Christian Prochaska 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac -index 59024f2..5245cdd 100644 +index 3bf1b41..15f2de6 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -89,9 +89,9 @@ CXXFLAGS="$save_CXXFLAGS" @@ -24,7 +24,7 @@ index 59024f2..5245cdd 100644 AM_PROG_LIBTOOL ACX_LT_HOST_FLAGS AC_SUBST(enable_shared) -@@ -191,7 +191,7 @@ GLIBCXX_CHECK_WRITEV +@@ -192,7 +192,7 @@ GLIBCXX_CHECK_WRITEV GLIBCXX_CHECK_C99_TR1 # For the EOF, SEEK_CUR, and SEEK_END integer constants. @@ -33,7 +33,7 @@ index 59024f2..5245cdd 100644 # For gettimeofday support. GLIBCXX_CHECK_GETTIMEOFDAY -@@ -339,7 +339,7 @@ GCC_CHECK_UNWIND_GETIPINFO +@@ -343,7 +343,7 @@ GCC_CHECK_UNWIND_GETIPINFO GCC_LINUX_FUTEX([AC_DEFINE(HAVE_LINUX_FUTEX, 1, [Define if futex syscall is available.])]) diff --git a/tool/patches/gcc-4.7.4/misc.patch b/tool/patches/gcc-4.8.4/misc.patch similarity index 89% rename from tool/patches/gcc-4.7.4/misc.patch rename to tool/patches/gcc-4.8.4/misc.patch index fb10ba85f..a11d12879 100644 --- a/tool/patches/gcc-4.7.4/misc.patch +++ b/tool/patches/gcc-4.8.4/misc.patch @@ -10,10 +10,10 @@ Changes lacking documentation 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in -index c301ff0..9f45475 100644 +index 990cd49..31740cb 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in -@@ -859,7 +859,7 @@ LIBGCOV = _gcov _gcov_merge_add _gcov_merge_single _gcov_merge_delta \ +@@ -857,7 +857,7 @@ LIBGCOV = _gcov _gcov_merge_add _gcov_merge_single _gcov_merge_delta \ _gcov_indirect_call_profiler _gcov_average_profiler _gcov_ior_profiler \ _gcov_merge_ior @@ -23,7 +23,7 @@ index c301ff0..9f45475 100644 $(libgcov-objects): %$(objext): $(srcdir)/libgcov.c $(gcc_compile) -DL$* -c $(srcdir)/libgcov.c diff --git a/libgcc/config/t-libunwind-elf b/libgcc/config/t-libunwind-elf -index 47a460b..cd6e291 100644 +index 6f8d0b2..2a4214c 100644 --- a/libgcc/config/t-libunwind-elf +++ b/libgcc/config/t-libunwind-elf @@ -32,7 +32,7 @@ SHLIBUNWIND_SONAME = @shlib_base_name@.so.$(SHLIBUNWIND_SOVERSION) @@ -36,10 +36,10 @@ index 47a460b..cd6e291 100644 if [ -f $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME) ]; then \ mv -f $(SHLIB_DIR)/$(SHLIBUNWIND_SONAME) \ diff --git a/libgcc/config/t-slibgcc b/libgcc/config/t-slibgcc -index 3727244..89c8e9b 100644 +index e55013f..4a67d27 100644 --- a/libgcc/config/t-slibgcc +++ b/libgcc/config/t-slibgcc -@@ -27,7 +27,7 @@ SHLIB_MAP = @shlib_map_file@ +@@ -26,7 +26,7 @@ SHLIB_MAP = @shlib_map_file@ SHLIB_OBJS = @shlib_objs@ SHLIB_DIR = @multilib_dir@ SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@ diff --git a/tool/patches/gcc-4.7.4/no_short_enums.patch b/tool/patches/gcc-4.8.4/no_short_enums.patch similarity index 83% rename from tool/patches/gcc-4.7.4/no_short_enums.patch rename to tool/patches/gcc-4.8.4/no_short_enums.patch index 72f6d7797..6130ffb4b 100644 --- a/tool/patches/gcc-4.7.4/no_short_enums.patch +++ b/tool/patches/gcc-4.8.4/no_short_enums.patch @@ -8,10 +8,10 @@ Ensure -fno-short-enums as default. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c -index 6ed3575..ba4cacb 100644 +index 5bc6603..3a836e3 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c -@@ -23466,7 +23466,7 @@ arm_promote_function_mode (const_tree type ATTRIBUTE_UNUSED, +@@ -24794,7 +24794,7 @@ arm_promote_function_mode (const_tree type ATTRIBUTE_UNUSED, static bool arm_default_short_enums (void) { diff --git a/tool/patches/gcc-4.7.4/prefer_pic.patch b/tool/patches/gcc-4.8.4/prefer_pic.patch similarity index 98% rename from tool/patches/gcc-4.7.4/prefer_pic.patch rename to tool/patches/gcc-4.8.4/prefer_pic.patch index 5f3fd4aec..d6d639b52 100644 --- a/tool/patches/gcc-4.7.4/prefer_pic.patch +++ b/tool/patches/gcc-4.8.4/prefer_pic.patch @@ -13,7 +13,7 @@ nothing rather than '-prefer-pic'. 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac -index ce1f6c4..59024f2 100644 +index 73d430a..3bf1b41 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -109,16 +109,16 @@ AC_SUBST(enable_static) diff --git a/tool/patches/gcc-4.7.4/series b/tool/patches/gcc-4.8.4/series similarity index 58% rename from tool/patches/gcc-4.7.4/series rename to tool/patches/gcc-4.8.4/series index 8df6b528e..7755c8035 100644 --- a/tool/patches/gcc-4.7.4/series +++ b/tool/patches/gcc-4.8.4/series @@ -5,3 +5,6 @@ host_target_combination.patch prefer_pic.patch libstdcxx_without_libc.patch libgcc_s.patch +go_libbacktrace.patch +target_libbacktrace.patch +caf62483f30035efca2958615a466f73cc99880e.patch diff --git a/tool/patches/gcc-4.8.4/target_libbacktrace.patch b/tool/patches/gcc-4.8.4/target_libbacktrace.patch new file mode 100644 index 000000000..189885e24 --- /dev/null +++ b/tool/patches/gcc-4.8.4/target_libbacktrace.patch @@ -0,0 +1,21 @@ +target_libbacktrace.patch + +From: Christian Prochaska + +Don't build libbacktrace, which needs a libc. +--- + configure.ac | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 943d93e..b4f20fd 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -152,7 +152,6 @@ libgcj="target-libffi \ + # the host libraries and the host tools (which may be a cross compiler) + # Note that libiberty is not a target library. + target_libraries="target-libgcc \ +- target-libbacktrace \ + target-libgloss \ + target-newlib \ + target-libgomp \ diff --git a/tool/tool_chain b/tool/tool_chain index 7433902dc..90e0a7af6 100755 --- a/tool/tool_chain +++ b/tool/tool_chain @@ -59,7 +59,7 @@ MPC_DOWNLOAD_URL ?= http://www.multiprecision.org/mpc/download # Tool versions and install location # -GCC_VERSION = 4.7.4 +GCC_VERSION = 4.8.4 BINUTILS_VERSION = 2.25 GDB_VERSION = 7.3.1 GMP_VERSION = 5.0.2 @@ -101,7 +101,7 @@ VERBOSE = @ # # Check if 'autoconf' is installed # -AUTOCONF_VERSION_gcc_4.7.4 = 2.64 +AUTOCONF_VERSION_gcc_4.8.4 = 2.64 AUTOCONF_VERSION = $(AUTOCONF_VERSION_gcc_$(GCC_VERSION))