Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 936960

Summary: sys-devel/crossdev-20240209: crossdev -S -t powerpc64-unknown-linux-musl fails on llvm profile
Product: Gentoo Linux Reporter: 2857 <2857>
Component: Current packagesAssignee: Cross compilation support <cross>
Status: UNCONFIRMED ---    
Severity: normal CC: 2857
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: /var/tmp/portage/cross-powerpc64-unknown-linux-musl/musl-1.2.4-r2/temp/build.log
/var/log/portage/cross-powerpc64-unknown-linux-musl-info.log
emerge --info cross-powerpc64-unknown-linux-musl/musl
/var/tmp/portage/cross-powerpc64-unknown-linux-musl/musl-1.2.4-r2/temp/environment

Description 2857 2024-07-30 23:59:12 UTC
Created attachment 898674 [details]
/var/tmp/portage/cross-powerpc64-unknown-linux-musl/musl-1.2.4-r2/temp/build.log

amd64 host, default/linux/amd64/23.0/musl/llvm profile. Trying to make cross toolchain for ppc64 results in the following:

-------------------------------------------------------------------------------------------------------------------------------------
 * crossdev version:      20240209
 * Host Portage ARCH:     amd64
 * Host Portage System:   x86_64-pc-linux-musl (x86_64-pc-linux-musl)
 * Target Portage ARCH:   ppc64
 * Target System:         powerpc64-unknown-linux-musl
 * Stage:                 4 (C/C++ compiler)
 * USE=multilib:          no
 * Target ABIs:           default

 * binutils:              binutils-[stable]
 * gcc:                   gcc-[stable]
 * headers:               linux-headers-[stable]
 * libc:                  musl-[stable]

 * CROSSDEV_OVERLAY:      /var/db/repos/crossdev
 * PORT_LOGDIR:           /var/log/portage
 * PORTAGE_CONFIGROOT:    /
 * Portage flags:         
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  - 
 * leaving metadata/layout.conf alone in /var/db/repos/crossdev
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  - 
 * Log: /var/log/portage/cross-powerpc64-unknown-linux-musl-binutils.log
 * Emerging cross-binutils ...                                                                                                 [ ok ]
 * Log: /var/log/portage/cross-powerpc64-unknown-linux-musl-gcc-stage1.log
 * Emerging cross-gcc-stage1 ...                                                                                               [ ok ]
 * Log: /var/log/portage/cross-powerpc64-unknown-linux-musl-linux-headers.log
 * Emerging cross-linux-headers ...                                                                                            [ ok ]
 * Log: /var/log/portage/cross-powerpc64-unknown-linux-musl-musl.log
 * Emerging cross-musl ...

 * error: musl failed :(
 * 
 * If you file a bug, please attach the following logfiles:
 * /var/log/portage/cross-powerpc64-unknown-linux-musl-info.log
 * /var/log/portage/cross-powerpc64-unknown-linux-musl-musl.log.xz
 * /var/tmp/portage/cross-powerpc64-unknown-linux-musl/musl*/temp/musl-config.logs.tar.xz

... 
(later in the musl build.log)

checking preprocessor condition _CALL_ELF == 2... false
./configure: error: unsupported powerpc64 ABI

In the musl build log one can clearly see that clang is picked up instead of gcc.
Comment 1 2857 2024-07-31 00:00:51 UTC
Created attachment 898675 [details]
/var/log/portage/cross-powerpc64-unknown-linux-musl-info.log
Comment 2 2857 2024-07-31 00:02:47 UTC
Created attachment 898676 [details]
emerge --info cross-powerpc64-unknown-linux-musl/musl
Comment 3 2857 2024-07-31 00:04:12 UTC
Created attachment 898677 [details]
/var/tmp/portage/cross-powerpc64-unknown-linux-musl/musl-1.2.4-r2/temp/environment
Comment 4 2857 2024-07-31 00:10:09 UTC
from IRC discussion with Arsen:

Adding "unset AR AS CPP NM STRIP RANLIB OBJCOPY STRINGS OBJDUMP READELF ADDR2LINE LD CC CXX" to the top of pkg_setup function in /var/db/repos/gentoo/sys-libs/musl/musl-1.2.4-r2.ebuild fixes the issue. CC="clang" seems to be hardcoded in the llvm profile.
Comment 5 2857 2024-07-31 00:32:15 UTC
update: crossdev build finishes, but produced toolchain doesn't seem to work: 

$ emerge-powerpc64-unknown-linux-musl -avu app-editors/nano
...

checking for native build linker-flags... -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--as-needed
checking for native build linker-libraries... 
checking if the build-compiler "gcc" works... no
configure: error: Cross-build requires two compilers.
Use --with-build-cc to specify the native compiler.