commit:     4b4f4514202b682d5361da627e6c317f8acc9907
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 18 23:59:29 2019 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Fri Apr 19 00:01:25 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4b4f4514

Revert "sys-libs/glibc: Fix headers-only cross-build for riscv"

Sergei's solution is way better. Tomorrow.
This reverts commit 08ac6a89ea72d4cdcb02383410b58e76e69913a4.

Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 sys-libs/glibc/glibc-2.29-r2.ebuild | 37 +++++++++++++++++++------------------
 sys-libs/glibc/glibc-9999.ebuild    | 37 +++++++++++++++++++------------------
 2 files changed, 38 insertions(+), 36 deletions(-)

diff --git a/sys-libs/glibc/glibc-2.29-r2.ebuild 
b/sys-libs/glibc/glibc-2.29-r2.ebuild
index fe9feab7f75..093ffc207eb 100644
--- a/sys-libs/glibc/glibc-2.29-r2.ebuild
+++ b/sys-libs/glibc/glibc-2.29-r2.ebuild
@@ -1006,6 +1006,25 @@ glibc_headers_configure() {
                popd >/dev/null
        fi
 
+       case ${CTARGET} in
+       riscv*)
+               # RISC-V interrogates the compiler to determine which target to
+               # build.  If building the headers then we don't strictly need a
+               # RISC-V compiler, so the built-in definitions that are provided
+               # along with all RISC-V compiler might not exist.  This causes
+               # glibc's RISC-V preconfigure script to blow up.  Since we're 
just
+               # building the headers any value will actually work here, so 
just
+               # pick the standard one (rv64g/lp64d) to make the build scripts
+               # happy for now -- the headers are all the same anyway so it
+               # doesn't matter.
+               headers_only_arch_CPPFLAGS+=(
+                       -D__riscv_xlen=64
+                       -D__riscv_flen=64
+                       -D__riscv_float_abi_double=1
+                       -D__riscv_atomic=1
+               ) ;;
+       esac
+
        local myconf=()
        myconf+=(
                --disable-sanity-checks
@@ -1023,24 +1042,6 @@ glibc_headers_configure() {
        # Nothing is compiled here which would affect the headers for the 
target.
        # So forcing CC/CFLAGS is sane.
        local headers_only_CC=$(tc-getBUILD_CC)
-
-       case ${CTARGET} in
-       riscv*)
-               # RISC-V interrogates the compiler to determine which target to
-               # build.  If building the headers then we don't strictly need a
-               # RISC-V compiler, so the built-in definitions that are provided
-               # along with all RISC-V compiler might not exist.  This causes
-               # glibc's RISC-V preconfigure script to blow up.  Since we're 
just
-               # building the headers any value will actually work here, so 
just
-               # pick the standard one (rv64g/lp64d) to make the build scripts
-               # happy for now -- the headers are all the same anyway so it
-               # doesn't matter.
-               # It's not sufficient to shove the flags into CPPFLAGS, they 
need
-               # to really go *everywhere*.
-               headers_only_CC="${headers_only_CC} -D__riscv_xlen=64 
-D__riscv_flen=64 -D__riscv_float_abi_double=1 -D__riscv_atomic=1"
-               ;;
-       esac
-
        local headers_only_CFLAGS="-O1 -pipe"
        local headers_only_CPPFLAGS="-U_FORTIFY_SOURCE 
${headers_only_arch_CPPFLAGS[*]}"
        local headers_only_LDFLAGS=""

diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
index 20846e05faf..142153734f9 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-9999.ebuild
@@ -1007,6 +1007,25 @@ glibc_headers_configure() {
                popd >/dev/null
        fi
 
+       case ${CTARGET} in
+       riscv*)
+               # RISC-V interrogates the compiler to determine which target to
+               # build.  If building the headers then we don't strictly need a
+               # RISC-V compiler, so the built-in definitions that are provided
+               # along with all RISC-V compiler might not exist.  This causes
+               # glibc's RISC-V preconfigure script to blow up.  Since we're 
just
+               # building the headers any value will actually work here, so 
just
+               # pick the standard one (rv64g/lp64d) to make the build scripts
+               # happy for now -- the headers are all the same anyway so it
+               # doesn't matter.
+               headers_only_arch_CPPFLAGS+=(
+                       -D__riscv_xlen=64
+                       -D__riscv_flen=64
+                       -D__riscv_float_abi_double=1
+                       -D__riscv_atomic=1
+               ) ;;
+       esac
+
        local myconf=()
        myconf+=(
                --disable-sanity-checks
@@ -1024,24 +1043,6 @@ glibc_headers_configure() {
        # Nothing is compiled here which would affect the headers for the 
target.
        # So forcing CC/CFLAGS is sane.
        local headers_only_CC=$(tc-getBUILD_CC)
-
-       case ${CTARGET} in
-       riscv*)
-               # RISC-V interrogates the compiler to determine which target to
-               # build.  If building the headers then we don't strictly need a
-               # RISC-V compiler, so the built-in definitions that are provided
-               # along with all RISC-V compiler might not exist.  This causes
-               # glibc's RISC-V preconfigure script to blow up.  Since we're 
just
-               # building the headers any value will actually work here, so 
just
-               # pick the standard one (rv64g/lp64d) to make the build scripts
-               # happy for now -- the headers are all the same anyway so it
-               # doesn't matter.
-               # It's not sufficient to shove the flags into CPPFLAGS, they 
need
-               # to really go *everywhere*.
-               headers_only_CC="${headers_only_CC} -D__riscv_xlen=64 
-D__riscv_flen=64 -D__riscv_float_abi_double=1 -D__riscv_atomic=1"
-               ;;
-       esac
-
        local headers_only_CFLAGS="-O1 -pipe"
        local headers_only_CPPFLAGS="-U_FORTIFY_SOURCE 
${headers_only_arch_CPPFLAGS[*]}"
        local headers_only_LDFLAGS=""

Reply via email to