Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 915057 - sys-devel/gcc-13.2.1_p20230826 fails to build on ppc64le (bogsucker, seed update in stage1, also reproduced in main system)
Summary: sys-devel/gcc-13.2.1_p20230826 fails to build on ppc64le (bogsucker, seed upd...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-01 21:31 UTC by Andreas K. Hüttel
Modified: 2023-10-02 15:05 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (xz) (build.log.xz,74.80 KB, application/x-xz)
2023-10-01 21:31 UTC, Andreas K. Hüttel
Details
build log (xz) outside catalyst (build.log.xz,93.61 KB, application/x-xz)
2023-10-01 22:00 UTC, Andreas K. Hüttel
Details
emerge --info (emerge-info.txt,5.91 KB, text/plain)
2023-10-01 22:00 UTC, Andreas K. Hüttel
Details
gcc build logs (gcc-build-logs.tar.xz,171.43 KB, application/x-xz)
2023-10-01 22:00 UTC, Andreas K. Hüttel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas K. Hüttel archtester gentoo-dev 2023-10-01 21:31:00 UTC
Created attachment 871989 [details]
build log (xz)

(...)
make[2]: Entering directory '/var/tmp/portage/sys-devel/gcc-13.2.1_p20230826/work/build'
Configuring stage 2 in ./libcody
configure: creating cache ./config.cache
checking build system type... powerpc64le-unknown-linux-gnu
checking host system type... powerpc64le-unknown-linux-gnu
checking maintainer-mode... 
checking whether the C++ compiler works... no
configure: error: in `/var/tmp/portage/sys-devel/gcc-13.2.1_p20230826/work/build/libcody':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
make[2]: *** [Makefile:10088: configure-stage2-libcody] Error 77

(and many more errors following)
Comment 1 Andreas K. Hüttel archtester gentoo-dev 2023-10-01 22:00:05 UTC
Created attachment 871991 [details]
build log (xz) outside catalyst
Comment 2 Andreas K. Hüttel archtester gentoo-dev 2023-10-01 22:00:18 UTC
Created attachment 871992 [details]
emerge --info
Comment 3 Andreas K. Hüttel archtester gentoo-dev 2023-10-01 22:00:33 UTC
Created attachment 871993 [details]
gcc build logs
Comment 4 Arsen Arsenović gentoo-dev 2023-10-02 12:47:22 UTC
the build passes -Wl,-m -Wl,elf64ppc.  the correct emulation is elf64lppc.  I'm trying to figure it out with vanilla.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-02 12:55:15 UTC
I guess it's caused by the toolchain.eclass changes then, but it's unclear to me why yet. Are we missing some override for that variable in profiles?
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-02 13:04:50 UTC
(In reply to Sam James from comment #5)
> I guess it's caused by the toolchain.eclass changes then, but it's unclear
> to me why yet. Are we missing some override for that variable in profiles?

$ rg elf64ppc
sys-devel/libtool/files/libtool-2.4.6-ppc64le.patch:77:           LD="${LD-ld} -m elf64ppc"
sys-devel/libtool/files/libtool-2.4.6-ppc64le.patch:81:seems linked to $LD='$LD-ld -m elf64ppc' and failed to compile packages.
sys-devel/libtool/files/libtool-2.4.6-ppc64le.patch:106:            LD="${LD-ld} -m elf64ppc"
sys-devel/binutils/files/binutils-2.35.2-powerpc-tests.patch:27:-#ld: -melf64ppc -Ttext=0x1000 -shared
sys-devel/binutils/files/binutils-2.35.2-powerpc-tests.patch:28:+#ld: -melf64ppc -Ttext=0x1000 -shared -z notext
sys-devel/binutils/files/binutils-2.35.2-powerpc-tests.patch:40:-#ld: -melf64ppc -Ttext=0x1000 -shared
sys-devel/binutils/files/binutils-2.35.2-powerpc-tests.patch:41:+#ld: -melf64ppc -Ttext=0x1000 -shared -z notext
sys-devel/binutils/files/binutils-2.35.2-powerpc-tests.patch:71:-    {"TLS shared" "-shared -melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tls.o" "" "" {}
sys-devel/binutils/files/binutils-2.35.2-powerpc-tests.patch:72:+    {"TLS shared" "-shared -melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv -z notext tmpdir/tls.o" "" "" {}
sys-devel/binutils/files/binutils-2.35.2-powerpc-tests.patch:80:-    {"TLSTOC shared" "-shared -melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv tmpdir/tlstoc.o" "" "" {}
sys-devel/binutils/files/binutils-2.35.2-powerpc-tests.patch:81:+    {"TLSTOC shared" "-shared -melf64ppc --no-plt-align --no-ld-generated-unwind-info --hash-style=sysv -z notext tmpdir/tlstoc.o" "" "" {}
profiles/arch/powerpc/ppc64/make.defaults:25:LDFLAGS_ppc64="-m elf64ppc"

vs

$ rg elf64lppc
sys-devel/libtool/files/libtool-2.4.6-ppc64le.patch:49:   elf64lppc
sys-devel/libtool/files/libtool-2.4.6-ppc64le.patch:74:           LD="${LD-ld} -m elf64lppc"
sys-devel/libtool/files/libtool-2.4.6-ppc64le.patch:102:            LD="${LD-ld} -m elf64lppc"

Looks like we're indeed missing a definition for that variable in profiles (maybe LDFLAGS_ppc64le instead of LDFLAGS_ppc64, not sure yet)?
Comment 7 Larry the Git Cow gentoo-dev 2023-10-02 15:05:49 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e974ac78c7eba3c5dd115e88bd2276dd1e4ecb4c

commit e974ac78c7eba3c5dd115e88bd2276dd1e4ecb4c
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-10-02 15:04:21 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-10-02 15:05:41 +0000

    profiles/arch/powerpc/ppc64/64le: set LDFLAGS_ppc64
    
    A recent change to toolchain.eclass (bb2d045c02a6ca647ef3280f4987cbc0d14e5a7e) starts
    to use LDFLAGS_${ABI}. It turns out in the 64le profiles, we weren't overridding
    LDLFLAGS_ppc64 so we were picking up the big-endian version (elf64ppc).
    
    Fix that - which is in line with what we do for CFLAGS & CHOST in that file
    anyway.
    
    Closes: https://bugs.gentoo.org/915057
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/arch/powerpc/ppc64/64le/make.defaults | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)