summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2018-02-05 14:24:24 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2018-02-08 15:41:08 +0100
commit3edabf9daa3a5be7f0a70dd478beb763a48472b2 (patch)
tree4610e70921dd37eb4b794466aa527ab51fd29a4a
parent8c6683ef45561aac852c29dd9b338071b2cdaea7 (diff)
downloadOSELAS.Toolchain-3edabf9daa3a5be7f0a70dd478beb763a48472b2.tar.gz
gcc-7-20180201 patches
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--patches/gcc-7-20180201/0200-no-host-includes.patch55
-rw-r--r--patches/gcc-7-20180201/0201-gcc-i386-use-pure64-CLFS-patch.patch47
-rw-r--r--patches/gcc-7-20180201/0202-aarch64-change-paths-for-pure64.patch22
-rw-r--r--patches/gcc-7-20180201/0300-also-match-uclibc-when-checking-host-os.patch26
-rw-r--r--patches/gcc-7-20180201/0302-c99-snprintf.patch24
-rw-r--r--patches/gcc-7-20180201/0400-libiberty-pic.patch24
-rw-r--r--patches/gcc-7-20180201/0401-libstdc-pic.patch58
-rw-r--r--patches/gcc-7-20180201/series14
8 files changed, 270 insertions, 0 deletions
diff --git a/patches/gcc-7-20180201/0200-no-host-includes.patch b/patches/gcc-7-20180201/0200-no-host-includes.patch
new file mode 100644
index 0000000..6d7bffe
--- /dev/null
+++ b/patches/gcc-7-20180201/0200-no-host-includes.patch
@@ -0,0 +1,55 @@
+From: Marc Kleine-Budde <m.kleine-budde@pengutronix.de>
+Date: Tue, 1 Nov 2011 18:25:06 +0100
+Subject: [PATCH] no host includes
+
+With this patch gcc bails out if you include a host include path into
+the searchlist (-I). This patch is not intended for upstream and was
+inspired by
+
+http://www.openembedded.org/repo/org.openembedded.dev/packages/gcc/gcc-4.1.1/zecke-no-host-includes.patch
+
+Signed-off-by: Marc Kleine-Budde <m.kleine-budde@pengutronix.de>
+Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
+---
+ gcc/incpath.c | 28 ++++++++++++++++++++++++++++
+ 1 file changed, 28 insertions(+)
+
+diff --git a/gcc/incpath.c b/gcc/incpath.c
+index 98fe5ec9ab36..d3008c7311e6 100644
+--- a/gcc/incpath.c
++++ b/gcc/incpath.c
+@@ -450,6 +450,34 @@ add_path (char *path, int chain, int cxx_aware, bool user_supplied_p)
+ p->construct = 0;
+ p->user_supplied_p = user_supplied_p;
+
++#ifdef CROSS_COMPILE
++ /* A common error when cross compiling is including
++ host headers. This code below will try to fail fast
++ for cross compiling. Currently we consider /usr/include,
++ /opt/include and /sw/include as harmful. */
++ {
++ unsigned int i;
++ const char *bad_path[] = {
++ "/usr/include",
++ "/usr/local/include",
++ "/sw/include",
++ "/opt/include",
++ };
++
++ for (i = 0; i < sizeof(bad_path)/sizeof(bad_path[0]); i++) {
++ if( strstr(p->name, bad_path[i]) == p->name ) {
++ fprintf(stderr,_("\n"
++ "CROSS COMPILE Badness: %s in INCLUDEPATH: %s\n"
++ "\n"),
++
++ bad_path[i], p->name);
++
++ exit (FATAL_EXIT_CODE);
++ }
++ }
++ }
++#endif
++
+ add_cpp_dir_path (p, chain);
+ }
+
diff --git a/patches/gcc-7-20180201/0201-gcc-i386-use-pure64-CLFS-patch.patch b/patches/gcc-7-20180201/0201-gcc-i386-use-pure64-CLFS-patch.patch
new file mode 100644
index 0000000..72a3554
--- /dev/null
+++ b/patches/gcc-7-20180201/0201-gcc-i386-use-pure64-CLFS-patch.patch
@@ -0,0 +1,47 @@
+From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= <andreas@biessmann.de>
+Date: Thu, 9 Feb 2012 13:59:12 +0100
+Subject: [PATCH] gcc/i386: use pure64 CLFS patch
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is a modified version of
+http://trac.cross-lfs.org/browser/patches/gcc-4.6.0-pure64-1.patch to use /lib
+instead of /lib64 for x86_64.
+This will only work as generic patch, if we do _not_ build multilib x86
+toolchains.
+
+Signed-off-by: Andreas BieƟmann <andreas@biessmann.de>
+---
+ gcc/config/i386/linux64.h | 4 ++--
+ gcc/config/i386/t-linux64 | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
+index e65c404ff919..397663eb6621 100644
+--- a/gcc/config/i386/linux64.h
++++ b/gcc/config/i386/linux64.h
+@@ -27,8 +27,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ #define GNU_USER_LINK_EMULATION64 "elf_x86_64"
+ #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
++#define GLIBC_DYNAMIC_LINKER32 "/lib32/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-linux-x86-64.so.2"
+ #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
+
+ #undef MUSL_DYNAMIC_LINKER32
+diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
+index e422c442daec..3c557f43ad9c 100644
+--- a/gcc/config/i386/t-linux64
++++ b/gcc/config/i386/t-linux64
+@@ -33,6 +33,6 @@
+ comma=,
+ MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
+ MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
+-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
+-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
++MULTILIB_OSDIRNAMES = m64=../lib$(call if_multiarch,:x86_64-linux-gnu)
++MULTILIB_OSDIRNAMES+= m32=../lib32$(call if_multiarch,:i386-linux-gnu)
+ MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
diff --git a/patches/gcc-7-20180201/0202-aarch64-change-paths-for-pure64.patch b/patches/gcc-7-20180201/0202-aarch64-change-paths-for-pure64.patch
new file mode 100644
index 0000000..c42fa48
--- /dev/null
+++ b/patches/gcc-7-20180201/0202-aarch64-change-paths-for-pure64.patch
@@ -0,0 +1,22 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Sun, 7 Dec 2014 21:07:28 +0100
+Subject: [PATCH] aarch64: change paths for pure64
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ gcc/config/aarch64/t-aarch64-linux | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux
+index ab064ab6f223..ad070d7e98e7 100644
+--- a/gcc/config/aarch64/t-aarch64-linux
++++ b/gcc/config/aarch64/t-aarch64-linux
+@@ -22,7 +22,7 @@ LIB1ASMSRC = aarch64/lib1funcs.asm
+ LIB1ASMFUNCS = _aarch64_sync_cache_range
+
+ AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
+-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
++MULTILIB_OSDIRNAMES = mabi.lp64=../lib$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
+ MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
+
+ MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32
diff --git a/patches/gcc-7-20180201/0300-also-match-uclibc-when-checking-host-os.patch b/patches/gcc-7-20180201/0300-also-match-uclibc-when-checking-host-os.patch
new file mode 100644
index 0000000..e5d01a6
--- /dev/null
+++ b/patches/gcc-7-20180201/0300-also-match-uclibc-when-checking-host-os.patch
@@ -0,0 +1,26 @@
+From: Robert Schwebel <r.schwebel@pengutronix.de>
+Date: Tue, 1 Nov 2011 18:25:07 +0100
+Subject: [PATCH] also match uclibc when checking host os
+
+This patch was taken from uclibc.
+
+Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
+---
+ contrib/regression/objs-gcc.sh | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/contrib/regression/objs-gcc.sh b/contrib/regression/objs-gcc.sh
+index 60b0497fea24..6dc7eadff360 100755
+--- a/contrib/regression/objs-gcc.sh
++++ b/contrib/regression/objs-gcc.sh
+@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-gnu ]
+ 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
diff --git a/patches/gcc-7-20180201/0302-c99-snprintf.patch b/patches/gcc-7-20180201/0302-c99-snprintf.patch
new file mode 100644
index 0000000..7ea8a91
--- /dev/null
+++ b/patches/gcc-7-20180201/0302-c99-snprintf.patch
@@ -0,0 +1,24 @@
+From: Robert Schwebel <r.schwebel@pengutronix.de>
+Date: Tue, 1 Nov 2011 18:25:07 +0100
+Subject: [PATCH] c99 snprintf
+
+This patch was taken from uclibc.
+
+Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
+---
+ libstdc++-v3/include/c_global/cstdio | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libstdc++-v3/include/c_global/cstdio b/libstdc++-v3/include/c_global/cstdio
+index d1c958b63834..01d9b80fd07f 100644
+--- a/libstdc++-v3/include/c_global/cstdio
++++ b/libstdc++-v3/include/c_global/cstdio
+@@ -146,7 +146,7 @@ namespace std
+ using ::vsprintf;
+ } // namespace
+
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined __UCLIBC__
+
+ #undef snprintf
+ #undef vfscanf
diff --git a/patches/gcc-7-20180201/0400-libiberty-pic.patch b/patches/gcc-7-20180201/0400-libiberty-pic.patch
new file mode 100644
index 0000000..1b0548e
--- /dev/null
+++ b/patches/gcc-7-20180201/0400-libiberty-pic.patch
@@ -0,0 +1,24 @@
+From: Marc Kleine-Budde <m.kleine-budde@pengutronix.de>
+Date: Tue, 1 Nov 2011 18:25:08 +0100
+Subject: [PATCH] libiberty pic
+
+Taken from gentoo.
+
+Signed-off-by: Marc Kleine-Budde <m.kleine-budde@pengutronix.de>
+Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
+---
+ libiberty/Makefile.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
+index 25cfa29ad5eb..556c06872587 100644
+--- a/libiberty/Makefile.in
++++ b/libiberty/Makefile.in
+@@ -261,6 +261,7 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
+ $(AR) $(AR_FLAGS) $(TARGETLIB) \
+ $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
+ $(RANLIB) $(TARGETLIB); \
++ cp $(TARGETLIB) ../ ; \
+ cd ..; \
+ else true; fi
+
diff --git a/patches/gcc-7-20180201/0401-libstdc-pic.patch b/patches/gcc-7-20180201/0401-libstdc-pic.patch
new file mode 100644
index 0000000..76a10ad
--- /dev/null
+++ b/patches/gcc-7-20180201/0401-libstdc-pic.patch
@@ -0,0 +1,58 @@
+From: Marc Kleine-Budde <m.kleine-budde@pengutronix.de>
+Date: Tue, 1 Nov 2011 18:25:08 +0100
+Subject: [PATCH] libstdc++ pic
+
+Install libstdc++_pic.a if we have pic objs. Taken from gentoo.
+
+Signed-off-by: Marc Kleine-Budde <m.kleine-budde@pengutronix.de>
+Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
+---
+ libstdc++-v3/src/Makefile.am | 7 +++++++
+ libstdc++-v3/src/Makefile.in | 9 ++++++++-
+ 2 files changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
+index a3c0d98ba862..f468495ecbb1 100644
+--- a/libstdc++-v3/src/Makefile.am
++++ b/libstdc++-v3/src/Makefile.am
+@@ -220,6 +220,13 @@ CXXLINK = \
+ $(VTV_CXXLINKFLAGS) \
+ $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
+
++install-exec-local:
++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
++ if [ x"$$pic_objs" != x ]; then \
++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
++ fi
++
+ # Symbol versioning for shared libraries.
+ if ENABLE_SYMVERS
+ libstdc++-symbols.ver: ${glibcxx_srcdir}/$(SYMVER_FILE) \
+diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
+index 7594c3fe62ec..483647f2feac 100644
+--- a/libstdc++-v3/src/Makefile.in
++++ b/libstdc++-v3/src/Makefile.in
+@@ -832,7 +832,7 @@ install-dvi: install-dvi-recursive
+
+ install-dvi-am:
+
+-install-exec-am: install-toolexeclibLTLIBRARIES
++install-exec-am: install-toolexeclibLTLIBRARIES install-exec-local
+
+ install-html: install-html-recursive
+
+@@ -1031,6 +1031,13 @@ install-debug: build-debug
+ (cd ${debugdir} && $(MAKE) CXXFLAGS='$(DEBUG_FLAGS)' \
+ toolexeclibdir=$(glibcxx_toolexeclibdir)/debug install) ;
+
++install-exec-local:
++ pic_objs=`sed -n "s:'::g;s:^pic_object=::p" *.lo | grep -v '^none$$'`; \
++ if [ x"$$pic_objs" != x ]; then \
++ $(AR) cru libstdc++_pic.a $$pic_objs $(top_builddir)/libsupc++/*.o || exit 1; \
++ $(INSTALL_DATA) libstdc++_pic.a $(DESTDIR)$(toolexeclibdir) || exit 1; \
++ fi
++
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
diff --git a/patches/gcc-7-20180201/series b/patches/gcc-7-20180201/series
new file mode 100644
index 0000000..acd4029
--- /dev/null
+++ b/patches/gcc-7-20180201/series
@@ -0,0 +1,14 @@
+# generated by git-ptx-patches
+#tag:base
+#tag:Upstream --start-number 100
+#tag:OSELAS.toolchain --start-number 200
+0200-no-host-includes.patch
+0201-gcc-i386-use-pure64-CLFS-patch.patch
+0202-aarch64-change-paths-for-pure64.patch
+#tag:uclibc --start-number 300
+0300-also-match-uclibc-when-checking-host-os.patch
+#0302-c99-snprintf.patch
+#tag:gentoo --start-number 400
+0400-libiberty-pic.patch
+0401-libstdc-pic.patch
+# bdbd0c15550577195e41bb0cf4eff162 - git-ptx-patches magic