summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2019-06-17 11:52:12 +0200
committerFabian Groffen <grobian@gentoo.org>2019-06-17 11:52:12 +0200
commitfc1019027bbed36b434ed818b4a3dc848a3679b6 (patch)
tree1b311b70b57b61f3cbaeaa6c1dc3ec3a60cdaf70
parentscripts/bootstrap-prefix: fix compilation of m4 on newer glibc/gcc (diff)
downloadprefix-fc1019027bbed36b434ed818b4a3dc848a3679b6.tar.gz
prefix-fc1019027bbed36b434ed818b4a3dc848a3679b6.tar.bz2
prefix-fc1019027bbed36b434ed818b4a3dc848a3679b6.zip
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@gentoo.org>
-rwxr-xr-xscripts/bootstrap-prefix.sh21
1 files 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