Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936960 - sys-devel/crossdev-20240209: crossdev -S -t powerpc64-unknown-linux-musl fails on llvm profile
Summary: sys-devel/crossdev-20240209: crossdev -S -t powerpc64-unknown-linux-musl fail...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Cross compilation support
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-30 23:59 UTC by 2857
Modified: 2024-08-03 21:20 UTC (History)
1 user (show)

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


Attachments
/var/tmp/portage/cross-powerpc64-unknown-linux-musl/musl-1.2.4-r2/temp/build.log (file_936960.txt,6.25 KB, text/plain)
2024-07-30 23:59 UTC, 2857
Details
/var/log/portage/cross-powerpc64-unknown-linux-musl-info.log (file_936960.txt,17.19 KB, text/plain)
2024-07-31 00:00 UTC, 2857
Details
emerge --info cross-powerpc64-unknown-linux-musl/musl (file_936960.txt,6.26 KB, text/plain)
2024-07-31 00:02 UTC, 2857
Details
/var/tmp/portage/cross-powerpc64-unknown-linux-musl/musl-1.2.4-r2/temp/environment (file_936960.txt,88.91 KB, text/plain)
2024-07-31 00:04 UTC, 2857
Details

Note You need to log in before you can comment on or make changes to this bug.
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.