commit:     fc1019027bbed36b434ed818b4a3dc848a3679b6
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 17 09:52:12 2019 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Jun 17 09:52:12 2019 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=fc101902

scripts/bootstrap-prefix: fix make bootstrap

Due to wrongly patched make, it would segfault when globs are used (as
for m4-1.4.18 and sed-4.7).  This crash was previously ignored by
bootstrapping m4-1.4.17, but resurfaced in stage2 when sed-4.7 is
installed.

Just define __alloca and __stat for GNU/Linux hosts, because that should
work everywhere.  We technically don't need the m4 fix any more because
we can use (fixed) 1.4.18, but keep it around as it doesn't hurt much.

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 scripts/bootstrap-prefix.sh | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 7a7d78ad0f..f8ce6c86c5 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -807,25 +807,16 @@ bootstrap_gnu() {
 
        local myconf=""
        if [[ ${PN} == "make" && ${PV} == "4.2.1" ]] ; then
-               # mimick 
http://git.savannah.gnu.org/cgit/make.git/commit/?id=48c8a116a914a325a0497721f5d8b58d5bba34d4
-               local oldl="# if _GNU_GLOB_INTERFACE_VERSION == 
GLOB_INTERFACE_VERSION"
-               local newl="# if _GNU_GLOB_INTERFACE_VERSION == 1 || 
_GNU_GLOB_INTERFACE_VERSION == 2"
-               mv configure.ac{,.orig}
-               mv configure{,.orig}
-               sed -e '/^#define GLOB_INTERFACE_VERSION 1/d' \
-                       -e "s/^${oldl}/${newl}/" \
-                       configure.ac.orig > configure.ac
-               sed -e '/^#define GLOB_INTERFACE_VERSION 1/d' \
-                       -e "s/^${oldl}/${newl}/" \
-                       configure.orig > configure
-               chmod 755 configure
-               touch -r configure.ac{.orig,}
-               touch -r configure{.orig,}
+               if [[ ${CHOST} == *-linux-gnu* ]] ; then
+                       # force this, macros aren't set correctly with newer 
glibc
+                       export CPPFLAGS="${CPPFLAGS} -D__alloca=alloca 
-D__stat=stat"
+               fi
        fi
 
        if [[ ${PN} == "m4" ]] ; then
                # drop _GL_WARN_ON_USE which gets turned into an error with
-               # recent GCC
+               # recent GCC 1.4.17 and below only, on 1.4.18 this expression
+               # doesn't match
                sed -i -e '/_GL_WARN_ON_USE (gets/d' lib/stdio.in.h lib/stdio.h
        fi
 

Reply via email to