From patchwork Sun Aug 16 10:29:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 3367 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4BTtmq0Zpwz3x0m for ; Sun, 16 Aug 2020 10:33:15 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4BTtk52cXPzy4; Sun, 16 Aug 2020 10:30:53 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4BTtk522ycz2y3k; Sun, 16 Aug 2020 10:30:53 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4BTtk14xNZz2yF8 for ; Sun, 16 Aug 2020 10:30:49 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 4BTtjx5DBbzvR; Sun, 16 Aug 2020 10:30:45 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1597573845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GwR7avLMPlTicWQzeUXJmJvtGn/u7yG2DvHFhCM/6EY=; b=DaX84wh0PbAcnbT1gm+FdGOp0oLZkVDuscE7J+l4zbKCELSngCwjKORK/UscOsP27LkmMd uuO/VCqo+BpB6bCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1597573845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GwR7avLMPlTicWQzeUXJmJvtGn/u7yG2DvHFhCM/6EY=; b=wlv5bl8uo4jFBXjYr6HXh+iUz8A+pqLmI0zXC9IlmTfMZO8mI2jalpPjO6e98opr/UIeNO hOQOEm8LIW99t8hqGnZKsTzHs+jxANx8AVe0+XA/pCbNz48dFVmTG1DokAJMYRso4w0+za O7gGFebOP3x5P/d6LTwir7WJ/EF+RGd8KOGquStYGDWnzI6k0kz28e8oDwm7mNrkDnIwCS tmMaG4cdnO8XUGdoGDtyenUA7rOCA7unNTiPty5RMmOVjES9SIeb5tubW4DdGE+Raj/HnA zA59kU/b02JkjfmgVMy8ezU1H3HPEJJfn9OOlAnZaZachatlv8rVcktM8ike1A== From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 61/62] perl: Fix build in toolchain stage Date: Sun, 16 Aug 2020 10:29:52 +0000 Message-Id: <20200816102953.3881-61-michael.tremer@ipfire.org> In-Reply-To: <20200816102953.3881-1-michael.tremer@ipfire.org> References: <20200816102953.3881-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" perl searches for headers and libraries in the wrong paths and detects GCC 10 as GCC 1.x. Signed-off-by: Michael Tremer --- lfs/perl | 6 +- ...0.0-fix-build-failure-against-gcc-10.patch | 99 +++++++++++++++++++ 2 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 src/patches/perl-5.30.0-fix-build-failure-against-gcc-10.patch diff --git a/lfs/perl b/lfs/perl index 690d5df29..bc0d67d5f 100644 --- a/lfs/perl +++ b/lfs/perl @@ -80,15 +80,15 @@ $(subst %,%_MD5,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) - cd $(DIR_APP) && sed -i -e 's|-fstack-protector|-fno-stack-protector|g' Configure + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/perl-5.30.0-fix-build-failure-against-gcc-10.patch ifeq "$(ROOT)" "" cd $(DIR_APP) && ./configure.gnu --prefix=/usr -Dman1dir=/usr/share/man/man1 \ -Dman3dir=/usr/share/man/man3 -Dpager="/usr/bin/less -isR" -Dusethreads cd $(DIR_APP) && make $(MAKETUNING) cd $(DIR_APP) && make install else - cd $(DIR_APP) && ./Configure -des -Dprefix=$(TOOLS_DIR) - cd $(DIR_APP) && make + cd $(DIR_APP) && ./Configure -des -Dprefix=$(TOOLS_DIR) -Dlibs="-lpthread -lm" -Uloclibpth -Ulocincpth + cd $(DIR_APP) && make $(MAKETUNING) cd $(DIR_APP) && cp -v perl cpan/podlators/scripts/pod2man $(TOOLS_DIR)/bin cd $(DIR_APP) && mkdir -pv $(TOOLS_DIR)/lib/perl5/$(VER) cd $(DIR_APP) && cp -Rv lib/* $(TOOLS_DIR)/lib/perl5/$(VER) diff --git a/src/patches/perl-5.30.0-fix-build-failure-against-gcc-10.patch b/src/patches/perl-5.30.0-fix-build-failure-against-gcc-10.patch new file mode 100644 index 000000000..bb9252785 --- /dev/null +++ b/src/patches/perl-5.30.0-fix-build-failure-against-gcc-10.patch @@ -0,0 +1,99 @@ +https://bugs.gentoo.org/708744 + +From 6bd6308fcea3541e505651bf8e8127a4a03d22cd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 12 Nov 2019 09:19:18 +0100 +Subject: [PATCH] Adapt Configure to GCC version 10 + +I got a notice from Jeff Law : + + Your particular package fails its testsuite. This was ultimately + tracked down to a Configure problem. The perl configure script treated + gcc-10 as gcc-1 and turned on -fpcc-struct-return. This is an ABI + changing flag and caused Perl to not be able to interact properly with + the dbm libraries on the system leading to a segfault. + +His proposed patch corrected only this one instance of the version +mismatch. Reading the Configure script revealed more issues. This +patch fixes all of them I found. + +Please note I do not have GCC 10 available, I tested it by faking the version +with: + +--- a/Configure ++++ b/Configure +@@ -4701,7 +4701,7 @@ else + fi + $rm -f try try.* + case "$gccversion" in +-1*) cpp=`./loc gcc-cpp $cpp $pth` ;; ++1.*) cpp=`./loc gcc-cpp $cpp $pth` ;; + esac + case "$gccversion" in + '') gccosandvers='' ;; +@@ -4741,7 +4741,7 @@ esac + # gcc 3.* complain about adding -Idirectories that they already know about, + # so we will take those off from locincpth. + case "$gccversion" in +-3*) ++3.*) + echo "main(){}">try.c + for incdir in $locincpth; do + warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \ +@@ -5467,13 +5467,13 @@ fi + case "$hint" in + default|recommended) + case "$gccversion" in +- 1*) dflt="$dflt -fpcc-struct-return" ;; ++ 1.*) dflt="$dflt -fpcc-struct-return" ;; + esac + case "$optimize:$DEBUGGING" in + *-g*:old) dflt="$dflt -DDEBUGGING";; + esac + case "$gccversion" in +- 2*) if $test -d /etc/conf/kconfig.d && ++ 2.*) if $test -d /etc/conf/kconfig.d && + $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1 + then + # Interactive Systems (ISC) POSIX mode. +@@ -5482,7 +5482,7 @@ default|recommended) + ;; + esac + case "$gccversion" in +- 1*) ;; ++ 1.*) ;; + 2.[0-8]*) ;; + ?*) set strict-aliasing -fno-strict-aliasing + eval $checkccflag +@@ -5600,7 +5600,7 @@ case "$cppflags" in + ;; + esac + case "$gccversion" in +-1*) cppflags="$cppflags -D__GNUC__" ++1.*) cppflags="$cppflags -D__GNUC__" + esac + case "$mips_type" in + '');; +@@ -23103,7 +23103,7 @@ fi + + : add -D_FORTIFY_SOURCE if feasible and not already there + case "$gccversion" in +-[456789].*) case "$optimize$ccflags" in ++[456789].*|[1-9][0-9]*) case "$optimize$ccflags" in + *-O*) case "$ccflags$cppsymbols" in + *_FORTIFY_SOURCE=*) # Don't add it again. + echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4 +--- a/cflags.SH ++++ b/cflags.SH +@@ -156,7 +156,7 @@ esac + + case "$gccversion" in + '') ;; +-[12]*) ;; # gcc versions 1 (gasp!) and 2 are not good for this. ++[12].*) ;; # gcc versions 1 (gasp!) and 2 are not good for this. + Intel*) ;; # # Is that you, Intel C++? + # + # NOTE 1: the -std=c89 without -pedantic is a bit pointless. +-- +2.25.0 +