sys-devel/kgcc64: drop GCC_FILESDIR override, bug #629776
authorSergei Trofimovich <slyfox@gentoo.org>
Sat, 16 Sep 2017 08:43:11 +0000 (09:43 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Sat, 16 Sep 2017 09:25:08 +0000 (10:25 +0100)
GCC_FILESDIR support was broken by portage-2.3.6 commit:
    https://github.com/gentoo/portage/commit/0637c95545ab7dc0bb5d091de221b9e99e2cf5b2
("portage.package.ebuild: Use a fake FILESDIR to catch invalid accesses")

Unfortunately it was applied to older EAPIs without fixing all
the users first.

The change yanks GCC_FILESDIR override support and copies
FILESDIR files used by toolchain.eclass in crosscompilation
mode only (kgcc does not support native builds)

Bug: https://bugs.gentoo.org/629776
Package-Manager: Portage-2.3.8, Repoman-2.3.3

19 files changed:
sys-devel/kgcc64/files/4.1.0/gcc-4.1.0-cross-compile.patch [new file with mode: 0644]
sys-devel/kgcc64/files/gcc-configure-LANG.patch [new file with mode: 0644]
sys-devel/kgcc64/files/gcc-configure-texinfo.patch [new file with mode: 0644]
sys-devel/kgcc64/kgcc64-3.4.6.ebuild
sys-devel/kgcc64/kgcc64-4.1.2.ebuild
sys-devel/kgcc64/kgcc64-4.2.4.ebuild
sys-devel/kgcc64/kgcc64-4.3.5.ebuild
sys-devel/kgcc64/kgcc64-4.4.5.ebuild
sys-devel/kgcc64/kgcc64-4.4.6.ebuild
sys-devel/kgcc64/kgcc64-4.5.3.ebuild
sys-devel/kgcc64/kgcc64-4.5.4.ebuild
sys-devel/kgcc64/kgcc64-4.6.4.ebuild
sys-devel/kgcc64/kgcc64-4.7.3.ebuild
sys-devel/kgcc64/kgcc64-4.7.4.ebuild
sys-devel/kgcc64/kgcc64-4.8.3.ebuild
sys-devel/kgcc64/kgcc64-4.8.5.ebuild
sys-devel/kgcc64/kgcc64-4.9.4.ebuild
sys-devel/kgcc64/kgcc64-5.4.0.ebuild
sys-devel/kgcc64/kgcc64-6.3.0.ebuild

diff --git a/sys-devel/kgcc64/files/4.1.0/gcc-4.1.0-cross-compile.patch b/sys-devel/kgcc64/files/4.1.0/gcc-4.1.0-cross-compile.patch
new file mode 100644 (file)
index 0000000..523caa4
--- /dev/null
@@ -0,0 +1,40 @@
+Some notes on the 'bootstrap with or without libc headers' debate:
+http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html
+http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html
+
+--- gcc/unwind-dw2.c
++++ gcc/unwind-dw2.c
+@@ -253,9 +253,11 @@
+ }
+ #endif
+ 
++#ifndef inhibit_libc
+ #ifdef MD_UNWIND_SUPPORT
+ #include MD_UNWIND_SUPPORT
+ #endif
++#endif
+ \f
+ /* Extract any interesting information from the CIE for the translation
+    unit F belongs to.  Return a pointer to the byte after the augmentation,
+--- gcc/configure
++++ gcc/configure
+@@ -12857,7 +12857,7 @@ then
+           | powerpc*-*-*,powerpc64*-*-*)
+               CROSS="$CROSS -DNATIVE_CROSS" ;;
+       esac
+-elif test "x$TARGET_SYSTEM_ROOT" != x; then
++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
+         SYSTEM_HEADER_DIR=$build_system_header_dir
+ fi
+ 
+--- gcc/configure.ac
++++ gcc/configure.ac
+@@ -1717,7 +1717,7 @@ then
+           | powerpc*-*-*,powerpc64*-*-*)
+               CROSS="$CROSS -DNATIVE_CROSS" ;;
+       esac
+-elif test "x$TARGET_SYSTEM_ROOT" != x; then
++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then
+         SYSTEM_HEADER_DIR=$build_system_header_dir 
+ fi
+ 
diff --git a/sys-devel/kgcc64/files/gcc-configure-LANG.patch b/sys-devel/kgcc64/files/gcc-configure-LANG.patch
new file mode 100644 (file)
index 0000000..d1b1b03
--- /dev/null
@@ -0,0 +1,64 @@
+The LANG vars aren't reset early enough so when sed tries to use [a-zA-Z] in 
+option parsing, it may break.
+
+http://bugs.gentoo.org/103483
+
+--- configure
++++ configure
+@@ -54,6 +54,19 @@
+ infodir='${prefix}/info'
+ mandir='${prefix}/man'
+ 
++# NLS nuisances.
++for as_var in \
++  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++  LC_TELEPHONE LC_TIME
++do
++  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
++    eval $as_var=C; export $as_var
++  else
++    unset $as_var
++  fi
++done
++
+ # Initialize some other variables.
+ subdirs=
+ MFLAGS= MAKEFLAGS=
+@@ -452,16 +463,6 @@
+   esac
+ done
+ 
+-# NLS nuisances.
+-# Only set these to C if already set.  These must not be set unconditionally
+-# because not all systems understand e.g. LANG=C (notably SCO).
+-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+-# Non-C LC_CTYPE values break the ctype check.
+-if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+-if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+-
+ # confdefs.h avoids OS command line length limits that DEFS can exceed.
+ rm -rf conftest* confdefs.h
+ # AIX cpp loses on an empty file, so make sure it contains at least a newline.
+@@ -1850,6 +1850,19 @@
+ # Compiler output produced by configure, useful for debugging
+ # configure, is in ./config.log if it exists.
+ 
++# NLS nuisances.
++for as_var in \
++  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
++  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
++  LC_TELEPHONE LC_TIME
++do
++  if (set +x; test -z "`(eval \$as_var=C; export \$as_var) 2>&1`"); then
++    eval \$as_var=C; export \$as_var
++  else
++    unset \$as_var
++  fi
++done
++
+ ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+ for ac_option
+ do
diff --git a/sys-devel/kgcc64/files/gcc-configure-texinfo.patch b/sys-devel/kgcc64/files/gcc-configure-texinfo.patch
new file mode 100644 (file)
index 0000000..ddc098d
--- /dev/null
@@ -0,0 +1,16 @@
+Chances are quite good that the installed makeinfo is sufficient.
+So ignore false positives where the makeinfo installed is so new
+that it violates the cheesy version grep.
+
+http://bugs.gentoo.org/198182
+
+--- configure
++++ configure
+@@ -3573,6 +3573,6 @@
+       :
+     else
+-      MAKEINFO="$MISSING makeinfo"
++      :
+     fi
+     ;;
+ 
index a11b85f78a5abb13d7af39d62cfbb77d31b96253..efe40943f4e172ada98236eb8ca7866bd8e91907 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=4
@@ -16,7 +16,6 @@ TOOLCHAIN_ALLOWED_LANGS="c"
 GCC_TARGET_NO_MULTILIB=true
 
 PATCH_VER="1.2"
-GCC_FILESDIR=${FILESDIR/${PN}/gcc}
 
 inherit eutils toolchain
 
@@ -34,7 +33,7 @@ DEPEND="hppa? ( sys-devel/binutils-hppa64 )
 
 src_prepare() {
        toolchain_src_prepare
-       epatch "${GCC_FILESDIR}"/3.4.4/gcc-3.4.4-cross-compile.patch
+       epatch "${FILESDIR}"/3.4.4/gcc-3.4.4-cross-compile.patch
 
        # Arch stuff
        case $(tc-arch) in
@@ -42,7 +41,7 @@ src_prepare() {
                        # Patch forward-ported from a gcc-3.0.x patch that adds -march=r10000 and
                        # -mtune=r10000 support to gcc (Allows the compiler to generate code to
                        # take advantage of R10k's second ALU, perform shifts, etc..
-                       epatch "${GCC_FILESDIR}"/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch
+                       epatch "${FILESDIR}"/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch
 
                        # This is a very special patch -- it allows us to build kernels on SGI IP28
                        # (Indigo2 Impact R10000) systems.
@@ -54,7 +53,7 @@ src_prepare() {
                        # The option also accepts a flag, which are highlighted below:
                        #       -mr10k-cache-barrier=1 - Protect stores only (IP28)
                        #       -mr10k-cache-barrier=2 - Protect stores and loads (IP32 R10K)
-                       epatch "${GCC_FILESDIR}"/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch
+                       epatch "${FILESDIR}"/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch
                        ;;
        esac
 }
index 06a1d5cb051ebceed9a30ef1b6427f3f016f7d0f..1b944aebd722909526ab357254200e0c91ffe5e2 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=4
@@ -16,7 +16,6 @@ TOOLCHAIN_ALLOWED_LANGS="c"
 GCC_TARGET_NO_MULTILIB=true
 
 PATCH_VER="1.0.1"
-GCC_FILESDIR=${FILESDIR/${PN}/gcc}
 
 inherit eutils toolchain
 
@@ -35,7 +34,7 @@ DEPEND="hppa? ( sys-devel/binutils-hppa64 )
 src_prepare() {
        toolchain_src_prepare
        # Fix cross-compiling
-       epatch "${GCC_FILESDIR}"/4.1.0/gcc-4.1.0-cross-compile.patch
+       epatch "${FILESDIR}"/4.1.0/gcc-4.1.0-cross-compile.patch
 }
 
 pkg_postinst() {
index 507cca65d8dbded565cfc7773c7e5b1864d012cb..280b4f0fb815cb5e23fe6fb8d40e5f1d2a29bac6 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=4
@@ -16,7 +16,6 @@ TOOLCHAIN_ALLOWED_LANGS="c"
 GCC_TARGET_NO_MULTILIB=true
 
 PATCH_VER="1.0"
-GCC_FILESDIR=${FILESDIR/${PN}/gcc}
 
 inherit eutils toolchain
 
index dab1a17f788161ad36fe12b0dba667e73cf7e3f9..d42caa3d104cf9fb774e48f29406e002338e3100 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=4
@@ -16,7 +16,6 @@ TOOLCHAIN_ALLOWED_LANGS="c"
 GCC_TARGET_NO_MULTILIB=true
 
 PATCH_VER="1.1"
-GCC_FILESDIR=${FILESDIR/${PN}/gcc}
 
 inherit eutils toolchain
 
index 72c0334e2acb98fa0f8c5a84b1eaa0ae8c20b0f8..a40dfa3752db9bc0eb5b00f3525e0d7c45620953 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=4
@@ -16,7 +16,6 @@ TOOLCHAIN_ALLOWED_LANGS="c"
 GCC_TARGET_NO_MULTILIB=true
 
 PATCH_VER="1.2"
-GCC_FILESDIR=${FILESDIR/${PN}/gcc}
 
 inherit eutils toolchain
 
index 44fb7243b55204605f465b8aee7a5e582a6fa1f8..4cf0932591db39558a6b2071b4d92d8fb1eb567e 100644 (file)
@@ -16,7 +16,6 @@ TOOLCHAIN_ALLOWED_LANGS="c"
 GCC_TARGET_NO_MULTILIB=true
 
 PATCH_VER="1.0"
-GCC_FILESDIR=${FILESDIR/${PN}/gcc}
 
 inherit eutils toolchain
 
index ae7a058dcac18c8aba9ed110d614b3f46808d5aa..4d7b7305dff781cb89146dbe2c5f280da309f6b4 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=4
@@ -16,7 +16,6 @@ TOOLCHAIN_ALLOWED_LANGS="c"
 GCC_TARGET_NO_MULTILIB=true
 
 PATCH_VER="1.4"
-GCC_FILESDIR=${FILESDIR/${PN}/gcc}
 
 inherit eutils toolchain
 
index 8a98169637fe55b4cf33720d2942fcede579535e..f89cae018873a38fbf4c3f27e2c7e1b1af5ca064 100644 (file)
@@ -16,7 +16,6 @@ TOOLCHAIN_ALLOWED_LANGS="c"
 GCC_TARGET_NO_MULTILIB=true
 
 PATCH_VER="1.2"
-GCC_FILESDIR=${FILESDIR/${PN}/gcc}
 
 inherit eutils toolchain
 
index 5f6fc1d5a61290398f636d5e325eb6001de17778..df9275b1676366103963cb6b4c8e3f16629161fd 100644 (file)
@@ -16,7 +16,6 @@ TOOLCHAIN_ALLOWED_LANGS="c"
 GCC_TARGET_NO_MULTILIB=true
 
 PATCH_VER="1.0"
-GCC_FILESDIR=${FILESDIR/${PN}/gcc}
 
 inherit eutils toolchain
 
index 8c72bb1ba7b1cb341e90502a66dc99b799c9a6fd..0fb3d04c68e16f29b3a8d3c3bda1d109bdb2aa65 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=4
@@ -16,7 +16,6 @@ TOOLCHAIN_ALLOWED_LANGS="c"
 GCC_TARGET_NO_MULTILIB=true
 
 PATCH_VER="1.3"
-GCC_FILESDIR=${FILESDIR/${PN}/gcc}
 
 inherit eutils toolchain
 
index 787c3e6b10b9a0770ac8d676dd42f64f739e3264..e126ea64f8d61668264a6d70492c813ead3288b0 100644 (file)
@@ -16,7 +16,6 @@ TOOLCHAIN_ALLOWED_LANGS="c"
 GCC_TARGET_NO_MULTILIB=true
 
 PATCH_VER="1.0"
-GCC_FILESDIR=${FILESDIR/${PN}/gcc}
 
 inherit eutils toolchain
 
index 5c2352ce4302501d2911e9c9b092e5d456e48d9e..731074eedc19256b88bdcc9905608eb3068885fb 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=4
@@ -16,7 +16,6 @@ TOOLCHAIN_ALLOWED_LANGS="c"
 GCC_TARGET_NO_MULTILIB=true
 
 PATCH_VER="1.1"
-GCC_FILESDIR=${FILESDIR/${PN}/gcc}
 
 inherit eutils toolchain
 
index a5ef49425d75ad5a992ba997c87873f546af4e68..90d69128a02c5abb3f65103f49f56ba654f3554f 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=4
@@ -16,7 +16,6 @@ TOOLCHAIN_ALLOWED_LANGS="c"
 GCC_TARGET_NO_MULTILIB=true
 
 PATCH_VER="1.3"
-GCC_FILESDIR=${FILESDIR/${PN}/gcc}
 
 inherit eutils toolchain
 
index 96fab0c3816ea8bdace0938e996f3c33dc07fd4c..40df19c0457a54e914e72b90d3dabbc154022efb 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=4
@@ -16,7 +16,6 @@ TOOLCHAIN_ALLOWED_LANGS="c"
 GCC_TARGET_NO_MULTILIB=true
 
 PATCH_VER="1.0"
-GCC_FILESDIR=${FILESDIR/${PN}/gcc}
 
 inherit eutils toolchain
 
index 919b590103c1e8788da7587b22b609f3098577c0..40df19c0457a54e914e72b90d3dabbc154022efb 100644 (file)
@@ -16,7 +16,6 @@ TOOLCHAIN_ALLOWED_LANGS="c"
 GCC_TARGET_NO_MULTILIB=true
 
 PATCH_VER="1.0"
-GCC_FILESDIR=${FILESDIR/${PN}/gcc}
 
 inherit eutils toolchain
 
index e51d7af905e15101e7a1f6342debe3cb523dac2c..12508960bb418813e5e49763b54bb328fcbbddd5 100644 (file)
@@ -16,7 +16,6 @@ TOOLCHAIN_ALLOWED_LANGS="c"
 GCC_TARGET_NO_MULTILIB=true
 
 PATCH_VER="1.0"
-GCC_FILESDIR=${FILESDIR/${PN}/gcc}
 
 inherit eutils toolchain