commit:     6c3740323094626403ee2e57f4a0c5b1cb4f37bb
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 13 20:45:58 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Wed Jun 13 20:46:38 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c374032

sys-libs/glibc: fix -mfpu=neon build failure, bug #657760

CFLAGS=-mfpu=neon tricked glibc into not building memcpy()
implementation. It's caused by the fact that -mfpu=neon
was passed when building .c files, but was not passed
when building .S files.

This change passes CFLAGS to CPPFLAGS to apply to .S files.

Reported-by: Markus Meier
Closes: https://bugs.gentoo.org/657760
Bug: https://sourceware.org/PR23273
Package-Manager: Portage-2.3.40, Repoman-2.3.9

 sys-libs/glibc/{glibc-9999.ebuild => glibc-2.27-r4.ebuild} | 10 +++++++---
 sys-libs/glibc/glibc-9999.ebuild                           |  6 ++++++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/sys-libs/glibc/glibc-9999.ebuild 
b/sys-libs/glibc/glibc-2.27-r4.ebuild
similarity index 98%
copy from sys-libs/glibc/glibc-9999.ebuild
copy to sys-libs/glibc/glibc-2.27-r4.ebuild
index d628938b2a7..a4689e7afde 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-2.27-r4.ebuild
@@ -18,8 +18,7 @@ if [[ ${PV} == 9999* ]]; then
        EGIT_REPO_URI="https://sourceware.org/git/glibc.git";
        inherit git-r3
 else
-       # KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc 
~ppc64 ~s390 ~sh ~sparc ~x86"
-       KEYWORDS=""
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 
~s390 ~sh ~sparc ~x86"
        SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
 fi
 
@@ -28,7 +27,7 @@ RELEASE_VER=${PV}
 GCC_BOOTSTRAP_VER=20180511
 
 # Gentoo patchset
-PATCH_VER=5
+PATCH_VER=2
 
 SRC_URI+=" 
https://dev.gentoo.org/~dilfridge/distfiles/${P}-patches-${PATCH_VER}.tar.bz2";
 SRC_URI+=" multilib? ( 
https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz
 )"
@@ -797,6 +796,11 @@ glibc_do_configure() {
        # Some of the tests are written in C++, so we need to force our multlib 
abis in, bug 623548
        export CXX="$(tc-getCXX ${CTARGET}) $(get_abi_CFLAGS)"
        einfo " $(printf '%15s' 'Manual CXX:')   ${CXX}"
+       # CFLAGS can contain ABI-spefcific flags like -mfpu=neon, see bug 
#657760
+       # To build .S (assembly) files with the same ABI-specific flags
+       # upstream currently recommends adding CFLAGS to CPPFLAGS: 
https://sourceware.org/PR23273
+       export CPPFLAGS="${CPPFLAGS} ${CFLAGS}"
+       einfo " $(printf '%15s' 'Manual CPPFLAGS:')   ${CPPFLAGS}"
 
        echo
 

diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
index d628938b2a7..7a1ae16ce82 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-9999.ebuild
@@ -798,6 +798,12 @@ glibc_do_configure() {
        export CXX="$(tc-getCXX ${CTARGET}) $(get_abi_CFLAGS)"
        einfo " $(printf '%15s' 'Manual CXX:')   ${CXX}"
 
+       # CFLAGS can contain ABI-spefcific flags like -mfpu=neon, see bug 
#657760
+       # To build .S (assembly) files with the same ABI-specific flags
+       # upstream currently recommends adding CFLAGS to CPPFLAGS: 
https://sourceware.org/PR23273
+       export CPPFLAGS="${CPPFLAGS} ${CFLAGS}"
+       einfo " $(printf '%15s' 'Manual CPPFLAGS:')   ${CPPFLAGS}"
+
        echo
 
        local myconf=()

Reply via email to