Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 939362 - sci-libs/composable-kernel 6.1.1 ld error
Summary: sci-libs/composable-kernel 6.1.1 ld error
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Sv. Lockal
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-09 07:41 UTC by Amit Ugol
Modified: 2025-02-08 01:19 UTC (History)
6 users (show)

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


Attachments
gzipped build log (build.log.gz,41.64 KB, application/gzip)
2024-09-09 07:42 UTC, Amit Ugol
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Amit Ugol 2024-09-09 07:41:27 UTC
sci-libs/composable-kernel 6.1.1 ld error

<genr8eofl> its the stupid relocation nonsense that they keep changing

Reproducible: Always

Steps to Reproduce:
1. with "default", "latest" profile (23), emerge sci-libs/composable-kernel
2.
3.
Actual Results:  
failure at linking time

Expected Results:  
linking should work

# emerge --info
Portage 3.0.65 (python 3.12.6-final-0, default/linux/amd64/23.0/desktop/plasma/systemd, gcc-14, glibc-2.40, 6.10.6-gentoo x86_64)
=================================================================
System uname: Linux-6.10.6-gentoo-x86_64-AMD_Ryzen_9_5900X_12-Core_Processor-with-glibc2.40
KiB Mem:    32761748 total,  20544756 free
KiB Swap:   16777212 total,  16747772 free
Timestamp of repository gentoo: Sun, 08 Sep 2024 17:00:00 +0000
Head commit of repository gentoo: a3eb02ba65924a642bfbe8a9f47688b8794e271b
Timestamp of repository guru: Sun, 08 Sep 2024 16:49:34 +0000
Head commit of repository guru: 442a69fe2222e89ed8c49a2219bd76441eca1b61

Timestamp of repository steam-overlay: Fri, 23 Aug 2024 21:33:51 +0000
Head commit of repository steam-overlay: 1057828cc4261082ad3faf418c27176e0282557b

sh bash 5.2_p32-r1
ld GNU ld (Gentoo 2.43 p2) 2.43.1
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p32-r1::gentoo
dev-build/autoconf:        2.13-r8::gentoo, 2.72-r1::gentoo
dev-build/automake:        1.17-r1::gentoo
dev-build/cmake:           3.30.3::gentoo
dev-build/libtool:         2.4.7-r4::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-build/meson:           1.5.1::gentoo
dev-java/java-config:      2.3.4::gentoo
dev-lang/perl:             5.40.0::gentoo
dev-lang/python:           3.12.6::gentoo
dev-lang/rust-bin:         1.80.1::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/sandbox:          2.39::gentoo
sys-apps/systemd:          256.5::gentoo
sys-devel/binutils:        2.43-r1::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/clang:           18.1.8::gentoo
sys-devel/gcc:             14.2.1_p20240817::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/lld:             18.1.8::gentoo
sys-devel/llvm:            18.1.8-r4::gentoo
sys-kernel/linux-headers:  6.10::gentoo (virtual/os-headers)
sys-libs/glibc:            2.40::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: False
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 3
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: 

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo
    volatile: False

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo
    volatile: False

Binary Repositories:

gentoobinhost
    priority: 1
    sync-uri: https://distfiles.gentoo.org/releases/amd64/binpackages/23.0/x86-64

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C.UTF8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
MAKEOPTS="-j20 -l20"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X aac acl acpi activities alsa amd64 aspell bidi bluetooth bzip2 cairo cet crypt dbus declarative dri dts encode exif ffmpeg flac gdbm gif gpm gtk gui harfbuzz iconv icu imagemagick ipv6 jpeg kde kf6compat lcms libnotify libtirpc mad matroska mng mp3 mp4 mpeg multilib ncurses nls ogg opengl openmp pam pango pcre pdf pipewire plasma png policykit ppds pulseaudio qml qt6 readline rocm screencast sdl seccomp sound spell ssl startup-notification svg system-act system-av1 system-boost system-bootloader system-bootstrap system-crontab system-ffmpeg system-harfbuzz system-heimdal system-icu system-info system-ipxe system-jpeg system-leveldb system-libevent system-librnp system-libsecp256k1 system-libvpx system-libyaml system-llvm system-lua system-lz4 system-man system-mathjax system-mimalloc system-mitkrb5 system-mongodb system-mspack system-png system-protoc system-python-libs system-qemu system-quazip system-seabios system-service system-sqlite system-ssl system-toolchain system-webp system-wide system-zlib system-zstd systemd test-rust tiff truetype udev udisks unicode upower usb v4l vorbis vulkan wayland webp widgets wxwidgets x264 xattr xcb xft xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gcc_12" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LLVM_SLOT="18" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" RUBY_TARGETS="ruby31 ruby32" VIDEO_CARDS="amdgpu radeonsi fbdev" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS



AMD GPU = gfx1100 (7900xtx)

# clang --version
clang version 18.1.8
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/18/bin
Configuration file: /etc/clang/x86_64-pc-linux-gnu-clang.cfg


# gcc --version
gcc (Gentoo 14.2.1_p20240817 p4) 14.2.1 20240817
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 1 Amit Ugol 2024-09-09 07:42:58 UTC
Created attachment 902438 [details]
gzipped build log
Comment 2 Norman Rieß 2024-10-27 09:15:04 UTC
Same issue.
Comment 3 Sv. Lockal 2024-12-12 21:22:37 UTC
Hi, this issue was reported to upstream multiple times, the last one is https://github.com/ROCm/composable_kernel/issues/1709. I left a comment there and copy it here.

The failing command looks like this:
* `/usr/bin/hipcc -DNDEBUG -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs`
* Followed by 537 object files of total size 2.85 GB (hardening flags disabled)
* Ending with `-o bin/ckProfiler lib/libutility.a /usr/lib64/libamdhip64.so.6.1.40093 --hip-link --offload-arch=gfx1030 --offload-arch=gfx1100 --offload-arch=gfx906 --offload-arch=gfx908 --offload-arch=gfx90a --offload-arch=gfx942 /usr/lib/llvm/18/bin/../../../../lib/clang/18/lib/linux/libclang_rt.builtins-x86_64.a`

From the user perspective this issue is solvable by reducing number or architectures or switching to medium code model. From coding standpoint it was solvable by partitioning object files into multiple shared libraries, instead of linking everything into a single application. 

The idea with `--offload-compress` that was applied in current (6.3.0) releases solved the issue, as now object files fit 2GB boundary. 

Action items on Gentoo side will be:
* To inform users with einfo that default build configuration can be optimized as described at https://wiki.gentoo.org/wiki/ROCm#Specifying_architectures_to_compile
* Provide a USE flag to build miopen without CK (might be useful).

I'll update my 6.3.0 PR https://github.com/gentoo/gentoo/pull/39654 to follow action items, and for 6.1.1 release the suggestion is just to specify AMDGPU_TARGETS in make.conf (which significantly decreases compilation time and size).