code
string
repo_name
string
path
string
language
string
license
string
size
int64
[PATCH]: Remove abstract socket namespace check breaking cross compilation Taken from openembedded: http://git.openembedded.org/cgit.cgi/openembedded/tree/recipes/gamin/files/no-abstract-sockets.patch Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> --- /tmp/configure.in 2007-04-30 13:08:49.000000000 +0200 +++ gamin-0.1.8/configure.in 2007-04-30 13:10:53.285251000 +0200 @@ -354,51 +354,6 @@ AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure]) fi -#### Abstract sockets - -AC_MSG_CHECKING(abstract socket namespace) -AC_LANG_PUSH(C) -AC_RUN_IFELSE([AC_LANG_PROGRAM( -[[ -#include <sys/types.h> -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <sys/socket.h> -#include <sys/un.h> -#include <errno.h> -]], -[[ - int listen_fd; - struct sockaddr_un addr; - - listen_fd = socket (PF_UNIX, SOCK_STREAM, 0); - - if (listen_fd < 0) - { - fprintf (stderr, "socket() failed: %s\n", strerror (errno)); - exit (1); - } - - memset (&addr, '\0', sizeof (addr)); - addr.sun_family = AF_UNIX; - strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test"); - addr.sun_path[0] = '\0'; /* this is what makes it abstract */ - - if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0) - { - fprintf (stderr, "Abstract socket namespace bind() failed: %s\n", - strerror (errno)); - exit (1); - } - else - exit (0); -]])], - [have_abstract_sockets=yes], - [have_abstract_sockets=no]) -AC_LANG_POP(C) -AC_MSG_RESULT($have_abstract_sockets) - if test x$enable_abstract_sockets = xyes; then if test x$have_abstract_sockets = xno; then AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.])
shibajee/buildroot
package/gamin/0001-no-abstract-sockets.patch
patch
mit
1,762
G_CONST_RETURN is deprecated in glib 2.30 so remove to to avoid build failures. Upstream-Status: Pending Index: gamin-0.1.10/server/gam_node.c =================================================================== --- gamin-0.1.10.orig/server/gam_node.c 2011-10-12 15:25:45.217178314 +0100 +++ gamin-0.1.10/server/gam_node.c 2011-10-12 15:26:17.807178293 +0100 @@ -122,7 +122,7 @@ * it has finished with the string. If it must keep it longer, it * should makes its own copy. The returned string must not be freed. */ -G_CONST_RETURN char * +const char * gam_node_get_path(GamNode * node) { g_assert(node); Index: gamin-0.1.10/server/gam_node.h =================================================================== --- gamin-0.1.10.orig/server/gam_node.h 2011-10-12 15:25:46.857178269 +0100 +++ gamin-0.1.10/server/gam_node.h 2011-10-12 15:26:28.637178297 +0100 @@ -58,7 +58,7 @@ void gam_node_set_is_dir (GamNode *node, gboolean is_dir); -G_CONST_RETURN char *gam_node_get_path (GamNode *node); +const char *gam_node_get_path (GamNode *node); GList *gam_node_get_subscriptions (GamNode *node); Index: gamin-0.1.10/server/gam_subscription.c =================================================================== --- gamin-0.1.10.orig/server/gam_subscription.c 2011-10-12 15:25:40.497177525 +0100 +++ gamin-0.1.10/server/gam_subscription.c 2011-10-12 15:26:39.867178304 +0100 @@ -141,7 +141,7 @@ * @param sub the GamSubscription * @returns The path being monitored. It should not be freed. */ -G_CONST_RETURN char * +const char * gam_subscription_get_path(GamSubscription * sub) { if (sub == NULL) Index: gamin-0.1.10/server/gam_subscription.h =================================================================== --- gamin-0.1.10.orig/server/gam_subscription.h 2011-10-12 15:25:28.507178266 +0100 +++ gamin-0.1.10/server/gam_subscription.h 2011-10-12 15:25:58.817178285 +0100 @@ -21,7 +21,7 @@ int gam_subscription_get_reqno (GamSubscription *sub); -G_CONST_RETURN char *gam_subscription_get_path (GamSubscription *sub); +const char *gam_subscription_get_path (GamSubscription *sub); GamListener *gam_subscription_get_listener (GamSubscription *sub);
shibajee/buildroot
package/gamin/0002-no-const-return.patch
patch
mit
2,342
Fix missing PTHREAD_MUTEX_RECURSIVE_NP The musl C library does not provide the non portable PTHREAD_MUTEX_RECURSIVE_NP. In addition, uClibc does not define it as a #define, but as an enum value, so doing a #if defined() check doesn't work properly. Instead, add a AC_CHECK_DECL() autoconf check. Signed-off-by: Baruch Siach <baruch@tkos.co.il> [Thomas: switch to an autoconf check.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Index: b/configure.in =================================================================== --- a/configure.in +++ b/configure.in @@ -294,6 +294,10 @@ AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)]) AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there]) WITH_THREADS="1"])) + + AC_CHECK_DECL([PTHREAD_MUTEX_RECURSIVE_NP], + [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], [], [whether HAVE_PTHREAD_MUTEX_RECURSIVE_NP is defined])], + [], [#include <pthread.h>]) fi dnl Use weak symbols on linux/gcc to avoid imposing libpthreads to apps Index: b/libgamin/gam_data.c =================================================================== --- a/libgamin/gam_data.c +++ b/libgamin/gam_data.c @@ -470,7 +470,7 @@ } if (is_threaded > 0) { pthread_mutexattr_init(&attr); -#if defined(linux) || defined(PTHREAD_MUTEX_RECURSIVE_NP) +#if defined(HAVE_PTHREAD_MUTEX_RECURSIVE_NP) pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP); #else pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
shibajee/buildroot
package/gamin/0003-fix-missing-PTHREAD_MUTEX_RECURSIVE_NP.patch
patch
mit
1,533
config BR2_PACKAGE_GAMIN bool "gamin" depends on BR2_USE_WCHAR # glib2 depends on BR2_TOOLCHAIN_HAS_THREADS depends on BR2_USE_MMU # glib2 select BR2_PACKAGE_LIBGLIB2 help the File Alteration Monitor http://www.gnome.org/~veillard/gamin/sources comment "gamin needs a toolchain w/ wchar, threads" depends on BR2_USE_MMU depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
shibajee/buildroot
package/gamin/Config.in
in
mit
392
# Locally calculated sha256 28085f0ae8be10eab582ff186af4fb0be92cc6c62b5cc19cd09b295c7c2899a1 gamin-0.1.10.tar.gz
shibajee/buildroot
package/gamin/gamin.hash
hash
mit
113
################################################################################ # # gamin # ################################################################################ GAMIN_VERSION = 0.1.10 GAMIN_SITE = http://www.gnome.org/~veillard/gamin/sources GAMIN_AUTORECONF = YES GAMIN_INSTALL_STAGING = YES GAMIN_LICENSE = LGPLv2+ GAMIN_LICENSE_FILES = COPYING # python support broken GAMIN_CONF_OPTS += --without-python GAMIN_CONF_ENV = have_abstract_sockets=no GAMIN_DEPENDENCIES = libglib2 $(eval $(autotools-package))
shibajee/buildroot
package/gamin/gamin.mk
mk
mit
526
With uclibc or musl configuration, $host does not match to '*-linux-gnu*'. I touch configure directly instead of configure.ac because autoreconf failed by version mismatch of autotools. Signed-off-by: Hiroshi Kawashima <kei-k@ca2.so-net.ne.jp> diff -ur a/configure b/configure --- a/configure 2014-07-20 15:15:05.000000000 +0900 +++ b/configure 2015-10-20 21:52:32.791442291 +0900 @@ -6843,7 +6843,7 @@ SHLIB_MAIN_LDFLAGS="" SHLIB_OK=ok ;; - *-linux-gnu*|*-*-gnu*|*freebsd*|*dragonfly*) + *-linux-*|*-*-gnu*|*freebsd*|*dragonfly*) SHLIB_SO_CFLAGS="-fPIC" SHLIB_SO_LDFLAGS="$rpath -shared -o" SHLIB_SO_SUFFIX="so" diff -ur a/configure.ac b/configure.ac --- a/configure.ac 2015-10-21 21:33:17.370000200 +0900 +++ b/configure.ac 2015-10-21 21:33:39.784110527 +0900 @@ -572,7 +572,7 @@ SHLIB_MAIN_LDFLAGS="" SHLIB_OK=ok ;; - *-linux-gnu*|*-*-gnu*|*freebsd*|*dragonfly*) + *-linux-*|*-*-gnu*|*freebsd*|*dragonfly*) SHLIB_SO_CFLAGS="-fPIC" SHLIB_SO_LDFLAGS="$rpath -shared -o" SHLIB_SO_SUFFIX="so"
shibajee/buildroot
package/gauche/0001-fix-so-suffix.patch
patch
mit
1,059
gc/configure.ac: add check for NO_GETCONTEXT definition This patch is ported from bdwgc package. Since Gauche uses an internal copy of the boehm gc code, it is affected by the same problem. Both configure and configure.ac are modified because autoreconf fails due to an incompatibility with the version of the autotools used by Buildroot. Signed-off-by: Hiroshi Kawashima <kei-k@ca2.so-net.ne.jp> Original credits of patch in bdwgc package: Signed-off-by: Samuel Martin <s.martin49@gmail.com> [yann.morin.1998@free.fr: add a comment, change variable name, use AS_IF, remove debug traces, use AC_CHECK_FUNCS (as suggested by Thomas)] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> diff -ur a/gc/configure b/gc/configure --- a/gc/configure 2015-11-12 21:41:02.394822056 +0900 +++ b/gc/configure 2015-11-12 22:04:14.655157423 +0900 @@ -16153,6 +16153,23 @@ $as_echo "$ac_cv_fno_strict_aliasing" >&6; } fi +# Check for getcontext (uClibc can be configured without it, for example) +for ac_func in getcontext +do : + ac_fn_c_check_func "$LINENO" "getcontext" "ac_cv_func_getcontext" +if test "x$ac_cv_func_getcontext" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETCONTEXT 1 +_ACEOF + +fi +done + +if test "$ac_cv_func_getcontext" = "no"; then : + CFLAGS="$CFLAGS -DNO_GETCONTEXT" + CPPFLAGS="$CPPFLAGS -DNO_GETCONTEXT" +fi + case "$host" in # While IRIX 6 has libdl for the O32 and N32 ABIs, it's missing for N64 # and unnecessary everywhere. diff -ur a/gc/configure.ac b/gc/configure.ac --- a/gc/configure.ac 2015-11-12 22:31:44.851510997 +0900 +++ b/gc/configure.ac 2015-11-12 22:33:39.292191227 +0900 @@ -459,6 +459,12 @@ AC_MSG_RESULT($ac_cv_fno_strict_aliasing) fi +# Check for getcontext (uClibc can be configured without it, for example) +AC_CHECK_FUNCS([getcontext]) +AS_IF([test "$ac_cv_func_getcontext" = "no"], + [CFLAGS="$CFLAGS -DNO_GETCONTEXT" + CPPFLAGS="$CPPFLAGS -DNO_GETCONTEXT"]) + case "$host" in # While IRIX 6 has libdl for the O32 and N32 ABIs, it's missing for N64 # and unnecessary everywhere.
shibajee/buildroot
package/gauche/0002-gc-configure.ac-add-check-for-NO_GETCONTEXT-definition.patch
patch
mit
2,128
# Architecture dependency from the bundled bdwgc. config BR2_PACKAGE_GAUCHE_ARCH_SUPPORTS bool default y if BR2_arm || BR2_armeb || BR2_i386 || BR2_m68k || \ BR2_mips || BR2_mipsel || BR2_mips64 || \ BR2_mips64el || BR2_powerpc || BR2_powerpc64 || \ BR2_powerpc64le || BR2_sh || BR2_sh64 || BR2_x86_64 config BR2_PACKAGE_GAUCHE bool "gauche" depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL depends on BR2_USE_MMU # fork() depends on BR2_PACKAGE_GAUCHE_ARCH_SUPPORTS depends on !BR2_STATIC_LIBS help Gauche is an R7RS Scheme implementation developed to be a handy script interpreter, which allows programmers and system administrators to write small to large scripts for their daily chores. Quick startup, built-in system interface, native multilingual support are some of its goals. http://practical-scheme.net/gauche/ comment "gauche needs a toolchain w/ NPTL, dynamic library" depends on BR2_USE_MMU depends on BR2_PACKAGE_GAUCHE_ARCH_SUPPORTS depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL || BR2_STATIC_LIBS
shibajee/buildroot
package/gauche/Config.in
in
mit
1,043
# Locally calculated sha256 7b18bcd70beaced1e004594be46c8cff95795318f6f5830dd2a8a700410fc149 Gauche-0.9.4.tgz sha256 0ff5986540d8ad89eee595de766810f09e489a6a3363b47a65ce7ad18701ee01 13a196557848f22a1607a300643131345e9f32b3.patch
shibajee/buildroot
package/gauche/gauche.hash
hash
mit
231
################################################################################ # # gauche # ################################################################################ GAUCHE_VERSION = 0.9.4 GAUCHE_SOURCE = Gauche-$(GAUCHE_VERSION).tgz GAUCHE_SITE = http://downloads.sourceforge.net/project/gauche/Gauche GAUCHE_LICENSE = BSD-3c, Boehm-gc, SRFI (srfi-11.scm), reload (reload.scm) GAUCHE_LICENSE_FILES = COPYING GAUCHE_DEPENDENCIES = host-gauche GAUCHE_PATCH = https://github.com/shirok/Gauche/commit/13a196557848f22a1607a300643131345e9f32b3.patch HOST_GAUCHE_CONF_OPTS = --without-zlib GAUCHE_CONF_OPTS = --without-libatomic-ops ifeq ($(BR2_PACKAGE_ZLIB),y) GAUCHE_CONF_OPTS += --with-zlib=$(STAGING_DIR) GAUCHE_DEPENDENCIES += zlib else GAUCHE_CONF_OPTS += --without-zlib endif # Detection of c99 support in configure fails without WCHAR. To enable # automatic detection of c99 support by configure, we need to enable # WCHAR in toolchain. But actually we do not need WCHAR at gauche # runtime. So reuesting WCHAR in toolchain just for automatic detection # will be overkill. To solve this, explicitly -std=gnu99 is specified # here. GAUCHE_CONF_ENV = CFLAGS="$(TARGET_CFLAGS) -std=gnu99" $(eval $(host-autotools-package)) $(eval $(autotools-package))
shibajee/buildroot
package/gauche/gauche.mk
mk
mit
1,265
Disabled versioned installation of binaries to save space. Also use symlinks where it's appropiate. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> [Gustavo: update for 4.1.2] diff -Nura gawk-4.1.2.orig/Makefile.in gawk-4.1.2/Makefile.in --- gawk-4.1.2.orig/Makefile.in 2015-04-29 16:11:09.367925925 -0300 +++ gawk-4.1.2/Makefile.in 2015-04-29 16:11:25.308466495 -0300 @@ -554,7 +554,7 @@ CLEANFILES = core core.* # We want hard links for install-exec-hook, below -LN = ln +LN = $(LN_S) # For some make's, e.g. OpenBSD, that don't define this RM = rm -f @@ -1173,6 +1173,7 @@ # (This is done universally, which may not always be right, but # there's no easy way to distinguish GNU from non-GNU systems.) install-exec-hook: +foo: (cd $(DESTDIR)$(bindir); \ $(LN) gawk$(EXEEXT) gawk-$(VERSION)$(EXEEXT) 2>/dev/null ; \ if [ ! -f awk$(EXEEXT) ]; \
shibajee/buildroot
package/gawk/0001-no-versioned.patch
patch
mit
874
config BR2_PACKAGE_GAWK bool "gawk" depends on BR2_USE_WCHAR depends on BR2_USE_MMU # fork() depends on !BR2_STATIC_LIBS depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS help A special-purpose programming language which is data driven rather than procedural. Allows for simple data-reformatting jobs with just a few lines of code. http://www.gnu.org/software/gawk/ comment "gawk needs a toolchain w/ wchar, dynamic library" depends on BR2_USE_MMU depends on !BR2_USE_WCHAR || BR2_STATIC_LIBS depends on BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
shibajee/buildroot
package/gawk/Config.in
in
mit
552
# Locally calculated after checking pgp signature sha256 e3cf55e91e31ea2845f8338bedd91e40671fc30e4d82ea147d220e687abda625 gawk-4.1.3.tar.xz
shibajee/buildroot
package/gawk/gawk.hash
hash
mit
140
################################################################################ # # gawk # ################################################################################ GAWK_VERSION = 4.1.3 GAWK_SOURCE = gawk-$(GAWK_VERSION).tar.xz GAWK_SITE = $(BR2_GNU_MIRROR)/gawk GAWK_DEPENDENCIES = host-gawk GAWK_LICENSE = GPLv3+ GAWK_LICENSE_FILES = COPYING # Prefer full-blown gawk over busybox awk ifeq ($(BR2_PACKAGE_BUSYBOX),y) GAWK_DEPENDENCIES += busybox endif ifeq ($(BR2_PACKAGE_LIBSIGSEGV),y) GAWK_DEPENDENCIES += libsigsegv endif # --with-mpfr requires an argument so just let # configure find it automatically ifeq ($(BR2_PACKAGE_MPFR),y) GAWK_DEPENDENCIES += mpfr else GAWK_CONF_OPTS += --without-mpfr endif # --with-readline requires an argument so just let # configure find it automatically ifeq ($(BR2_PACKAGE_READLINE),y) GAWK_DEPENDENCIES += readline else GAWK_CONF_OPTS += --without-readline endif HOST_GAWK_CONF_OPTS = --without-readline --without-mpfr define GAWK_CREATE_SYMLINK ln -sf /usr/bin/gawk $(TARGET_DIR)/usr/bin/awk endef GAWK_POST_INSTALL_TARGET_HOOKS += GAWK_CREATE_SYMLINK # Assume we support shared libs # The check isn't cross-compile friendly and it's mandatory anyway define GAWK_DISABLE_SHARED_CHECK $(SED) 's/ check-for-shared-lib-support//' $(@D)/extension/Makefile.in endef GAWK_POST_PATCH_HOOKS += GAWK_DISABLE_SHARED_CHECK $(eval $(autotools-package)) $(eval $(host-autotools-package))
shibajee/buildroot
package/gawk/gawk.mk
mk
mit
1,436
--- gcc/gcc/config/--- gcc/contrib/regression/objs-gcc.sh +++ gcc/contrib/regression/objs-gcc.sh @@ -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
shibajee/buildroot
package/gcc/4.7.4/100-uclibc-conf.patch
patch
mit
518
http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00269.html On glibc the libc.so carries a copy of the math function copysignl() but on uClibc math functions like copysignl() live in libm. Since libgcc_s contains unresolved symbols, any attempt to link against libgcc_s without explicitely specifying -lm fails, resulting in a broken bootstrap of the compiler. Forward ported to gcc 4.7.3 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> diff -Nura gcc-4.7.3.orig/libgcc/config/t-slibgcc gcc-4.7.3/libgcc/config/t-slibgcc --- gcc-4.7.3.orig/libgcc/config/t-slibgcc 2013-04-11 15:23:46.491571116 -0300 +++ gcc-4.7.3/libgcc/config/t-slibgcc 2013-04-11 15:25:06.241141824 -0300 @@ -27,7 +27,7 @@ SHLIB_OBJS = @shlib_objs@ SHLIB_DIR = @multilib_dir@ SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@ -SHLIB_LC = -lc +SHLIB_LC = @libgcc_libm@ -lc SHLIB_MAKE_SOLINK = $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK) SHLIB_INSTALL_SOLINK = $(LN_S) $(SHLIB_SONAME) \ $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK) diff -Nura gcc-4.7.3.orig/libgcc/configure gcc-4.7.3/libgcc/configure --- gcc-4.7.3.orig/libgcc/configure 2013-04-11 15:23:46.551573051 -0300 +++ gcc-4.7.3/libgcc/configure 2013-04-11 15:25:06.243141875 -0300 @@ -563,6 +563,7 @@ tmake_file sfp_machine_header set_use_emutls +LIBGCC_LIBM set_have_cc_tls vis_hide fixed_point @@ -4445,6 +4446,37 @@ fi fi +# On powerpc libgcc_s references copysignl which is a libm function but +# glibc apparently also provides it via libc as opposed to uClibc where +# it lives in libm. +echo "$as_me:$LINENO: checking for library containing copysignl" >&5 +echo $ECHO_N "checking for library containing copysignl... $ECHO_C" >&6 +if test "${libgcc_cv_copysignl_lib+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + echo '#include <features.h>' > conftest.c + echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c + libgcc_cv_copysignl_lib="-lc" + if { ac_try='${CC-cc} -S conftest.c -o conftest.s 1>&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then + libgcc_cv_copysignl_lib="-lm" + fi + rm -f conftest.* + +fi +echo "$as_me:$LINENO: result: $libgcc_cv_copysignl_lib" >&5 +echo "${ECHO_T}$libgcc_cv_copysignl_lib" >&6 + +case /${libgcc_cv_copysignl_lib}/ in + /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;; + *) LIBGCC_LIBM= ;; +esac # Conditionalize the makefile for this target machine. tmake_file_= diff -Nura gcc-4.7.3.orig/libgcc/configure.ac gcc-4.7.3/libgcc/configure.ac --- gcc-4.7.3.orig/libgcc/configure.ac 2013-04-11 15:23:46.551573051 -0300 +++ gcc-4.7.3/libgcc/configure.ac 2013-04-11 15:25:06.244141901 -0300 @@ -324,6 +324,27 @@ fi AC_SUBST(set_have_cc_tls) +# On powerpc libgcc_s references copysignl which is a libm function but +# glibc apparently also provides it via libc as opposed to uClibc where +# it lives in libm. +AC_CACHE_CHECK + libgcc_cv_copysignl_lib, + echo '#include <features.h>' > conftest.c + echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c + libgcc_cv_copysignl_lib="-lc" + if AC_TRY_COMMAND(${CC-cc} -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD) + then + libgcc_cv_copysignl_lib="-lm" + fi + rm -f conftest.* + ]) + +case /${libgcc_cv_copysignl_lib}/ in + /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;; + *) LIBGCC_LIBM= ;; +esac +AC_SUBST(LIBGCC_LIBM) + # See if we have emulated thread-local storage. GCC_CHECK_EMUTLS set_use_emutls= diff -Nura gcc-4.7.3.orig/libgcc/Makefile.in gcc-4.7.3/libgcc/Makefile.in --- gcc-4.7.3.orig/libgcc/Makefile.in 2013-04-11 15:23:46.537572599 -0300 +++ gcc-4.7.3/libgcc/Makefile.in 2013-04-11 15:25:06.241141824 -0300 @@ -41,6 +41,7 @@ decimal_float = @decimal_float@ enable_decimal_float = @enable_decimal_float@ fixed_point = @fixed_point@ +LIBGCC_LIBM = @LIBGCC_LIBM@ host_noncanonical = @host_noncanonical@ target_noncanonical = @target_noncanonical@ @@ -928,9 +929,10 @@ @multilib_dir@,$(MULTIDIR),$(subst \ @shlib_objs@,$(objects) libgcc.a,$(subst \ @shlib_base_name@,libgcc_s,$(subst \ + @libgcc_libm@,$(LIBGCC_LIBM),$(subst \ @shlib_map_file@,$(mapfile),$(subst \ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \ - @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK)))))))) + @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))) libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts) # @multilib_flags@ is still needed because this may use
shibajee/buildroot
package/gcc/4.7.4/1000-powerpc-link-with-math-lib.patch.conditional
conditional
mit
4,555
From b9a7775674d91c7af8043a83211ffeaa576327d7 Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Fri, 10 Apr 2015 17:46:30 +0300 Subject: [PATCH] Fix PR target/65730 2015-05-20 Max Filippov <jcmvbkbc@gmail.com> gcc/ * config/xtensa/xtensa.c (init_alignment_context): Replace MULT by BITS_PER_UNIT with ASHIFT by exact_log2 (BITS_PER_UNIT). Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223452 Changes to ChangeLog are dropped. gcc/config/xtensa/xtensa.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index eb039ba..7296e36 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -1461,8 +1461,9 @@ init_alignment_context (struct alignment_context *ac, rtx mem) if (ac->shift != NULL_RTX) { /* Shift is the byte count, but we need the bitcount. */ - ac->shift = expand_simple_binop (SImode, MULT, ac->shift, - GEN_INT (BITS_PER_UNIT), + gcc_assert (exact_log2 (BITS_PER_UNIT) >= 0); + ac->shift = expand_simple_binop (SImode, ASHIFT, ac->shift, + GEN_INT (exact_log2 (BITS_PER_UNIT)), NULL_RTX, 1, OPTAB_DIRECT); ac->modemask = expand_simple_binop (SImode, ASHIFT, GEN_INT (GET_MODE_MASK (mode)), -- 1.8.1.4
shibajee/buildroot
package/gcc/4.7.4/111-pr65730.patch
patch
mit
1,378
From c037df1be41f8daf4d581d7ffa4ec8cfa640bccf Mon Sep 17 00:00:00 2001 From: glisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Fri, 25 Apr 2014 08:03:08 +0000 Subject: [PATCH] 2014-04-25 Marc Glisse <marc.glisse@inria.fr> PR target/43538 * mt-gnu: Don't reset CXXFLAGS_FOR_TARGET. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209784 138bc75d-0d04-0410-961f-82ee72b054a4 Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- config/mt-gnu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/mt-gnu b/config/mt-gnu index 15bf417..5c696f5 100644 --- a/config/mt-gnu +++ b/config/mt-gnu @@ -1 +1 @@ -CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -D_GNU_SOURCE +CXXFLAGS_FOR_TARGET += -D_GNU_SOURCE -- 2.1.4
shibajee/buildroot
package/gcc/4.7.4/130-pr43538.patch
patch
mit
738
--- gcc-4.0.0/boehm-gc/include/gc.h-orig 2005-04-28 22:28:57.000000000 -0500 +++ gcc-4.0.0/boehm-gc/include/gc.h 2005-04-28 22:30:38.000000000 -0500 @@ -500,7 +500,7 @@ #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
shibajee/buildroot
package/gcc/4.7.4/301-missing-execinfo_h.patch
patch
mit
446
Index: gcc-4.2/libmudflap/mf-hooks2.c =================================================================== --- gcc-4.2/libmudflap/mf-hooks2.c (revision 119834) +++ gcc-4.2/libmudflap/mf-hooks2.c (working copy) @@ -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 */
shibajee/buildroot
package/gcc/4.7.4/305-libmudflap-susv3-legacy.patch
patch
mit
1,352
--- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -57,7 +57,7 @@ %{shared:-lc} \ %{!shared:%{profile:-lc_p}%{!profile:-lc}}" -#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" +#define LIBGCC_SPEC "-lgcc" #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" --- a/libgcc/config/arm/t-linux +++ b/libgcc/config/arm/t-linux @@ -1,6 +1,10 @@ LIB1ASMSRC = arm/lib1funcs.S LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ - _arm_addsubdf3 _arm_addsubsf3 + _arm_addsubdf3 _arm_addsubsf3 \ + _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ + _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ + _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ + _arm_fixsfsi _arm_fixunssfsi # Just for these, we omit the frame pointer since it makes such a big # difference.
shibajee/buildroot
package/gcc/4.7.4/810-arm-softfloat-libgcc.patch
patch
mit
832
http://sourceware.org/ml/crossgcc/2008-05/msg00009.html --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -45,7 +45,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 /* TARGET_BIG_ENDIAN_DEFAULT is set in config.gcc for big endian configurations. */
shibajee/buildroot
package/gcc/4.7.4/830-arm_unbreak_armv4t.patch
patch
mit
473
commit 4fa1f8926227d4e79975b674dc4292b9bec4b137 Author: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Thu Mar 6 12:07:07 2014 +0000 PR target/58595 * config/arm/arm.c (arm_tls_symbol_p): Remove. (arm_legitimize_address): Call legitimize_tls_address for any arm_tls_referenced_p expression, handle constant addend. Call it before testing for !TARGET_ARM. (thumb_legitimize_address): Don't handle arm_tls_symbol_p here. * gcc.dg/tls/pr58595.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208380 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index ce24bfe..af5666b 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -235,7 +235,6 @@ static tree arm_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *); static void arm_option_override (void); static unsigned HOST_WIDE_INT arm_shift_truncation_mask (enum machine_mode); static bool arm_cannot_copy_insn_p (rtx); -static bool arm_tls_symbol_p (rtx x); static int arm_issue_rate (void); static void arm_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED; static bool arm_output_addr_const_extra (FILE *, rtx); @@ -7336,6 +7335,32 @@ legitimize_tls_address (rtx x, rtx reg) rtx arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode) { + if (arm_tls_referenced_p (x)) + { + rtx addend = NULL; + + if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == PLUS) + { + addend = XEXP (XEXP (x, 0), 1); + x = XEXP (XEXP (x, 0), 0); + } + + if (GET_CODE (x) != SYMBOL_REF) + return x; + + gcc_assert (SYMBOL_REF_TLS_MODEL (x) != 0); + + x = legitimize_tls_address (x, NULL_RTX); + + if (addend) + { + x = gen_rtx_PLUS (SImode, x, addend); + orig_x = x; + } + else + return x; + } + if (!TARGET_ARM) { /* TODO: legitimize_address for Thumb2. */ @@ -7344,9 +7369,6 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode) return thumb_legitimize_address (x, orig_x, mode); } - if (arm_tls_symbol_p (x)) - return legitimize_tls_address (x, NULL_RTX); - if (GET_CODE (x) == PLUS) { rtx xop0 = XEXP (x, 0); @@ -7459,9 +7481,6 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode) rtx thumb_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode) { - if (arm_tls_symbol_p (x)) - return legitimize_tls_address (x, NULL_RTX); - if (GET_CODE (x) == PLUS && CONST_INT_P (XEXP (x, 1)) && (INTVAL (XEXP (x, 1)) >= 32 * GET_MODE_SIZE (mode) @@ -7756,20 +7775,6 @@ thumb_legitimize_reload_address (rtx *x_p, /* Test for various thread-local symbols. */ -/* Return TRUE if X is a thread-local symbol. */ - -static bool -arm_tls_symbol_p (rtx x) -{ - if (! TARGET_HAVE_TLS) - return false; - - if (GET_CODE (x) != SYMBOL_REF) - return false; - - return SYMBOL_REF_TLS_MODEL (x) != 0; -} - /* Helper for arm_tls_referenced_p. */ static int
shibajee/buildroot
package/gcc/4.7.4/843-gcc-4.7.3-Fix-PR-target-58595.patch
patch
mit
3,018
From 4fb4acf88912dd978bb63ecab79641a5795ce84f Mon Sep 17 00:00:00 2001 From: Romain Naour <romain.naour@openwide.fr> Date: Mon, 27 Jul 2015 15:05:14 +0200 Subject: [PATCH] gcc: fix build with gcc5 gcc < 4.8 doesn't build with gcc5. Patch is from DragonFlyBSD github [1] [1] https://github.com/DragonFlyBSD/DPorts/issues/136 Signed-off-by: Romain Naour <romain.naour@openwide.fr> --- gcc/cp/cfns.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h index 62cdfab..4f63cc4 100644 --- a/gcc/cp/cfns.h +++ b/gcc/cp/cfns.h @@ -53,6 +53,9 @@ __inline static unsigned int hash (const char *, unsigned int); #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif const char * libc_name_p (const char *, unsigned int); /* maximum key range = 391, duplicates = 0 */ @@ -96,7 +99,7 @@ hash (register const char *str, register unsigned int len) 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, 400 }; - register int hval = len; + register int hval = (int)len; switch (hval) { -- 2.4.3
shibajee/buildroot
package/gcc/4.7.4/844-gcc-fix-build-with-gcc5.patch
patch
mit
1,147
Allow C99-depending features of libstdc++ with uClibc The libstdc++ code is fairly restrictive on how it checks for C99 compatibility: it requires *complete* C99 support to enable certain features. For example, uClibc provides a good number of C99 features, but not C99 complex number support. For this reason, libstdc++ completely disables many the standard C++ methods that can in fact work because uClibc provides the necessary functions. This patch is similar and highly inspired from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58393, but implemented in a way that doesn't involve changing the configure.ac script, as autoreconfiguring gcc is complicated. It simply relies on the fact that uClibc defines the __UCLIBC__ definition. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Index: b/libstdc++-v3/config/locale/generic/c_locale.h =================================================================== --- a/libstdc++-v3/config/locale/generic/c_locale.h +++ b/libstdc++-v3/config/locale/generic/c_locale.h @@ -71,7 +71,7 @@ __builtin_va_list __args; __builtin_va_start(__args, __fmt); -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args); #else const int __ret = __builtin_vsprintf(__out, __fmt, __args); Index: b/libstdc++-v3/config/locale/gnu/c_locale.h =================================================================== --- a/libstdc++-v3/config/locale/gnu/c_locale.h +++ b/libstdc++-v3/config/locale/gnu/c_locale.h @@ -89,7 +89,7 @@ __builtin_va_list __args; __builtin_va_start(__args, __fmt); -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args); #else const int __ret = __builtin_vsprintf(__out, __fmt, __args); Index: b/libstdc++-v3/include/bits/basic_string.h =================================================================== --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -2806,7 +2806,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if (defined(__GXX_EXPERIMENTAL_CXX0X__) && defined(_GLIBCXX_USE_C99) \ +#if (defined(__GXX_EXPERIMENTAL_CXX0X__) && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)) \ && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)) #include <ext/string_conversions.h> Index: b/libstdc++-v3/include/bits/locale_facets.tcc =================================================================== --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -989,7 +989,7 @@ char __fbuf[16]; __num_base::_S_format_float(__io, __fbuf, __mod); -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) // First try a buffer perhaps big enough (most probably sufficient // for non-ios_base::fixed outputs) int __cs_size = __max_digits * 3; Index: b/libstdc++-v3/include/bits/locale_facets_nonio.tcc =================================================================== --- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc +++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc @@ -572,7 +572,7 @@ { const locale __loc = __io.getloc(); const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) // First try a buffer perhaps big enough. int __cs_size = 64; char* __cs = static_cast<char*>(__builtin_alloca(__cs_size)); Index: b/libstdc++-v3/include/c_compatibility/math.h =================================================================== --- a/libstdc++-v3/include/c_compatibility/math.h +++ b/libstdc++-v3/include/c_compatibility/math.h @@ -57,7 +57,7 @@ using std::floor; using std::fmod; -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::fpclassify; using std::isfinite; using std::isinf; Index: b/libstdc++-v3/include/c_compatibility/wchar.h =================================================================== --- a/libstdc++-v3/include/c_compatibility/wchar.h +++ b/libstdc++-v3/include/c_compatibility/wchar.h @@ -103,7 +103,7 @@ using std::wmemset; using std::wcsftime; -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::wcstold; using std::wcstoll; using std::wcstoull; Index: b/libstdc++-v3/include/c_global/cstdlib =================================================================== --- a/libstdc++-v3/include/c_global/cstdlib +++ b/libstdc++-v3/include/c_global/cstdlib @@ -146,7 +146,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef _Exit #undef llabs Index: b/libstdc++-v3/include/c_global/cwchar =================================================================== --- a/libstdc++-v3/include/c_global/cwchar +++ b/libstdc++-v3/include/c_global/cwchar @@ -234,7 +234,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef wcstold #undef wcstoll @@ -291,7 +291,7 @@ using std::vwscanf; #endif -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::wcstold; using std::wcstoll; using std::wcstoull; Index: b/libstdc++-v3/include/c_std/cstdio =================================================================== --- a/libstdc++-v3/include/c_std/cstdio +++ b/libstdc++-v3/include/c_std/cstdio @@ -140,7 +140,7 @@ using ::vsprintf; } // namespace std -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef snprintf #undef vfscanf Index: b/libstdc++-v3/include/c_std/cstdlib =================================================================== --- a/libstdc++-v3/include/c_std/cstdlib +++ b/libstdc++-v3/include/c_std/cstdlib @@ -143,7 +143,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef _Exit #undef llabs Index: b/libstdc++-v3/include/c_std/cwchar =================================================================== --- a/libstdc++-v3/include/c_std/cwchar +++ b/libstdc++-v3/include/c_std/cwchar @@ -230,7 +230,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef wcstold #undef wcstoll Index: b/libstdc++-v3/include/ext/vstring.h =================================================================== --- a/libstdc++-v3/include/ext/vstring.h +++ b/libstdc++-v3/include/ext/vstring.h @@ -2537,7 +2537,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if (defined(__GXX_EXPERIMENTAL_CXX0X__) && defined(_GLIBCXX_USE_C99)) +#if (defined(__GXX_EXPERIMENTAL_CXX0X__) && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__))) #include <ext/string_conversions.h> Index: b/libstdc++-v3/include/tr1/cstdio =================================================================== --- a/libstdc++-v3/include/tr1/cstdio +++ b/libstdc++-v3/include/tr1/cstdio @@ -33,7 +33,7 @@ #include <cstdio> -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) namespace std _GLIBCXX_VISIBILITY(default) { Index: b/libstdc++-v3/include/tr1/cstdlib =================================================================== --- a/libstdc++-v3/include/tr1/cstdlib +++ b/libstdc++-v3/include/tr1/cstdlib @@ -35,7 +35,7 @@ #if _GLIBCXX_HOSTED -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) namespace std _GLIBCXX_VISIBILITY(default) { Index: b/libstdc++-v3/include/tr1/cwchar =================================================================== --- a/libstdc++-v3/include/tr1/cwchar +++ b/libstdc++-v3/include/tr1/cwchar @@ -52,7 +52,7 @@ using std::vwscanf; #endif -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::wcstold; using std::wcstoll; using std::wcstoull; Index: b/libstdc++-v3/include/tr1/stdlib.h =================================================================== --- a/libstdc++-v3/include/tr1/stdlib.h +++ b/libstdc++-v3/include/tr1/stdlib.h @@ -33,7 +33,7 @@ #if _GLIBCXX_HOSTED -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::tr1::atoll; using std::tr1::strtoll; Index: b/libstdc++-v3/src/c++11/debug.cc =================================================================== --- a/libstdc++-v3/src/c++11/debug.cc +++ b/libstdc++-v3/src/c++11/debug.cc @@ -783,7 +783,7 @@ int __n __attribute__ ((__unused__)), const char* __fmt, _Tp __s) const throw () { -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) std::snprintf(__buf, __n, __fmt, __s); #else std::sprintf(__buf, __fmt, __s); Index: b/libstdc++-v3/include/c_global/cstdio =================================================================== --- a/libstdc++-v3/include/c_global/cstdio +++ b/libstdc++-v3/include/c_global/cstdio @@ -140,7 +140,7 @@ using ::vsprintf; } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef snprintf #undef vfscanf
shibajee/buildroot
package/gcc/4.7.4/850-libstdcxx-uclibc-c99.patch
patch
mit
9,267
From 4e318d50b876def5f97e2031926354055e442ca3 Mon Sep 17 00:00:00 2001 From: ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Sat, 1 Jun 2013 00:20:49 +0000 Subject: [PATCH] PR other/56780 * libiberty/configure.ac: Move test for --enable-install-libiberty outside of the 'with_target_subdir' test so that it actually gets run. Add output messages to show the test result. * libiberty/configure: Regenerate. * libiberty/Makefile.in (install_to_libdir): Place the installation of the libiberty library in the same guard as that used for the headers to prevent it being installed unless requested via --enable-install-libiberty. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199570 138bc75d-0d04-0410-961f-82ee72b054a4 libiberty: fix --enable-install-libiberty flag [PR 56780] Commit 199570 fixed the --disable-install-libiberty behavior, but it also added a bug where the enable path never works because the initial clear of target_header_dir wasn't deleted. So we end up initializing properly at the top only to reset it at the end all the time. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206367 138bc75d-0d04-0410-961f-82ee72b054a4 [Romain squash the two upstream commits Remove the ChangeLog] Signed-off-by: Romain Naour <romain.naour@openwide.fr> --- libiberty/Makefile.in | 24 ++++++++++----------- libiberty/configure | 57 +++++++++++++++++++++++++++----------------------- libiberty/configure.ac | 47 ++++++++++++++++++++++------------------- 3 files changed, 68 insertions(+), 60 deletions(-) diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in index 5280bc1..a69c6b6 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in @@ -353,19 +353,19 @@ install-strip: install # since it will be passed the multilib flags. MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory` install_to_libdir: all - ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR) - $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n - ( cd $(DESTDIR)$(libdir)/$(MULTIOSDIR) ; chmod 644 $(TARGETLIB)n ;$(RANLIB) $(TARGETLIB)n ) - mv -f $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB) if test -n "${target_header_dir}"; then \ - case "${target_header_dir}" in \ - /*) thd=${target_header_dir};; \ - *) thd=${includedir}/${target_header_dir};; \ - esac; \ - ${mkinstalldirs} $(DESTDIR)$${thd}; \ - for h in ${INSTALLED_HEADERS}; do \ - ${INSTALL_DATA} $$h $(DESTDIR)$${thd}; \ - done; \ + ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR); \ + $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n; \ + ( cd $(DESTDIR)$(libdir)/$(MULTIOSDIR) ; chmod 644 $(TARGETLIB)n ;$(RANLIB) $(TARGETLIB)n ); \ + mv -f $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB); \ + case "${target_header_dir}" in \ + /*) thd=${target_header_dir};; \ + *) thd=${includedir}/${target_header_dir};; \ + esac; \ + ${mkinstalldirs} $(DESTDIR)$${thd}; \ + for h in ${INSTALLED_HEADERS}; do \ + ${INSTALL_DATA} $$h $(DESTDIR)$${thd}; \ + done; \ fi @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install diff --git a/libiberty/configure b/libiberty/configure index 6e98352..44d1f78 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -675,8 +675,8 @@ with_cross_host with_newlib enable_maintainer_mode enable_multilib -enable_largefile enable_install_libiberty +enable_largefile ' ac_precious_vars='build_alias host_alias @@ -1303,8 +1303,8 @@ Optional Features: enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-multilib build many library versions (default) + --enable-install-libiberty Install headers and library for end users --disable-largefile omit support for large files - --enable-install-libiberty Install headers for end users Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -2784,6 +2784,35 @@ if test $cross_compiling = no && test $multilib = yes \ cross_compiling=maybe fi +# We may wish to install the target headers somewhere. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to install libiberty headers and static library" >&5 +$as_echo_n "checking whether to install libiberty headers and static library... " >&6; } + +# Check whether --enable-install-libiberty was given. +if test "${enable_install_libiberty+set}" = set; then : + enableval=$enable_install_libiberty; enable_install_libiberty=$enableval +else + enable_install_libiberty=no +fi + +# Option parsed, now set things appropriately. +case x"$enable_install_libiberty" in + xyes|x) + target_header_dir=libiberty + ;; + xno) + target_header_dir= + ;; + *) + # This could be sanity-checked in various ways... + target_header_dir="${enable_install_libiberty}" + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_install_libiberty" >&5 +$as_echo "$enable_install_libiberty" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: target_header_dir = $target_header_dir" >&5 +$as_echo "$as_me: target_header_dir = $target_header_dir" >&6;} + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -5475,7 +5504,6 @@ fi setobjs= CHECK= -target_header_dir= if test -n "${with_target_subdir}"; then # We are being configured as a target library. AC_REPLACE_FUNCS @@ -5752,29 +5780,6 @@ _ACEOF esac - # We may wish to install the target headers somewhere. - # Check whether --enable-install-libiberty was given. -if test "${enable_install_libiberty+set}" = set; then : - enableval=$enable_install_libiberty; enable_install_libiberty=$enableval -else - enable_install_libiberty=no -fi - - # Option parsed, now set things appropriately. - case x"$enable_install_libiberty" in - xyes|x) - target_header_dir=libiberty - ;; - xno) - target_header_dir= - ;; - *) - # This could be sanity-checked in various ways... - target_header_dir="${enable_install_libiberty}" - ;; - esac - - else # Not a target library, so we set things up to run the test suite. diff --git a/libiberty/configure.ac b/libiberty/configure.ac index 754b66a..04260ec 100644 --- a/libiberty/configure.ac +++ b/libiberty/configure.ac @@ -128,6 +128,31 @@ if test $cross_compiling = no && test $multilib = yes \ cross_compiling=maybe fi +# We may wish to install the target headers somewhere. +AC_MSG_CHECKING([whether to install libiberty headers and static library]) +dnl install-libiberty is disabled by default + +AC_ARG_ENABLE(install-libiberty, +[ --enable-install-libiberty Install headers and library for end users], +enable_install_libiberty=$enableval, +enable_install_libiberty=no)dnl + +# Option parsed, now set things appropriately. +case x"$enable_install_libiberty" in + xyes|x) + target_header_dir=libiberty + ;; + xno) + target_header_dir= + ;; + *) + # This could be sanity-checked in various ways... + target_header_dir="${enable_install_libiberty}" + ;; +esac +AC_MSG_RESULT($enable_install_libiberty) +AC_MSG_NOTICE([target_header_dir = $target_header_dir]) + GCC_NO_EXECUTABLES AC_PROG_CC AC_SYS_LARGEFILE @@ -379,7 +404,6 @@ fi setobjs= CHECK= -target_header_dir= if test -n "${with_target_subdir}"; then # We are being configured as a target library. AC_REPLACE_FUNCS @@ -490,27 +514,6 @@ if test -n "${with_target_subdir}"; then esac - # We may wish to install the target headers somewhere. - AC_ARG_ENABLE(install-libiberty, - [ --enable-install-libiberty Install headers for end users], - enable_install_libiberty=$enableval, - enable_install_libiberty=no)dnl - - # Option parsed, now set things appropriately. - case x"$enable_install_libiberty" in - xyes|x) - target_header_dir=libiberty - ;; - xno) - target_header_dir= - ;; - *) - # This could be sanity-checked in various ways... - target_header_dir="${enable_install_libiberty}" - ;; - esac - - else # Not a target library, so we set things up to run the test suite. -- 2.4.3
shibajee/buildroot
package/gcc/4.7.4/851-PR-other-56780.patch
patch
mit
8,221
Add musl support to gcc This patch comes from the musl-cross project at https://bitbucket.org/GregorR/musl-cross/src. Compared to the upstream version: * the config.sub modifications have been removed, because Buildroot already overwrites all config.sub with a more recent config.sub that has musl support. * change to ensure that a dummy dynamic linker path MUSL_DYNAMIC_LINKER<foo> is defined for all architectures, otherwise building gcc for architectures not supported by musl was causing build failure. Bug reported upstream at https://bitbucket.org/GregorR/musl-gcc-patches/issue/4/musl-gcc-patches-break-the-build-on. * change the USE_PT_GNU_EH_FRAME logic to keep the existing gcc logic and only add the musl one as an addition, not as a replacement. Not doing this breaks C++ exception handling with glibc, because USE_PT_GNU_EH_FRAME doesn't get defined due to the configure script not testing dl_iterate_phdr() on any system except Solaris. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> --- # HG changeset patch # Parent f50bb54f331f73405131a30b4f353cfda1c70304 Use the generic implementation of libstdc++ primitives when we're on musl, not the glibc one. Index: b/libstdc++-v3/configure.host =================================================================== --- a/libstdc++-v3/configure.host +++ b/libstdc++-v3/configure.host @@ -243,6 +243,13 @@ os_include_dir="os/bsd/freebsd" ;; gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) + # check for musl by target + case "${host_os}" in + *-musl*) + os_include_dir="os/generic" + ;; + *) + if [ "$uclibc" = "yes" ]; then os_include_dir="os/uclibc" elif [ "$bionic" = "yes" ]; then @@ -251,6 +258,9 @@ os_include_dir="os/gnu-linux" fi ;; + + esac + ;; hpux*) os_include_dir="os/hpux" ;; Index: b/gcc/config.gcc =================================================================== --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -522,7 +522,7 @@ esac # Common C libraries. -tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3" +tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4" # Common parts for widely ported systems. case ${target} in @@ -625,6 +625,9 @@ *-*-*uclibc*) tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" ;; + *-*-*musl*) + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL" + ;; *) tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" ;; @@ -2091,6 +2094,10 @@ powerpc*-*-linux*paired*) tm_file="${tm_file} rs6000/750cl.h" ;; esac + case ${target} in + *-linux*-musl*) + enable_secureplt=yes ;; + esac if test x${enable_secureplt} = xyes; then tm_file="rs6000/secureplt.h ${tm_file}" fi Index: b/gcc/config/linux.h =================================================================== --- a/gcc/config/linux.h +++ b/gcc/config/linux.h @@ -33,10 +33,12 @@ #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) #else #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) +#define OPTION_MUSL (linux_libc == LIBC_MUSL) #endif #define GNU_USER_TARGET_OS_CPP_BUILTINS() \ @@ -54,18 +56,21 @@ uClibc or Bionic is the default C library and whether -muclibc or -mglibc or -mbionic has been passed to change the default. */ -#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \ - "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}" +#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \ + "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}" #if DEFAULT_LIBC == LIBC_GLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ - CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B) +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ + CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M) #elif DEFAULT_LIBC == LIBC_UCLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ - CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B) +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ + CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M) #elif DEFAULT_LIBC == LIBC_BIONIC -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ - CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U) +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ + CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M) +#elif DEFAULT_LIBC == LIBC_MUSL +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ + CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B) #else #error "Unsupported DEFAULT_LIBC" #endif /* DEFAULT_LIBC */ @@ -83,23 +88,32 @@ #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64" #define BIONIC_DYNAMIC_LINKERX32 "/system/bin/linkerx32" +/* Musl dynamic linker paths must be defined on a per-architecture + basis, for each architecture supported by Musl. However, in order + to let other architectures continue to build with other C + libraries, we provide a dummy definition of the following defines. */ +#define MUSL_DYNAMIC_LINKER "invalid" +#define MUSL_DYNAMIC_LINKER32 "invalid" +#define MUSL_DYNAMIC_LINKER64 "invalid" +#define MUSL_DYNAMIC_LINKERX32 "invalid" + #define GNU_USER_DYNAMIC_LINKER \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \ - BIONIC_DYNAMIC_LINKER) + BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) #define GNU_USER_DYNAMIC_LINKER32 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \ - BIONIC_DYNAMIC_LINKER32) + BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) #define GNU_USER_DYNAMIC_LINKER64 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \ - BIONIC_DYNAMIC_LINKER64) + BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) #define GNU_USER_DYNAMIC_LINKERX32 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \ - BIONIC_DYNAMIC_LINKERX32) + BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32) /* Determine whether the entire c99 runtime is present in the runtime library. */ #undef TARGET_C99_FUNCTIONS -#define TARGET_C99_FUNCTIONS (OPTION_GLIBC) +#define TARGET_C99_FUNCTIONS (OPTION_GLIBC || OPTION_MUSL) /* Whether we have sincos that follows the GNU extension. */ #undef TARGET_HAS_SINCOS @@ -108,3 +122,74 @@ /* Whether we have Bionic libc runtime */ #undef TARGET_HAS_BIONIC #define TARGET_HAS_BIONIC (OPTION_BIONIC) + +/* musl avoids problematic includes by rearranging the include directories. + * Unfortunately, this is mostly duplicated from cppdefault.c */ +#if DEFAULT_LIBC == LIBC_MUSL +#define INCLUDE_DEFAULTS_MUSL_GPP \ + { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \ + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \ + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \ + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \ + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \ + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, + +#ifdef LOCAL_INCLUDE_DIR +#define INCLUDE_DEFAULTS_MUSL_LOCAL \ + { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \ + { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 }, +#else +#define INCLUDE_DEFAULTS_MUSL_LOCAL +#endif + +#ifdef PREFIX_INCLUDE_DIR +#define INCLUDE_DEFAULTS_MUSL_PREFIX \ + { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0}, +#else +#define INCLUDE_DEFAULTS_MUSL_PREFIX +#endif + +#ifdef CROSS_INCLUDE_DIR +#define INCLUDE_DEFAULTS_MUSL_CROSS \ + { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0}, +#else +#define INCLUDE_DEFAULTS_MUSL_CROSS +#endif + +#ifdef TOOL_INCLUDE_DIR +#define INCLUDE_DEFAULTS_MUSL_TOOL \ + { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0}, +#else +#define INCLUDE_DEFAULTS_MUSL_TOOL +#endif + +#ifdef NATIVE_SYSTEM_HEADER_DIR +#define INCLUDE_DEFAULTS_MUSL_NATIVE \ + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, +#else +#define INCLUDE_DEFAULTS_MUSL_NATIVE +#endif + +#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT) +# undef INCLUDE_DEFAULTS_MUSL_LOCAL +# define INCLUDE_DEFAULTS_MUSL_LOCAL +# undef INCLUDE_DEFAULTS_MUSL_NATIVE +# define INCLUDE_DEFAULTS_MUSL_NATIVE +#else +# undef INCLUDE_DEFAULTS_MUSL_CROSS +# define INCLUDE_DEFAULTS_MUSL_CROSS +#endif + +#undef INCLUDE_DEFAULTS +#define INCLUDE_DEFAULTS \ + { \ + INCLUDE_DEFAULTS_MUSL_GPP \ + INCLUDE_DEFAULTS_MUSL_PREFIX \ + INCLUDE_DEFAULTS_MUSL_CROSS \ + INCLUDE_DEFAULTS_MUSL_TOOL \ + INCLUDE_DEFAULTS_MUSL_NATIVE \ + { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \ + { 0, 0, 0, 0, 0, 0 } \ + } +#endif Index: b/gcc/config/linux.opt =================================================================== --- a/gcc/config/linux.opt +++ b/gcc/config/linux.opt @@ -30,3 +30,7 @@ muclibc Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic) Use uClibc C library + +mmusl +Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc) +Use musl C library Index: b/gcc/ginclude/stddef.h =================================================================== --- a/gcc/ginclude/stddef.h +++ b/gcc/ginclude/stddef.h @@ -184,6 +184,7 @@ #ifndef _GCC_SIZE_T #ifndef _SIZET_ #ifndef __size_t +#ifndef __DEFINED_size_t /* musl */ #define __size_t__ /* BeOS */ #define __SIZE_T__ /* Cray Unicos/Mk */ #define _SIZE_T @@ -200,6 +201,7 @@ #define ___int_size_t_h #define _GCC_SIZE_T #define _SIZET_ +#define __DEFINED_size_t /* musl */ #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \ || defined(__FreeBSD_kernel__) /* __size_t is a typedef on FreeBSD 5, must not trash it. */ @@ -215,6 +217,7 @@ typedef long ssize_t; #endif /* __BEOS__ */ #endif /* !(defined (__GNUG__) && defined (size_t)) */ +#endif /* __DEFINED_size_t */ #endif /* __size_t */ #endif /* _SIZET_ */ #endif /* _GCC_SIZE_T */ Index: b/libgomp/config/posix/time.c =================================================================== --- a/libgomp/config/posix/time.c +++ b/libgomp/config/posix/time.c @@ -28,6 +28,8 @@ The following implementation uses the most simple POSIX routines. If present, POSIX 4 clocks should be used instead. */ +#define _POSIX_C_SOURCE 199309L /* for clocks */ + #include "libgomp.h" #include <unistd.h> #if TIME_WITH_SYS_TIME Index: b/libgcc/unwind-dw2-fde-dip.c =================================================================== --- a/libgcc/unwind-dw2-fde-dip.c +++ b/libgcc/unwind-dw2-fde-dip.c @@ -71,6 +71,13 @@ # define USE_PT_GNU_EH_FRAME #endif +/* For musl libc, TARGET_DL_ITERATE_PHDR gets defined by the configure + script. */ +#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ + && defined(TARGET_DL_ITERATE_PHDR) +# define USE_PT_GNU_EH_FRAME +#endif + #if defined(USE_PT_GNU_EH_FRAME) #include <link.h> Index: b/gcc/configure =================================================================== --- a/gcc/configure +++ b/gcc/configure @@ -26906,6 +26910,9 @@ gcc_cv_target_dl_iterate_phdr=no fi ;; + *-linux-musl*) + gcc_cv_target_dl_iterate_phdr=yes + ;; esac if test x$gcc_cv_target_dl_iterate_phdr = xyes; then Index: b/gcc/configure.ac =================================================================== --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -4767,6 +4771,9 @@ gcc_cv_target_dl_iterate_phdr=no fi ;; + *-linux-musl*) + gcc_cv_target_dl_iterate_phdr=yes + ;; esac GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR]) if test x$gcc_cv_target_dl_iterate_phdr = xyes; then Index: b/fixincludes/mkfixinc.sh =================================================================== --- a/fixincludes/mkfixinc.sh +++ b/fixincludes/mkfixinc.sh @@ -20,7 +20,8 @@ powerpc-*-eabi* | \ powerpc-*-rtems* | \ powerpcle-*-eabisim* | \ - powerpcle-*-eabi* ) + powerpcle-*-eabi* | \ + *-musl* ) # IF there is no include fixing, # THEN create a no-op fixer and exit (echo "#! /bin/sh" ; echo "exit 0" ) > ${target} Index: b/gcc/config/i386/linux.h =================================================================== --- a/gcc/config/i386/linux.h +++ b/gcc/config/i386/linux.h @@ -22,3 +22,5 @@ #define GNU_USER_LINK_EMULATION "elf_i386" #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1" Index: b/gcc/config/i386/linux64.h =================================================================== --- a/gcc/config/i386/linux64.h +++ b/gcc/config/i386/linux64.h @@ -31,3 +31,10 @@ #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" + +#undef MUSL_DYNAMIC_LINKER32 +#undef MUSL_DYNAMIC_LINKER64 +#undef MUSL_DYNAMIC_LINKERX32 +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1" +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1" +#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1" Index: b/libitm/config/linux/x86/tls.h =================================================================== --- a/libitm/config/linux/x86/tls.h +++ b/libitm/config/linux/x86/tls.h @@ -25,16 +25,19 @@ #ifndef LIBITM_X86_TLS_H #define LIBITM_X86_TLS_H 1 -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) +#if defined(__GLIBC_PREREQ) +#if __GLIBC_PREREQ(2, 10) /* Use slots in the TCB head rather than __thread lookups. GLIBC has reserved words 10 through 13 for TM. */ #define HAVE_ARCH_GTM_THREAD 1 #define HAVE_ARCH_GTM_THREAD_DISP 1 #endif +#endif #include "config/generic/tls.h" -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) +#if defined(__GLIBC_PREREQ) +#if __GLIBC_PREREQ(2, 10) namespace GTM HIDDEN { #ifdef __x86_64__ @@ -101,5 +104,6 @@ } // namespace GTM #endif /* >= GLIBC 2.10 */ +#endif #endif // LIBITM_X86_TLS_H Index: b/gcc/config/arm/linux-eabi.h =================================================================== --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -64,6 +64,23 @@ #undef GLIBC_DYNAMIC_LINKER #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3" +/* For ARM musl currently supports four dynamic linkers: + - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI + - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI + - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB + - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB + musl does not support the legacy OABI mode. + All the dynamic linkers live in /lib. + We default to soft-float, EL. */ +#undef MUSL_DYNAMIC_LINKER +#if TARGET_BIG_ENDIAN_DEFAULT +#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}" +#else +#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}" +#endif +#define MUSL_DYNAMIC_LINKER \ + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to use the GNU/Linux version, not the generic BPABI version. */ #undef LINK_SPEC Index: b/libitm/config/arm/hwcap.cc =================================================================== --- a/libitm/config/arm/hwcap.cc +++ b/libitm/config/arm/hwcap.cc @@ -40,7 +40,11 @@ #ifdef __linux__ #include <unistd.h> +#ifdef __GLIBC__ #include <sys/fcntl.h> +#else +#include <fcntl.h> +#endif #include <elf.h> static void __attribute__((constructor)) Index: b/gcc/config/mips/linux.h =================================================================== --- a/gcc/config/mips/linux.h +++ b/gcc/config/mips/linux.h @@ -19,3 +19,11 @@ <http://www.gnu.org/licenses/>. */ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + +#if TARGET_ENDIAN_DEFAULT == 0 /* LE */ +#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}" +#else +#define MUSL_DYNAMIC_LINKER_E "%{EL:el}" +#endif +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" Index: b/gcc/config/rs6000/linux64.h =================================================================== --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -362,17 +362,23 @@ #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1" #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" +#undef MUSL_DYNAMIC_LINKER32 +#undef MUSL_DYNAMIC_LINKER64 +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1" +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1" #if DEFAULT_LIBC == LIBC_UCLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" #elif DEFAULT_LIBC == LIBC_GLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" +#elif DEFAULT_LIBC == LIBC_MUSL +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" #else #error "Unsupported DEFAULT_LIBC" #endif #define GNU_USER_DYNAMIC_LINKER32 \ - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32) + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) #define GNU_USER_DYNAMIC_LINKER64 \ - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64) + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \ Index: b/gcc/config/rs6000/secureplt.h =================================================================== --- a/gcc/config/rs6000/secureplt.h +++ b/gcc/config/rs6000/secureplt.h @@ -18,3 +18,4 @@ <http://www.gnu.org/licenses/>. */ #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt" +#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt" Index: b/gcc/config/rs6000/sysv4.h =================================================================== --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -566,6 +566,9 @@ #ifndef CC1_SECURE_PLT_DEFAULT_SPEC #define CC1_SECURE_PLT_DEFAULT_SPEC "" #endif +#ifndef LINK_SECURE_PLT_DEFAULT_SPEC +#define LINK_SECURE_PLT_DEFAULT_SPEC "" +#endif /* Pass -G xxx to the compiler and set correct endian mode. */ #define CC1_SPEC "%{G*} %(cc1_cpu) \ @@ -626,7 +629,8 @@ %{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \ %{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \ %{mcall-i960-old: --oformat elf32-powerpcle} \ - }}}}" + }}}} \ +%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}" /* Any specific OS flags. */ #define LINK_OS_SPEC "\ @@ -804,15 +808,19 @@ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1" #if DEFAULT_LIBC == LIBC_UCLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" +#elif DEFAULT_LIBC == LIBC_MUSL +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" #else #error "Unsupported DEFAULT_LIBC" #endif #define GNU_USER_DYNAMIC_LINKER \ - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ %{rdynamic:-export-dynamic} \ @@ -938,6 +946,7 @@ { "cc1_endian_little", CC1_ENDIAN_LITTLE_SPEC }, \ { "cc1_endian_default", CC1_ENDIAN_DEFAULT_SPEC }, \ { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \ + { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \ { "cpp_os_ads", CPP_OS_ADS_SPEC }, \ { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \ { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \ Index: b/gcc/config/mips/linux64.h =================================================================== --- a/gcc/config/mips/linux64.h +++ b/gcc/config/mips/linux64.h @@ -30,4 +30,4 @@ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32" #define GNU_USER_DYNAMIC_LINKERN32 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \ - BIONIC_DYNAMIC_LINKERN32) + BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKER)
shibajee/buildroot
package/gcc/4.7.4/900-musl-support.patch
patch
mit
20,849
Index: gcc-4.8.0/contrib/regression/objs-gcc.sh =================================================================== --- gcc-4.8.0.orig/contrib/regression/objs-gcc.sh 2009-04-09 17:00:19.000000000 +0200 +++ gcc-4.8.0/contrib/regression/objs-gcc.sh 2013-03-23 17:39:04.000000000 +0100 @@ -106,6 +106,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
shibajee/buildroot
package/gcc/4.8.5/100-uclibc-conf.patch
patch
mit
704
http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00269.html On glibc the libc.so carries a copy of the math function copysignl() but on uClibc math functions like copysignl() live in libm. Since libgcc_s contains unresolved symbols, any attempt to link against libgcc_s without explicitely specifying -lm fails, resulting in a broken bootstrap of the compiler. Forward port to gcc 4.5.1 by Gustavo Zacarias <gustavo@zacarias.com.ar> --- libgcc/Makefile.in | 4 +++- libgcc/configure | 32 ++++++++++++++++++++++++++++++++ libgcc/configure.ac | 21 +++++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) Index: gcc-4.8.0/libgcc/Makefile.in =================================================================== --- gcc-4.8.0.orig/libgcc/Makefile.in 2013-02-04 20:06:20.000000000 +0100 +++ gcc-4.8.0/libgcc/Makefile.in 2013-03-24 09:12:43.000000000 +0100 @@ -41,6 +41,7 @@ decimal_float = @decimal_float@ enable_decimal_float = @enable_decimal_float@ fixed_point = @fixed_point@ +LIBGCC_LIBM = @LIBGCC_LIBM@ host_noncanonical = @host_noncanonical@ target_noncanonical = @target_noncanonical@ @@ -927,9 +928,10 @@ @multilib_dir@,$(MULTIDIR),$(subst \ @shlib_objs@,$(objects) libgcc.a,$(subst \ @shlib_base_name@,libgcc_s,$(subst \ + @libgcc_libm@,$(LIBGCC_LIBM),$(subst \ @shlib_map_file@,$(mapfile),$(subst \ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \ - @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK)))))))) + @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))) libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts) # @multilib_flags@ is still needed because this may use Index: gcc-4.8.0/libgcc/configure =================================================================== --- gcc-4.8.0.orig/libgcc/configure 2012-11-05 00:08:42.000000000 +0100 +++ gcc-4.8.0/libgcc/configure 2013-03-24 09:12:43.000000000 +0100 @@ -564,6 +564,7 @@ tmake_file sfp_machine_header set_use_emutls +LIBGCC_LIBM set_have_cc_tls vis_hide fixed_point @@ -4481,6 +4482,37 @@ fi fi +# On powerpc libgcc_s references copysignl which is a libm function but +# glibc apparently also provides it via libc as opposed to uClibc where +# it lives in libm. +echo "$as_me:$LINENO: checking for library containing copysignl" >&5 +echo $ECHO_N "checking for library containing copysignl... $ECHO_C" >&6 +if test "${libgcc_cv_copysignl_lib+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + echo '#include <features.h>' > conftest.c + echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c + libgcc_cv_copysignl_lib="-lc" + if { ac_try='${CC-cc} -S conftest.c -o conftest.s 1>&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then + libgcc_cv_copysignl_lib="-lm" + fi + rm -f conftest.* + +fi +echo "$as_me:$LINENO: result: $libgcc_cv_copysignl_lib" >&5 +echo "${ECHO_T}$libgcc_cv_copysignl_lib" >&6 + +case /${libgcc_cv_copysignl_lib}/ in + /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;; + *) LIBGCC_LIBM= ;; +esac # Conditionalize the makefile for this target machine. tmake_file_= Index: gcc-4.8.0/libgcc/configure.ac =================================================================== --- gcc-4.8.0.orig/libgcc/configure.ac 2012-10-15 15:10:30.000000000 +0200 +++ gcc-4.8.0/libgcc/configure.ac 2013-03-24 09:12:43.000000000 +0100 @@ -326,6 +326,27 @@ fi AC_SUBST(set_have_cc_tls) +# On powerpc libgcc_s references copysignl which is a libm function but +# glibc apparently also provides it via libc as opposed to uClibc where +# it lives in libm. +AC_CACHE_CHECK + libgcc_cv_copysignl_lib, + echo '#include <features.h>' > conftest.c + echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c + libgcc_cv_copysignl_lib="-lc" + if AC_TRY_COMMAND(${CC-cc} -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD) + then + libgcc_cv_copysignl_lib="-lm" + fi + rm -f conftest.* + ]) + +case /${libgcc_cv_copysignl_lib}/ in + /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;; + *) LIBGCC_LIBM= ;; +esac +AC_SUBST(LIBGCC_LIBM) + # See if we have emulated thread-local storage. GCC_CHECK_EMUTLS set_use_emutls=
shibajee/buildroot
package/gcc/4.8.5/1000-powerpc-link-with-math-lib.patch.conditional
conditional
mit
4,247
From b9a7775674d91c7af8043a83211ffeaa576327d7 Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Fri, 10 Apr 2015 17:46:30 +0300 Subject: [PATCH] Fix PR target/65730 2015-05-20 Max Filippov <jcmvbkbc@gmail.com> gcc/ * config/xtensa/xtensa.c (init_alignment_context): Replace MULT by BITS_PER_UNIT with ASHIFT by exact_log2 (BITS_PER_UNIT). Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223452 Changes to ChangeLog are dropped. gcc/config/xtensa/xtensa.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index eb039ba..7296e36 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -1461,8 +1461,9 @@ init_alignment_context (struct alignment_context *ac, rtx mem) if (ac->shift != NULL_RTX) { /* Shift is the byte count, but we need the bitcount. */ - ac->shift = expand_simple_binop (SImode, MULT, ac->shift, - GEN_INT (BITS_PER_UNIT), + gcc_assert (exact_log2 (BITS_PER_UNIT) >= 0); + ac->shift = expand_simple_binop (SImode, ASHIFT, ac->shift, + GEN_INT (exact_log2 (BITS_PER_UNIT)), NULL_RTX, 1, OPTAB_DIRECT); ac->modemask = expand_simple_binop (SImode, ASHIFT, GEN_INT (GET_MODE_MASK (mode)), -- 1.8.1.4
shibajee/buildroot
package/gcc/4.8.5/111-pr65730.patch
patch
mit
1,378
From 9bf6066d588632dab9f78932df15b5b4140f31f3 Mon Sep 17 00:00:00 2001 From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be> Date: Fri, 6 Nov 2015 14:27:23 +0100 Subject: [PATCH] gcc/config.gcc: fix typo for powerpc e6500 cpu_is_64bit Otherwise it is not recognized as a 64-bit powerpc and gcc will not generate 64-bit binaries by default. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> --- gcc/config.gcc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index 4a7cbd2..9cc765e 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -439,7 +439,7 @@ powerpc*-*-*) cpu_type=rs6000 extra_headers="ppc-asm.h altivec.h spe.h ppu_intrinsics.h paired.h spu2vmx.h vec_types.h si2vmx.h htmintrin.h htmxlintrin.h" case x$with_cpu in - xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345678]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|Xe6500) + xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345678]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|xe6500) cpu_is_64bit=yes ;; esac -- 2.6.2
shibajee/buildroot
package/gcc/4.8.5/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch
patch
mit
1,081
From 1e5f1089dec3af328fd03125d6778f666d0bd4e4 Mon Sep 17 00:00:00 2001 From: edlinger <edlinger@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Thu, 25 Feb 2016 15:33:50 +0000 Subject: [PATCH 1/1] 2016-02-25 Bernd Edlinger <bernd.edlinger@hotmail.de> Backported from mainline 2016-02-19 Jakub Jelinek <jakub@redhat.com> Bernd Edlinger <bernd.edlinger@hotmail.de> * Make-lang.in: Invoke gperf with -L C++. * cfns.gperf: Remove prototypes for hash and libc_name_p inlines. * cfns.h: Regenerated. * except.c (nothrow_libfn_p): Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@233720 138bc75d-0d04-0410-961f-82ee72b054a4 Signed-off-by: Samuel Martin <s.martin49@gmail.com> --- gcc/cp/Make-lang.in | 2 +- gcc/cp/cfns.gperf | 10 ++-------- gcc/cp/cfns.h | 41 ++++++++++++++--------------------------- gcc/cp/except.c | 3 ++- 5 files changed, 31 insertions(+), 37 deletions(-) diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index e98beb1..b09fb02 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -111,7 +111,7 @@ else # deleting the $(srcdir)/cp/cfns.h file. $(srcdir)/cp/cfns.h: endif - gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ + gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \ $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h # diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf index 68acd3d..214ecf6 100644 --- a/gcc/cp/cfns.gperf +++ b/gcc/cp/cfns.gperf @@ -1,3 +1,5 @@ +%language=C++ +%define class-name libc_name %{ /* Copyright (C) 2000-2015 Free Software Foundation, Inc. @@ -16,14 +18,6 @@ for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ -#ifdef __GNUC__ -__inline -#endif -static unsigned int hash (const char *, unsigned int); -#ifdef __GNUC__ -__inline -#endif -const char * libc_name_p (const char *, unsigned int); %} %% # The standard C library functions, for feeding to gperf; the result is used diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h index 1c6665d..596f413 100644 --- a/gcc/cp/cfns.h +++ b/gcc/cp/cfns.h @@ -1,5 +1,5 @@ -/* ANSI-C code produced by gperf version 3.0.3 */ -/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf */ +/* C++ code produced by gperf version 3.0.4 */ +/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ @@ -28,7 +28,7 @@ #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>." #endif -#line 1 "cfns.gperf" +#line 3 "cfns.gperf" /* Copyright (C) 2000-2015 Free Software Foundation, Inc. @@ -47,25 +47,18 @@ for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>. */ -#ifdef __GNUC__ -__inline -#endif -static unsigned int hash (const char *, unsigned int); -#ifdef __GNUC__ -__inline -#endif -const char * libc_name_p (const char *, unsigned int); /* maximum key range = 391, duplicates = 0 */ -#ifdef __GNUC__ -__inline -#else -#ifdef __cplusplus -inline -#endif -#endif -static unsigned int -hash (register const char *str, register unsigned int len) +class libc_name +{ +private: + static inline unsigned int hash (const char *str, unsigned int len); +public: + static const char *libc_name_p (const char *str, unsigned int len); +}; + +inline unsigned int +libc_name::hash (register const char *str, register unsigned int len) { static const unsigned short asso_values[] = { @@ -122,14 +115,8 @@ hash (register const char *str, register unsigned int len) return hval + asso_values[(unsigned char)str[len - 1]]; } -#ifdef __GNUC__ -__inline -#ifdef __GNUC_STDC_INLINE__ -__attribute__ ((__gnu_inline__)) -#endif -#endif const char * -libc_name_p (register const char *str, register unsigned int len) +libc_name::libc_name_p (register const char *str, register unsigned int len) { enum { diff --git a/gcc/cp/except.c b/gcc/cp/except.c index 3ff1ce6..2f2e396 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -1040,7 +1040,8 @@ nothrow_libfn_p (const_tree fn) unless the system headers are playing rename tricks, and if they are, we don't want to be confused by them. */ id = DECL_NAME (fn); - return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id)); + return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id), + IDENTIFIER_LENGTH (id)); } /* Returns nonzero if an exception of type FROM will be caught by a -- 1.7.1
shibajee/buildroot
package/gcc/4.8.5/130-fix_build_with_gcc-6.patch
patch
mit
4,898
From c037df1be41f8daf4d581d7ffa4ec8cfa640bccf Mon Sep 17 00:00:00 2001 From: glisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Fri, 25 Apr 2014 08:03:08 +0000 Subject: [PATCH] 2014-04-25 Marc Glisse <marc.glisse@inria.fr> PR target/43538 * mt-gnu: Don't reset CXXFLAGS_FOR_TARGET. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209784 138bc75d-0d04-0410-961f-82ee72b054a4 Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- config/mt-gnu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/mt-gnu b/config/mt-gnu index 15bf417..5c696f5 100644 --- a/config/mt-gnu +++ b/config/mt-gnu @@ -1 +1 @@ -CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -D_GNU_SOURCE +CXXFLAGS_FOR_TARGET += -D_GNU_SOURCE -- 2.1.4
shibajee/buildroot
package/gcc/4.8.5/130-pr43538.patch
patch
mit
738
Index: gcc-4.8.0/boehm-gc/include/gc.h =================================================================== --- gcc-4.8.0.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200 +++ gcc-4.8.0/boehm-gc/include/gc.h 2013-03-23 17:39:20.000000000 +0100 @@ -503,7 +503,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
shibajee/buildroot
package/gcc/4.8.5/301-missing-execinfo_h.patch
patch
mit
581
Index: gcc-4.8.0/libmudflap/mf-hooks2.c =================================================================== --- gcc-4.8.0.orig/libmudflap/mf-hooks2.c 2013-02-03 18:48:05.000000000 +0100 +++ gcc-4.8.0/libmudflap/mf-hooks2.c 2013-03-23 17:39:43.000000000 +0100 @@ -424,7 +424,7 @@ { TRACE ("%s\n", __PRETTY_FUNCTION__); MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region"); - bzero (s, n); + memset (s, 0, n); } @@ -434,7 +434,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); } @@ -444,7 +444,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); } @@ -453,7 +453,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); } @@ -462,7 +462,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 */
shibajee/buildroot
package/gcc/4.8.5/305-libmudflap-susv3-legacy.patch
patch
mit
1,402
Index: gcc-4.8.0/gcc/config/arm/linux-elf.h =================================================================== --- gcc-4.8.0.orig/gcc/config/arm/linux-elf.h 2013-01-10 21:38:27.000000000 +0100 +++ gcc-4.8.0/gcc/config/arm/linux-elf.h 2013-03-23 17:40:00.000000000 +0100 @@ -55,7 +55,7 @@ %{shared:-lc} \ %{!shared:%{profile:-lc_p}%{!profile:-lc}}" -#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" +#define LIBGCC_SPEC "-lgcc" #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" Index: gcc-4.8.0/libgcc/config/arm/t-linux =================================================================== --- gcc-4.8.0.orig/libgcc/config/arm/t-linux 2012-03-22 16:14:46.000000000 +0100 +++ gcc-4.8.0/libgcc/config/arm/t-linux 2013-03-23 17:40:54.000000000 +0100 @@ -1,6 +1,11 @@ LIB1ASMSRC = arm/lib1funcs.S LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ - _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 + _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ + _arm_addsubdf3 _arm_addsubsf3 \ + _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ + _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ + _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ + _arm_fixsfsi _arm_fixunssfsi # Just for these, we omit the frame pointer since it makes such a big # difference.
shibajee/buildroot
package/gcc/4.8.5/810-arm-softfloat-libgcc.patch
patch
mit
1,291
http://sourceware.org/ml/crossgcc/2008-05/msg00009.html --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -45,7 +45,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 /* TARGET_BIG_ENDIAN_DEFAULT is set in config.gcc for big endian configurations. */
shibajee/buildroot
package/gcc/4.8.5/830-arm_unbreak_armv4t.patch
patch
mit
473
This backports fix from http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57717 Upstream-Status: Backport Signed-off-by: Julian Brown <Julian_Brown@mentor.com> [Gustavo: Update for gcc 4.8.3] fix for PR57717 (PowerPC E500v2) http://gcc.gnu.org/ml/gcc-patches/2013-08/msg00668.html diff -Nura gcc-4.8.3/gcc/config/rs6000/rs6000.c gcc-4.8.3-pr57717/gcc/config/rs6000/rs6000.c --- gcc-4.8.3/gcc/config/rs6000/rs6000.c 2014-05-04 23:18:35.000000000 -0300 +++ gcc-4.8.3-pr57717/gcc/config/rs6000/rs6000.c 2014-05-22 15:20:12.554270919 -0300 @@ -7343,9 +7343,7 @@ && GET_CODE (XEXP (x, 1)) == CONST_INT && reg_offset_p && !SPE_VECTOR_MODE (mode) - && !(TARGET_E500_DOUBLE && (mode == DFmode || mode == TFmode - || mode == DDmode || mode == TDmode - || mode == DImode)) + && !(TARGET_E500_DOUBLE && GET_MODE_SIZE (mode) > UNITS_PER_WORD) && (!VECTOR_MODE_P (mode) || VECTOR_MEM_NONE_P (mode))) { HOST_WIDE_INT val = INTVAL (XEXP (x, 1));
shibajee/buildroot
package/gcc/4.8.5/841-PR57717-E500v2.patch
patch
mit
988
From gcc bugzilla https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60155 Upstream status: in trunk. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar> --- trunk/gcc/gcse.c 2014/02/12 14:50:06 207726 +++ trunk/gcc/gcse.c 2014/04/04 22:25:51 209134 @@ -2502,6 +2502,65 @@ } } +struct set_data +{ + rtx insn; + const_rtx set; + int nsets; +}; + +/* Increment number of sets and record set in DATA. */ + +static void +record_set_data (rtx dest, const_rtx set, void *data) +{ + struct set_data *s = (struct set_data *)data; + + if (GET_CODE (set) == SET) + { + /* We allow insns having multiple sets, where all but one are + dead as single set insns. In the common case only a single + set is present, so we want to avoid checking for REG_UNUSED + notes unless necessary. */ + if (s->nsets == 1 + && find_reg_note (s->insn, REG_UNUSED, SET_DEST (s->set)) + && !side_effects_p (s->set)) + s->nsets = 0; + + if (!s->nsets) + { + /* Record this set. */ + s->nsets += 1; + s->set = set; + } + else if (!find_reg_note (s->insn, REG_UNUSED, dest) + || side_effects_p (set)) + s->nsets += 1; + } +} + +static const_rtx +single_set_gcse (rtx insn) +{ + struct set_data s; + rtx pattern; + + gcc_assert (INSN_P (insn)); + + /* Optimize common case. */ + pattern = PATTERN (insn); + if (GET_CODE (pattern) == SET) + return pattern; + + s.insn = insn; + s.nsets = 0; + note_stores (pattern, record_set_data, &s); + + /* Considered invariant insns have exactly one set. */ + gcc_assert (s.nsets == 1); + return s.set; +} + /* Emit move from SRC to DEST noting the equivalence with expression computed in INSN. */ @@ -2509,7 +2568,8 @@ gcse_emit_move_after (rtx dest, rtx src, rtx insn) { rtx new_rtx; - rtx set = single_set (insn), set2; + const_rtx set = single_set_gcse (insn); + rtx set2; rtx note; rtx eqv = NULL_RTX; @@ -3369,13 +3429,12 @@ FOR_EACH_VEC_ELT (occrs_to_hoist, j, occr) { rtx insn; - rtx set; + const_rtx set; gcc_assert (!occr->deleted_p); insn = occr->insn; - set = single_set (insn); - gcc_assert (set); + set = single_set_gcse (insn); /* Create a pseudo-reg to store the result of reaching expressions into. Get the mode for the new pseudo @@ -3456,10 +3515,8 @@ { rtx reg; enum reg_class pressure_class; - rtx set = single_set (insn); + const_rtx set = single_set_gcse (insn); - /* Considered invariant insns have only one set. */ - gcc_assert (set != NULL_RTX); reg = SET_DEST (set); if (GET_CODE (reg) == SUBREG) reg = SUBREG_REG (reg);
shibajee/buildroot
package/gcc/4.8.5/842-PR60155.patch
patch
mit
2,645
From 845478644ba54a6947e9b224f2e5cd342e8257a9 Mon Sep 17 00:00:00 2001 From: Andrew Hsieh <andrewhsieh@google.com> Date: Wed, 25 Jun 2014 22:13:48 -0700 Subject: [PATCH] Fix a typo in vmlaq_lane_s32 BUG=15526898 Change-Id: I4e35a764d369d378808dab29beefe34d1f93249b Signed-off-by: Peter Korsgaard <peter@korsgaard.com> --- diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h index 73c7e7d..92b0119 100644 --- a/gcc/config/aarch64/arm_neon.h +++ b/gcc/config/aarch64/arm_neon.h @@ -9984,7 +9984,7 @@ #define vmlaq_lane_s32(a, b, c, d) \ __extension__ \ ({ \ - int32x4_t c_ = (c); \ + int32x2_t c_ = (c); \ int32x4_t b_ = (b); \ int32x4_t a_ = (a); \ int32x4_t result; \
shibajee/buildroot
package/gcc/4.8.5/843-aarch64-vmlaq_lane_s32-typo.patch
patch
mit
1,124
Allow C99-depending features of libstdc++ with uClibc The libstdc++ code is fairly restrictive on how it checks for C99 compatibility: it requires *complete* C99 support to enable certain features. For example, uClibc provides a good number of C99 features, but not C99 complex number support. For this reason, libstdc++ completely disables many the standard C++ methods that can in fact work because uClibc provides the necessary functions. This patch is similar and highly inspired from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58393, but implemented in a way that doesn't involve changing the configure.ac script, as autoreconfiguring gcc is complicated. It simply relies on the fact that uClibc defines the __UCLIBC__ definition. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Index: b/libstdc++-v3/config/locale/generic/c_locale.h =================================================================== --- a/libstdc++-v3/config/locale/generic/c_locale.h +++ b/libstdc++-v3/config/locale/generic/c_locale.h @@ -70,7 +70,7 @@ __builtin_va_list __args; __builtin_va_start(__args, __fmt); -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args); #else const int __ret = __builtin_vsprintf(__out, __fmt, __args); Index: b/libstdc++-v3/config/locale/gnu/c_locale.h =================================================================== --- a/libstdc++-v3/config/locale/gnu/c_locale.h +++ b/libstdc++-v3/config/locale/gnu/c_locale.h @@ -88,7 +88,7 @@ __builtin_va_list __args; __builtin_va_start(__args, __fmt); -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args); #else const int __ret = __builtin_vsprintf(__out, __fmt, __args); Index: b/libstdc++-v3/include/bits/basic_string.h =================================================================== --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -2809,7 +2809,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \ +#if ((__cplusplus >= 201103L) && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)) \ && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)) #include <ext/string_conversions.h> Index: b/libstdc++-v3/include/bits/locale_facets.tcc =================================================================== --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -987,7 +987,7 @@ char __fbuf[16]; __num_base::_S_format_float(__io, __fbuf, __mod); -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) // First try a buffer perhaps big enough (most probably sufficient // for non-ios_base::fixed outputs) int __cs_size = __max_digits * 3; Index: b/libstdc++-v3/include/bits/locale_facets_nonio.tcc =================================================================== --- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc +++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc @@ -572,7 +572,7 @@ { const locale __loc = __io.getloc(); const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) // First try a buffer perhaps big enough. int __cs_size = 64; char* __cs = static_cast<char*>(__builtin_alloca(__cs_size)); Index: b/libstdc++-v3/include/c_compatibility/math.h =================================================================== --- a/libstdc++-v3/include/c_compatibility/math.h +++ b/libstdc++-v3/include/c_compatibility/math.h @@ -56,7 +56,7 @@ using std::floor; using std::fmod; -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::fpclassify; using std::isfinite; using std::isinf; Index: b/libstdc++-v3/include/c_compatibility/wchar.h =================================================================== --- a/libstdc++-v3/include/c_compatibility/wchar.h +++ b/libstdc++-v3/include/c_compatibility/wchar.h @@ -103,7 +103,7 @@ using std::wmemset; using std::wcsftime; -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::wcstold; using std::wcstoll; using std::wcstoull; Index: b/libstdc++-v3/include/c_global/cstdlib =================================================================== --- a/libstdc++-v3/include/c_global/cstdlib +++ b/libstdc++-v3/include/c_global/cstdlib @@ -182,7 +182,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef _Exit #undef llabs Index: b/libstdc++-v3/include/c_global/cwchar =================================================================== --- a/libstdc++-v3/include/c_global/cwchar +++ b/libstdc++-v3/include/c_global/cwchar @@ -232,7 +232,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef wcstold #undef wcstoll @@ -289,7 +289,7 @@ using std::vwscanf; #endif -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::wcstold; using std::wcstoll; using std::wcstoull; Index: b/libstdc++-v3/include/c_std/cstdio =================================================================== --- a/libstdc++-v3/include/c_std/cstdio +++ b/libstdc++-v3/include/c_std/cstdio @@ -139,7 +139,7 @@ using ::vsprintf; } // namespace std -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef snprintf #undef vfscanf Index: b/libstdc++-v3/include/c_std/cstdlib =================================================================== --- a/libstdc++-v3/include/c_std/cstdlib +++ b/libstdc++-v3/include/c_std/cstdlib @@ -180,7 +180,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef _Exit #undef llabs Index: b/libstdc++-v3/include/c_std/cwchar =================================================================== --- a/libstdc++-v3/include/c_std/cwchar +++ b/libstdc++-v3/include/c_std/cwchar @@ -228,7 +228,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef wcstold #undef wcstoll Index: b/libstdc++-v3/include/ext/vstring.h =================================================================== --- a/libstdc++-v3/include/ext/vstring.h +++ b/libstdc++-v3/include/ext/vstring.h @@ -2571,7 +2571,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99)) +#if ((__cplusplus >= 201103L) && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__))) #include <ext/string_conversions.h> Index: b/libstdc++-v3/include/tr1/cstdio =================================================================== --- a/libstdc++-v3/include/tr1/cstdio +++ b/libstdc++-v3/include/tr1/cstdio @@ -33,7 +33,7 @@ #include <cstdio> -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) namespace std _GLIBCXX_VISIBILITY(default) { Index: b/libstdc++-v3/include/tr1/cstdlib =================================================================== --- a/libstdc++-v3/include/tr1/cstdlib +++ b/libstdc++-v3/include/tr1/cstdlib @@ -35,7 +35,7 @@ #if _GLIBCXX_HOSTED -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) namespace std _GLIBCXX_VISIBILITY(default) { Index: b/libstdc++-v3/include/tr1/cwchar =================================================================== --- a/libstdc++-v3/include/tr1/cwchar +++ b/libstdc++-v3/include/tr1/cwchar @@ -52,7 +52,7 @@ using std::vwscanf; #endif -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::wcstold; using std::wcstoll; using std::wcstoull; Index: b/libstdc++-v3/include/tr1/stdlib.h =================================================================== --- a/libstdc++-v3/include/tr1/stdlib.h +++ b/libstdc++-v3/include/tr1/stdlib.h @@ -33,7 +33,7 @@ #if _GLIBCXX_HOSTED -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::tr1::atoll; using std::tr1::strtoll; Index: b/libstdc++-v3/src/c++11/debug.cc =================================================================== --- a/libstdc++-v3/src/c++11/debug.cc +++ b/libstdc++-v3/src/c++11/debug.cc @@ -787,7 +787,7 @@ int __n __attribute__ ((__unused__)), const char* __fmt, _Tp __s) const throw () { -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) std::snprintf(__buf, __n, __fmt, __s); #else std::sprintf(__buf, __fmt, __s); Index: b/libstdc++-v3/include/c_global/cstdio =================================================================== --- a/libstdc++-v3/include/c_global/cstdio +++ b/libstdc++-v3/include/c_global/cstdio @@ -139,7 +139,7 @@ using ::vsprintf; } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef snprintf #undef vfscanf
shibajee/buildroot
package/gcc/4.8.5/850-libstdcxx-uclibc-c99.patch
patch
mit
9,223
From afe990251bd9b3a063f03da31a3b8d139d033bc3 Mon Sep 17 00:00:00 2001 From: ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Sat, 1 Jun 2013 00:20:49 +0000 Subject: [PATCH] PR other/56780 * libiberty/configure.ac: Move test for --enable-install-libiberty outside of the 'with_target_subdir' test so that it actually gets run. Add output messages to show the test result. * libiberty/configure: Regenerate. * libiberty/Makefile.in (install_to_libdir): Place the installation of the libiberty library in the same guard as that used for the headers to prevent it being installed unless requested via --enable-install-libiberty. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199570 138bc75d-0d04-0410-961f-82ee72b054a4 libiberty: fix --enable-install-libiberty flag [PR 56780] Commit 199570 fixed the --disable-install-libiberty behavior, but it also added a bug where the enable path never works because the initial clear of target_header_dir wasn't deleted. So we end up initializing properly at the top only to reset it at the end all the time. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206367 138bc75d-0d04-0410-961f-82ee72b054a4 [Romain squash the two upstream commits Remove the ChangeLog] Signed-off-by: Romain Naour <romain.naour@openwide.fr> --- libiberty/Makefile.in | 24 ++++++++++----------- libiberty/configure | 57 +++++++++++++++++++++++++++----------------------- libiberty/configure.ac | 47 ++++++++++++++++++++++------------------- 3 files changed, 68 insertions(+), 60 deletions(-) diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in index f6a3ebd..75ff82d 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in @@ -355,19 +355,19 @@ install-strip: install # since it will be passed the multilib flags. MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory` install_to_libdir: all - ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR) - $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n - ( cd $(DESTDIR)$(libdir)/$(MULTIOSDIR) ; chmod 644 $(TARGETLIB)n ;$(RANLIB) $(TARGETLIB)n ) - mv -f $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB) if test -n "${target_header_dir}"; then \ - case "${target_header_dir}" in \ - /*) thd=${target_header_dir};; \ - *) thd=${includedir}/${target_header_dir};; \ - esac; \ - ${mkinstalldirs} $(DESTDIR)$${thd}; \ - for h in ${INSTALLED_HEADERS}; do \ - ${INSTALL_DATA} $$h $(DESTDIR)$${thd}; \ - done; \ + ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR); \ + $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n; \ + ( cd $(DESTDIR)$(libdir)/$(MULTIOSDIR) ; chmod 644 $(TARGETLIB)n ;$(RANLIB) $(TARGETLIB)n ); \ + mv -f $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB); \ + case "${target_header_dir}" in \ + /*) thd=${target_header_dir};; \ + *) thd=${includedir}/${target_header_dir};; \ + esac; \ + ${mkinstalldirs} $(DESTDIR)$${thd}; \ + for h in ${INSTALLED_HEADERS}; do \ + ${INSTALL_DATA} $$h $(DESTDIR)$${thd}; \ + done; \ fi @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install diff --git a/libiberty/configure b/libiberty/configure index 5367027..4feb95a 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -675,8 +675,8 @@ with_cross_host with_newlib enable_maintainer_mode enable_multilib -enable_largefile enable_install_libiberty +enable_largefile ' ac_precious_vars='build_alias host_alias @@ -1303,8 +1303,8 @@ Optional Features: enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-multilib build many library versions (default) + --enable-install-libiberty Install headers and library for end users --disable-largefile omit support for large files - --enable-install-libiberty Install headers for end users Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -2784,6 +2784,35 @@ if test $cross_compiling = no && test $multilib = yes \ cross_compiling=maybe fi +# We may wish to install the target headers somewhere. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to install libiberty headers and static library" >&5 +$as_echo_n "checking whether to install libiberty headers and static library... " >&6; } + +# Check whether --enable-install-libiberty was given. +if test "${enable_install_libiberty+set}" = set; then : + enableval=$enable_install_libiberty; enable_install_libiberty=$enableval +else + enable_install_libiberty=no +fi + +# Option parsed, now set things appropriately. +case x"$enable_install_libiberty" in + xyes|x) + target_header_dir=libiberty + ;; + xno) + target_header_dir= + ;; + *) + # This could be sanity-checked in various ways... + target_header_dir="${enable_install_libiberty}" + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_install_libiberty" >&5 +$as_echo "$enable_install_libiberty" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: target_header_dir = $target_header_dir" >&5 +$as_echo "$as_me: target_header_dir = $target_header_dir" >&6;} + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -5476,7 +5505,6 @@ fi setobjs= CHECK= -target_header_dir= if test -n "${with_target_subdir}"; then # We are being configured as a target library. AC_REPLACE_FUNCS @@ -5759,29 +5787,6 @@ _ACEOF esac - # We may wish to install the target headers somewhere. - # Check whether --enable-install-libiberty was given. -if test "${enable_install_libiberty+set}" = set; then : - enableval=$enable_install_libiberty; enable_install_libiberty=$enableval -else - enable_install_libiberty=no -fi - - # Option parsed, now set things appropriately. - case x"$enable_install_libiberty" in - xyes|x) - target_header_dir=libiberty - ;; - xno) - target_header_dir= - ;; - *) - # This could be sanity-checked in various ways... - target_header_dir="${enable_install_libiberty}" - ;; - esac - - else # Not a target library, so we set things up to run the test suite. diff --git a/libiberty/configure.ac b/libiberty/configure.ac index c763894..f17e6b6 100644 --- a/libiberty/configure.ac +++ b/libiberty/configure.ac @@ -128,6 +128,31 @@ if test $cross_compiling = no && test $multilib = yes \ cross_compiling=maybe fi +# We may wish to install the target headers somewhere. +AC_MSG_CHECKING([whether to install libiberty headers and static library]) +dnl install-libiberty is disabled by default + +AC_ARG_ENABLE(install-libiberty, +[ --enable-install-libiberty Install headers and library for end users], +enable_install_libiberty=$enableval, +enable_install_libiberty=no)dnl + +# Option parsed, now set things appropriately. +case x"$enable_install_libiberty" in + xyes|x) + target_header_dir=libiberty + ;; + xno) + target_header_dir= + ;; + *) + # This could be sanity-checked in various ways... + target_header_dir="${enable_install_libiberty}" + ;; +esac +AC_MSG_RESULT($enable_install_libiberty) +AC_MSG_NOTICE([target_header_dir = $target_header_dir]) + GCC_NO_EXECUTABLES AC_PROG_CC AC_SYS_LARGEFILE @@ -380,7 +405,6 @@ fi setobjs= CHECK= -target_header_dir= if test -n "${with_target_subdir}"; then # We are being configured as a target library. AC_REPLACE_FUNCS @@ -492,27 +516,6 @@ if test -n "${with_target_subdir}"; then esac - # We may wish to install the target headers somewhere. - AC_ARG_ENABLE(install-libiberty, - [ --enable-install-libiberty Install headers for end users], - enable_install_libiberty=$enableval, - enable_install_libiberty=no)dnl - - # Option parsed, now set things appropriately. - case x"$enable_install_libiberty" in - xyes|x) - target_header_dir=libiberty - ;; - xno) - target_header_dir= - ;; - *) - # This could be sanity-checked in various ways... - target_header_dir="${enable_install_libiberty}" - ;; - esac - - else # Not a target library, so we set things up to run the test suite. -- 1.9.3
shibajee/buildroot
package/gcc/4.8.5/851-PR-other-56780.patch
patch
mit
8,221
From 6d852ffb43b111a39162135c95249e749c4e285b Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Thu, 6 Aug 2015 01:16:02 +0300 Subject: [PATCH] xtensa: add -mauto-litpools option With support from assembler this option allows compiling huge functions, where single literal pool at the beginning of a function may not be reachable by L32R instructions at its end. Currently assembler --auto-litpools option cannot deal with literals used from multiple locations separated by more than 256 KBytes of code. Don't turn constants into literals, instead use MOVI instruction to load them into registers and let the assembler turn them into literals as necessary. 2015-08-12 Max Filippov <jcmvbkbc@gmail.com> gcc/ * config/xtensa/constraints.md (define_constraint "Y"): New constraint. * config/xtensa/elf.h (ASM_SPEC): Add m(no-)auto-litpools. * config/xtensa/linux.h (ASM_SPEC): Likewise. * config/xtensa/predicates.md (move_operand): Match constants and symbols in the presence of TARGET_AUTO_LITPOOLS. * config/xtensa/xtensa.c (xtensa_valid_move): Don't allow immediate references to TLS data. (xtensa_emit_move_sequence): Don't force constants to memory in the presence of TARGET_AUTO_LITPOOLS. (print_operand): Add 'y' format, same as default, but capable of printing SF mode constants as well. * config/xtensa/xtensa.md (movsi_internal, movhi_internal) (movsf_internal): Add movi pattern that loads literal. (movsf, movdf): Don't force constants to memory in the presence of TARGET_AUTO_LITPOOLS. (movdf_internal): Add 'Y' constraint. * config/xtensa/xtensa.opt (mauto-litpools): New option. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: r226828 Changes to ChangeLogs and documentation are dropped. gcc/config/xtensa/constraints.md | 5 +++++ gcc/config/xtensa/elf.h | 4 +++- gcc/config/xtensa/linux.h | 4 +++- gcc/config/xtensa/predicates.md | 3 ++- gcc/config/xtensa/xtensa.c | 19 ++++++++++++++++++- gcc/config/xtensa/xtensa.md | 35 +++++++++++++++++++---------------- gcc/config/xtensa/xtensa.opt | 4 ++++ 7 files changed, 54 insertions(+), 20 deletions(-) diff --git a/gcc/config/xtensa/constraints.md b/gcc/config/xtensa/constraints.md index 30f4c1f..773d4f9 100644 --- a/gcc/config/xtensa/constraints.md +++ b/gcc/config/xtensa/constraints.md @@ -111,6 +111,11 @@ (and (match_code "const_int") (match_test "xtensa_mask_immediate (ival)"))) +(define_constraint "Y" + "A constant that can be used in relaxed MOVI instructions." + (and (match_code "const_int,const_double,const,symbol_ref,label_ref") + (match_test "TARGET_AUTO_LITPOOLS"))) + ;; Memory constraints. Do not use define_memory_constraint here. Doing so ;; causes reload to force some constants into the constant pool, but since ;; the Xtensa constant pool can only be accessed with L32R instructions, it diff --git a/gcc/config/xtensa/elf.h b/gcc/config/xtensa/elf.h index e59bede..12056f7 100644 --- a/gcc/config/xtensa/elf.h +++ b/gcc/config/xtensa/elf.h @@ -48,7 +48,9 @@ along with GCC; see the file COPYING3. If not see %{mtarget-align:--target-align} \ %{mno-target-align:--no-target-align} \ %{mlongcalls:--longcalls} \ - %{mno-longcalls:--no-longcalls}" + %{mno-longcalls:--no-longcalls} \ + %{mauto-litpools:--auto-litpools} \ + %{mno-auto-litpools:--no-auto-litpools}" #undef LIB_SPEC #define LIB_SPEC "-lc -lsim -lc -lhandlers-sim -lhal" diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h index 675aacf..5b0243a 100644 --- a/gcc/config/xtensa/linux.h +++ b/gcc/config/xtensa/linux.h @@ -42,7 +42,9 @@ along with GCC; see the file COPYING3. If not see %{mtarget-align:--target-align} \ %{mno-target-align:--no-target-align} \ %{mlongcalls:--longcalls} \ - %{mno-longcalls:--no-longcalls}" + %{mno-longcalls:--no-longcalls} \ + %{mauto-litpools:--auto-litpools} \ + %{mno-auto-litpools:--no-auto-litpools}" #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" diff --git a/gcc/config/xtensa/predicates.md b/gcc/config/xtensa/predicates.md index e02209e..d7dfa11 100644 --- a/gcc/config/xtensa/predicates.md +++ b/gcc/config/xtensa/predicates.md @@ -142,7 +142,8 @@ (match_test "GET_MODE_CLASS (mode) == MODE_INT && xtensa_simm12b (INTVAL (op))")) (and (match_code "const_int,const_double,const,symbol_ref,label_ref") - (match_test "TARGET_CONST16 && CONSTANT_P (op) + (match_test "(TARGET_CONST16 || TARGET_AUTO_LITPOOLS) + && CONSTANT_P (op) && GET_MODE_SIZE (mode) % UNITS_PER_WORD == 0"))))) ;; Accept the floating point constant 1 in the appropriate mode. diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index eb039ba..206ff80 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -501,6 +501,9 @@ xtensa_valid_move (machine_mode mode, rtx *operands) { int dst_regnum = xt_true_regnum (operands[0]); + if (xtensa_tls_referenced_p (operands[1])) + return FALSE; + /* The stack pointer can only be assigned with a MOVSP opcode. */ if (dst_regnum == STACK_POINTER_REGNUM) return !TARGET_WINDOWED_ABI @@ -1069,7 +1072,7 @@ xtensa_emit_move_sequence (rtx *operands, machine_mode mode) return 1; } - if (! TARGET_CONST16) + if (! TARGET_AUTO_LITPOOLS && ! TARGET_CONST16) { src = force_const_mem (SImode, src); operands[1] = src; @@ -2449,6 +2452,20 @@ print_operand (FILE *file, rtx x, int letter) } break; + case 'y': + if (GET_CODE (x) == CONST_DOUBLE && + GET_MODE (x) == SFmode) + { + REAL_VALUE_TYPE r; + long l; + REAL_VALUE_FROM_CONST_DOUBLE (r, x); + REAL_VALUE_TO_TARGET_SINGLE (r, l); + fprintf (file, "0x%08lx", l); + break; + } + + /* fall through */ + default: if (GET_CODE (x) == REG || GET_CODE (x) == SUBREG) fprintf (file, "%s", reg_names[xt_true_regnum (x)]); diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index 6d84384..0e673a3 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -761,8 +761,8 @@ }) (define_insn "movsi_internal" - [(set (match_operand:SI 0 "nonimmed_operand" "=D,D,D,D,R,R,a,q,a,W,a,a,U,*a,*A") - (match_operand:SI 1 "move_operand" "M,D,d,R,D,d,r,r,I,i,T,U,r,*A,*r"))] + [(set (match_operand:SI 0 "nonimmed_operand" "=D,D,D,D,R,R,a,q,a,a,W,a,a,U,*a,*A") + (match_operand:SI 1 "move_operand" "M,D,d,R,D,d,r,r,I,Y,i,T,U,r,*A,*r"))] "xtensa_valid_move (SImode, operands)" "@ movi.n\t%0, %x1 @@ -774,15 +774,16 @@ mov\t%0, %1 movsp\t%0, %1 movi\t%0, %x1 + movi\t%0, %1 const16\t%0, %t1\;const16\t%0, %b1 %v1l32r\t%0, %1 %v1l32i\t%0, %1 %v0s32i\t%1, %0 rsr\t%0, ACCLO wsr\t%1, ACCLO" - [(set_attr "type" "move,move,move,load,store,store,move,move,move,move,load,load,store,rsr,wsr") + [(set_attr "type" "move,move,move,load,store,store,move,move,move,move,move,load,load,store,rsr,wsr") (set_attr "mode" "SI") - (set_attr "length" "2,2,2,2,2,2,3,3,3,6,3,3,3,3,3")]) + (set_attr "length" "2,2,2,2,2,2,3,3,3,3,6,3,3,3,3,3")]) ;; 16-bit Integer moves @@ -796,21 +797,22 @@ }) (define_insn "movhi_internal" - [(set (match_operand:HI 0 "nonimmed_operand" "=D,D,a,a,a,U,*a,*A") - (match_operand:HI 1 "move_operand" "M,d,r,I,U,r,*A,*r"))] + [(set (match_operand:HI 0 "nonimmed_operand" "=D,D,a,a,a,a,U,*a,*A") + (match_operand:HI 1 "move_operand" "M,d,r,I,Y,U,r,*A,*r"))] "xtensa_valid_move (HImode, operands)" "@ movi.n\t%0, %x1 mov.n\t%0, %1 mov\t%0, %1 movi\t%0, %x1 + movi\t%0, %1 %v1l16ui\t%0, %1 %v0s16i\t%1, %0 rsr\t%0, ACCLO wsr\t%1, ACCLO" - [(set_attr "type" "move,move,move,move,load,store,rsr,wsr") + [(set_attr "type" "move,move,move,move,move,load,store,rsr,wsr") (set_attr "mode" "HI") - (set_attr "length" "2,2,3,3,3,3,3,3")]) + (set_attr "length" "2,2,3,3,3,3,3,3,3")]) ;; 8-bit Integer moves @@ -881,7 +883,7 @@ (match_operand:SF 1 "general_operand" ""))] "" { - if (!TARGET_CONST16 && CONSTANT_P (operands[1])) + if (!TARGET_CONST16 && !TARGET_AUTO_LITPOOLS && CONSTANT_P (operands[1])) operands[1] = force_const_mem (SFmode, operands[1]); if ((!register_operand (operands[0], SFmode) @@ -896,8 +898,8 @@ }) (define_insn "movsf_internal" - [(set (match_operand:SF 0 "nonimmed_operand" "=f,f,U,D,D,R,a,f,a,W,a,a,U") - (match_operand:SF 1 "move_operand" "f,U,f,d,R,d,r,r,f,iF,T,U,r"))] + [(set (match_operand:SF 0 "nonimmed_operand" "=f,f,U,D,D,R,a,f,a,a,W,a,a,U") + (match_operand:SF 1 "move_operand" "f,U,f,d,R,d,r,r,f,Y,iF,T,U,r"))] "((register_operand (operands[0], SFmode) || register_operand (operands[1], SFmode)) && !(FP_REG_P (xt_true_regnum (operands[0])) @@ -912,13 +914,14 @@ mov\t%0, %1 wfr\t%0, %1 rfr\t%0, %1 + movi\t%0, %y1 const16\t%0, %t1\;const16\t%0, %b1 %v1l32r\t%0, %1 %v1l32i\t%0, %1 %v0s32i\t%1, %0" - [(set_attr "type" "farith,fload,fstore,move,load,store,move,farith,farith,move,load,load,store") + [(set_attr "type" "farith,fload,fstore,move,load,store,move,farith,farith,move,move,load,load,store") (set_attr "mode" "SF") - (set_attr "length" "3,3,3,2,2,2,3,3,3,6,3,3,3")]) + (set_attr "length" "3,3,3,2,2,2,3,3,3,3,6,3,3,3")]) (define_insn "*lsiu" [(set (match_operand:SF 0 "register_operand" "=f") @@ -991,7 +994,7 @@ (match_operand:DF 1 "general_operand" ""))] "" { - if (CONSTANT_P (operands[1]) && !TARGET_CONST16) + if (CONSTANT_P (operands[1]) && !TARGET_CONST16 && !TARGET_AUTO_LITPOOLS) operands[1] = force_const_mem (DFmode, operands[1]); if (!register_operand (operands[0], DFmode) @@ -1002,8 +1005,8 @@ }) (define_insn_and_split "movdf_internal" - [(set (match_operand:DF 0 "nonimmed_operand" "=a,W,a,a,U") - (match_operand:DF 1 "move_operand" "r,iF,T,U,r"))] + [(set (match_operand:DF 0 "nonimmed_operand" "=a,a,W,a,a,U") + (match_operand:DF 1 "move_operand" "r,Y,iF,T,U,r"))] "register_operand (operands[0], DFmode) || register_operand (operands[1], DFmode)" "#" diff --git a/gcc/config/xtensa/xtensa.opt b/gcc/config/xtensa/xtensa.opt index 2fd6cee..21c6e96 100644 --- a/gcc/config/xtensa/xtensa.opt +++ b/gcc/config/xtensa/xtensa.opt @@ -38,6 +38,10 @@ mtext-section-literals Target Intersperse literal pools with code in the text section +mauto-litpools +Target Report Mask(AUTO_LITPOOLS) +Relax literals in assembler and place them automatically in the text section + mserialize-volatile Target Report Mask(SERIALIZE_VOLATILE) -mno-serialize-volatile Do not serialize volatile memory references with MEMW instructions -- 1.8.1.4
shibajee/buildroot
package/gcc/4.8.5/870-xtensa-add-mauto-litpools-option.patch
patch
mit
10,692
From 05154174b369505238b759cf80d595d8cfc8c731 Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Mon, 10 Aug 2015 21:35:20 +0300 Subject: [PATCH 1/3] xtensa: reimplement register spilling Spilling windowed registers in userspace is much easier, more portable, less error-prone and equally effective as in kernel. Now that register spilling syscall is considered obsolete in the xtensa linux kernel replace it with CALL12 followed by series of ENTRY in libgcc. 2015-08-18 Max Filippov <jcmvbkbc@gmail.com> libgcc/ * config/xtensa/lib2funcs.S (__xtensa_libgcc_window_spill): Use CALL12 followed by series of ENTRY to spill windowed registers. (__xtensa_nonlocal_goto): Call __xtensa_libgcc_window_spill instead of making linux spill syscall. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: r226962 libgcc/config/xtensa/lib2funcs.S | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/libgcc/config/xtensa/lib2funcs.S b/libgcc/config/xtensa/lib2funcs.S index 3ac8c1d..2e678af 100644 --- a/libgcc/config/xtensa/lib2funcs.S +++ b/libgcc/config/xtensa/lib2funcs.S @@ -33,10 +33,29 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see .global __xtensa_libgcc_window_spill .type __xtensa_libgcc_window_spill,@function __xtensa_libgcc_window_spill: - entry sp, 32 - movi a2, 0 - syscall + entry sp, 48 +#if XCHAL_NUM_AREGS > 16 + call12 1f + retw + .align 4 +1: + .rept (XCHAL_NUM_AREGS - 24) / 12 + _entry sp, 48 + mov a12, a0 + .endr + _entry sp, 16 +#if XCHAL_NUM_AREGS % 12 == 0 + mov a4, a4 +#elif XCHAL_NUM_AREGS % 12 == 4 + mov a8, a8 +#elif XCHAL_NUM_AREGS % 12 == 8 + mov a12, a12 +#endif + retw +#else + mov a8, a8 retw +#endif .size __xtensa_libgcc_window_spill, .-__xtensa_libgcc_window_spill @@ -58,10 +77,7 @@ __xtensa_nonlocal_goto: entry sp, 32 /* Flush registers. */ - mov a5, a2 - movi a2, 0 - syscall - mov a2, a5 + call8 __xtensa_libgcc_window_spill /* Because the save area for a0-a3 is stored one frame below the one identified by a2, the only way to restore those -- 1.8.1.4
shibajee/buildroot
package/gcc/4.8.5/871-xtensa-reimplement-register-spilling.patch
patch
mit
2,140
From f66206679a0ad604f13673559f230160cd3d1189 Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Fri, 14 Aug 2015 02:45:02 +0300 Subject: [PATCH 2/3] xtensa: use unwind-dw2-fde-dip instead of unwind-dw2-fde This allows having exception cleanup code in binaries that don't register their unwind tables. 2015-08-18 Max Filippov <jcmvbkbc@gmail.com> libgcc/ * config/xtensa/t-xtensa (LIB2ADDEH): Replace unwind-dw2-fde with unwind-dw2-fde-dip. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: r226963 libgcc/config/xtensa/t-xtensa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgcc/config/xtensa/t-xtensa b/libgcc/config/xtensa/t-xtensa index 27399e6..66d0eb3 100644 --- a/libgcc/config/xtensa/t-xtensa +++ b/libgcc/config/xtensa/t-xtensa @@ -13,4 +13,4 @@ LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3 _udivsi3 _umodsi3 \ LIB2ADD = $(srcdir)/config/xtensa/lib2funcs.S LIB2ADDEH = $(srcdir)/config/xtensa/unwind-dw2-xtensa.c \ - $(srcdir)/unwind-dw2-fde.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + $(srcdir)/unwind-dw2-fde-dip.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c -- 1.8.1.4
shibajee/buildroot
package/gcc/4.8.5/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
patch
mit
1,164
From 15c7c4d39b317f0d902ef28fd43eca5c3369f891 Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Sat, 15 Aug 2015 05:12:11 +0300 Subject: [PATCH 3/3] xtensa: fix _Unwind_GetCFA Returning context->cfa in _Unwind_GetCFA makes CFA point one stack frame higher than what was actually used by code at context->ra. This results in invalid CFA value in signal frames and premature unwinding completion in forced unwinding used by uClibc NPTL thread cancellation. Returning context->sp from _Unwind_GetCFA makes all CFA values valid and matching code that used them. 2015-08-18 Max Filippov <jcmvbkbc@gmail.com> libgcc/ * config/xtensa/unwind-dw2-xtensa.c (_Unwind_GetCFA): Return context->sp instead of context->cfa. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: r226964 libgcc/config/xtensa/unwind-dw2-xtensa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgcc/config/xtensa/unwind-dw2-xtensa.c b/libgcc/config/xtensa/unwind-dw2-xtensa.c index 35f7797..ef6b900 100644 --- a/libgcc/config/xtensa/unwind-dw2-xtensa.c +++ b/libgcc/config/xtensa/unwind-dw2-xtensa.c @@ -130,7 +130,7 @@ _Unwind_GetGR (struct _Unwind_Context *context, int index) _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *context) { - return (_Unwind_Ptr) context->cfa; + return (_Unwind_Ptr) context->sp; } /* Overwrite the saved value for register INDEX in CONTEXT with VAL. */ -- 1.8.1.4
shibajee/buildroot
package/gcc/4.8.5/873-xtensa-fix-_Unwind_GetCFA.patch
patch
mit
1,447
From 70c2cb98fb129b4766b5da0f945dc41fd568c77a Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Sat, 22 Aug 2015 08:44:26 +0300 Subject: [PATCH] xtensa: add uclinux support 2015-10-03 Max Filippov <jcmvbkbc@gmail.com> gcc/ * config.gcc (xtensa*-*-uclinux*): New configuration. * config/xtensa/uclinux.h: New file. * config/xtensa/uclinux.opt: New file. libgcc/ * config.host (xtensa*-*-uclinux*): New configuration. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: r228450 gcc/config.gcc | 5 ++++ gcc/config/xtensa/uclinux.h | 69 +++++++++++++++++++++++++++++++++++++++++++ gcc/config/xtensa/uclinux.opt | 32 ++++++++++++++++++++ libgcc/config.host | 5 ++++ 4 files changed, 111 insertions(+) create mode 100644 gcc/config/xtensa/uclinux.h create mode 100644 gcc/config/xtensa/uclinux.opt diff --git a/gcc/config.gcc b/gcc/config.gcc index c52f5a8..56797bd 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -2995,6 +2995,11 @@ xtensa*-*-linux*) tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h" tmake_file="${tmake_file} xtensa/t-xtensa" ;; +xtensa*-*-uclinux*) + tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/uclinux.h" + tmake_file="${tmake_file} xtensa/t-xtensa" + extra_options="${extra_options} xtensa/uclinux.opt" + ;; am33_2.0-*-linux*) tm_file="mn10300/mn10300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h" gas=yes gnu_ld=yes diff --git a/gcc/config/xtensa/uclinux.h b/gcc/config/xtensa/uclinux.h new file mode 100644 index 0000000..4606020 --- /dev/null +++ b/gcc/config/xtensa/uclinux.h @@ -0,0 +1,69 @@ +/* Xtensa uClinux configuration. + Derived from the configuration for GCC for Intel i386 running Linux. + Copyright (C) 2001-2015 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +<http://www.gnu.org/licenses/>. */ + +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + GNU_USER_TARGET_OS_CPP_BUILTINS (); \ + builtin_define ("__uClinux__"); \ + } \ + while (0) + +#undef SUBTARGET_CPP_SPEC +#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" + +#undef SIZE_TYPE +#define SIZE_TYPE "unsigned int" + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE "int" + +#undef WCHAR_TYPE +#define WCHAR_TYPE "long int" + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE 32 + +#undef ASM_SPEC +#define ASM_SPEC \ + "%{mtext-section-literals:--text-section-literals} \ + %{mno-text-section-literals:--no-text-section-literals} \ + %{mtarget-align:--target-align} \ + %{mno-target-align:--no-target-align} \ + %{mlongcalls:--longcalls} \ + %{mno-longcalls:--no-longcalls} \ + %{mauto-litpools:--auto-litpools} \ + %{mno-auto-litpools:--no-auto-litpools}" + +#undef LINK_SPEC +#define LINK_SPEC "%{!no-elf2flt:%{!elf2flt*:-elf2flt}}" + +#undef LOCAL_LABEL_PREFIX +#define LOCAL_LABEL_PREFIX "." + +/* Always enable "-fpic" for Xtensa Linux. */ +#define XTENSA_ALWAYS_PIC 1 + +#undef TARGET_LIBC_HAS_FUNCTION +#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function + +#undef DBX_REGISTER_NUMBER + diff --git a/gcc/config/xtensa/uclinux.opt b/gcc/config/xtensa/uclinux.opt new file mode 100644 index 0000000..95ef777 --- /dev/null +++ b/gcc/config/xtensa/uclinux.opt @@ -0,0 +1,32 @@ +; Xtensa uClinux options. + +; Copyright (C) 2015 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 3, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; You should have received a copy of the GNU General Public License +; along with GCC; see the file COPYING3. If not see +; <http://www.gnu.org/licenses/>. + +; See the GCC internals manual (options.texi) for a description of +; this file's format. + +; Please try to keep this file in ASCII collating order. + +elf2flt +Driver + +elf2flt= +Driver JoinedOrMissing + +; This comment is to ensure we retain the blank line above. diff --git a/libgcc/config.host b/libgcc/config.host index 2c64756..2ee92c1 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1295,6 +1295,11 @@ xtensa*-*-linux*) tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc" md_unwind_header=xtensa/linux-unwind.h ;; +xtensa*-*-uclinux*) + tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc" + md_unwind_header=xtensa/linux-unwind.h + extra_parts="$extra_parts crtbeginS.o crtbeginT.o crtendS.o" + ;; am33_2.0-*-linux*) # Don't need crtbeginT.o from *-*-linux* default. extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" -- 1.8.1.4
shibajee/buildroot
package/gcc/4.8.5/874-xtensa-add-uclinux-support.patch
patch
mit
5,634
remove unused header, which breaks the toolchain building Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> diff -Nur gcc-4.8.5.orig/libgcc/config/m68k/linux-atomic.c gcc-4.8.5/libgcc/config/m68k/linux-atomic.c --- gcc-4.8.5.orig/libgcc/config/m68k/linux-atomic.c 2013-02-04 20:06:20.000000000 +0100 +++ gcc-4.8.5/libgcc/config/m68k/linux-atomic.c 2016-03-19 00:18:12.000000000 +0100 @@ -33,7 +33,6 @@ using the kernel helper defined below. There is no support for 64-bit operations yet. */ -#include <asm/unistd.h> #include <stdbool.h> #ifndef __NR_atomic_cmpxchg_32
shibajee/buildroot
package/gcc/4.8.5/890-fix-m68k-compile.patch
patch
mit
587
avoids internal compiler error while compiling linux-atomic.c See here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53833 Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> diff -Nur gcc-4.8.5.orig/libgcc/config.host gcc-4.8.5/libgcc/config.host --- gcc-4.8.5.orig/libgcc/config.host 2014-03-20 17:12:30.000000000 +0100 +++ gcc-4.8.5/libgcc/config.host 2016-04-27 15:04:01.521171537 +0200 @@ -689,7 +689,7 @@ m68k*-*-openbsd*) ;; m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux with uClibc - tmake_file="$tmake_file m68k/t-floatlib m68k/t-linux" + tmake_file="$tmake_file m68k/t-floatlib" md_unwind_header=m68k/linux-unwind.h ;; m68k-*-linux*) # Motorola m68k's running GNU/Linux
shibajee/buildroot
package/gcc/4.8.5/891-fix-m68k-uclinux.patch
patch
mit
704
Add musl support to gcc This patch comes from the musl-cross project at https://bitbucket.org/GregorR/musl-cross/src. Compared to the upstream version: * the config.sub modifications have been removed, because Buildroot already overwrites all config.sub with a more recent config.sub that has musl support. * change to ensure that a dummy dynamic linker path MUSL_DYNAMIC_LINKER<foo> is defined for all architectures, otherwise building gcc for architectures not supported by musl was causing build failure. Bug reported upstream at https://bitbucket.org/GregorR/musl-gcc-patches/issue/4/musl-gcc-patches-break-the-build-on. * change the USE_PT_GNU_EH_FRAME logic to keep the existing gcc logic and only add the musl one as an addition, not as a replacement. Not doing this breaks C++ exception handling with glibc, because USE_PT_GNU_EH_FRAME doesn't get defined due to the configure script not testing dl_iterate_phdr() on any system except Solaris. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> [Gustavo: Update for gcc 4.8.3] Index: b/fixincludes/mkfixinc.sh =================================================================== --- a/fixincludes/mkfixinc.sh +++ b/fixincludes/mkfixinc.sh @@ -19,7 +19,8 @@ powerpc-*-eabi* | \ powerpc-*-rtems* | \ powerpcle-*-eabisim* | \ - powerpcle-*-eabi* ) + powerpcle-*-eabi* | \ + *-musl* ) # IF there is no include fixing, # THEN create a no-op fixer and exit (echo "#! /bin/sh" ; echo "exit 0" ) > ${target} Index: b/gcc/config/aarch64/aarch64-linux.h =================================================================== --- a/gcc/config/aarch64/aarch64-linux.h +++ b/gcc/config/aarch64/aarch64-linux.h @@ -21,7 +21,12 @@ #ifndef GCC_AARCH64_LINUX_H #define GCC_AARCH64_LINUX_H +/* The AArch64 port currently supports two dynamic linkers: + - ld-linux-aarch64.so.1 - GLIBC dynamic linker + - ld-musl-aarch64.so.1 - musl libc dynamic linker */ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64.so.1" +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64.so.1" #define CPP_SPEC "%{pthread:-D_REENTRANT}" Index: b/gcc/config/arm/linux-eabi.h =================================================================== --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -77,6 +77,23 @@ %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" +/* For ARM musl currently supports four dynamic linkers: + - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI + - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI + - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB + - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB + musl does not support the legacy OABI mode. + All the dynamic linkers live in /lib. + We default to soft-float, EL. */ +#undef MUSL_DYNAMIC_LINKER +#if TARGET_BIG_ENDIAN_DEFAULT +#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}" +#else +#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}" +#endif +#define MUSL_DYNAMIC_LINKER \ + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to use the GNU/Linux version, not the generic BPABI version. */ #undef LINK_SPEC Index: b/gcc/config/i386/linux64.h =================================================================== --- a/gcc/config/i386/linux64.h +++ b/gcc/config/i386/linux64.h @@ -30,3 +30,10 @@ #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" + +#undef MUSL_DYNAMIC_LINKER32 +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1" +#undef MUSL_DYNAMIC_LINKER64 +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1" +#undef MUSL_DYNAMIC_LINKERX32 +#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1" Index: b/gcc/config/i386/linux.h =================================================================== --- a/gcc/config/i386/linux.h +++ b/gcc/config/i386/linux.h @@ -21,3 +21,5 @@ #define GNU_USER_LINK_EMULATION "elf_i386" #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1" Index: b/gcc/config/linux.h =================================================================== --- a/gcc/config/linux.h +++ b/gcc/config/linux.h @@ -32,10 +32,12 @@ #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) #else #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) +#define OPTION_MUSL (linux_libc == LIBC_MUSL) #endif #define GNU_USER_TARGET_OS_CPP_BUILTINS() \ @@ -53,18 +55,21 @@ uClibc or Bionic is the default C library and whether -muclibc or -mglibc or -mbionic has been passed to change the default. */ -#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \ - "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}" +#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \ + "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}" #if DEFAULT_LIBC == LIBC_GLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ - CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B) +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ + CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M) #elif DEFAULT_LIBC == LIBC_UCLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ - CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B) +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ + CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M) #elif DEFAULT_LIBC == LIBC_BIONIC -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ - CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U) +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ + CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M) +#elif DEFAULT_LIBC == LIBC_MUSL +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ + CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B) #else #error "Unsupported DEFAULT_LIBC" #endif /* DEFAULT_LIBC */ @@ -82,23 +87,32 @@ #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64" #define BIONIC_DYNAMIC_LINKERX32 "/system/bin/linkerx32" +/* Musl dynamic linker paths must be defined on a per-architecture + basis, for each architecture supported by Musl. However, in order + to let other architectures continue to build with other C + libraries, we provide a dummy definition of the following defines. */ +#define MUSL_DYNAMIC_LINKER "invalid" +#define MUSL_DYNAMIC_LINKER32 "invalid" +#define MUSL_DYNAMIC_LINKER64 "invalid" +#define MUSL_DYNAMIC_LINKERX32 "invalid" + #define GNU_USER_DYNAMIC_LINKER \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \ - BIONIC_DYNAMIC_LINKER) + BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) #define GNU_USER_DYNAMIC_LINKER32 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \ - BIONIC_DYNAMIC_LINKER32) + BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) #define GNU_USER_DYNAMIC_LINKER64 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \ - BIONIC_DYNAMIC_LINKER64) + BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) #define GNU_USER_DYNAMIC_LINKERX32 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \ - BIONIC_DYNAMIC_LINKERX32) + BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32) /* Determine whether the entire c99 runtime is present in the runtime library. */ #undef TARGET_C99_FUNCTIONS -#define TARGET_C99_FUNCTIONS (OPTION_GLIBC) +#define TARGET_C99_FUNCTIONS (OPTION_GLIBC || OPTION_MUSL) /* Whether we have sincos that follows the GNU extension. */ #undef TARGET_HAS_SINCOS @@ -107,3 +121,74 @@ /* Whether we have Bionic libc runtime */ #undef TARGET_HAS_BIONIC #define TARGET_HAS_BIONIC (OPTION_BIONIC) + +/* musl avoids problematic includes by rearranging the include directories. + * Unfortunately, this is mostly duplicated from cppdefault.c */ +#if DEFAULT_LIBC == LIBC_MUSL +#define INCLUDE_DEFAULTS_MUSL_GPP \ + { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \ + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \ + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \ + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \ + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \ + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, + +#ifdef LOCAL_INCLUDE_DIR +#define INCLUDE_DEFAULTS_MUSL_LOCAL \ + { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \ + { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 }, +#else +#define INCLUDE_DEFAULTS_MUSL_LOCAL +#endif + +#ifdef PREFIX_INCLUDE_DIR +#define INCLUDE_DEFAULTS_MUSL_PREFIX \ + { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0}, +#else +#define INCLUDE_DEFAULTS_MUSL_PREFIX +#endif + +#ifdef CROSS_INCLUDE_DIR +#define INCLUDE_DEFAULTS_MUSL_CROSS \ + { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0}, +#else +#define INCLUDE_DEFAULTS_MUSL_CROSS +#endif + +#ifdef TOOL_INCLUDE_DIR +#define INCLUDE_DEFAULTS_MUSL_TOOL \ + { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0}, +#else +#define INCLUDE_DEFAULTS_MUSL_TOOL +#endif + +#ifdef NATIVE_SYSTEM_HEADER_DIR +#define INCLUDE_DEFAULTS_MUSL_NATIVE \ + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, +#else +#define INCLUDE_DEFAULTS_MUSL_NATIVE +#endif + +#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT) +# undef INCLUDE_DEFAULTS_MUSL_LOCAL +# define INCLUDE_DEFAULTS_MUSL_LOCAL +# undef INCLUDE_DEFAULTS_MUSL_NATIVE +# define INCLUDE_DEFAULTS_MUSL_NATIVE +#else +# undef INCLUDE_DEFAULTS_MUSL_CROSS +# define INCLUDE_DEFAULTS_MUSL_CROSS +#endif + +#undef INCLUDE_DEFAULTS +#define INCLUDE_DEFAULTS \ + { \ + INCLUDE_DEFAULTS_MUSL_GPP \ + INCLUDE_DEFAULTS_MUSL_PREFIX \ + INCLUDE_DEFAULTS_MUSL_CROSS \ + INCLUDE_DEFAULTS_MUSL_TOOL \ + INCLUDE_DEFAULTS_MUSL_NATIVE \ + { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \ + { 0, 0, 0, 0, 0, 0 } \ + } +#endif Index: b/gcc/config/linux.opt =================================================================== --- a/gcc/config/linux.opt +++ b/gcc/config/linux.opt @@ -30,3 +30,7 @@ muclibc Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic) Use uClibc C library + +mmusl +Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc) +Use musl C library Index: b/gcc/config/microblaze/linux.h =================================================================== --- a/gcc/config/microblaze/linux.h +++ b/gcc/config/microblaze/linux.h @@ -25,7 +25,23 @@ #undef TLS_NEEDS_GOT #define TLS_NEEDS_GOT 1 -#define DYNAMIC_LINKER "/lib/ld.so.1" +#if TARGET_BIG_ENDIAN_DEFAULT == 0 /* LE */ +#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}" +#else +#define MUSL_DYNAMIC_LINKER_E "%{EL:el}" +#endif + +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-microblaze" MUSL_DYNAMIC_LINKER_E ".so.1" +#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + +#if DEFAULT_LIBC == LIBC_MUSL +#define DYNAMIC_LINKER MUSL_DYNAMIC_LINKER +#else +#define DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER +#endif + + #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ { "dynamic_linker", DYNAMIC_LINKER } Index: b/gcc/config/mips/linux64.h =================================================================== --- a/gcc/config/mips/linux64.h +++ b/gcc/config/mips/linux64.h @@ -29,4 +29,4 @@ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32" #define GNU_USER_DYNAMIC_LINKERN32 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \ - BIONIC_DYNAMIC_LINKERN32) + BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKER) Index: b/gcc/config/mips/linux.h =================================================================== --- a/gcc/config/mips/linux.h +++ b/gcc/config/mips/linux.h @@ -18,3 +18,11 @@ <http://www.gnu.org/licenses/>. */ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + +#if TARGET_ENDIAN_DEFAULT == 0 /* LE */ +#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}" +#else +#define MUSL_DYNAMIC_LINKER_E "%{EL:el}" +#endif +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" Index: b/gcc/config/rs6000/linux64.h =================================================================== --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -374,17 +374,23 @@ #endif #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" +#undef MUSL_DYNAMIC_LINKER32 +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1" +#undef MUSL_DYNAMIC_LINKER64 +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1" #if DEFAULT_LIBC == LIBC_UCLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" #elif DEFAULT_LIBC == LIBC_GLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" +#elif DEFAULT_LIBC == LIBC_MUSL +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" #else #error "Unsupported DEFAULT_LIBC" #endif #define GNU_USER_DYNAMIC_LINKER32 \ - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32) + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) #define GNU_USER_DYNAMIC_LINKER64 \ - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64) + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) #undef DEFAULT_ASM_ENDIAN #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN) Index: b/gcc/config/rs6000/secureplt.h =================================================================== --- a/gcc/config/rs6000/secureplt.h +++ b/gcc/config/rs6000/secureplt.h @@ -18,3 +18,4 @@ <http://www.gnu.org/licenses/>. */ #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt" +#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt" Index: b/gcc/config/rs6000/sysv4.h =================================================================== --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -537,6 +537,9 @@ #ifndef CC1_SECURE_PLT_DEFAULT_SPEC #define CC1_SECURE_PLT_DEFAULT_SPEC "" #endif +#ifndef LINK_SECURE_PLT_DEFAULT_SPEC +#define LINK_SECURE_PLT_DEFAULT_SPEC "" +#endif /* Pass -G xxx to the compiler. */ #define CC1_SPEC "%{G*} %(cc1_cpu)" \ @@ -585,7 +588,8 @@ /* Override the default target of the linker. */ #define LINK_TARGET_SPEC \ - ENDIAN_SELECT("", " --oformat elf32-powerpcle", "") + ENDIAN_SELECT("", " --oformat elf32-powerpcle", "") \ + "%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}" /* Any specific OS flags. */ #define LINK_OS_SPEC "\ @@ -763,15 +767,18 @@ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1" #if DEFAULT_LIBC == LIBC_UCLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" +#elif DEFAULT_LIBC == LIBC_MUSL +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" #else #error "Unsupported DEFAULT_LIBC" #endif #define GNU_USER_DYNAMIC_LINKER \ - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ %{rdynamic:-export-dynamic} \ @@ -894,6 +901,7 @@ { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \ { "link_os_default", LINK_OS_DEFAULT_SPEC }, \ { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \ + { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \ { "cpp_os_ads", CPP_OS_ADS_SPEC }, \ { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \ { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \ Index: b/gcc/config/sh/linux.h =================================================================== --- a/gcc/config/sh/linux.h +++ b/gcc/config/sh/linux.h @@ -43,7 +43,15 @@ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack +#if TARGET_BIG_ENDIAN_DEFAULT /* BE */ +#define MUSL_DYNAMIC_LINKER_E "eb" +#else +#define MUSL_DYNAMIC_LINKER_E +#endif + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E ".so.1" #undef SUBTARGET_LINK_EMUL_SUFFIX #define SUBTARGET_LINK_EMUL_SUFFIX "_linux" Index: b/gcc/config.gcc =================================================================== --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -550,7 +550,7 @@ esac # Common C libraries. -tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3" +tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4" # Common parts for widely ported systems. case ${target} in @@ -653,6 +653,9 @@ *-*-*uclibc*) tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" ;; + *-*-*musl*) + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL" + ;; *) tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" ;; @@ -2135,6 +2138,10 @@ powerpc*-*-linux*paired*) tm_file="${tm_file} rs6000/750cl.h" ;; esac + case ${target} in + *-linux*-musl*) + enable_secureplt=yes ;; + esac if test x${enable_secureplt} = xyes; then tm_file="rs6000/secureplt.h ${tm_file}" fi Index: b/gcc/configure =================================================================== --- a/gcc/configure +++ b/gcc/configure @@ -26936,6 +26940,9 @@ gcc_cv_target_dl_iterate_phdr=no fi ;; + *-linux-musl*) + gcc_cv_target_dl_iterate_phdr=yes + ;; esac if test x$gcc_cv_target_dl_iterate_phdr = xyes; then Index: b/gcc/configure.ac =================================================================== --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -4848,6 +4852,9 @@ gcc_cv_target_dl_iterate_phdr=no fi ;; + *-linux-musl*) + gcc_cv_target_dl_iterate_phdr=yes + ;; esac GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR]) if test x$gcc_cv_target_dl_iterate_phdr = xyes; then Index: b/gcc/ginclude/stddef.h =================================================================== --- a/gcc/ginclude/stddef.h +++ b/gcc/ginclude/stddef.h @@ -181,6 +181,7 @@ #ifndef _GCC_SIZE_T #ifndef _SIZET_ #ifndef __size_t +#ifndef __DEFINED_size_t /* musl */ #define __size_t__ /* BeOS */ #define __SIZE_T__ /* Cray Unicos/Mk */ #define _SIZE_T @@ -197,6 +198,7 @@ #define ___int_size_t_h #define _GCC_SIZE_T #define _SIZET_ +#define __DEFINED_size_t /* musl */ #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \ || defined(__FreeBSD_kernel__) /* __size_t is a typedef on FreeBSD 5, must not trash it. */ @@ -214,6 +216,7 @@ typedef long ssize_t; #endif /* __BEOS__ */ #endif /* !(defined (__GNUG__) && defined (size_t)) */ +#endif /* __DEFINED_size_t */ #endif /* __size_t */ #endif /* _SIZET_ */ #endif /* _GCC_SIZE_T */ Index: b/libgcc/unwind-dw2-fde-dip.c =================================================================== --- a/libgcc/unwind-dw2-fde-dip.c +++ b/libgcc/unwind-dw2-fde-dip.c @@ -75,6 +75,13 @@ # define USE_PT_GNU_EH_FRAME #endif +/* For musl libc, TARGET_DL_ITERATE_PHDR gets defined by the configure + script. */ +#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ + && defined(TARGET_DL_ITERATE_PHDR) +# define USE_PT_GNU_EH_FRAME +#endif + #if defined(USE_PT_GNU_EH_FRAME) #include <link.h> Index: b/libgomp/config/posix/time.c =================================================================== --- a/libgomp/config/posix/time.c +++ b/libgomp/config/posix/time.c @@ -28,6 +28,8 @@ The following implementation uses the most simple POSIX routines. If present, POSIX 4 clocks should be used instead. */ +#define _POSIX_C_SOURCE 199309L /* for clocks */ + #include "libgomp.h" #include <unistd.h> #if TIME_WITH_SYS_TIME Index: b/libitm/config/arm/hwcap.cc =================================================================== --- a/libitm/config/arm/hwcap.cc +++ b/libitm/config/arm/hwcap.cc @@ -40,7 +40,11 @@ #ifdef __linux__ #include <unistd.h> +#ifdef __GLIBC__ #include <sys/fcntl.h> +#else +#include <fcntl.h> +#endif #include <elf.h> static void __attribute__((constructor)) Index: b/libitm/config/linux/x86/tls.h =================================================================== --- a/libitm/config/linux/x86/tls.h +++ b/libitm/config/linux/x86/tls.h @@ -25,16 +25,19 @@ #ifndef LIBITM_X86_TLS_H #define LIBITM_X86_TLS_H 1 -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) +#if defined(__GLIBC_PREREQ) +#if __GLIBC_PREREQ(2, 10) /* Use slots in the TCB head rather than __thread lookups. GLIBC has reserved words 10 through 13 for TM. */ #define HAVE_ARCH_GTM_THREAD 1 #define HAVE_ARCH_GTM_THREAD_DISP 1 #endif +#endif #include "config/generic/tls.h" -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) +#if defined(__GLIBC_PREREQ) +#if __GLIBC_PREREQ(2, 10) namespace GTM HIDDEN { #ifdef __x86_64__ @@ -101,5 +104,6 @@ } // namespace GTM #endif /* >= GLIBC 2.10 */ +#endif #endif // LIBITM_X86_TLS_H Index: b/libstdc++-v3/configure.host =================================================================== --- a/libstdc++-v3/configure.host +++ b/libstdc++-v3/configure.host @@ -264,6 +264,13 @@ os_include_dir="os/bsd/freebsd" ;; gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) + # check for musl by target + case "${host_os}" in + *-musl*) + os_include_dir="os/generic" + ;; + *) + if [ "$uclibc" = "yes" ]; then os_include_dir="os/uclibc" elif [ "$bionic" = "yes" ]; then @@ -272,6 +279,9 @@ os_include_dir="os/gnu-linux" fi ;; + + esac + ;; hpux*) os_include_dir="os/hpux" ;;
shibajee/buildroot
package/gcc/4.8.5/900-musl-support.patch
patch
mit
22,690
disable split-stack for non-thread builds Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> diff -Nur gcc-4.8.5.orig/libgcc/config/t-stack gcc-4.8.5/libgcc/config/t-stack --- gcc-4.8.5.orig/libgcc/config/t-stack 2010-10-01 21:31:49.000000000 +0200 +++ gcc-4.8.5/libgcc/config/t-stack 2016-03-07 05:28:12.000000000 +0100 @@ -1,4 +1,6 @@ # Makefile fragment to provide generic support for -fsplit-stack. # This should be used in config.host for any host which supports # -fsplit-stack. +ifeq ($(enable_threads),yes) LIB2ADD_ST += $(srcdir)/generic-morestack.c $(srcdir)/generic-morestack-thread.c +endif
shibajee/buildroot
package/gcc/4.8.5/930-libgcc-disable-split-stack-nothreads.patch
patch
mit
609
Enable POSIX threads for uClinux targets Reported upstream: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71721 Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> diff -Nur gcc-4.8.5.orig/gcc/config.gcc gcc-4.8.5/gcc/config.gcc --- gcc-4.8.5.orig/gcc/config.gcc 2015-05-21 22:57:29.000000000 +0200 +++ gcc-4.8.5/gcc/config.gcc 2016-07-02 20:35:24.107644834 +0200 @@ -741,6 +741,9 @@ *-*-uclinux*) extra_options="$extra_options gnu-user.opt" use_gcc_stdint=wrap + case ${enable_threads} in + "" | yes | posix) thread_file='posix' ;; + esac tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC" ;; *-*-rdos*)
shibajee/buildroot
package/gcc/4.8.5/940-uclinux-enable-threads.patch
patch
mit
635
Index: gcc-4.8.0/contrib/regression/objs-gcc.sh =================================================================== --- gcc-4.8.0.orig/contrib/regression/objs-gcc.sh 2009-04-09 17:00:19.000000000 +0200 +++ gcc-4.8.0/contrib/regression/objs-gcc.sh 2013-03-23 17:39:04.000000000 +0100 @@ -106,6 +106,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
shibajee/buildroot
package/gcc/4.9.4/100-uclibc-conf.patch
patch
mit
704
http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00269.html On glibc the libc.so carries a copy of the math function copysignl() but on uClibc math functions like copysignl() live in libm. Since libgcc_s contains unresolved symbols, any attempt to link against libgcc_s without explicitely specifying -lm fails, resulting in a broken bootstrap of the compiler. Forward port to gcc 4.5.1 by Gustavo Zacarias <gustavo@zacarias.com.ar> --- libgcc/Makefile.in | 4 +++- libgcc/configure | 32 ++++++++++++++++++++++++++++++++ libgcc/configure.ac | 21 +++++++++++++++++++++ 3 files changed, 56 insertions(+), 1 deletion(-) Index: b/libgcc/Makefile.in =================================================================== --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -42,6 +42,7 @@ enable_vtable_verify = @enable_vtable_verify@ enable_decimal_float = @enable_decimal_float@ fixed_point = @fixed_point@ +LIBGCC_LIBM = @LIBGCC_LIBM@ host_noncanonical = @host_noncanonical@ target_noncanonical = @target_noncanonical@ @@ -943,9 +944,10 @@ @multilib_dir@,$(MULTIDIR),$(subst \ @shlib_objs@,$(objects) libgcc.a,$(subst \ @shlib_base_name@,libgcc_s,$(subst \ + @libgcc_libm@,$(LIBGCC_LIBM),$(subst \ @shlib_map_file@,$(mapfile),$(subst \ @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \ - @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK)))))))) + @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))) libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts) # @multilib_flags@ is still needed because this may use Index: b/libgcc/configure =================================================================== --- a/libgcc/configure +++ b/libgcc/configure @@ -564,6 +564,7 @@ tmake_file sfp_machine_header set_use_emutls +LIBGCC_LIBM set_have_cc_tls vis_hide fixed_point @@ -4535,6 +4536,37 @@ fi fi +# On powerpc libgcc_s references copysignl which is a libm function but +# glibc apparently also provides it via libc as opposed to uClibc where +# it lives in libm. +echo "$as_me:$LINENO: checking for library containing copysignl" >&5 +echo $ECHO_N "checking for library containing copysignl... $ECHO_C" >&6 +if test "${libgcc_cv_copysignl_lib+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + echo '#include <features.h>' > conftest.c + echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c + libgcc_cv_copysignl_lib="-lc" + if { ac_try='${CC-cc} -S conftest.c -o conftest.s 1>&5' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } + then + libgcc_cv_copysignl_lib="-lm" + fi + rm -f conftest.* + +fi +echo "$as_me:$LINENO: result: $libgcc_cv_copysignl_lib" >&5 +echo "${ECHO_T}$libgcc_cv_copysignl_lib" >&6 + +case /${libgcc_cv_copysignl_lib}/ in + /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;; + *) LIBGCC_LIBM= ;; +esac # Conditionalize the makefile for this target machine. tmake_file_= Index: b/libgcc/configure.ac =================================================================== --- a/libgcc/configure.ac +++ b/libgcc/configure.ac @@ -357,6 +357,27 @@ fi AC_SUBST(set_have_cc_tls) +# On powerpc libgcc_s references copysignl which is a libm function but +# glibc apparently also provides it via libc as opposed to uClibc where +# it lives in libm. +AC_CACHE_CHECK + libgcc_cv_copysignl_lib, + echo '#include <features.h>' > conftest.c + echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c + libgcc_cv_copysignl_lib="-lc" + if AC_TRY_COMMAND(${CC-cc} -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD) + then + libgcc_cv_copysignl_lib="-lm" + fi + rm -f conftest.* + ]) + +case /${libgcc_cv_copysignl_lib}/ in + /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;; + *) LIBGCC_LIBM= ;; +esac +AC_SUBST(LIBGCC_LIBM) + # See if we have emulated thread-local storage. GCC_CHECK_EMUTLS set_use_emutls=
shibajee/buildroot
package/gcc/4.9.4/1000-powerpc-link-with-math-lib.patch.conditional
conditional
mit
3,958
From b9a7775674d91c7af8043a83211ffeaa576327d7 Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Fri, 10 Apr 2015 17:46:30 +0300 Subject: [PATCH] Fix PR target/65730 2015-05-20 Max Filippov <jcmvbkbc@gmail.com> gcc/ * config/xtensa/xtensa.c (init_alignment_context): Replace MULT by BITS_PER_UNIT with ASHIFT by exact_log2 (BITS_PER_UNIT). Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223452 Changes to ChangeLog are dropped. gcc/config/xtensa/xtensa.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Index: b/gcc/config/xtensa/xtensa.c =================================================================== --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -1436,8 +1436,9 @@ if (ac->shift != NULL_RTX) { /* Shift is the byte count, but we need the bitcount. */ - ac->shift = expand_simple_binop (SImode, MULT, ac->shift, - GEN_INT (BITS_PER_UNIT), + gcc_assert (exact_log2 (BITS_PER_UNIT) >= 0); + ac->shift = expand_simple_binop (SImode, ASHIFT, ac->shift, + GEN_INT (exact_log2 (BITS_PER_UNIT)), NULL_RTX, 1, OPTAB_DIRECT); ac->modemask = expand_simple_binop (SImode, ASHIFT, GEN_INT (GET_MODE_MASK (mode)),
shibajee/buildroot
package/gcc/4.9.4/111-pr65730.patch
patch
mit
1,307
From 9bf6066d588632dab9f78932df15b5b4140f31f3 Mon Sep 17 00:00:00 2001 From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be> Date: Fri, 6 Nov 2015 14:27:23 +0100 Subject: [PATCH] gcc/config.gcc: fix typo for powerpc e6500 cpu_is_64bit Otherwise it is not recognized as a 64-bit powerpc and gcc will not generate 64-bit binaries by default. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> --- gcc/config.gcc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) Index: b/gcc/config.gcc =================================================================== --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -441,7 +441,7 @@ extra_headers="ppc-asm.h altivec.h spe.h ppu_intrinsics.h paired.h spu2vmx.h vec_types.h si2vmx.h htmintrin.h htmxlintrin.h" need_64bit_hwint=yes case x$with_cpu in - xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345678]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|Xe6500) + xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345678]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|xe6500) cpu_is_64bit=yes ;; esac
shibajee/buildroot
package/gcc/4.9.4/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch
patch
mit
1,078
From c037df1be41f8daf4d581d7ffa4ec8cfa640bccf Mon Sep 17 00:00:00 2001 From: glisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Fri, 25 Apr 2014 08:03:08 +0000 Subject: [PATCH] 2014-04-25 Marc Glisse <marc.glisse@inria.fr> PR target/43538 * mt-gnu: Don't reset CXXFLAGS_FOR_TARGET. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209784 138bc75d-0d04-0410-961f-82ee72b054a4 Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- config/mt-gnu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/mt-gnu b/config/mt-gnu index 15bf417..5c696f5 100644 --- a/config/mt-gnu +++ b/config/mt-gnu @@ -1 +1 @@ -CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -D_GNU_SOURCE +CXXFLAGS_FOR_TARGET += -D_GNU_SOURCE -- 2.1.4
shibajee/buildroot
package/gcc/4.9.4/130-pr43538.patch
patch
mit
738
From 3c536954a67a883630f4a7513a27f02a892c3dcb Mon Sep 17 00:00:00 2001 From: Evgeniy Stepanov <eugeni.stepanov@gmail.com> Date: Tue, 21 Oct 2014 21:08:13 +0000 Subject: [PATCH] [sanitizer] Fix build with _FILE_OFFSET_BITS=64. Sanitizer source is not affected by _FILE_OFFSET_BITS in general, but this one file must be built with 32-bit off_t. More details in the code. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220328 91177308-0d34-0410-b5e6-96231b3b80d8 Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- lib/sanitizer_common/sanitizer_platform_limits_posix.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc index bbc1108..fc09522 100644 --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc @@ -13,7 +13,15 @@ #include "sanitizer_platform.h" #if SANITIZER_LINUX || SANITIZER_MAC +// Tests in this file assume that off_t-dependent data structures match the +// libc ABI. For example, struct dirent here is what readdir() function (as +// exported from libc) returns, and not the user-facing "dirent", which +// depends on _FILE_OFFSET_BITS setting. +// To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS below. +#ifdef _FILE_OFFSET_BITS +#undef _FILE_OFFSET_BITS +#endif #include "sanitizer_internal_defs.h" #include "sanitizer_platform_limits_posix.h" -- 2.1.4
shibajee/buildroot
package/gcc/4.9.4/140-sanitizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch
patch
mit
1,552
Index: gcc-4.8.0/boehm-gc/include/gc.h =================================================================== --- gcc-4.8.0.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200 +++ gcc-4.8.0/boehm-gc/include/gc.h 2013-03-23 17:39:20.000000000 +0100 @@ -503,7 +503,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
shibajee/buildroot
package/gcc/4.9.4/301-missing-execinfo_h.patch
patch
mit
581
Index: b/gcc/config/arm/linux-elf.h =================================================================== --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -60,7 +60,7 @@ %{shared:-lc} \ %{!shared:%{profile:-lc_p}%{!profile:-lc}}" -#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" +#define LIBGCC_SPEC "-lgcc" #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" Index: b/libgcc/config/arm/t-linux =================================================================== --- a/libgcc/config/arm/t-linux +++ b/libgcc/config/arm/t-linux @@ -1,6 +1,11 @@ LIB1ASMSRC = arm/lib1funcs.S LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ - _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 + _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ + _arm_addsubdf3 _arm_addsubsf3 \ + _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ + _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ + _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ + _arm_fixsfsi _arm_fixunssfsi # Just for these, we omit the frame pointer since it makes such a big # difference.
shibajee/buildroot
package/gcc/4.9.4/810-arm-softfloat-libgcc.patch
patch
mit
1,089
http://sourceware.org/ml/crossgcc/2008-05/msg00009.html --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -45,7 +45,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 /* TARGET_BIG_ENDIAN_DEFAULT is set in config.gcc for big endian configurations. */
shibajee/buildroot
package/gcc/4.9.4/830-arm_unbreak_armv4t.patch
patch
mit
473
Fetched from Xilinx gcc git at https://github.com/Xilinx/gcc From 23c35173490ac2d6348a668dfc9c1a6eb62171f2 Mon Sep 17 00:00:00 2001 From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com> Date: Mon, 18 Jun 2012 20:18:13 +0200 Subject: [PATCH] [Patch, microblaze]: Enable DWARF exception handling support. Changelog 2013-03-18 Edgar E. Iglesias <edgar.iglesias@xilinx.com> David Holsgrove <david.holsgrove@xilinx.com> * common/config/microblaze/microblaze-common.c: Remove TARGET_EXCEPT_UNWIND_INFO definition. * config/microblaze/microblaze-protos.h: Add microblaze_eh_return prototype. * gcc/config/microblaze/microblaze.c: (microblaze_must_save_register, microblaze_expand_epilogue, microblaze_return_addr): Handle calls_eh_return (microblaze_eh_return): New function. * gcc/config/microblaze/microblaze.h: Define RETURN_ADDR_OFFSET, EH_RETURN_DATA_REGNO, MB_EH_STACKADJ_REGNUM, EH_RETURN_STACKADJ_RTX, ASM_PREFERRED_EH_DATA_FORMAT * gcc/config/microblaze/microblaze.md: Define eh_return pattern. Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> --- gcc/common/config/microblaze/microblaze-common.c | 3 --- gcc/config/microblaze/microblaze-protos.h | 1 + gcc/config/microblaze/microblaze.c | 29 ++++++++++++++++++++---- gcc/config/microblaze/microblaze.h | 15 ++++++++++++ gcc/config/microblaze/microblaze.md | 11 +++++++++ 5 files changed, 52 insertions(+), 7 deletions(-) Index: b/gcc/common/config/microblaze/microblaze-common.c =================================================================== --- a/gcc/common/config/microblaze/microblaze-common.c +++ b/gcc/common/config/microblaze/microblaze-common.c @@ -37,7 +37,4 @@ #undef TARGET_OPTION_OPTIMIZATION_TABLE #define TARGET_OPTION_OPTIMIZATION_TABLE microblaze_option_optimization_table -#undef TARGET_EXCEPT_UNWIND_INFO -#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info - struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER; Index: b/gcc/config/microblaze/microblaze-protos.h =================================================================== --- a/gcc/config/microblaze/microblaze-protos.h +++ b/gcc/config/microblaze/microblaze-protos.h @@ -54,6 +54,7 @@ extern int symbol_mentioned_p (rtx); extern int label_mentioned_p (rtx); extern bool microblaze_cannot_force_const_mem (enum machine_mode, rtx); +extern void microblaze_eh_return (rtx op0); #endif /* RTX_CODE */ /* Declare functions in microblaze-c.c. */ Index: b/gcc/config/microblaze/microblaze.c =================================================================== --- a/gcc/config/microblaze/microblaze.c +++ b/gcc/config/microblaze/microblaze.c @@ -1906,6 +1906,11 @@ if (frame_pointer_needed && (regno == HARD_FRAME_POINTER_REGNUM)) return 1; + if (crtl->calls_eh_return + && regno == MB_ABI_SUB_RETURN_ADDR_REGNUM) { + return 1; + } + if (!crtl->is_leaf) { if (regno == MB_ABI_SUB_RETURN_ADDR_REGNUM) @@ -1933,6 +1938,13 @@ return 1; } + if (crtl->calls_eh_return + && (regno == EH_RETURN_DATA_REGNO (0) + || regno == EH_RETURN_DATA_REGNO (1))) + { + return 1; + } + return 0; } @@ -2962,6 +2974,12 @@ emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, fsiz_rtx)); } + if (crtl->calls_eh_return) + emit_insn (gen_addsi3 (stack_pointer_rtx, + stack_pointer_rtx, + gen_rtx_raw_REG (SImode, + MB_EH_STACKADJ_REGNUM))); + emit_jump_insn (gen_return_internal (gen_rtx_REG (Pmode, GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM))); } @@ -3256,10 +3274,13 @@ if (count != 0) return NULL_RTX; - return gen_rtx_PLUS (Pmode, - get_hard_reg_initial_val (Pmode, - MB_ABI_SUB_RETURN_ADDR_REGNUM), - GEN_INT (8)); + return get_hard_reg_initial_val (Pmode, + MB_ABI_SUB_RETURN_ADDR_REGNUM); +} + +void microblaze_eh_return (rtx op0) +{ + emit_insn (gen_movsi(gen_rtx_MEM(Pmode, stack_pointer_rtx), op0)); } /* Queue an .ident string in the queue of top-level asm statements. Index: b/gcc/config/microblaze/microblaze.h =================================================================== --- a/gcc/config/microblaze/microblaze.h +++ b/gcc/config/microblaze/microblaze.h @@ -184,6 +184,21 @@ #define INCOMING_RETURN_ADDR_RTX \ gen_rtx_REG (VOIDmode, GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM) +/* Specifies the offset from INCOMING_RETURN_ADDR_RTX and the actual return PC. */ +#define RETURN_ADDR_OFFSET (8) + +/* Describe how we implement __builtin_eh_return. */ +#define EH_RETURN_DATA_REGNO(N) (((N) < 2) ? MB_ABI_FIRST_ARG_REGNUM + (N) : INVALID_REGNUM) + +#define MB_EH_STACKADJ_REGNUM MB_ABI_INT_RETURN_VAL2_REGNUM +#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, MB_EH_STACKADJ_REGNUM) + +/* Select a format to encode pointers in exception handling data. CODE + is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is + true if the symbol may be affected by dynamic relocations. */ +#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ + ((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr) + /* Use DWARF 2 debugging information by default. */ #define DWARF2_DEBUGGING_INFO #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG Index: b/gcc/config/microblaze/microblaze.md =================================================================== --- a/gcc/config/microblaze/microblaze.md +++ b/gcc/config/microblaze/microblaze.md @@ -2261,4 +2261,15 @@ (set_attr "mode" "SI") (set_attr "length" "4")]) +; This is used in compiling the unwind routines. +(define_expand "eh_return" + [(use (match_operand 0 "general_operand" ""))] + "" + " +{ + microblaze_eh_return(operands[0]); + DONE; +}") + (include "sync.md") +
shibajee/buildroot
package/gcc/4.9.4/840-microblaze-enable-dwarf-eh-support.patch
patch
mit
5,990
Allow C99-depending features of libstdc++ with uClibc The libstdc++ code is fairly restrictive on how it checks for C99 compatibility: it requires *complete* C99 support to enable certain features. For example, uClibc provides a good number of C99 features, but not C99 complex number support. For this reason, libstdc++ completely disables many the standard C++ methods that can in fact work because uClibc provides the necessary functions. This patch is similar and highly inspired from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58393, but implemented in a way that doesn't involve changing the configure.ac script, as autoreconfiguring gcc is complicated. It simply relies on the fact that uClibc defines the __UCLIBC__ definition. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> [Gustavo: update for 4.9.3] Index: b/libstdc++-v3/config/locale/generic/c_locale.h =================================================================== --- a/libstdc++-v3/config/locale/generic/c_locale.h +++ b/libstdc++-v3/config/locale/generic/c_locale.h @@ -70,7 +70,7 @@ __builtin_va_list __args; __builtin_va_start(__args, __fmt); -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args); #else const int __ret = __builtin_vsprintf(__out, __fmt, __args); Index: b/libstdc++-v3/config/locale/gnu/c_locale.h =================================================================== --- a/libstdc++-v3/config/locale/gnu/c_locale.h +++ b/libstdc++-v3/config/locale/gnu/c_locale.h @@ -88,7 +88,7 @@ __builtin_va_list __args; __builtin_va_start(__args, __fmt); -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args); #else const int __ret = __builtin_vsprintf(__out, __fmt, __args); Index: b/libstdc++-v3/include/bits/basic_string.h =================================================================== --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -2843,7 +2843,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99) +#if __cplusplus >= 201103L && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)) #include <ext/string_conversions.h> Index: b/libstdc++-v3/include/bits/locale_facets_nonio.tcc =================================================================== --- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc +++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc @@ -572,7 +572,7 @@ { const locale __loc = __io.getloc(); const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) // First try a buffer perhaps big enough. int __cs_size = 64; char* __cs = static_cast<char*>(__builtin_alloca(__cs_size)); Index: b/libstdc++-v3/include/bits/locale_facets.tcc =================================================================== --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -987,7 +987,7 @@ char __fbuf[16]; __num_base::_S_format_float(__io, __fbuf, __mod); -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) // First try a buffer perhaps big enough (most probably sufficient // for non-ios_base::fixed outputs) int __cs_size = __max_digits * 3; Index: b/libstdc++-v3/include/c_compatibility/math.h =================================================================== --- a/libstdc++-v3/include/c_compatibility/math.h +++ b/libstdc++-v3/include/c_compatibility/math.h @@ -56,7 +56,7 @@ using std::floor; using std::fmod; -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::fpclassify; using std::isfinite; using std::isinf; Index: b/libstdc++-v3/include/c_compatibility/wchar.h =================================================================== --- a/libstdc++-v3/include/c_compatibility/wchar.h +++ b/libstdc++-v3/include/c_compatibility/wchar.h @@ -103,7 +103,7 @@ using std::wmemset; using std::wcsftime; -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::wcstold; using std::wcstoll; using std::wcstoull; Index: b/libstdc++-v3/include/c_global/cstdio =================================================================== --- a/libstdc++-v3/include/c_global/cstdio +++ b/libstdc++-v3/include/c_global/cstdio @@ -146,7 +146,7 @@ using ::vsprintf; } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef snprintf #undef vfscanf Index: b/libstdc++-v3/include/c_global/cstdlib =================================================================== --- a/libstdc++-v3/include/c_global/cstdlib +++ b/libstdc++-v3/include/c_global/cstdlib @@ -182,7 +182,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef _Exit #undef llabs Index: b/libstdc++-v3/include/c_global/cwchar =================================================================== --- a/libstdc++-v3/include/c_global/cwchar +++ b/libstdc++-v3/include/c_global/cwchar @@ -232,7 +232,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef wcstold #undef wcstoll @@ -289,7 +289,7 @@ using std::vwscanf; #endif -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::wcstold; using std::wcstoll; using std::wcstoull; Index: b/libstdc++-v3/include/c_std/cstdio =================================================================== --- a/libstdc++-v3/include/c_std/cstdio +++ b/libstdc++-v3/include/c_std/cstdio @@ -144,7 +144,7 @@ using ::vsprintf; } // namespace std -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef snprintf #undef vfscanf Index: b/libstdc++-v3/include/c_std/cstdlib =================================================================== --- a/libstdc++-v3/include/c_std/cstdlib +++ b/libstdc++-v3/include/c_std/cstdlib @@ -180,7 +180,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef _Exit #undef llabs Index: b/libstdc++-v3/include/c_std/cwchar =================================================================== --- a/libstdc++-v3/include/c_std/cwchar +++ b/libstdc++-v3/include/c_std/cwchar @@ -228,7 +228,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef wcstold #undef wcstoll Index: b/libstdc++-v3/include/ext/vstring.h =================================================================== --- a/libstdc++-v3/include/ext/vstring.h +++ b/libstdc++-v3/include/ext/vstring.h @@ -2680,7 +2680,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99)) +#if ((__cplusplus >= 201103L) && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__))) #include <ext/string_conversions.h> Index: b/libstdc++-v3/include/tr1/cstdio =================================================================== --- a/libstdc++-v3/include/tr1/cstdio +++ b/libstdc++-v3/include/tr1/cstdio @@ -33,7 +33,7 @@ #include <cstdio> -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) namespace std _GLIBCXX_VISIBILITY(default) { Index: b/libstdc++-v3/include/tr1/cstdlib =================================================================== --- a/libstdc++-v3/include/tr1/cstdlib +++ b/libstdc++-v3/include/tr1/cstdlib @@ -35,7 +35,7 @@ #if _GLIBCXX_HOSTED -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) namespace std _GLIBCXX_VISIBILITY(default) { Index: b/libstdc++-v3/include/tr1/cwchar =================================================================== --- a/libstdc++-v3/include/tr1/cwchar +++ b/libstdc++-v3/include/tr1/cwchar @@ -52,7 +52,7 @@ using std::vwscanf; #endif -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::wcstold; using std::wcstoll; using std::wcstoull; Index: b/libstdc++-v3/include/tr1/stdlib.h =================================================================== --- a/libstdc++-v3/include/tr1/stdlib.h +++ b/libstdc++-v3/include/tr1/stdlib.h @@ -33,7 +33,7 @@ #if _GLIBCXX_HOSTED -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::tr1::atoll; using std::tr1::strtoll; Index: b/libstdc++-v3/src/c++11/debug.cc =================================================================== --- a/libstdc++-v3/src/c++11/debug.cc +++ b/libstdc++-v3/src/c++11/debug.cc @@ -788,7 +788,7 @@ int __n __attribute__ ((__unused__)), const char* __fmt, _Tp __s) const throw () { -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) std::snprintf(__buf, __n, __fmt, __s); #else std::sprintf(__buf, __fmt, __s);
shibajee/buildroot
package/gcc/4.9.4/850-libstdcxx-uclibc-c99.patch
patch
mit
9,192
[PATCH] cilk: fix build without wchar When building against uClibc with wchar support disabled, WCHAR_MIN and WCHAR_MAX are not defined leading to compilation errors. Fix it by only including the wchar code if available. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> --- libcilkrts/include/cilk/reducer_min_max.h | 8 ++++++++ 1 file changed, 8 insertions(+) Index: host-gcc-final-4.9.2/libcilkrts/include/cilk/reducer_min_max.h =================================================================== --- host-gcc-final-4.9.2.orig/libcilkrts/include/cilk/reducer_min_max.h +++ host-gcc-final-4.9.2/libcilkrts/include/cilk/reducer_min_max.h @@ -3154,7 +3154,9 @@ CILK_C_REDUCER_MAX_INSTANCE(char, char, CHAR_MIN) CILK_C_REDUCER_MAX_INSTANCE(unsigned char, uchar, 0) CILK_C_REDUCER_MAX_INSTANCE(signed char, schar, SCHAR_MIN) +#ifdef WCHAR_MIN CILK_C_REDUCER_MAX_INSTANCE(wchar_t, wchar_t, WCHAR_MIN) +#endif CILK_C_REDUCER_MAX_INSTANCE(short, short, SHRT_MIN) CILK_C_REDUCER_MAX_INSTANCE(unsigned short, ushort, 0) CILK_C_REDUCER_MAX_INSTANCE(int, int, INT_MIN) @@ -3306,7 +3308,9 @@ CILK_C_REDUCER_MAX_INDEX_INSTANCE(char, char, CHAR_MIN) CILK_C_REDUCER_MAX_INDEX_INSTANCE(unsigned char, uchar, 0) CILK_C_REDUCER_MAX_INDEX_INSTANCE(signed char, schar, SCHAR_MIN) +#ifdef WCHAR_MIN CILK_C_REDUCER_MAX_INDEX_INSTANCE(wchar_t, wchar_t, WCHAR_MIN) +#endif CILK_C_REDUCER_MAX_INDEX_INSTANCE(short, short, SHRT_MIN) CILK_C_REDUCER_MAX_INDEX_INSTANCE(unsigned short, ushort, 0) CILK_C_REDUCER_MAX_INDEX_INSTANCE(int, int, INT_MIN) @@ -3432,7 +3436,9 @@ CILK_C_REDUCER_MIN_INSTANCE(char, char, CHAR_MAX) CILK_C_REDUCER_MIN_INSTANCE(unsigned char, uchar, CHAR_MAX) CILK_C_REDUCER_MIN_INSTANCE(signed char, schar, SCHAR_MAX) +#ifdef WCHAR_MAX CILK_C_REDUCER_MIN_INSTANCE(wchar_t, wchar_t, WCHAR_MAX) +#endif CILK_C_REDUCER_MIN_INSTANCE(short, short, SHRT_MAX) CILK_C_REDUCER_MIN_INSTANCE(unsigned short, ushort, USHRT_MAX) CILK_C_REDUCER_MIN_INSTANCE(int, int, INT_MAX) @@ -3584,7 +3590,9 @@ CILK_C_REDUCER_MIN_INDEX_INSTANCE(char, char, CHAR_MAX) CILK_C_REDUCER_MIN_INDEX_INSTANCE(unsigned char, uchar, CHAR_MAX) CILK_C_REDUCER_MIN_INDEX_INSTANCE(signed char, schar, SCHAR_MAX) +#ifdef WCHAR_MAX CILK_C_REDUCER_MIN_INDEX_INSTANCE(wchar_t, wchar_t, WCHAR_MAX) +#endif CILK_C_REDUCER_MIN_INDEX_INSTANCE(short, short, SHRT_MAX) CILK_C_REDUCER_MIN_INDEX_INSTANCE(unsigned short, ushort, USHRT_MAX) CILK_C_REDUCER_MIN_INDEX_INSTANCE(int, int, INT_MAX)
shibajee/buildroot
package/gcc/4.9.4/860-cilk-wchar.patch
patch
mit
2,893
From 6d852ffb43b111a39162135c95249e749c4e285b Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Thu, 6 Aug 2015 01:16:02 +0300 Subject: [PATCH] xtensa: add -mauto-litpools option With support from assembler this option allows compiling huge functions, where single literal pool at the beginning of a function may not be reachable by L32R instructions at its end. Currently assembler --auto-litpools option cannot deal with literals used from multiple locations separated by more than 256 KBytes of code. Don't turn constants into literals, instead use MOVI instruction to load them into registers and let the assembler turn them into literals as necessary. 2015-08-12 Max Filippov <jcmvbkbc@gmail.com> gcc/ * config/xtensa/constraints.md (define_constraint "Y"): New constraint. * config/xtensa/elf.h (ASM_SPEC): Add m(no-)auto-litpools. * config/xtensa/linux.h (ASM_SPEC): Likewise. * config/xtensa/predicates.md (move_operand): Match constants and symbols in the presence of TARGET_AUTO_LITPOOLS. * config/xtensa/xtensa.c (xtensa_valid_move): Don't allow immediate references to TLS data. (xtensa_emit_move_sequence): Don't force constants to memory in the presence of TARGET_AUTO_LITPOOLS. (print_operand): Add 'y' format, same as default, but capable of printing SF mode constants as well. * config/xtensa/xtensa.md (movsi_internal, movhi_internal) (movsf_internal): Add movi pattern that loads literal. (movsf, movdf): Don't force constants to memory in the presence of TARGET_AUTO_LITPOOLS. (movdf_internal): Add 'Y' constraint. * config/xtensa/xtensa.opt (mauto-litpools): New option. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: r226828 Changes to ChangeLogs and documentation are dropped. gcc/config/xtensa/constraints.md | 5 +++++ gcc/config/xtensa/elf.h | 4 +++- gcc/config/xtensa/linux.h | 4 +++- gcc/config/xtensa/predicates.md | 3 ++- gcc/config/xtensa/xtensa.c | 19 ++++++++++++++++++- gcc/config/xtensa/xtensa.md | 35 +++++++++++++++++++---------------- gcc/config/xtensa/xtensa.opt | 4 ++++ 7 files changed, 54 insertions(+), 20 deletions(-) Index: b/gcc/config/xtensa/constraints.md =================================================================== --- a/gcc/config/xtensa/constraints.md +++ b/gcc/config/xtensa/constraints.md @@ -111,6 +111,11 @@ (and (match_code "const_int") (match_test "xtensa_mask_immediate (ival)"))) +(define_constraint "Y" + "A constant that can be used in relaxed MOVI instructions." + (and (match_code "const_int,const_double,const,symbol_ref,label_ref") + (match_test "TARGET_AUTO_LITPOOLS"))) + ;; Memory constraints. Do not use define_memory_constraint here. Doing so ;; causes reload to force some constants into the constant pool, but since ;; the Xtensa constant pool can only be accessed with L32R instructions, it Index: b/gcc/config/xtensa/elf.h =================================================================== --- a/gcc/config/xtensa/elf.h +++ b/gcc/config/xtensa/elf.h @@ -48,7 +48,9 @@ %{mtarget-align:--target-align} \ %{mno-target-align:--no-target-align} \ %{mlongcalls:--longcalls} \ - %{mno-longcalls:--no-longcalls}" + %{mno-longcalls:--no-longcalls} \ + %{mauto-litpools:--auto-litpools} \ + %{mno-auto-litpools:--no-auto-litpools}" #undef LIB_SPEC #define LIB_SPEC "-lc -lsim -lc -lhandlers-sim -lhal" Index: b/gcc/config/xtensa/linux.h =================================================================== --- a/gcc/config/xtensa/linux.h +++ b/gcc/config/xtensa/linux.h @@ -42,7 +42,9 @@ %{mtarget-align:--target-align} \ %{mno-target-align:--no-target-align} \ %{mlongcalls:--longcalls} \ - %{mno-longcalls:--no-longcalls}" + %{mno-longcalls:--no-longcalls} \ + %{mauto-litpools:--auto-litpools} \ + %{mno-auto-litpools:--no-auto-litpools}" #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" Index: b/gcc/config/xtensa/predicates.md =================================================================== --- a/gcc/config/xtensa/predicates.md +++ b/gcc/config/xtensa/predicates.md @@ -142,7 +142,8 @@ (match_test "GET_MODE_CLASS (mode) == MODE_INT && xtensa_simm12b (INTVAL (op))")) (and (match_code "const_int,const_double,const,symbol_ref,label_ref") - (match_test "TARGET_CONST16 && CONSTANT_P (op) + (match_test "(TARGET_CONST16 || TARGET_AUTO_LITPOOLS) + && CONSTANT_P (op) && GET_MODE_SIZE (mode) % UNITS_PER_WORD == 0"))))) ;; Accept the floating point constant 1 in the appropriate mode. Index: b/gcc/config/xtensa/xtensa.c =================================================================== --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -477,6 +477,9 @@ { int dst_regnum = xt_true_regnum (operands[0]); + if (xtensa_tls_referenced_p (operands[1])) + return FALSE; + /* The stack pointer can only be assigned with a MOVSP opcode. */ if (dst_regnum == STACK_POINTER_REGNUM) return (mode == SImode @@ -1044,7 +1047,7 @@ return 1; } - if (! TARGET_CONST16) + if (! TARGET_AUTO_LITPOOLS && ! TARGET_CONST16) { src = force_const_mem (SImode, src); operands[1] = src; @@ -2428,6 +2431,20 @@ } break; + case 'y': + if (GET_CODE (x) == CONST_DOUBLE && + GET_MODE (x) == SFmode) + { + REAL_VALUE_TYPE r; + long l; + REAL_VALUE_FROM_CONST_DOUBLE (r, x); + REAL_VALUE_TO_TARGET_SINGLE (r, l); + fprintf (file, "0x%08lx", l); + break; + } + + /* fall through */ + default: if (GET_CODE (x) == REG || GET_CODE (x) == SUBREG) fprintf (file, "%s", reg_names[xt_true_regnum (x)]); Index: b/gcc/config/xtensa/xtensa.md =================================================================== --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -799,8 +799,8 @@ }) (define_insn "movsi_internal" - [(set (match_operand:SI 0 "nonimmed_operand" "=D,D,D,D,R,R,a,q,a,W,a,a,U,*a,*A") - (match_operand:SI 1 "move_operand" "M,D,d,R,D,d,r,r,I,i,T,U,r,*A,*r"))] + [(set (match_operand:SI 0 "nonimmed_operand" "=D,D,D,D,R,R,a,q,a,a,W,a,a,U,*a,*A") + (match_operand:SI 1 "move_operand" "M,D,d,R,D,d,r,r,I,Y,i,T,U,r,*A,*r"))] "xtensa_valid_move (SImode, operands)" "@ movi.n\t%0, %x1 @@ -812,15 +812,16 @@ mov\t%0, %1 movsp\t%0, %1 movi\t%0, %x1 + movi\t%0, %1 const16\t%0, %t1\;const16\t%0, %b1 %v1l32r\t%0, %1 %v1l32i\t%0, %1 %v0s32i\t%1, %0 rsr\t%0, ACCLO wsr\t%1, ACCLO" - [(set_attr "type" "move,move,move,load,store,store,move,move,move,move,load,load,store,rsr,wsr") + [(set_attr "type" "move,move,move,load,store,store,move,move,move,move,move,load,load,store,rsr,wsr") (set_attr "mode" "SI") - (set_attr "length" "2,2,2,2,2,2,3,3,3,6,3,3,3,3,3")]) + (set_attr "length" "2,2,2,2,2,2,3,3,3,3,6,3,3,3,3,3")]) ;; 16-bit Integer moves @@ -834,21 +835,22 @@ }) (define_insn "movhi_internal" - [(set (match_operand:HI 0 "nonimmed_operand" "=D,D,a,a,a,U,*a,*A") - (match_operand:HI 1 "move_operand" "M,d,r,I,U,r,*A,*r"))] + [(set (match_operand:HI 0 "nonimmed_operand" "=D,D,a,a,a,a,U,*a,*A") + (match_operand:HI 1 "move_operand" "M,d,r,I,Y,U,r,*A,*r"))] "xtensa_valid_move (HImode, operands)" "@ movi.n\t%0, %x1 mov.n\t%0, %1 mov\t%0, %1 movi\t%0, %x1 + movi\t%0, %1 %v1l16ui\t%0, %1 %v0s16i\t%1, %0 rsr\t%0, ACCLO wsr\t%1, ACCLO" - [(set_attr "type" "move,move,move,move,load,store,rsr,wsr") + [(set_attr "type" "move,move,move,move,move,load,store,rsr,wsr") (set_attr "mode" "HI") - (set_attr "length" "2,2,3,3,3,3,3,3")]) + (set_attr "length" "2,2,3,3,3,3,3,3,3")]) ;; 8-bit Integer moves @@ -919,7 +921,7 @@ (match_operand:SF 1 "general_operand" ""))] "" { - if (!TARGET_CONST16 && CONSTANT_P (operands[1])) + if (!TARGET_CONST16 && !TARGET_AUTO_LITPOOLS && CONSTANT_P (operands[1])) operands[1] = force_const_mem (SFmode, operands[1]); if ((!register_operand (operands[0], SFmode) @@ -934,8 +936,8 @@ }) (define_insn "movsf_internal" - [(set (match_operand:SF 0 "nonimmed_operand" "=f,f,U,D,D,R,a,f,a,W,a,a,U") - (match_operand:SF 1 "move_operand" "f,U,f,d,R,d,r,r,f,iF,T,U,r"))] + [(set (match_operand:SF 0 "nonimmed_operand" "=f,f,U,D,D,R,a,f,a,a,W,a,a,U") + (match_operand:SF 1 "move_operand" "f,U,f,d,R,d,r,r,f,Y,iF,T,U,r"))] "((register_operand (operands[0], SFmode) || register_operand (operands[1], SFmode)) && !(FP_REG_P (xt_true_regnum (operands[0])) @@ -950,13 +952,14 @@ mov\t%0, %1 wfr\t%0, %1 rfr\t%0, %1 + movi\t%0, %y1 const16\t%0, %t1\;const16\t%0, %b1 %v1l32r\t%0, %1 %v1l32i\t%0, %1 %v0s32i\t%1, %0" - [(set_attr "type" "farith,fload,fstore,move,load,store,move,farith,farith,move,load,load,store") + [(set_attr "type" "farith,fload,fstore,move,load,store,move,farith,farith,move,move,load,load,store") (set_attr "mode" "SF") - (set_attr "length" "3,3,3,2,2,2,3,3,3,6,3,3,3")]) + (set_attr "length" "3,3,3,2,2,2,3,3,3,3,6,3,3,3")]) (define_insn "*lsiu" [(set (match_operand:SF 0 "register_operand" "=f") @@ -997,7 +1000,7 @@ (match_operand:DF 1 "general_operand" ""))] "" { - if (CONSTANT_P (operands[1]) && !TARGET_CONST16) + if (CONSTANT_P (operands[1]) && !TARGET_CONST16 && !TARGET_AUTO_LITPOOLS) operands[1] = force_const_mem (DFmode, operands[1]); if (!register_operand (operands[0], DFmode) @@ -1008,8 +1011,8 @@ }) (define_insn_and_split "movdf_internal" - [(set (match_operand:DF 0 "nonimmed_operand" "=a,W,a,a,U") - (match_operand:DF 1 "move_operand" "r,iF,T,U,r"))] + [(set (match_operand:DF 0 "nonimmed_operand" "=a,a,W,a,a,U") + (match_operand:DF 1 "move_operand" "r,Y,iF,T,U,r"))] "register_operand (operands[0], DFmode) || register_operand (operands[1], DFmode)" "#" Index: b/gcc/config/xtensa/xtensa.opt =================================================================== --- a/gcc/config/xtensa/xtensa.opt +++ b/gcc/config/xtensa/xtensa.opt @@ -38,6 +38,10 @@ Target Intersperse literal pools with code in the text section +mauto-litpools +Target Report Mask(AUTO_LITPOOLS) +Relax literals in assembler and place them automatically in the text section + mserialize-volatile Target Report Mask(SERIALIZE_VOLATILE) -mno-serialize-volatile Do not serialize volatile memory references with MEMW instructions
shibajee/buildroot
package/gcc/4.9.4/870-xtensa-add-mauto-litpools-option.patch
patch
mit
10,415
From 05154174b369505238b759cf80d595d8cfc8c731 Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Mon, 10 Aug 2015 21:35:20 +0300 Subject: [PATCH 1/3] xtensa: reimplement register spilling Spilling windowed registers in userspace is much easier, more portable, less error-prone and equally effective as in kernel. Now that register spilling syscall is considered obsolete in the xtensa linux kernel replace it with CALL12 followed by series of ENTRY in libgcc. 2015-08-18 Max Filippov <jcmvbkbc@gmail.com> libgcc/ * config/xtensa/lib2funcs.S (__xtensa_libgcc_window_spill): Use CALL12 followed by series of ENTRY to spill windowed registers. (__xtensa_nonlocal_goto): Call __xtensa_libgcc_window_spill instead of making linux spill syscall. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: r226962 libgcc/config/xtensa/lib2funcs.S | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/libgcc/config/xtensa/lib2funcs.S b/libgcc/config/xtensa/lib2funcs.S index 3ac8c1d..2e678af 100644 --- a/libgcc/config/xtensa/lib2funcs.S +++ b/libgcc/config/xtensa/lib2funcs.S @@ -33,10 +33,29 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see .global __xtensa_libgcc_window_spill .type __xtensa_libgcc_window_spill,@function __xtensa_libgcc_window_spill: - entry sp, 32 - movi a2, 0 - syscall + entry sp, 48 +#if XCHAL_NUM_AREGS > 16 + call12 1f + retw + .align 4 +1: + .rept (XCHAL_NUM_AREGS - 24) / 12 + _entry sp, 48 + mov a12, a0 + .endr + _entry sp, 16 +#if XCHAL_NUM_AREGS % 12 == 0 + mov a4, a4 +#elif XCHAL_NUM_AREGS % 12 == 4 + mov a8, a8 +#elif XCHAL_NUM_AREGS % 12 == 8 + mov a12, a12 +#endif + retw +#else + mov a8, a8 retw +#endif .size __xtensa_libgcc_window_spill, .-__xtensa_libgcc_window_spill @@ -58,10 +77,7 @@ __xtensa_nonlocal_goto: entry sp, 32 /* Flush registers. */ - mov a5, a2 - movi a2, 0 - syscall - mov a2, a5 + call8 __xtensa_libgcc_window_spill /* Because the save area for a0-a3 is stored one frame below the one identified by a2, the only way to restore those -- 1.8.1.4
shibajee/buildroot
package/gcc/4.9.4/871-xtensa-reimplement-register-spilling.patch
patch
mit
2,140
From f66206679a0ad604f13673559f230160cd3d1189 Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Fri, 14 Aug 2015 02:45:02 +0300 Subject: [PATCH 2/3] xtensa: use unwind-dw2-fde-dip instead of unwind-dw2-fde This allows having exception cleanup code in binaries that don't register their unwind tables. 2015-08-18 Max Filippov <jcmvbkbc@gmail.com> libgcc/ * config/xtensa/t-xtensa (LIB2ADDEH): Replace unwind-dw2-fde with unwind-dw2-fde-dip. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: r226963 libgcc/config/xtensa/t-xtensa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgcc/config/xtensa/t-xtensa b/libgcc/config/xtensa/t-xtensa index 27399e6..66d0eb3 100644 --- a/libgcc/config/xtensa/t-xtensa +++ b/libgcc/config/xtensa/t-xtensa @@ -13,4 +13,4 @@ LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3 _udivsi3 _umodsi3 \ LIB2ADD = $(srcdir)/config/xtensa/lib2funcs.S LIB2ADDEH = $(srcdir)/config/xtensa/unwind-dw2-xtensa.c \ - $(srcdir)/unwind-dw2-fde.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + $(srcdir)/unwind-dw2-fde-dip.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c -- 1.8.1.4
shibajee/buildroot
package/gcc/4.9.4/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
patch
mit
1,164
From 15c7c4d39b317f0d902ef28fd43eca5c3369f891 Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Sat, 15 Aug 2015 05:12:11 +0300 Subject: [PATCH 3/3] xtensa: fix _Unwind_GetCFA Returning context->cfa in _Unwind_GetCFA makes CFA point one stack frame higher than what was actually used by code at context->ra. This results in invalid CFA value in signal frames and premature unwinding completion in forced unwinding used by uClibc NPTL thread cancellation. Returning context->sp from _Unwind_GetCFA makes all CFA values valid and matching code that used them. 2015-08-18 Max Filippov <jcmvbkbc@gmail.com> libgcc/ * config/xtensa/unwind-dw2-xtensa.c (_Unwind_GetCFA): Return context->sp instead of context->cfa. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: r226964 libgcc/config/xtensa/unwind-dw2-xtensa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgcc/config/xtensa/unwind-dw2-xtensa.c b/libgcc/config/xtensa/unwind-dw2-xtensa.c index 35f7797..ef6b900 100644 --- a/libgcc/config/xtensa/unwind-dw2-xtensa.c +++ b/libgcc/config/xtensa/unwind-dw2-xtensa.c @@ -130,7 +130,7 @@ _Unwind_GetGR (struct _Unwind_Context *context, int index) _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *context) { - return (_Unwind_Ptr) context->cfa; + return (_Unwind_Ptr) context->sp; } /* Overwrite the saved value for register INDEX in CONTEXT with VAL. */ -- 1.8.1.4
shibajee/buildroot
package/gcc/4.9.4/873-xtensa-fix-_Unwind_GetCFA.patch
patch
mit
1,447
From 70c2cb98fb129b4766b5da0f945dc41fd568c77a Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Sat, 22 Aug 2015 08:44:26 +0300 Subject: [PATCH] xtensa: add uclinux support 2015-10-03 Max Filippov <jcmvbkbc@gmail.com> gcc/ * config.gcc (xtensa*-*-uclinux*): New configuration. * config/xtensa/uclinux.h: New file. * config/xtensa/uclinux.opt: New file. libgcc/ * config.host (xtensa*-*-uclinux*): New configuration. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: r228450 gcc/config.gcc | 5 ++++ gcc/config/xtensa/uclinux.h | 69 +++++++++++++++++++++++++++++++++++++++++++ gcc/config/xtensa/uclinux.opt | 32 ++++++++++++++++++++ libgcc/config.host | 5 ++++ 4 files changed, 111 insertions(+) create mode 100644 gcc/config/xtensa/uclinux.h create mode 100644 gcc/config/xtensa/uclinux.opt Index: b/gcc/config.gcc =================================================================== --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -2871,6 +2871,11 @@ tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h" tmake_file="${tmake_file} xtensa/t-xtensa" ;; +xtensa*-*-uclinux*) + tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/uclinux.h" + tmake_file="${tmake_file} xtensa/t-xtensa" + extra_options="${extra_options} xtensa/uclinux.opt" + ;; am33_2.0-*-linux*) tm_file="mn10300/mn10300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h" gas=yes gnu_ld=yes Index: b/gcc/config/xtensa/uclinux.h =================================================================== --- /dev/null +++ b/gcc/config/xtensa/uclinux.h @@ -0,0 +1,69 @@ +/* Xtensa uClinux configuration. + Derived from the configuration for GCC for Intel i386 running Linux. + Copyright (C) 2001-2015 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +<http://www.gnu.org/licenses/>. */ + +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + GNU_USER_TARGET_OS_CPP_BUILTINS (); \ + builtin_define ("__uClinux__"); \ + } \ + while (0) + +#undef SUBTARGET_CPP_SPEC +#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" + +#undef SIZE_TYPE +#define SIZE_TYPE "unsigned int" + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE "int" + +#undef WCHAR_TYPE +#define WCHAR_TYPE "long int" + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE 32 + +#undef ASM_SPEC +#define ASM_SPEC \ + "%{mtext-section-literals:--text-section-literals} \ + %{mno-text-section-literals:--no-text-section-literals} \ + %{mtarget-align:--target-align} \ + %{mno-target-align:--no-target-align} \ + %{mlongcalls:--longcalls} \ + %{mno-longcalls:--no-longcalls} \ + %{mauto-litpools:--auto-litpools} \ + %{mno-auto-litpools:--no-auto-litpools}" + +#undef LINK_SPEC +#define LINK_SPEC "%{!no-elf2flt:%{!elf2flt*:-elf2flt}}" + +#undef LOCAL_LABEL_PREFIX +#define LOCAL_LABEL_PREFIX "." + +/* Always enable "-fpic" for Xtensa Linux. */ +#define XTENSA_ALWAYS_PIC 1 + +#undef TARGET_LIBC_HAS_FUNCTION +#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function + +#undef DBX_REGISTER_NUMBER + Index: b/gcc/config/xtensa/uclinux.opt =================================================================== --- /dev/null +++ b/gcc/config/xtensa/uclinux.opt @@ -0,0 +1,32 @@ +; Xtensa uClinux options. + +; Copyright (C) 2015 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 3, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; You should have received a copy of the GNU General Public License +; along with GCC; see the file COPYING3. If not see +; <http://www.gnu.org/licenses/>. + +; See the GCC internals manual (options.texi) for a description of +; this file's format. + +; Please try to keep this file in ASCII collating order. + +elf2flt +Driver + +elf2flt= +Driver JoinedOrMissing + +; This comment is to ensure we retain the blank line above. Index: b/libgcc/config.host =================================================================== --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1213,6 +1213,11 @@ tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc" md_unwind_header=xtensa/linux-unwind.h ;; +xtensa*-*-uclinux*) + tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc" + md_unwind_header=xtensa/linux-unwind.h + extra_parts="$extra_parts crtbeginS.o crtbeginT.o crtendS.o" + ;; am33_2.0-*-linux*) # Don't need crtbeginT.o from *-*-linux* default. extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
shibajee/buildroot
package/gcc/4.9.4/874-xtensa-add-uclinux-support.patch
patch
mit
5,593
From b0ea54f3f995754881e0ea6651133aa7b58eeaa2 Mon Sep 17 00:00:00 2001 From: cltang <cltang@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Tue, 22 Sep 2015 12:23:20 +0000 Subject: [PATCH] nios2_legitimize_address 2015-09-22 Chung-Lin Tang <cltang@codesourcery.com> Backport from mainline 2015-09-22 Chung-Lin Tang <cltang@codesourcery.com> * config/nios2/nios2.c (nios2_legitimize_address): When handling 'reg + reloc' cases, allow first operand to be non-REG, and use force_reg() to enforce address pattern. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@228013 138bc75d-0d04-0410-961f-82ee72b054a4 Fixes: http://autobuild.buildroot.net/results/901/90186d1fe134b804c0101554296b1235dc0ccbb0 [backported to 4.9.3] Signed-off-by: Romain Naour <romain.naour@gmail.com> --- gcc/config/nios2/nios2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/nios2/nios2.c b/gcc/config/nios2/nios2.c index 047b615..41dd6f9 100644 --- a/gcc/config/nios2/nios2.c +++ b/gcc/config/nios2/nios2.c @@ -1786,15 +1786,15 @@ nios2_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, Which will be output as '%tls_le(var+48)(r23)' in assembly. */ if (GET_CODE (x) == PLUS - && GET_CODE (XEXP (x, 0)) == REG && GET_CODE (XEXP (x, 1)) == CONST) { - rtx unspec, offset, reg = XEXP (x, 0); + rtx unspec, offset; split_const (XEXP (x, 1), &unspec, &offset); if (GET_CODE (unspec) == UNSPEC && !nios2_large_offset_p (XINT (unspec, 1)) && offset != const0_rtx) { + rtx reg = force_reg (Pmode, XEXP (x, 0)); unspec = copy_rtx (unspec); XVECEXP (unspec, 0, 0) = plus_constant (Pmode, XVECEXP (unspec, 0, 0), INTVAL (offset)); -- 2.5.0
shibajee/buildroot
package/gcc/4.9.4/880-nios2_legitimize_address.patch
patch
mit
1,748
remove unused header, which breaks the toolchain building Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> diff -Nur gcc-4.9.3.orig/libgcc/config/m68k/linux-atomic.c gcc-4.9.3/libgcc/config/m68k/linux-atomic.c --- gcc-4.9.3.orig/libgcc/config/m68k/linux-atomic.c 2014-01-02 23:25:22.000000000 +0100 +++ gcc-4.9.3/libgcc/config/m68k/linux-atomic.c 2016-03-18 22:24:40.000000000 +0100 @@ -33,7 +33,6 @@ using the kernel helper defined below. There is no support for 64-bit operations yet. */ -#include <asm/unistd.h> #include <stdbool.h> #ifndef __NR_atomic_cmpxchg_32
shibajee/buildroot
package/gcc/4.9.4/890-fix-m68k-compile.patch
patch
mit
587
avoids internal compiler error while compiling linux-atomic.c See here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53833 Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> diff -Nur gcc-4.9.3.orig/libgcc/config.host gcc-4.9.3/libgcc/config.host --- gcc-4.9.3.orig/libgcc/config.host 2014-03-27 16:40:31.000000000 +0100 +++ gcc-4.9.3/libgcc/config.host 2016-04-05 16:20:53.422809885 +0200 @@ -750,7 +750,7 @@ m68k*-*-openbsd*) ;; m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux with uClibc - tmake_file="$tmake_file m68k/t-floatlib m68k/t-linux" + tmake_file="$tmake_file m68k/t-floatlib" md_unwind_header=m68k/linux-unwind.h ;; m68k-*-linux*) # Motorola m68k's running GNU/Linux
shibajee/buildroot
package/gcc/4.9.4/891-fix-m68k-uclinux.patch
patch
mit
704
Add musl support to gcc This patch comes from the musl-cross project at https://bitbucket.org/GregorR/musl-cross/src. Compared to the upstream version: * the config.sub modifications have been removed, because Buildroot already overwrites all config.sub with a more recent config.sub that has musl support. * change to ensure that a dummy dynamic linker path MUSL_DYNAMIC_LINKER<foo> is defined for all architectures, otherwise building gcc for architectures not supported by musl was causing build failure. Bug reported upstream at https://bitbucket.org/GregorR/musl-gcc-patches/issue/4/musl-gcc-patches-break-the-build-on. * change the USE_PT_GNU_EH_FRAME logic to keep the existing gcc logic and only add the musl one as an addition, not as a replacement. Not doing this breaks C++ exception handling with glibc, because USE_PT_GNU_EH_FRAME doesn't get defined due to the configure script not testing dl_iterate_phdr() on any system except Solaris. [Gustavo: remove upstream applied gcc/config/sh/sh.c chunk for 4.9.1] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> --- Index: b/fixincludes/mkfixinc.sh =================================================================== --- a/fixincludes/mkfixinc.sh +++ b/fixincludes/mkfixinc.sh @@ -19,7 +19,8 @@ powerpc-*-eabi* | \ powerpc-*-rtems* | \ powerpcle-*-eabisim* | \ - powerpcle-*-eabi* ) + powerpcle-*-eabi* | \ + *-musl* ) # IF there is no include fixing, # THEN create a no-op fixer and exit (echo "#! /bin/sh" ; echo "exit 0" ) > ${target} Index: b/gcc/config.gcc =================================================================== --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -594,7 +594,7 @@ esac # Common C libraries. -tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3" +tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4" # 32-bit x86 processors supported by --with-arch=. Each processor # MUST be separated by exactly one space. @@ -719,6 +719,9 @@ *-*-*uclibc*) tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" ;; + *-*-*musl*) + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL" + ;; *) tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" ;; @@ -2338,6 +2341,10 @@ powerpc*-*-linux*paired*) tm_file="${tm_file} rs6000/750cl.h" ;; esac + case ${target} in + *-linux*-musl*) + enable_secureplt=yes ;; + esac if test x${enable_secureplt} = xyes; then tm_file="rs6000/secureplt.h ${tm_file}" fi Index: b/gcc/config/aarch64/aarch64-linux.h =================================================================== --- a/gcc/config/aarch64/aarch64-linux.h +++ b/gcc/config/aarch64/aarch64-linux.h @@ -22,6 +22,8 @@ #define GCC_AARCH64_LINUX_H #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}.so.1" +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64.so.1" #define CPP_SPEC "%{pthread:-D_REENTRANT}" Index: b/gcc/config/arm/linux-eabi.h =================================================================== --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -77,6 +77,23 @@ %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" +/* For ARM musl currently supports four dynamic linkers: + - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI + - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI + - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB + - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB + musl does not support the legacy OABI mode. + All the dynamic linkers live in /lib. + We default to soft-float, EL. */ +#undef MUSL_DYNAMIC_LINKER +#if TARGET_BIG_ENDIAN_DEFAULT +#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}" +#else +#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}" +#endif +#define MUSL_DYNAMIC_LINKER \ + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to use the GNU/Linux version, not the generic BPABI version. */ #undef LINK_SPEC Index: b/gcc/config/i386/linux.h =================================================================== --- a/gcc/config/i386/linux.h +++ b/gcc/config/i386/linux.h @@ -21,3 +21,5 @@ #define GNU_USER_LINK_EMULATION "elf_i386" #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1" Index: b/gcc/config/i386/linux64.h =================================================================== --- a/gcc/config/i386/linux64.h +++ b/gcc/config/i386/linux64.h @@ -30,3 +30,10 @@ #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" + +#undef MUSL_DYNAMIC_LINKER32 +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1" +#undef MUSL_DYNAMIC_LINKER64 +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1" +#undef MUSL_DYNAMIC_LINKERX32 +#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1" Index: b/gcc/config/linux.h =================================================================== --- a/gcc/config/linux.h +++ b/gcc/config/linux.h @@ -32,10 +32,12 @@ #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) #else #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) +#define OPTION_MUSL (linux_libc == LIBC_MUSL) #endif #define GNU_USER_TARGET_OS_CPP_BUILTINS() \ @@ -53,18 +55,21 @@ uClibc or Bionic is the default C library and whether -muclibc or -mglibc or -mbionic has been passed to change the default. */ -#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \ - "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}" +#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \ + "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}" #if DEFAULT_LIBC == LIBC_GLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ - CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B) +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ + CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M) #elif DEFAULT_LIBC == LIBC_UCLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ - CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B) +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ + CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M) #elif DEFAULT_LIBC == LIBC_BIONIC -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ - CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U) +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ + CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M) +#elif DEFAULT_LIBC == LIBC_MUSL +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ + CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B) #else #error "Unsupported DEFAULT_LIBC" #endif /* DEFAULT_LIBC */ @@ -82,23 +87,103 @@ #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64" #define BIONIC_DYNAMIC_LINKERX32 "/system/bin/linkerx32" +/* Musl dynamic linker paths must be defined on a per-architecture + basis, for each architecture supported by Musl. However, in order + to let other architectures continue to build with other C + libraries, we provide a dummy definition of the following defines. */ +#define MUSL_DYNAMIC_LINKER "invalid" +#define MUSL_DYNAMIC_LINKER32 "invalid" +#define MUSL_DYNAMIC_LINKER64 "invalid" +#define MUSL_DYNAMIC_LINKERX32 "invalid" + #define GNU_USER_DYNAMIC_LINKER \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \ - BIONIC_DYNAMIC_LINKER) + BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) #define GNU_USER_DYNAMIC_LINKER32 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \ - BIONIC_DYNAMIC_LINKER32) + BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) #define GNU_USER_DYNAMIC_LINKER64 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \ - BIONIC_DYNAMIC_LINKER64) + BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) #define GNU_USER_DYNAMIC_LINKERX32 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \ - BIONIC_DYNAMIC_LINKERX32) + BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKER32) /* Whether we have Bionic libc runtime */ #undef TARGET_HAS_BIONIC #define TARGET_HAS_BIONIC (OPTION_BIONIC) +/* musl avoids problematic includes by rearranging the include directories. + * Unfortunately, this is mostly duplicated from cppdefault.c */ +#if DEFAULT_LIBC == LIBC_MUSL +#define INCLUDE_DEFAULTS_MUSL_GPP \ + { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \ + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \ + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \ + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \ + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \ + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, + +#ifdef LOCAL_INCLUDE_DIR +#define INCLUDE_DEFAULTS_MUSL_LOCAL \ + { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \ + { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 }, +#else +#define INCLUDE_DEFAULTS_MUSL_LOCAL +#endif + +#ifdef PREFIX_INCLUDE_DIR +#define INCLUDE_DEFAULTS_MUSL_PREFIX \ + { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0}, +#else +#define INCLUDE_DEFAULTS_MUSL_PREFIX +#endif + +#ifdef CROSS_INCLUDE_DIR +#define INCLUDE_DEFAULTS_MUSL_CROSS \ + { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0}, +#else +#define INCLUDE_DEFAULTS_MUSL_CROSS +#endif + +#ifdef TOOL_INCLUDE_DIR +#define INCLUDE_DEFAULTS_MUSL_TOOL \ + { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0}, +#else +#define INCLUDE_DEFAULTS_MUSL_TOOL +#endif + +#ifdef NATIVE_SYSTEM_HEADER_DIR +#define INCLUDE_DEFAULTS_MUSL_NATIVE \ + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, +#else +#define INCLUDE_DEFAULTS_MUSL_NATIVE +#endif + +#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT) +# undef INCLUDE_DEFAULTS_MUSL_LOCAL +# define INCLUDE_DEFAULTS_MUSL_LOCAL +# undef INCLUDE_DEFAULTS_MUSL_NATIVE +# define INCLUDE_DEFAULTS_MUSL_NATIVE +#else +# undef INCLUDE_DEFAULTS_MUSL_CROSS +# define INCLUDE_DEFAULTS_MUSL_CROSS +#endif + +#undef INCLUDE_DEFAULTS +#define INCLUDE_DEFAULTS \ + { \ + INCLUDE_DEFAULTS_MUSL_GPP \ + INCLUDE_DEFAULTS_MUSL_PREFIX \ + INCLUDE_DEFAULTS_MUSL_CROSS \ + INCLUDE_DEFAULTS_MUSL_TOOL \ + INCLUDE_DEFAULTS_MUSL_NATIVE \ + { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \ + { 0, 0, 0, 0, 0, 0 } \ + } +#endif + #if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */ /* This is a *uclinux* target. We don't define below macros to normal linux versions, because doing so would require *uclinux* targets to include Index: b/gcc/config/linux.opt =================================================================== --- a/gcc/config/linux.opt +++ b/gcc/config/linux.opt @@ -30,3 +30,7 @@ muclibc Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic) Use uClibc C library + +mmusl +Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc) +Use musl C library Index: b/gcc/config/microblaze/linux.h =================================================================== --- a/gcc/config/microblaze/linux.h +++ b/gcc/config/microblaze/linux.h @@ -28,7 +28,23 @@ #undef TLS_NEEDS_GOT #define TLS_NEEDS_GOT 1 -#define DYNAMIC_LINKER "/lib/ld.so.1" +#if TARGET_BIG_ENDIAN_DEFAULT == 0 /* LE */ +#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}" +#else +#define MUSL_DYNAMIC_LINKER_E "%{EL:el}" +#endif + +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-microblaze" MUSL_DYNAMIC_LINKER_E ".so.1" +#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + +#if DEFAULT_LIBC == LIBC_MUSL +#define DYNAMIC_LINKER MUSL_DYNAMIC_LINKER +#else +#define DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER +#endif + + #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ { "dynamic_linker", DYNAMIC_LINKER } Index: b/gcc/config/rs6000/linux64.h =================================================================== --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -371,17 +371,23 @@ #endif #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" +#undef MUSL_DYNAMIC_LINKER32 +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1" +#undef MUSL_DYNAMIC_LINKER64 +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1" #if DEFAULT_LIBC == LIBC_UCLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" #elif DEFAULT_LIBC == LIBC_GLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" +#elif DEFAULT_LIBC == LIBC_MUSL +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" #else #error "Unsupported DEFAULT_LIBC" #endif #define GNU_USER_DYNAMIC_LINKER32 \ - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32) + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) #define GNU_USER_DYNAMIC_LINKER64 \ - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64) + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) #undef DEFAULT_ASM_ENDIAN #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN) Index: b/gcc/config/rs6000/secureplt.h =================================================================== --- a/gcc/config/rs6000/secureplt.h +++ b/gcc/config/rs6000/secureplt.h @@ -18,3 +18,4 @@ <http://www.gnu.org/licenses/>. */ #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt" +#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt" Index: b/gcc/config/rs6000/sysv4.h =================================================================== --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -537,6 +537,9 @@ #ifndef CC1_SECURE_PLT_DEFAULT_SPEC #define CC1_SECURE_PLT_DEFAULT_SPEC "" #endif +#ifndef LINK_SECURE_PLT_DEFAULT_SPEC +#define LINK_SECURE_PLT_DEFAULT_SPEC "" +#endif /* Pass -G xxx to the compiler. */ #define CC1_SPEC "%{G*} %(cc1_cpu)" \ @@ -585,7 +588,8 @@ /* Override the default target of the linker. */ #define LINK_TARGET_SPEC \ - ENDIAN_SELECT("", " --oformat elf32-powerpcle", "") + ENDIAN_SELECT("", " --oformat elf32-powerpcle", "") \ + "%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}" /* Any specific OS flags. */ #define LINK_OS_SPEC "\ @@ -763,15 +767,18 @@ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1" #if DEFAULT_LIBC == LIBC_UCLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" +#elif DEFAULT_LIBC == LIBC_MUSL +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" +#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" #else #error "Unsupported DEFAULT_LIBC" #endif #define GNU_USER_DYNAMIC_LINKER \ - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ %{rdynamic:-export-dynamic} \ @@ -894,6 +901,7 @@ { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \ { "link_os_default", LINK_OS_DEFAULT_SPEC }, \ { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \ + { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \ { "cpp_os_ads", CPP_OS_ADS_SPEC }, \ { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \ { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \ Index: b/gcc/config/sh/linux.h =================================================================== --- a/gcc/config/sh/linux.h +++ b/gcc/config/sh/linux.h @@ -43,7 +43,15 @@ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack +#if TARGET_BIG_ENDIAN_DEFAULT /* BE */ +#define MUSL_DYNAMIC_LINKER_E "eb" +#else +#define MUSL_DYNAMIC_LINKER_E +#endif + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E ".so.1" #undef SUBTARGET_LINK_EMUL_SUFFIX #define SUBTARGET_LINK_EMUL_SUFFIX "_linux" Index: b/gcc/configure =================================================================== --- a/gcc/configure +++ b/gcc/configure @@ -27601,6 +27601,9 @@ gcc_cv_target_dl_iterate_phdr=no fi ;; + *-linux-musl*) + gcc_cv_target_dl_iterate_phdr=yes + ;; esac if test x$gcc_cv_target_dl_iterate_phdr = xyes; then Index: b/gcc/configure.ac =================================================================== --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -5173,6 +5173,9 @@ gcc_cv_target_dl_iterate_phdr=no fi ;; + *-linux-musl*) + gcc_cv_target_dl_iterate_phdr=yes + ;; esac GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR]) if test x$gcc_cv_target_dl_iterate_phdr = xyes; then Index: b/gcc/ginclude/stddef.h =================================================================== --- a/gcc/ginclude/stddef.h +++ b/gcc/ginclude/stddef.h @@ -181,6 +181,7 @@ #ifndef _GCC_SIZE_T #ifndef _SIZET_ #ifndef __size_t +#ifndef __DEFINED_size_t /* musl */ #define __size_t__ /* BeOS */ #define __SIZE_T__ /* Cray Unicos/Mk */ #define _SIZE_T @@ -197,6 +198,7 @@ #define ___int_size_t_h #define _GCC_SIZE_T #define _SIZET_ +#define __DEFINED_size_t /* musl */ #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \ || defined(__FreeBSD_kernel__) /* __size_t is a typedef on FreeBSD 5, must not trash it. */ @@ -214,6 +216,7 @@ typedef long ssize_t; #endif /* __BEOS__ */ #endif /* !(defined (__GNUG__) && defined (size_t)) */ +#endif /* __DEFINED_size_t */ #endif /* __size_t */ #endif /* _SIZET_ */ #endif /* _GCC_SIZE_T */ Index: b/libgcc/unwind-dw2-fde-dip.c =================================================================== --- a/libgcc/unwind-dw2-fde-dip.c +++ b/libgcc/unwind-dw2-fde-dip.c @@ -73,6 +73,13 @@ && defined(TARGET_DL_ITERATE_PHDR) \ && defined(__sun__) && defined(__svr4__) # define USE_PT_GNU_EH_FRAME + #endif + +/* For musl libc, TARGET_DL_ITERATE_PHDR gets defined by the configure + script. */ +#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ + && defined(TARGET_DL_ITERATE_PHDR) +# define USE_PT_GNU_EH_FRAME #endif #if defined(USE_PT_GNU_EH_FRAME) Index: b/libgomp/config/posix/time.c =================================================================== --- a/libgomp/config/posix/time.c +++ b/libgomp/config/posix/time.c @@ -28,6 +28,8 @@ The following implementation uses the most simple POSIX routines. If present, POSIX 4 clocks should be used instead. */ +#define _POSIX_C_SOURCE 199309L /* for clocks */ + #include "libgomp.h" #include <unistd.h> #if TIME_WITH_SYS_TIME Index: b/libitm/config/arm/hwcap.cc =================================================================== --- a/libitm/config/arm/hwcap.cc +++ b/libitm/config/arm/hwcap.cc @@ -40,7 +40,11 @@ #ifdef __linux__ #include <unistd.h> +#ifdef __GLIBC__ #include <sys/fcntl.h> +#else +#include <fcntl.h> +#endif #include <elf.h> static void __attribute__((constructor)) Index: b/libitm/config/linux/x86/tls.h =================================================================== --- a/libitm/config/linux/x86/tls.h +++ b/libitm/config/linux/x86/tls.h @@ -25,16 +25,19 @@ #ifndef LIBITM_X86_TLS_H #define LIBITM_X86_TLS_H 1 -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) +#if defined(__GLIBC_PREREQ) +#if __GLIBC_PREREQ(2, 10) /* Use slots in the TCB head rather than __thread lookups. GLIBC has reserved words 10 through 13 for TM. */ #define HAVE_ARCH_GTM_THREAD 1 #define HAVE_ARCH_GTM_THREAD_DISP 1 #endif +#endif #include "config/generic/tls.h" -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) +#if defined(__GLIBC_PREREQ) +#if __GLIBC_PREREQ(2, 10) namespace GTM HIDDEN { #ifdef __x86_64__ @@ -101,5 +104,6 @@ } // namespace GTM #endif /* >= GLIBC 2.10 */ +#endif #endif // LIBITM_X86_TLS_H Index: b/libstdc++-v3/configure.host =================================================================== --- a/libstdc++-v3/configure.host +++ b/libstdc++-v3/configure.host @@ -266,6 +266,13 @@ os_include_dir="os/bsd/freebsd" ;; gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) + # check for musl by target + case "${host_os}" in + *-musl*) + os_include_dir="os/generic" + ;; + *) + if [ "$uclibc" = "yes" ]; then os_include_dir="os/uclibc" elif [ "$bionic" = "yes" ]; then @@ -274,6 +281,9 @@ os_include_dir="os/gnu-linux" fi ;; + + esac + ;; hpux*) os_include_dir="os/hpux" ;; Index: b/gcc/config/mips/linux64.h =================================================================== --- a/gcc/config/mips/linux64.h +++ b/gcc/config/mips/linux64.h @@ -41,4 +41,4 @@ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32" #define GNU_USER_DYNAMIC_LINKERN32 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \ - BIONIC_DYNAMIC_LINKERN32) + BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKER) Index: b/gcc/config/mips/linux.h =================================================================== --- a/gcc/config/mips/linux.h +++ b/gcc/config/mips/linux.h @@ -23,3 +23,11 @@ #undef UCLIBC_DYNAMIC_LINKER #define UCLIBC_DYNAMIC_LINKER \ "%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}" + +#if TARGET_ENDIAN_DEFAULT == 0 /* LE */ +#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}" +#else +#define MUSL_DYNAMIC_LINKER_E "%{EL:el}" +#endif +#undef MUSL_DYNAMIC_LINKER +#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
shibajee/buildroot
package/gcc/4.9.4/900-musl-support.patch
patch
mit
22,604
Add dynamic linker support for uClibc Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org> diff -Nur gcc-4.9.3.orig/gcc/config/microblaze/linux.h gcc-4.9.3/gcc/config/microblaze/linux.h --- gcc-4.9.3.orig/gcc/config/microblaze/linux.h 2016-06-04 21:21:09.430646655 +0200 +++ gcc-4.9.3/gcc/config/microblaze/linux.h 2016-06-04 21:21:44.596003509 +0200 @@ -36,10 +36,13 @@ #undef MUSL_DYNAMIC_LINKER #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-microblaze" MUSL_DYNAMIC_LINKER_E ".so.1" +#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" #if DEFAULT_LIBC == LIBC_MUSL #define DYNAMIC_LINKER MUSL_DYNAMIC_LINKER +#elif DEFAULT_LIBC == LIBC_UCLIBC +#define DYNAMIC_LINKER UCLIBC_DYNAMIC_LINKER #else #define DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER #endif
shibajee/buildroot
package/gcc/4.9.4/901-microblaze-uclibc.patch
patch
mit
804
disable split-stack for non-thread builds Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> diff -Nur gcc-4.9.3.orig/libgcc/config/t-stack gcc-4.9.3/libgcc/config/t-stack --- gcc-4.9.3.orig/libgcc/config/t-stack 2010-10-01 21:31:49.000000000 +0200 +++ gcc-4.9.3/libgcc/config/t-stack 2016-03-07 01:34:32.000000000 +0100 @@ -1,4 +1,6 @@ # Makefile fragment to provide generic support for -fsplit-stack. # This should be used in config.host for any host which supports # -fsplit-stack. +ifeq ($(enable_threads),yes) LIB2ADD_ST += $(srcdir)/generic-morestack.c $(srcdir)/generic-morestack-thread.c +endif
shibajee/buildroot
package/gcc/4.9.4/930-libgcc-disable-split-stack-nothreads.patch
patch
mit
609
Enable POSIX threads for uClinux targets Reported upstream: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71721 Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> Index: b/gcc/config.gcc =================================================================== --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -810,6 +810,9 @@ *-*-uclinux*) extra_options="$extra_options gnu-user.opt" use_gcc_stdint=wrap + case ${enable_threads} in + "" | yes | posix) thread_file='posix' ;; + esac tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC" ;; *-*-rdos*)
shibajee/buildroot
package/gcc/4.9.4/940-uclinux-enable-threads.patch
patch
mit
569
Index: b/contrib/regression/objs-gcc.sh =================================================================== --- a/contrib/regression/objs-gcc.sh +++ b/contrib/regression/objs-gcc.sh @@ -106,6 +106,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
shibajee/buildroot
package/gcc/5.4.0/100-uclibc-conf.patch
patch
mit
603
From 9bf6066d588632dab9f78932df15b5b4140f31f3 Mon Sep 17 00:00:00 2001 From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be> Date: Fri, 6 Nov 2015 14:27:23 +0100 Subject: [PATCH] gcc/config.gcc: fix typo for powerpc e6500 cpu_is_64bit Otherwise it is not recognized as a 64-bit powerpc and gcc will not generate 64-bit binaries by default. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> --- gcc/config.gcc | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index 4a7cbd2..9cc765e 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -439,7 +439,7 @@ powerpc*-*-*) cpu_type=rs6000 extra_headers="ppc-asm.h altivec.h spe.h ppu_intrinsics.h paired.h spu2vmx.h vec_types.h si2vmx.h htmintrin.h htmxlintrin.h" case x$with_cpu in - xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345678]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|Xe6500) + xpowerpc64|xdefault64|x6[23]0|x970|xG5|xpower[345678]|xpower6x|xrs64a|xcell|xa2|xe500mc64|xe5500|xe6500) cpu_is_64bit=yes ;; esac -- 2.6.2
shibajee/buildroot
package/gcc/5.4.0/120-gcc-config.gcc-fix-typo-for-powerpc-e6500-cpu_is_64b.patch
patch
mit
1,081
Index: b/boehm-gc/include/gc.h =================================================================== --- a/boehm-gc/include/gc.h +++ b/boehm-gc/include/gc.h @@ -503,7 +503,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
shibajee/buildroot
package/gcc/5.4.0/301-missing-execinfo_h.patch
patch
mit
480
Index: b/gcc/config/arm/linux-elf.h =================================================================== --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -60,7 +60,7 @@ %{shared:-lc} \ %{!shared:%{profile:-lc_p}%{!profile:-lc}}" -#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" +#define LIBGCC_SPEC "-lgcc" #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" Index: b/libgcc/config/arm/t-linux =================================================================== --- a/libgcc/config/arm/t-linux +++ b/libgcc/config/arm/t-linux @@ -1,6 +1,11 @@ LIB1ASMSRC = arm/lib1funcs.S LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ - _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 + _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ + _arm_addsubdf3 _arm_addsubsf3 \ + _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ + _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ + _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ + _arm_fixsfsi _arm_fixunssfsi # Just for these, we omit the frame pointer since it makes such a big # difference.
shibajee/buildroot
package/gcc/5.4.0/810-arm-softfloat-libgcc.patch
patch
mit
1,089
http://sourceware.org/ml/crossgcc/2008-05/msg00009.html Index: b/gcc/config/arm/linux-eabi.h =================================================================== --- a/gcc/config/arm/linux-eabi.h +++ b/gcc/config/arm/linux-eabi.h @@ -45,7 +45,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 /* TARGET_BIG_ENDIAN_DEFAULT is set in config.gcc for big endian configurations. */
shibajee/buildroot
package/gcc/5.4.0/830-arm_unbreak_armv4t.patch
patch
mit
578
Fetched from Xilinx gcc git at https://github.com/Xilinx/gcc From 23c35173490ac2d6348a668dfc9c1a6eb62171f2 Mon Sep 17 00:00:00 2001 From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com> Date: Mon, 18 Jun 2012 20:18:13 +0200 Subject: [PATCH] [Patch, microblaze]: Enable DWARF exception handling support. Changelog 2013-03-18 Edgar E. Iglesias <edgar.iglesias@xilinx.com> David Holsgrove <david.holsgrove@xilinx.com> * common/config/microblaze/microblaze-common.c: Remove TARGET_EXCEPT_UNWIND_INFO definition. * config/microblaze/microblaze-protos.h: Add microblaze_eh_return prototype. * gcc/config/microblaze/microblaze.c: (microblaze_must_save_register, microblaze_expand_epilogue, microblaze_return_addr): Handle calls_eh_return (microblaze_eh_return): New function. * gcc/config/microblaze/microblaze.h: Define RETURN_ADDR_OFFSET, EH_RETURN_DATA_REGNO, MB_EH_STACKADJ_REGNUM, EH_RETURN_STACKADJ_RTX, ASM_PREFERRED_EH_DATA_FORMAT * gcc/config/microblaze/microblaze.md: Define eh_return pattern. Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> --- gcc/common/config/microblaze/microblaze-common.c | 3 --- gcc/config/microblaze/microblaze-protos.h | 1 + gcc/config/microblaze/microblaze.c | 29 ++++++++++++++++++++---- gcc/config/microblaze/microblaze.h | 15 ++++++++++++ gcc/config/microblaze/microblaze.md | 11 +++++++++ 5 files changed, 52 insertions(+), 7 deletions(-) Index: b/gcc/common/config/microblaze/microblaze-common.c =================================================================== --- a/gcc/common/config/microblaze/microblaze-common.c +++ b/gcc/common/config/microblaze/microblaze-common.c @@ -37,7 +37,4 @@ #undef TARGET_OPTION_OPTIMIZATION_TABLE #define TARGET_OPTION_OPTIMIZATION_TABLE microblaze_option_optimization_table -#undef TARGET_EXCEPT_UNWIND_INFO -#define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info - struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER; Index: b/gcc/config/microblaze/microblaze-protos.h =================================================================== --- a/gcc/config/microblaze/microblaze-protos.h +++ b/gcc/config/microblaze/microblaze-protos.h @@ -56,6 +56,7 @@ extern int symbol_mentioned_p (rtx); extern int label_mentioned_p (rtx); extern bool microblaze_cannot_force_const_mem (machine_mode, rtx); +extern void microblaze_eh_return (rtx op0); #endif /* RTX_CODE */ /* Declare functions in microblaze-c.c. */ Index: b/gcc/config/microblaze/microblaze.c =================================================================== --- a/gcc/config/microblaze/microblaze.c +++ b/gcc/config/microblaze/microblaze.c @@ -1959,6 +1959,11 @@ if (frame_pointer_needed && (regno == HARD_FRAME_POINTER_REGNUM)) return 1; + if (crtl->calls_eh_return + && regno == MB_ABI_SUB_RETURN_ADDR_REGNUM) { + return 1; + } + if (!crtl->is_leaf) { if (regno == MB_ABI_SUB_RETURN_ADDR_REGNUM) @@ -1986,6 +1991,13 @@ return 1; } + if (crtl->calls_eh_return + && (regno == EH_RETURN_DATA_REGNO (0) + || regno == EH_RETURN_DATA_REGNO (1))) + { + return 1; + } + return 0; } @@ -3067,6 +3079,12 @@ emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, fsiz_rtx)); } + if (crtl->calls_eh_return) + emit_insn (gen_addsi3 (stack_pointer_rtx, + stack_pointer_rtx, + gen_rtx_raw_REG (SImode, + MB_EH_STACKADJ_REGNUM))); + emit_jump_insn (gen_return_internal (gen_rtx_REG (Pmode, GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM))); } @@ -3364,10 +3382,13 @@ if (count != 0) return NULL_RTX; - return gen_rtx_PLUS (Pmode, - get_hard_reg_initial_val (Pmode, - MB_ABI_SUB_RETURN_ADDR_REGNUM), - GEN_INT (8)); + return get_hard_reg_initial_val (Pmode, + MB_ABI_SUB_RETURN_ADDR_REGNUM); +} + +void microblaze_eh_return (rtx op0) +{ + emit_insn (gen_movsi(gen_rtx_MEM(Pmode, stack_pointer_rtx), op0)); } /* Queue an .ident string in the queue of top-level asm statements. Index: b/gcc/config/microblaze/microblaze.h =================================================================== --- a/gcc/config/microblaze/microblaze.h +++ b/gcc/config/microblaze/microblaze.h @@ -184,6 +184,21 @@ #define INCOMING_RETURN_ADDR_RTX \ gen_rtx_REG (VOIDmode, GP_REG_FIRST + MB_ABI_SUB_RETURN_ADDR_REGNUM) +/* Specifies the offset from INCOMING_RETURN_ADDR_RTX and the actual return PC. */ +#define RETURN_ADDR_OFFSET (8) + +/* Describe how we implement __builtin_eh_return. */ +#define EH_RETURN_DATA_REGNO(N) (((N) < 2) ? MB_ABI_FIRST_ARG_REGNUM + (N) : INVALID_REGNUM) + +#define MB_EH_STACKADJ_REGNUM MB_ABI_INT_RETURN_VAL2_REGNUM +#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, MB_EH_STACKADJ_REGNUM) + +/* Select a format to encode pointers in exception handling data. CODE + is 0 for data, 1 for code labels, 2 for function pointers. GLOBAL is + true if the symbol may be affected by dynamic relocations. */ +#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \ + ((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr) + /* Use DWARF 2 debugging information by default. */ #define DWARF2_DEBUGGING_INFO #define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG Index: b/gcc/config/microblaze/microblaze.md =================================================================== --- a/gcc/config/microblaze/microblaze.md +++ b/gcc/config/microblaze/microblaze.md @@ -2272,4 +2272,15 @@ (set_attr "mode" "SI") (set_attr "length" "4")]) +; This is used in compiling the unwind routines. +(define_expand "eh_return" + [(use (match_operand 0 "general_operand" ""))] + "" + " +{ + microblaze_eh_return(operands[0]); + DONE; +}") + (include "sync.md") +
shibajee/buildroot
package/gcc/5.4.0/840-microblaze-enable-dwarf-eh-support.patch
patch
mit
5,985
Allow C99-depending features of libstdc++ with uClibc The libstdc++ code is fairly restrictive on how it checks for C99 compatibility: it requires *complete* C99 support to enable certain features. For example, uClibc provides a good number of C99 features, but not C99 complex number support. For this reason, libstdc++ completely disables many the standard C++ methods that can in fact work because uClibc provides the necessary functions. This patch is similar and highly inspired from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58393, but implemented in a way that doesn't involve changing the configure.ac script, as autoreconfiguring gcc is complicated. It simply relies on the fact that uClibc defines the __UCLIBC__ definition. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Index: b/libstdc++-v3/config/locale/generic/c_locale.h =================================================================== --- a/libstdc++-v3/config/locale/generic/c_locale.h +++ b/libstdc++-v3/config/locale/generic/c_locale.h @@ -70,7 +70,7 @@ __builtin_va_list __args; __builtin_va_start(__args, __fmt); -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args); #else const int __ret = __builtin_vsprintf(__out, __fmt, __args); Index: b/libstdc++-v3/config/locale/gnu/c_locale.h =================================================================== --- a/libstdc++-v3/config/locale/gnu/c_locale.h +++ b/libstdc++-v3/config/locale/gnu/c_locale.h @@ -88,7 +88,7 @@ __builtin_va_list __args; __builtin_va_start(__args, __fmt); -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args); #else const int __ret = __builtin_vsprintf(__out, __fmt, __args); Index: b/libstdc++-v3/include/bits/basic_string.h =================================================================== --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -5239,7 +5239,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99) +#if __cplusplus >= 201103L && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)) #include <ext/string_conversions.h> Index: b/libstdc++-v3/include/bits/locale_facets.tcc =================================================================== --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -992,7 +992,7 @@ char __fbuf[16]; __num_base::_S_format_float(__io, __fbuf, __mod); -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) // Precision is always used except for hexfloat format. const bool __use_prec = (__io.flags() & ios_base::floatfield) != ios_base::floatfield; Index: b/libstdc++-v3/include/bits/locale_facets_nonio.tcc =================================================================== --- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc +++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc @@ -578,7 +578,7 @@ { const locale __loc = __io.getloc(); const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc); -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) // First try a buffer perhaps big enough. int __cs_size = 64; char* __cs = static_cast<char*>(__builtin_alloca(__cs_size)); Index: b/libstdc++-v3/include/c_compatibility/math.h =================================================================== --- a/libstdc++-v3/include/c_compatibility/math.h +++ b/libstdc++-v3/include/c_compatibility/math.h @@ -56,7 +56,7 @@ using std::floor; using std::fmod; -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::fpclassify; using std::isfinite; using std::isinf; Index: b/libstdc++-v3/include/c_compatibility/wchar.h =================================================================== --- a/libstdc++-v3/include/c_compatibility/wchar.h +++ b/libstdc++-v3/include/c_compatibility/wchar.h @@ -103,7 +103,7 @@ using std::wmemset; using std::wcsftime; -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::wcstold; using std::wcstoll; using std::wcstoull; Index: b/libstdc++-v3/include/c_global/cstdlib =================================================================== --- a/libstdc++-v3/include/c_global/cstdlib +++ b/libstdc++-v3/include/c_global/cstdlib @@ -195,7 +195,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef _Exit #undef llabs Index: b/libstdc++-v3/include/c_global/cwchar =================================================================== --- a/libstdc++-v3/include/c_global/cwchar +++ b/libstdc++-v3/include/c_global/cwchar @@ -232,7 +232,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef wcstold #undef wcstoll @@ -289,7 +289,7 @@ using std::vwscanf; #endif -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::wcstold; using std::wcstoll; using std::wcstoull; Index: b/libstdc++-v3/include/c_std/cstdio =================================================================== --- a/libstdc++-v3/include/c_std/cstdio +++ b/libstdc++-v3/include/c_std/cstdio @@ -144,7 +144,7 @@ using ::vsprintf; } // namespace std -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef snprintf #undef vfscanf Index: b/libstdc++-v3/include/c_std/cstdlib =================================================================== --- a/libstdc++-v3/include/c_std/cstdlib +++ b/libstdc++-v3/include/c_std/cstdlib @@ -192,7 +192,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef _Exit #undef llabs Index: b/libstdc++-v3/include/c_std/cwchar =================================================================== --- a/libstdc++-v3/include/c_std/cwchar +++ b/libstdc++-v3/include/c_std/cwchar @@ -228,7 +228,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef wcstold #undef wcstoll Index: b/libstdc++-v3/include/ext/vstring.h =================================================================== --- a/libstdc++-v3/include/ext/vstring.h +++ b/libstdc++-v3/include/ext/vstring.h @@ -2680,7 +2680,7 @@ _GLIBCXX_END_NAMESPACE_VERSION } // namespace -#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99)) +#if ((__cplusplus >= 201103L) && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__))) #include <ext/string_conversions.h> Index: b/libstdc++-v3/include/tr1/cstdio =================================================================== --- a/libstdc++-v3/include/tr1/cstdio +++ b/libstdc++-v3/include/tr1/cstdio @@ -33,7 +33,7 @@ #include <cstdio> -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) namespace std _GLIBCXX_VISIBILITY(default) { Index: b/libstdc++-v3/include/tr1/cstdlib =================================================================== --- a/libstdc++-v3/include/tr1/cstdlib +++ b/libstdc++-v3/include/tr1/cstdlib @@ -35,7 +35,7 @@ #if _GLIBCXX_HOSTED -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) namespace std _GLIBCXX_VISIBILITY(default) { Index: b/libstdc++-v3/include/tr1/cwchar =================================================================== --- a/libstdc++-v3/include/tr1/cwchar +++ b/libstdc++-v3/include/tr1/cwchar @@ -52,7 +52,7 @@ using std::vwscanf; #endif -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::wcstold; using std::wcstoll; using std::wcstoull; Index: b/libstdc++-v3/include/tr1/stdlib.h =================================================================== --- a/libstdc++-v3/include/tr1/stdlib.h +++ b/libstdc++-v3/include/tr1/stdlib.h @@ -33,7 +33,7 @@ #if _GLIBCXX_HOSTED -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) using std::tr1::atoll; using std::tr1::strtoll; Index: b/libstdc++-v3/src/c++11/debug.cc =================================================================== --- a/libstdc++-v3/src/c++11/debug.cc +++ b/libstdc++-v3/src/c++11/debug.cc @@ -788,7 +788,7 @@ int __n __attribute__ ((__unused__)), const char* __fmt, _Tp __s) const throw () { -#ifdef _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) std::snprintf(__buf, __n, __fmt, __s); #else std::sprintf(__buf, __fmt, __s); Index: b/libstdc++-v3/include/c_global/cstdio =================================================================== --- a/libstdc++-v3/include/c_global/cstdio +++ b/libstdc++-v3/include/c_global/cstdio @@ -146,7 +146,7 @@ using ::vsprintf; } // namespace -#if _GLIBCXX_USE_C99 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__) #undef snprintf #undef vfscanf
shibajee/buildroot
package/gcc/5.4.0/850-libstdcxx-uclibc-c99.patch
patch
mit
9,172
[PATCH] cilk: fix build without wchar When building against uClibc with wchar support disabled, WCHAR_MIN and WCHAR_MAX are not defined leading to compilation errors. Fix it by only including the wchar code if available. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> --- libcilkrts/include/cilk/reducer_min_max.h | 8 ++++++++ 1 file changed, 8 insertions(+) Index: b/libcilkrts/include/cilk/reducer_min_max.h =================================================================== --- a/libcilkrts/include/cilk/reducer_min_max.h +++ b/libcilkrts/include/cilk/reducer_min_max.h @@ -3154,7 +3154,9 @@ CILK_C_REDUCER_MAX_INSTANCE(char, char, CHAR_MIN) CILK_C_REDUCER_MAX_INSTANCE(unsigned char, uchar, 0) CILK_C_REDUCER_MAX_INSTANCE(signed char, schar, SCHAR_MIN) +#ifdef WCHAR_MIN CILK_C_REDUCER_MAX_INSTANCE(wchar_t, wchar_t, WCHAR_MIN) +#endif CILK_C_REDUCER_MAX_INSTANCE(short, short, SHRT_MIN) CILK_C_REDUCER_MAX_INSTANCE(unsigned short, ushort, 0) CILK_C_REDUCER_MAX_INSTANCE(int, int, INT_MIN) @@ -3306,7 +3308,9 @@ CILK_C_REDUCER_MAX_INDEX_INSTANCE(char, char, CHAR_MIN) CILK_C_REDUCER_MAX_INDEX_INSTANCE(unsigned char, uchar, 0) CILK_C_REDUCER_MAX_INDEX_INSTANCE(signed char, schar, SCHAR_MIN) +#ifdef WCHAR_MIN CILK_C_REDUCER_MAX_INDEX_INSTANCE(wchar_t, wchar_t, WCHAR_MIN) +#endif CILK_C_REDUCER_MAX_INDEX_INSTANCE(short, short, SHRT_MIN) CILK_C_REDUCER_MAX_INDEX_INSTANCE(unsigned short, ushort, 0) CILK_C_REDUCER_MAX_INDEX_INSTANCE(int, int, INT_MIN) @@ -3432,7 +3436,9 @@ CILK_C_REDUCER_MIN_INSTANCE(char, char, CHAR_MAX) CILK_C_REDUCER_MIN_INSTANCE(unsigned char, uchar, CHAR_MAX) CILK_C_REDUCER_MIN_INSTANCE(signed char, schar, SCHAR_MAX) +#ifdef WCHAR_MAX CILK_C_REDUCER_MIN_INSTANCE(wchar_t, wchar_t, WCHAR_MAX) +#endif CILK_C_REDUCER_MIN_INSTANCE(short, short, SHRT_MAX) CILK_C_REDUCER_MIN_INSTANCE(unsigned short, ushort, USHRT_MAX) CILK_C_REDUCER_MIN_INSTANCE(int, int, INT_MAX) @@ -3584,7 +3590,9 @@ CILK_C_REDUCER_MIN_INDEX_INSTANCE(char, char, CHAR_MAX) CILK_C_REDUCER_MIN_INDEX_INSTANCE(unsigned char, uchar, CHAR_MAX) CILK_C_REDUCER_MIN_INDEX_INSTANCE(signed char, schar, SCHAR_MAX) +#ifdef WCHAR_MAX CILK_C_REDUCER_MIN_INDEX_INSTANCE(wchar_t, wchar_t, WCHAR_MAX) +#endif CILK_C_REDUCER_MIN_INDEX_INSTANCE(short, short, SHRT_MAX) CILK_C_REDUCER_MIN_INDEX_INSTANCE(unsigned short, ushort, USHRT_MAX) CILK_C_REDUCER_MIN_INDEX_INSTANCE(int, int, INT_MAX)
shibajee/buildroot
package/gcc/5.4.0/860-cilk-wchar.patch
patch
mit
2,831
From 6d852ffb43b111a39162135c95249e749c4e285b Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Thu, 6 Aug 2015 01:16:02 +0300 Subject: [PATCH] xtensa: add -mauto-litpools option With support from assembler this option allows compiling huge functions, where single literal pool at the beginning of a function may not be reachable by L32R instructions at its end. Currently assembler --auto-litpools option cannot deal with literals used from multiple locations separated by more than 256 KBytes of code. Don't turn constants into literals, instead use MOVI instruction to load them into registers and let the assembler turn them into literals as necessary. 2015-08-12 Max Filippov <jcmvbkbc@gmail.com> gcc/ * config/xtensa/constraints.md (define_constraint "Y"): New constraint. * config/xtensa/elf.h (ASM_SPEC): Add m(no-)auto-litpools. * config/xtensa/linux.h (ASM_SPEC): Likewise. * config/xtensa/predicates.md (move_operand): Match constants and symbols in the presence of TARGET_AUTO_LITPOOLS. * config/xtensa/xtensa.c (xtensa_valid_move): Don't allow immediate references to TLS data. (xtensa_emit_move_sequence): Don't force constants to memory in the presence of TARGET_AUTO_LITPOOLS. (print_operand): Add 'y' format, same as default, but capable of printing SF mode constants as well. * config/xtensa/xtensa.md (movsi_internal, movhi_internal) (movsf_internal): Add movi pattern that loads literal. (movsf, movdf): Don't force constants to memory in the presence of TARGET_AUTO_LITPOOLS. (movdf_internal): Add 'Y' constraint. * config/xtensa/xtensa.opt (mauto-litpools): New option. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: r226828 Changes to ChangeLogs and documentation are dropped. gcc/config/xtensa/constraints.md | 5 +++++ gcc/config/xtensa/elf.h | 4 +++- gcc/config/xtensa/linux.h | 4 +++- gcc/config/xtensa/predicates.md | 3 ++- gcc/config/xtensa/xtensa.c | 19 ++++++++++++++++++- gcc/config/xtensa/xtensa.md | 35 +++++++++++++++++++---------------- gcc/config/xtensa/xtensa.opt | 4 ++++ 7 files changed, 54 insertions(+), 20 deletions(-) diff --git a/gcc/config/xtensa/constraints.md b/gcc/config/xtensa/constraints.md index 30f4c1f..773d4f9 100644 --- a/gcc/config/xtensa/constraints.md +++ b/gcc/config/xtensa/constraints.md @@ -111,6 +111,11 @@ (and (match_code "const_int") (match_test "xtensa_mask_immediate (ival)"))) +(define_constraint "Y" + "A constant that can be used in relaxed MOVI instructions." + (and (match_code "const_int,const_double,const,symbol_ref,label_ref") + (match_test "TARGET_AUTO_LITPOOLS"))) + ;; Memory constraints. Do not use define_memory_constraint here. Doing so ;; causes reload to force some constants into the constant pool, but since ;; the Xtensa constant pool can only be accessed with L32R instructions, it diff --git a/gcc/config/xtensa/elf.h b/gcc/config/xtensa/elf.h index e59bede..12056f7 100644 --- a/gcc/config/xtensa/elf.h +++ b/gcc/config/xtensa/elf.h @@ -48,7 +48,9 @@ along with GCC; see the file COPYING3. If not see %{mtarget-align:--target-align} \ %{mno-target-align:--no-target-align} \ %{mlongcalls:--longcalls} \ - %{mno-longcalls:--no-longcalls}" + %{mno-longcalls:--no-longcalls} \ + %{mauto-litpools:--auto-litpools} \ + %{mno-auto-litpools:--no-auto-litpools}" #undef LIB_SPEC #define LIB_SPEC "-lc -lsim -lc -lhandlers-sim -lhal" diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h index 675aacf..5b0243a 100644 --- a/gcc/config/xtensa/linux.h +++ b/gcc/config/xtensa/linux.h @@ -42,7 +42,9 @@ along with GCC; see the file COPYING3. If not see %{mtarget-align:--target-align} \ %{mno-target-align:--no-target-align} \ %{mlongcalls:--longcalls} \ - %{mno-longcalls:--no-longcalls}" + %{mno-longcalls:--no-longcalls} \ + %{mauto-litpools:--auto-litpools} \ + %{mno-auto-litpools:--no-auto-litpools}" #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" diff --git a/gcc/config/xtensa/predicates.md b/gcc/config/xtensa/predicates.md index e02209e..d7dfa11 100644 --- a/gcc/config/xtensa/predicates.md +++ b/gcc/config/xtensa/predicates.md @@ -142,7 +142,8 @@ (match_test "GET_MODE_CLASS (mode) == MODE_INT && xtensa_simm12b (INTVAL (op))")) (and (match_code "const_int,const_double,const,symbol_ref,label_ref") - (match_test "TARGET_CONST16 && CONSTANT_P (op) + (match_test "(TARGET_CONST16 || TARGET_AUTO_LITPOOLS) + && CONSTANT_P (op) && GET_MODE_SIZE (mode) % UNITS_PER_WORD == 0"))))) ;; Accept the floating point constant 1 in the appropriate mode. diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index eb039ba..206ff80 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -501,6 +501,9 @@ xtensa_valid_move (machine_mode mode, rtx *operands) { int dst_regnum = xt_true_regnum (operands[0]); + if (xtensa_tls_referenced_p (operands[1])) + return FALSE; + /* The stack pointer can only be assigned with a MOVSP opcode. */ if (dst_regnum == STACK_POINTER_REGNUM) return !TARGET_WINDOWED_ABI @@ -1069,7 +1072,7 @@ xtensa_emit_move_sequence (rtx *operands, machine_mode mode) return 1; } - if (! TARGET_CONST16) + if (! TARGET_AUTO_LITPOOLS && ! TARGET_CONST16) { src = force_const_mem (SImode, src); operands[1] = src; @@ -2449,6 +2452,20 @@ print_operand (FILE *file, rtx x, int letter) } break; + case 'y': + if (GET_CODE (x) == CONST_DOUBLE && + GET_MODE (x) == SFmode) + { + REAL_VALUE_TYPE r; + long l; + REAL_VALUE_FROM_CONST_DOUBLE (r, x); + REAL_VALUE_TO_TARGET_SINGLE (r, l); + fprintf (file, "0x%08lx", l); + break; + } + + /* fall through */ + default: if (GET_CODE (x) == REG || GET_CODE (x) == SUBREG) fprintf (file, "%s", reg_names[xt_true_regnum (x)]); diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md index 6d84384..0e673a3 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -761,8 +761,8 @@ }) (define_insn "movsi_internal" - [(set (match_operand:SI 0 "nonimmed_operand" "=D,D,D,D,R,R,a,q,a,W,a,a,U,*a,*A") - (match_operand:SI 1 "move_operand" "M,D,d,R,D,d,r,r,I,i,T,U,r,*A,*r"))] + [(set (match_operand:SI 0 "nonimmed_operand" "=D,D,D,D,R,R,a,q,a,a,W,a,a,U,*a,*A") + (match_operand:SI 1 "move_operand" "M,D,d,R,D,d,r,r,I,Y,i,T,U,r,*A,*r"))] "xtensa_valid_move (SImode, operands)" "@ movi.n\t%0, %x1 @@ -774,15 +774,16 @@ mov\t%0, %1 movsp\t%0, %1 movi\t%0, %x1 + movi\t%0, %1 const16\t%0, %t1\;const16\t%0, %b1 %v1l32r\t%0, %1 %v1l32i\t%0, %1 %v0s32i\t%1, %0 rsr\t%0, ACCLO wsr\t%1, ACCLO" - [(set_attr "type" "move,move,move,load,store,store,move,move,move,move,load,load,store,rsr,wsr") + [(set_attr "type" "move,move,move,load,store,store,move,move,move,move,move,load,load,store,rsr,wsr") (set_attr "mode" "SI") - (set_attr "length" "2,2,2,2,2,2,3,3,3,6,3,3,3,3,3")]) + (set_attr "length" "2,2,2,2,2,2,3,3,3,3,6,3,3,3,3,3")]) ;; 16-bit Integer moves @@ -796,21 +797,22 @@ }) (define_insn "movhi_internal" - [(set (match_operand:HI 0 "nonimmed_operand" "=D,D,a,a,a,U,*a,*A") - (match_operand:HI 1 "move_operand" "M,d,r,I,U,r,*A,*r"))] + [(set (match_operand:HI 0 "nonimmed_operand" "=D,D,a,a,a,a,U,*a,*A") + (match_operand:HI 1 "move_operand" "M,d,r,I,Y,U,r,*A,*r"))] "xtensa_valid_move (HImode, operands)" "@ movi.n\t%0, %x1 mov.n\t%0, %1 mov\t%0, %1 movi\t%0, %x1 + movi\t%0, %1 %v1l16ui\t%0, %1 %v0s16i\t%1, %0 rsr\t%0, ACCLO wsr\t%1, ACCLO" - [(set_attr "type" "move,move,move,move,load,store,rsr,wsr") + [(set_attr "type" "move,move,move,move,move,load,store,rsr,wsr") (set_attr "mode" "HI") - (set_attr "length" "2,2,3,3,3,3,3,3")]) + (set_attr "length" "2,2,3,3,3,3,3,3,3")]) ;; 8-bit Integer moves @@ -881,7 +883,7 @@ (match_operand:SF 1 "general_operand" ""))] "" { - if (!TARGET_CONST16 && CONSTANT_P (operands[1])) + if (!TARGET_CONST16 && !TARGET_AUTO_LITPOOLS && CONSTANT_P (operands[1])) operands[1] = force_const_mem (SFmode, operands[1]); if ((!register_operand (operands[0], SFmode) @@ -896,8 +898,8 @@ }) (define_insn "movsf_internal" - [(set (match_operand:SF 0 "nonimmed_operand" "=f,f,U,D,D,R,a,f,a,W,a,a,U") - (match_operand:SF 1 "move_operand" "f,U,f,d,R,d,r,r,f,iF,T,U,r"))] + [(set (match_operand:SF 0 "nonimmed_operand" "=f,f,U,D,D,R,a,f,a,a,W,a,a,U") + (match_operand:SF 1 "move_operand" "f,U,f,d,R,d,r,r,f,Y,iF,T,U,r"))] "((register_operand (operands[0], SFmode) || register_operand (operands[1], SFmode)) && !(FP_REG_P (xt_true_regnum (operands[0])) @@ -912,13 +914,14 @@ mov\t%0, %1 wfr\t%0, %1 rfr\t%0, %1 + movi\t%0, %y1 const16\t%0, %t1\;const16\t%0, %b1 %v1l32r\t%0, %1 %v1l32i\t%0, %1 %v0s32i\t%1, %0" - [(set_attr "type" "farith,fload,fstore,move,load,store,move,farith,farith,move,load,load,store") + [(set_attr "type" "farith,fload,fstore,move,load,store,move,farith,farith,move,move,load,load,store") (set_attr "mode" "SF") - (set_attr "length" "3,3,3,2,2,2,3,3,3,6,3,3,3")]) + (set_attr "length" "3,3,3,2,2,2,3,3,3,3,6,3,3,3")]) (define_insn "*lsiu" [(set (match_operand:SF 0 "register_operand" "=f") @@ -991,7 +994,7 @@ (match_operand:DF 1 "general_operand" ""))] "" { - if (CONSTANT_P (operands[1]) && !TARGET_CONST16) + if (CONSTANT_P (operands[1]) && !TARGET_CONST16 && !TARGET_AUTO_LITPOOLS) operands[1] = force_const_mem (DFmode, operands[1]); if (!register_operand (operands[0], DFmode) @@ -1002,8 +1005,8 @@ }) (define_insn_and_split "movdf_internal" - [(set (match_operand:DF 0 "nonimmed_operand" "=a,W,a,a,U") - (match_operand:DF 1 "move_operand" "r,iF,T,U,r"))] + [(set (match_operand:DF 0 "nonimmed_operand" "=a,a,W,a,a,U") + (match_operand:DF 1 "move_operand" "r,Y,iF,T,U,r"))] "register_operand (operands[0], DFmode) || register_operand (operands[1], DFmode)" "#" diff --git a/gcc/config/xtensa/xtensa.opt b/gcc/config/xtensa/xtensa.opt index 2fd6cee..21c6e96 100644 --- a/gcc/config/xtensa/xtensa.opt +++ b/gcc/config/xtensa/xtensa.opt @@ -38,6 +38,10 @@ mtext-section-literals Target Intersperse literal pools with code in the text section +mauto-litpools +Target Report Mask(AUTO_LITPOOLS) +Relax literals in assembler and place them automatically in the text section + mserialize-volatile Target Report Mask(SERIALIZE_VOLATILE) -mno-serialize-volatile Do not serialize volatile memory references with MEMW instructions -- 1.8.1.4
shibajee/buildroot
package/gcc/5.4.0/870-xtensa-add-mauto-litpools-option.patch
patch
mit
10,692
From 40507bf199440082ed69b777986d50c31efe2520 Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Mon, 10 Aug 2015 21:35:20 +0300 Subject: [PATCH 1/3] xtensa: reimplement register spilling Spilling windowed registers in userspace is much easier, more portable, less error-prone and equally effective as in kernel. Now that register spilling syscall is considered obsolete in the xtensa linux kernel replace it with CALL12 followed by series of ENTRY in libgcc. 2015-08-18 Max Filippov <jcmvbkbc@gmail.com> libgcc/ * config/xtensa/lib2funcs.S (__xtensa_libgcc_window_spill): Use CALL12 followed by series of ENTRY to spill windowed registers. (__xtensa_nonlocal_goto): Call __xtensa_libgcc_window_spill instead of making linux spill syscall. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: r226962 libgcc/config/xtensa/lib2funcs.S | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/libgcc/config/xtensa/lib2funcs.S b/libgcc/config/xtensa/lib2funcs.S index 4d451c8..ef0703f 100644 --- a/libgcc/config/xtensa/lib2funcs.S +++ b/libgcc/config/xtensa/lib2funcs.S @@ -34,10 +34,29 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see .global __xtensa_libgcc_window_spill .type __xtensa_libgcc_window_spill,@function __xtensa_libgcc_window_spill: - entry sp, 32 - movi a2, 0 - syscall + entry sp, 48 +#if XCHAL_NUM_AREGS > 16 + call12 1f + retw + .align 4 +1: + .rept (XCHAL_NUM_AREGS - 24) / 12 + _entry sp, 48 + mov a12, a0 + .endr + _entry sp, 16 +#if XCHAL_NUM_AREGS % 12 == 0 + mov a4, a4 +#elif XCHAL_NUM_AREGS % 12 == 4 + mov a8, a8 +#elif XCHAL_NUM_AREGS % 12 == 8 + mov a12, a12 +#endif retw +#else + mov a8, a8 + retw +#endif .size __xtensa_libgcc_window_spill, .-__xtensa_libgcc_window_spill #endif @@ -61,10 +80,7 @@ __xtensa_nonlocal_goto: entry sp, 32 /* Flush registers. */ - mov a5, a2 - movi a2, 0 - syscall - mov a2, a5 + call8 __xtensa_libgcc_window_spill /* Because the save area for a0-a3 is stored one frame below the one identified by a2, the only way to restore those -- 1.8.1.4
shibajee/buildroot
package/gcc/5.4.0/871-xtensa-reimplement-register-spilling.patch
patch
mit
2,146
From 7d7a85f75ba218df4a4226e95865fc8fa561cb86 Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Fri, 14 Aug 2015 02:45:02 +0300 Subject: [PATCH 2/3] xtensa: use unwind-dw2-fde-dip instead of unwind-dw2-fde This allows having exception cleanup code in binaries that don't register their unwind tables. 2015-08-18 Max Filippov <jcmvbkbc@gmail.com> libgcc/ * config/xtensa/t-windowed (LIB2ADDEH): Replace unwind-dw2-fde with unwind-dw2-fde-dip. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: r226963 libgcc/config/xtensa/t-windowed | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgcc/config/xtensa/t-windowed b/libgcc/config/xtensa/t-windowed index 7d9e9db..a99156c 100644 --- a/libgcc/config/xtensa/t-windowed +++ b/libgcc/config/xtensa/t-windowed @@ -1,2 +1,2 @@ LIB2ADDEH = $(srcdir)/config/xtensa/unwind-dw2-xtensa.c \ - $(srcdir)/unwind-dw2-fde.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + $(srcdir)/unwind-dw2-fde-dip.c $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c -- 1.8.1.4
shibajee/buildroot
package/gcc/5.4.0/872-xtensa-use-unwind-dw2-fde-dip-instead-of-unwind-dw2-.patch
patch
mit
1,066
From b33905dc310f475ddbde4c9fb7230724b2068a2b Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Sat, 15 Aug 2015 05:12:11 +0300 Subject: [PATCH 3/3] xtensa: fix _Unwind_GetCFA Returning context->cfa in _Unwind_GetCFA makes CFA point one stack frame higher than what was actually used by code at context->ra. This results in invalid CFA value in signal frames and premature unwinding completion in forced unwinding used by uClibc NPTL thread cancellation. Returning context->sp from _Unwind_GetCFA makes all CFA values valid and matching code that used them. 2015-08-18 Max Filippov <jcmvbkbc@gmail.com> libgcc/ * config/xtensa/unwind-dw2-xtensa.c (_Unwind_GetCFA): Return context->sp instead of context->cfa. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: r226964 libgcc/config/xtensa/unwind-dw2-xtensa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgcc/config/xtensa/unwind-dw2-xtensa.c b/libgcc/config/xtensa/unwind-dw2-xtensa.c index 82b0e63..8e579c7 100644 --- a/libgcc/config/xtensa/unwind-dw2-xtensa.c +++ b/libgcc/config/xtensa/unwind-dw2-xtensa.c @@ -130,7 +130,7 @@ _Unwind_GetGR (struct _Unwind_Context *context, int index) _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *context) { - return (_Unwind_Ptr) context->cfa; + return (_Unwind_Ptr) context->sp; } /* Overwrite the saved value for register INDEX in CONTEXT with VAL. */ -- 1.8.1.4
shibajee/buildroot
package/gcc/5.4.0/873-xtensa-fix-_Unwind_GetCFA.patch
patch
mit
1,447
From 70c2cb98fb129b4766b5da0f945dc41fd568c77a Mon Sep 17 00:00:00 2001 From: Max Filippov <jcmvbkbc@gmail.com> Date: Sat, 22 Aug 2015 08:44:26 +0300 Subject: [PATCH] xtensa: add uclinux support 2015-10-03 Max Filippov <jcmvbkbc@gmail.com> gcc/ * config.gcc (xtensa*-*-uclinux*): New configuration. * config/xtensa/uclinux.h: New file. * config/xtensa/uclinux.opt: New file. libgcc/ * config.host (xtensa*-*-uclinux*): New configuration. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> --- Backported from: r228450 gcc/config.gcc | 5 ++++ gcc/config/xtensa/uclinux.h | 69 +++++++++++++++++++++++++++++++++++++++++++ gcc/config/xtensa/uclinux.opt | 32 ++++++++++++++++++++ libgcc/config.host | 5 ++++ 4 files changed, 111 insertions(+) create mode 100644 gcc/config/xtensa/uclinux.h create mode 100644 gcc/config/xtensa/uclinux.opt diff --git a/gcc/config.gcc b/gcc/config.gcc index c52f5a8..56797bd 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -2995,6 +2995,11 @@ xtensa*-*-linux*) tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h" tmake_file="${tmake_file} xtensa/t-xtensa" ;; +xtensa*-*-uclinux*) + tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/uclinux.h" + tmake_file="${tmake_file} xtensa/t-xtensa" + extra_options="${extra_options} xtensa/uclinux.opt" + ;; am33_2.0-*-linux*) tm_file="mn10300/mn10300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h" gas=yes gnu_ld=yes diff --git a/gcc/config/xtensa/uclinux.h b/gcc/config/xtensa/uclinux.h new file mode 100644 index 0000000..4606020 --- /dev/null +++ b/gcc/config/xtensa/uclinux.h @@ -0,0 +1,69 @@ +/* Xtensa uClinux configuration. + Derived from the configuration for GCC for Intel i386 running Linux. + Copyright (C) 2001-2015 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +<http://www.gnu.org/licenses/>. */ + +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + GNU_USER_TARGET_OS_CPP_BUILTINS (); \ + builtin_define ("__uClinux__"); \ + } \ + while (0) + +#undef SUBTARGET_CPP_SPEC +#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}" + +#undef SIZE_TYPE +#define SIZE_TYPE "unsigned int" + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE "int" + +#undef WCHAR_TYPE +#define WCHAR_TYPE "long int" + +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE 32 + +#undef ASM_SPEC +#define ASM_SPEC \ + "%{mtext-section-literals:--text-section-literals} \ + %{mno-text-section-literals:--no-text-section-literals} \ + %{mtarget-align:--target-align} \ + %{mno-target-align:--no-target-align} \ + %{mlongcalls:--longcalls} \ + %{mno-longcalls:--no-longcalls} \ + %{mauto-litpools:--auto-litpools} \ + %{mno-auto-litpools:--no-auto-litpools}" + +#undef LINK_SPEC +#define LINK_SPEC "%{!no-elf2flt:%{!elf2flt*:-elf2flt}}" + +#undef LOCAL_LABEL_PREFIX +#define LOCAL_LABEL_PREFIX "." + +/* Always enable "-fpic" for Xtensa Linux. */ +#define XTENSA_ALWAYS_PIC 1 + +#undef TARGET_LIBC_HAS_FUNCTION +#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function + +#undef DBX_REGISTER_NUMBER + diff --git a/gcc/config/xtensa/uclinux.opt b/gcc/config/xtensa/uclinux.opt new file mode 100644 index 0000000..95ef777 --- /dev/null +++ b/gcc/config/xtensa/uclinux.opt @@ -0,0 +1,32 @@ +; Xtensa uClinux options. + +; Copyright (C) 2015 Free Software Foundation, Inc. +; +; This file is part of GCC. +; +; GCC is free software; you can redistribute it and/or modify it under +; the terms of the GNU General Public License as published by the Free +; Software Foundation; either version 3, or (at your option) any later +; version. +; +; GCC is distributed in the hope that it will be useful, but WITHOUT ANY +; WARRANTY; without even the implied warranty of MERCHANTABILITY or +; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +; for more details. +; +; You should have received a copy of the GNU General Public License +; along with GCC; see the file COPYING3. If not see +; <http://www.gnu.org/licenses/>. + +; See the GCC internals manual (options.texi) for a description of +; this file's format. + +; Please try to keep this file in ASCII collating order. + +elf2flt +Driver + +elf2flt= +Driver JoinedOrMissing + +; This comment is to ensure we retain the blank line above. diff --git a/libgcc/config.host b/libgcc/config.host index 2c64756..2ee92c1 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -1295,6 +1295,11 @@ xtensa*-*-linux*) tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc" md_unwind_header=xtensa/linux-unwind.h ;; +xtensa*-*-uclinux*) + tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux t-slibgcc-libgcc" + md_unwind_header=xtensa/linux-unwind.h + extra_parts="$extra_parts crtbeginS.o crtbeginT.o crtendS.o" + ;; am33_2.0-*-linux*) # Don't need crtbeginT.o from *-*-linux* default. extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o" -- 1.8.1.4
shibajee/buildroot
package/gcc/5.4.0/874-xtensa-add-uclinux-support.patch
patch
mit
5,634
remove unused header, which breaks the toolchain building Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> diff -Nur gcc-5.3.0.orig/libgcc/config/m68k/linux-atomic.c gcc-5.3.0/libgcc/config/m68k/linux-atomic.c --- gcc-5.3.0.orig/libgcc/config/m68k/linux-atomic.c 2015-01-05 13:33:28.000000000 +0100 +++ gcc-5.3.0/libgcc/config/m68k/linux-atomic.c 2016-03-19 09:25:07.000000000 +0100 @@ -33,7 +33,6 @@ using the kernel helper defined below. There is no support for 64-bit operations yet. */ -#include <asm/unistd.h> #include <stdbool.h> #ifndef __NR_atomic_cmpxchg_32
shibajee/buildroot
package/gcc/5.4.0/890-fix-m68k-compile.patch
patch
mit
587
avoids internal compiler error while compiling linux-atomic.c See here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53833 Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> diff -Nur gcc-5.3.0.orig/libgcc/config.host gcc-5.3.0/libgcc/config.host --- gcc-5.3.0.orig/libgcc/config.host 2015-10-01 14:01:18.000000000 +0200 +++ gcc-5.3.0/libgcc/config.host 2016-04-26 21:30:25.353691745 +0200 @@ -794,7 +794,7 @@ m68k*-*-openbsd*) ;; m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux with uClibc - tmake_file="$tmake_file m68k/t-floatlib m68k/t-linux" + tmake_file="$tmake_file m68k/t-floatlib" md_unwind_header=m68k/linux-unwind.h ;; m68k-*-linux*) # Motorola m68k's running GNU/Linux
shibajee/buildroot
package/gcc/5.4.0/891-fix-m68k-uclinux.patch
patch
mit
704
Add dynamic linker support for uClibc Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org> diff -Nur gcc-5.3.0.orig/gcc/config/microblaze/linux.h gcc-5.3.0/gcc/config/microblaze/linux.h --- gcc-5.3.0.orig/gcc/config/microblaze/linux.h 2015-05-28 16:08:19.000000000 +0200 +++ gcc-5.3.0/gcc/config/microblaze/linux.h 2016-05-13 09:21:01.579262885 +0200 @@ -28,7 +28,15 @@ #undef TLS_NEEDS_GOT #define TLS_NEEDS_GOT 1 -#define DYNAMIC_LINKER "/lib/ld.so.1" +#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" +#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" + +#if DEFAULT_LIBC == LIBC_UCLIBC +#define DYNAMIC_LINKER UCLIBC_DYNAMIC_LINKER +#else +#define DYNAMIC_LINKER GLIBC_DYNAMIC_LINKER +#endif + #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ { "dynamic_linker", DYNAMIC_LINKER }
shibajee/buildroot
package/gcc/5.4.0/892-microblaze-uclibc.patch
patch
mit
805
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Wed, 22 Apr 2015 14:11:25 +0000 (+0000) Subject: libitm fixes for musl support X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=e53a4d49c3d03ab8eaddb073cf972c1c46d75338 libitm fixes for musl support On behalf of Szabolcs.Nagy@arm.com 2015-04-22 Gregor Richards <gregor.richards@uwaterloo.ca> * config/arm/hwcap.cc: Use fcntl.h instead of sys/fcntl.h. * config/linux/x86/tls.h: Only use __GLIBC_PREREQ if defined. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222325 138bc75d-0d04-0410-961f-82ee72b054a4 --- Index: b/libitm/config/arm/hwcap.cc =================================================================== --- a/libitm/config/arm/hwcap.cc +++ b/libitm/config/arm/hwcap.cc @@ -40,7 +40,7 @@ #ifdef __linux__ #include <unistd.h> -#include <sys/fcntl.h> +#include <fcntl.h> #include <elf.h> static void __attribute__((constructor)) Index: b/libitm/config/linux/x86/tls.h =================================================================== --- a/libitm/config/linux/x86/tls.h +++ b/libitm/config/linux/x86/tls.h @@ -25,16 +25,19 @@ #ifndef LIBITM_X86_TLS_H #define LIBITM_X86_TLS_H 1 -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) +#if defined(__GLIBC_PREREQ) +#if __GLIBC_PREREQ(2, 10) /* Use slots in the TCB head rather than __thread lookups. GLIBC has reserved words 10 through 13 for TM. */ #define HAVE_ARCH_GTM_THREAD 1 #define HAVE_ARCH_GTM_THREAD_DISP 1 #endif +#endif #include "config/generic/tls.h" -#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) +#if defined(__GLIBC_PREREQ) +#if __GLIBC_PREREQ(2, 10) namespace GTM HIDDEN { #ifdef __x86_64__ @@ -101,5 +104,6 @@ } // namespace GTM #endif /* >= GLIBC 2.10 */ +#endif #endif // LIBITM_X86_TLS_H
shibajee/buildroot
package/gcc/5.4.0/900-libitm-fixes-for-musl-support.patch
patch
mit
1,820
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Wed, 22 Apr 2015 14:18:16 +0000 (+0000) Subject: fixincludes update for musl support X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=2dc727de2e87c2756a514cbb43cea23c99deaa3d fixincludes update for musl support On behalf of Szabolcs.Nagy@arm.com 2015-04-22 Gregor Richards <gregor.richards@uwaterloo.ca> * mkfixinc.sh: Add *-musl* with no fixes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222327 138bc75d-0d04-0410-961f-82ee72b054a4 --- Index: b/fixincludes/mkfixinc.sh =================================================================== --- a/fixincludes/mkfixinc.sh +++ b/fixincludes/mkfixinc.sh @@ -19,7 +19,8 @@ powerpc-*-eabi* | \ powerpc-*-rtems* | \ powerpcle-*-eabisim* | \ - powerpcle-*-eabi* ) + powerpcle-*-eabi* | \ + *-musl* ) # IF there is no include fixing, # THEN create a no-op fixer and exit (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
shibajee/buildroot
package/gcc/5.4.0/901-fixincludes-update-for-musl-support.patch
patch
mit
999
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Wed, 22 Apr 2015 14:20:01 +0000 (+0000) Subject: unwind fix for musl X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=a2e31d0681d8a47389b8a3552622fbd9827bcef4 unwind fix for musl On behalf of szabolcs.nagy@arm.com 2015-04-22 Gregor Richards <gregor.richards@uwaterloo.ca> Szabolcs Nagy <szabolcs.nagy@arm.com> * unwind-dw2-fde-dip.c (USE_PT_GNU_EH_FRAME): Define it on Linux if target provides dl_iterate_phdr. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222328 138bc75d-0d04-0410-961f-82ee72b054a4 --- Index: b/libgcc/unwind-dw2-fde-dip.c =================================================================== --- a/libgcc/unwind-dw2-fde-dip.c +++ b/libgcc/unwind-dw2-fde-dip.c @@ -59,6 +59,12 @@ #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ && defined(TARGET_DL_ITERATE_PHDR) \ + && defined(__linux__) +# define USE_PT_GNU_EH_FRAME +#endif + +#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ + && defined(TARGET_DL_ITERATE_PHDR) \ && (defined(__DragonFly__) || defined(__FreeBSD__)) # define ElfW __ElfN # define USE_PT_GNU_EH_FRAME
shibajee/buildroot
package/gcc/5.4.0/902-unwind-fix-for-musl.patch
patch
mit
1,191
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Wed, 22 Apr 2015 14:24:11 +0000 (+0000) Subject: libstdc++, libgfortran gthr workaround for musl X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=1e5f711c11cb80ce609db9e9c1d8b2da0f7b5b61 libstdc++, libgfortran gthr workaround for musl On behalf of szabolcs.nagy@arm.com [libstdc++-v3/] 2015-04-22 Szabolcs Nagy <szabolcs.nagy@arm.com> * config/os/generic/os_defines.h (_GLIBCXX_GTHREAD_USE_WEAK): Define. * configure.host (os_include_dir): Set to "os/generic" for linux-musl*. [libgfortran/] 2015-04-22 Szabolcs Nagy <szabolcs.nagy@arm.com> * acinclude.m4 (GTHREAD_USE_WEAK): Define as 0 for *-*-musl*. * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222329 138bc75d-0d04-0410-961f-82ee72b054a4 --- Index: b/libgfortran/acinclude.m4 =================================================================== --- a/libgfortran/acinclude.m4 +++ b/libgfortran/acinclude.m4 @@ -100,7 +100,7 @@ [Define to 1 if the target supports #pragma weak]) fi case "$host" in - *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* ) + *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* ) AC_DEFINE(GTHREAD_USE_WEAK, 0, [Define to 0 if the target shouldn't use #pragma weak]) ;; Index: b/libgfortran/configure =================================================================== --- a/libgfortran/configure +++ b/libgfortran/configure @@ -26447,7 +26447,7 @@ fi case "$host" in - *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* ) + *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* ) $as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h Index: b/libstdc++-v3/config/os/generic/os_defines.h =================================================================== --- a/libstdc++-v3/config/os/generic/os_defines.h +++ b/libstdc++-v3/config/os/generic/os_defines.h @@ -33,4 +33,9 @@ // System-specific #define, typedefs, corrections, etc, go here. This // file will come before all others. +// Disable the weak reference logic in gthr.h for os/generic because it +// is broken on every platform unless there is implementation specific +// workaround in gthr-posix.h and at link-time for static linking. +#define _GLIBCXX_GTHREAD_USE_WEAK 0 + #endif Index: b/libstdc++-v3/configure.host =================================================================== --- a/libstdc++-v3/configure.host +++ b/libstdc++-v3/configure.host @@ -271,6 +271,9 @@ freebsd*) os_include_dir="os/bsd/freebsd" ;; + linux-musl*) + os_include_dir="os/generic" + ;; gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) if [ "$uclibc" = "yes" ]; then os_include_dir="os/uclibc"
shibajee/buildroot
package/gcc/5.4.0/903-libstdc++-libgfortran-gthr-workaround-for-musl.patch
patch
mit
2,760
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Fri, 8 May 2015 08:25:47 +0000 (+0000) Subject: [PATCH 2/13] musl libc config X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=a9173ceabaf29c16f8ef226fbf98af373a4b2ceb [PATCH 2/13] musl libc config 2015-05-08 Gregor Richards <gregor.richards@uwaterloo.ca> Szabolcs Nagy <szabolcs.nagy@arm.com> * config.gcc (LIBC_MUSL): New tm_defines macro. * config/linux.h (OPTION_MUSL): Define. (MUSL_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER32,) (MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERX32,) (INCLUDE_DEFAULTS_MUSL_GPP, INCLUDE_DEFAULTS_MUSL_LOCAL,) (INCLUDE_DEFAULTS_MUSL_PREFIX, INCLUDE_DEFAULTS_MUSL_CROSS,) (INCLUDE_DEFAULTS_MUSL_TOOL, INCLUDE_DEFAULTS_MUSL_NATIVE): Define. * config/linux.opt (mmusl): New option. * doc/invoke.texi (GNU/Linux Options): Document -mmusl. * configure.ac (gcc_cv_libc_provides_ssp): Add *-*-musl*. (gcc_cv_target_dl_iterate_phdr): Add *-linux-musl*. * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222904 138bc75d-0d04-0410-961f-82ee72b054a4 --- Index: b/gcc/config.gcc =================================================================== --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -575,7 +575,7 @@ esac # Common C libraries. -tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3" +tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4" # 32-bit x86 processors supported by --with-arch=. Each processor # MUST be separated by exactly one space. @@ -720,6 +720,9 @@ *-*-*uclibc*) tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" ;; + *-*-*musl*) + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL" + ;; *) tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" ;; Index: b/gcc/config/linux.h =================================================================== --- a/gcc/config/linux.h +++ b/gcc/config/linux.h @@ -32,10 +32,12 @@ #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) #else #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) +#define OPTION_MUSL (linux_libc == LIBC_MUSL) #endif #define GNU_USER_TARGET_OS_CPP_BUILTINS() \ @@ -50,21 +52,25 @@ } while (0) /* Determine which dynamic linker to use depending on whether GLIBC or - uClibc or Bionic is the default C library and whether - -muclibc or -mglibc or -mbionic has been passed to change the default. */ + uClibc or Bionic or musl is the default C library and whether + -muclibc or -mglibc or -mbionic or -mmusl has been passed to change + the default. */ -#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \ - "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}" +#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \ + "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}" #if DEFAULT_LIBC == LIBC_GLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ - CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B) +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ + CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M) #elif DEFAULT_LIBC == LIBC_UCLIBC -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ - CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B) +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ + CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M) #elif DEFAULT_LIBC == LIBC_BIONIC -#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ - CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U) +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ + CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M) +#elif DEFAULT_LIBC == LIBC_MUSL +#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ + CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B) #else #error "Unsupported DEFAULT_LIBC" #endif /* DEFAULT_LIBC */ @@ -81,24 +87,100 @@ #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker" #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64" #define BIONIC_DYNAMIC_LINKERX32 "/system/bin/linkerx32" +/* Should be redefined for each target that supports musl. */ +#define MUSL_DYNAMIC_LINKER "/dev/null" +#define MUSL_DYNAMIC_LINKER32 "/dev/null" +#define MUSL_DYNAMIC_LINKER64 "/dev/null" +#define MUSL_DYNAMIC_LINKERX32 "/dev/null" #define GNU_USER_DYNAMIC_LINKER \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \ - BIONIC_DYNAMIC_LINKER) + BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) #define GNU_USER_DYNAMIC_LINKER32 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \ - BIONIC_DYNAMIC_LINKER32) + BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) #define GNU_USER_DYNAMIC_LINKER64 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \ - BIONIC_DYNAMIC_LINKER64) + BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) #define GNU_USER_DYNAMIC_LINKERX32 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \ - BIONIC_DYNAMIC_LINKERX32) + BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32) /* Whether we have Bionic libc runtime */ #undef TARGET_HAS_BIONIC #define TARGET_HAS_BIONIC (OPTION_BIONIC) +/* musl avoids problematic includes by rearranging the include directories. + * Unfortunately, this is mostly duplicated from cppdefault.c */ +#if DEFAULT_LIBC == LIBC_MUSL +#define INCLUDE_DEFAULTS_MUSL_GPP \ + { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \ + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \ + { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \ + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \ + { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \ + GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, + +#ifdef LOCAL_INCLUDE_DIR +#define INCLUDE_DEFAULTS_MUSL_LOCAL \ + { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \ + { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 }, +#else +#define INCLUDE_DEFAULTS_MUSL_LOCAL +#endif + +#ifdef PREFIX_INCLUDE_DIR +#define INCLUDE_DEFAULTS_MUSL_PREFIX \ + { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0}, +#else +#define INCLUDE_DEFAULTS_MUSL_PREFIX +#endif + +#ifdef CROSS_INCLUDE_DIR +#define INCLUDE_DEFAULTS_MUSL_CROSS \ + { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0}, +#else +#define INCLUDE_DEFAULTS_MUSL_CROSS +#endif + +#ifdef TOOL_INCLUDE_DIR +#define INCLUDE_DEFAULTS_MUSL_TOOL \ + { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0}, +#else +#define INCLUDE_DEFAULTS_MUSL_TOOL +#endif + +#ifdef NATIVE_SYSTEM_HEADER_DIR +#define INCLUDE_DEFAULTS_MUSL_NATIVE \ + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ + { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, +#else +#define INCLUDE_DEFAULTS_MUSL_NATIVE +#endif + +#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT) +# undef INCLUDE_DEFAULTS_MUSL_LOCAL +# define INCLUDE_DEFAULTS_MUSL_LOCAL +# undef INCLUDE_DEFAULTS_MUSL_NATIVE +# define INCLUDE_DEFAULTS_MUSL_NATIVE +#else +# undef INCLUDE_DEFAULTS_MUSL_CROSS +# define INCLUDE_DEFAULTS_MUSL_CROSS +#endif + +#undef INCLUDE_DEFAULTS +#define INCLUDE_DEFAULTS \ + { \ + INCLUDE_DEFAULTS_MUSL_GPP \ + INCLUDE_DEFAULTS_MUSL_PREFIX \ + INCLUDE_DEFAULTS_MUSL_CROSS \ + INCLUDE_DEFAULTS_MUSL_TOOL \ + INCLUDE_DEFAULTS_MUSL_NATIVE \ + { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \ + { 0, 0, 0, 0, 0, 0 } \ + } +#endif + #if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */ /* This is a *uclinux* target. We don't define below macros to normal linux versions, because doing so would require *uclinux* targets to include Index: b/gcc/config/linux.opt =================================================================== --- a/gcc/config/linux.opt +++ b/gcc/config/linux.opt @@ -28,5 +28,9 @@ Use GNU C library muclibc -Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic) +Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mmusl) Use uClibc C library + +mmusl +Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mbionic) +Use musl C library Index: b/gcc/configure =================================================================== --- a/gcc/configure +++ b/gcc/configure @@ -27809,6 +27813,9 @@ gcc_cv_target_dl_iterate_phdr=no fi ;; + *-linux-musl*) + gcc_cv_target_dl_iterate_phdr=yes + ;; esac if test x$gcc_cv_target_dl_iterate_phdr = xyes; then Index: b/gcc/configure.ac =================================================================== --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -5298,6 +5302,9 @@ gcc_cv_target_dl_iterate_phdr=no fi ;; + *-linux-musl*) + gcc_cv_target_dl_iterate_phdr=yes + ;; esac GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR]) if test x$gcc_cv_target_dl_iterate_phdr = xyes; then Index: b/gcc/doc/invoke.texi =================================================================== --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -667,7 +667,7 @@ -mcpu=@var{cpu}} @emph{GNU/Linux Options} -@gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol +@gccoptlist{-mglibc -muclibc -mmusl -mbionic -mandroid @gol -tno-android-cc -tno-android-ld} @emph{H8/300 Options} @@ -15324,13 +15324,19 @@ @item -mglibc @opindex mglibc Use the GNU C library. This is the default except -on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets. +on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and +@samp{*-*-linux-*android*} targets. @item -muclibc @opindex muclibc Use uClibc C library. This is the default on @samp{*-*-linux-*uclibc*} targets. +@item -mmusl +@opindex mmusl +Use the musl C library. This is the default on +@samp{*-*-linux-*musl*} targets. + @item -mbionic @opindex mbionic Use Bionic C library. This is the default on
shibajee/buildroot
package/gcc/5.4.0/904-musl-libc-config.patch
patch
mit
10,060
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Fri, 8 May 2015 08:30:40 +0000 (+0000) Subject: [PATCH 0/13] Add musl support to GCC X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=f2d678afa5b8385d763b93772d73d6bf80a9739e [PATCH 0/13] Add musl support to GCC 2015-05-08 Szabolcs Nagy <szabolcs.nagy@arm.com> * config/glibc-stdint.h (OPTION_MUSL): Define. (INT_FAST16_TYPE, INT_FAST32_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE): Change the definition based on OPTION_MUSL for 64 bit targets. * config/linux.h (OPTION_MUSL): Redefine. * config/alpha/linux.h (OPTION_MUSL): Redefine. * config/rs6000/linux.h (OPTION_MUSL): Redefine. * config/rs6000/linux64.h (OPTION_MUSL): Redefine. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222905 138bc75d-0d04-0410-961f-82ee72b054a4 --- Index: b/gcc/config/alpha/linux.h =================================================================== --- a/gcc/config/alpha/linux.h +++ b/gcc/config/alpha/linux.h @@ -61,10 +61,14 @@ #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) +#undef OPTION_MUSL +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) #else #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) +#undef OPTION_MUSL +#define OPTION_MUSL (linux_libc == LIBC_MUSL) #endif /* Determine what functions are present at the runtime; Index: b/gcc/config/glibc-stdint.h =================================================================== --- a/gcc/config/glibc-stdint.h +++ b/gcc/config/glibc-stdint.h @@ -22,6 +22,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ +/* Systems using musl libc should use this header and make sure + OPTION_MUSL is defined correctly before using the TYPE macros. */ +#ifndef OPTION_MUSL +#define OPTION_MUSL 0 +#endif + #define SIG_ATOMIC_TYPE "int" #define INT8_TYPE "signed char" @@ -43,12 +49,12 @@ #define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") #define INT_FAST8_TYPE "signed char" -#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") -#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") +#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int") +#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int") #define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") #define UINT_FAST8_TYPE "unsigned char" -#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int") -#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int") +#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int") +#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int") #define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") #define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") Index: b/gcc/config/linux.h =================================================================== --- a/gcc/config/linux.h +++ b/gcc/config/linux.h @@ -32,11 +32,13 @@ #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) +#undef OPTION_MUSL #define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) #else #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) +#undef OPTION_MUSL #define OPTION_MUSL (linux_libc == LIBC_MUSL) #endif Index: b/gcc/config/rs6000/linux.h =================================================================== --- a/gcc/config/rs6000/linux.h +++ b/gcc/config/rs6000/linux.h @@ -30,10 +30,14 @@ #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) +#undef OPTION_MUSL +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) #else #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) +#undef OPTION_MUSL +#define OPTION_MUSL (linux_libc == LIBC_MUSL) #endif /* Determine what functions are present at the runtime; Index: b/gcc/config/rs6000/linux64.h =================================================================== --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -299,10 +299,14 @@ #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) +#undef OPTION_MUSL +#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) #else #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) +#undef OPTION_MUSL +#define OPTION_MUSL (linux_libc == LIBC_MUSL) #endif /* Determine what functions are present at the runtime;
shibajee/buildroot
package/gcc/5.4.0/905-add-musl-support-to-gcc.patch
patch
mit
5,289
From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Fri, 8 May 2015 15:16:50 +0000 (+0000) Subject: [PATCH 6/13] mips musl support X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=2550b6a866c887472b587bef87d433c51cf1ebc8 [PATCH 6/13] mips musl support 2015-05-08 Gregor Richards <gregor.richards@uwaterloo.ca> Szabolcs Nagy <szabolcs.nagy@arm.com> * config/mips/linux.h (MUSL_DYNAMIC_LINKER32): Define. (MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERN32): Define. (GNU_USER_DYNAMIC_LINKERN32): Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222915 138bc75d-0d04-0410-961f-82ee72b054a4 --- Index: b/gcc/config/mips/linux.h =================================================================== --- a/gcc/config/mips/linux.h +++ b/gcc/config/mips/linux.h @@ -37,7 +37,13 @@ #define UCLIBC_DYNAMIC_LINKERN32 \ "%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}" +#undef MUSL_DYNAMIC_LINKER32 +#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-mips%{EL:el}%{msoft-float:-sf}.so.1" +#undef MUSL_DYNAMIC_LINKER64 +#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-mips64%{EL:el}%{msoft-float:-sf}.so.1" +#define MUSL_DYNAMIC_LINKERN32 "/lib/ld-musl-mipsn32%{EL:el}%{msoft-float:-sf}.so.1" + #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32" #define GNU_USER_DYNAMIC_LINKERN32 \ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \ - BIONIC_DYNAMIC_LINKERN32) + BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32)
shibajee/buildroot
package/gcc/5.4.0/906-mips-musl-support.patch
patch
mit
1,550