Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 861488 - media-libs/mesa: mold unsupported relocation in .eh_frame: R_RISCV_SET32
Summary: media-libs/mesa: mold unsupported relocation in .eh_frame: R_RISCV_SET32
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: riscv Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: systemwide-mold
  Show dependency tree
 
Reported: 2022-07-27 13:53 UTC by Han Gao
Modified: 2022-07-28 10:54 UTC (History)
1 user (show)

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


Attachments
build.log.xz (build.log.xz,44.58 KB, text/plain)
2022-07-27 14:00 UTC, Han Gao
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Han Gao 2022-07-27 13:53:21 UTC
[1042/1108] riscv64-unknown-linux-gnu-g++  -o src/gallium/targets/dri/libgallium_dri.so src/gallium/targets/dri/libgallium_dri.so.p/targ
et.c.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libgallium_dri.so -O2 -pipe -fuse-ld=mold -Wl,-O1
-Wl,--as-needed '-Wl,-rpath,$ORIGIN/../../../mapi/shared-glapi' -Wl,-rpath-link,/var/tmp/portage/media-libs/mesa-22.1.3/work/mesa-22.1.3
-.lp64d/src/mapi/shared-glapi src/gallium/frontends/dri/libdri.a src/util/libmesa_util.a src/util/format/libmesa_format.a src/mesa/libme
sa.a src/compiler/glsl/libglsl.a src/compiler/glsl/glcpp/libglcpp.a src/compiler/nir/libnir.a src/compiler/libcompiler.a src/gallium/aux
iliary/libgalliumvl.a src/gallium/auxiliary/libgallium.a src/mapi/shared-glapi/libglapi.so.0.0.0 src/gallium/auxiliary/pipe-loader/libpi
pe_loader_static.a src/loader/libloader.a src/util/libxmlconfig.a src/gallium/winsys/sw/null/libws_null.a src/gallium/winsys/sw/wrapper/
libwsw.a src/gallium/winsys/sw/dri/libswdri.a src/gallium/winsys/sw/kms-dri/libswkmsdri.a src/gallium/drivers/llvmpipe/libllvmpipe.a src
/gallium/drivers/softpipe/libsoftpipe.a -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--version-script /var/tmp/portage/media-libs/mesa-22.1
.3/work/mesa-22.1.3/src/gallium/targets/dri/dri.sym -Wl,--dynamic-list /var/tmp/portage/media-libs/mesa-22.1.3/work/mesa-22.1.3/src/gall
ium/targets/dri/../dri-vdpau.dyn /usr/lib64/libdrm.so -L/usr/lib/llvm/14/lib64 -lLLVM-14 -pthread /usr/lib64/libexpat.so /usr/lib64/libz
.so -lm /usr/lib64/libzstd.so -L/usr/lib/llvm/14/lib64 -lLLVM-14 -L/usr/lib/llvm/14/lib64 -lLLVM-14 -Wl,--end-group
FAILED: src/gallium/targets/dri/libgallium_dri.so
riscv64-unknown-linux-gnu-g++  -o src/gallium/targets/dri/libgallium_dri.so src/gallium/targets/dri/libgallium_dri.so.p/target.c.o -Wl,-
-as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libgallium_dri.so -O2 -pipe -fuse-ld=mold -Wl,-O1 -Wl,--as-nee
ded '-Wl,-rpath,$ORIGIN/../../../mapi/shared-glapi' -Wl,-rpath-link,/var/tmp/portage/media-libs/mesa-22.1.3/work/mesa-22.1.3-.lp64d/src/
mapi/shared-glapi src/gallium/frontends/dri/libdri.a src/util/libmesa_util.a src/util/format/libmesa_format.a src/mesa/libmesa.a src/com
piler/glsl/libglsl.a src/compiler/glsl/glcpp/libglcpp.a src/compiler/nir/libnir.a src/compiler/libcompiler.a src/gallium/auxiliary/libga
lliumvl.a src/gallium/auxiliary/libgallium.a src/mapi/shared-glapi/libglapi.so.0.0.0 src/gallium/auxiliary/pipe-loader/libpipe_loader_st
atic.a src/loader/libloader.a src/util/libxmlconfig.a src/gallium/winsys/sw/null/libws_null.a src/gallium/winsys/sw/wrapper/libwsw.a src
/gallium/winsys/sw/dri/libswdri.a src/gallium/winsys/sw/kms-dri/libswkmsdri.a src/gallium/drivers/llvmpipe/libllvmpipe.a src/gallium/dri
vers/softpipe/libsoftpipe.a -Wl,--build-id=sha1 -Wl,--gc-sections -Wl,--version-script /var/tmp/portage/media-libs/mesa-22.1.3/work/mesa
-22.1.3/src/gallium/targets/dri/dri.sym -Wl,--dynamic-list /var/tmp/portage/media-libs/mesa-22.1.3/work/mesa-22.1.3/src/gallium/targets/
dri/../dri-vdpau.dyn /usr/lib64/libdrm.so -L/usr/lib/llvm/14/lib64 -lLLVM-14 -pthread /usr/lib64/libexpat.so /usr/lib64/libz.so -lm /usr
/lib64/libzstd.so -L/usr/lib/llvm/14/lib64 -lLLVM-14 -L/usr/lib/llvm/14/lib64 -lLLVM-14 -Wl,--end-group
mimalloc: warning: unable to allocate aligned OS memory directly, fall back to over-allocation (67108864 bytes, address: 0x3f8b4ea000, a
lignment: 67108864, commit: 1)
mold: fatal: unsupported relocation in .eh_frame: R_RISCV_SET32
collect2: error: ld returned 1 exit status

Reproducible: Always

Steps to Reproduce:
1.LDFLAGS="-fuse-ld=mold -Wl,-O1 -Wl,--as-needed"
2.emerge -av1 media-libs/mesa
Comment 1 Han Gao 2022-07-27 13:55:41 UTC
Portage 3.0.34 (python 3.10.5-final-0, default/linux/riscv/20.0/rv64gc/lp64d/desktop/plasma/systemd, gcc-12.1.1, glibc-2.35-r8, 5.18.7-gentoo-riscv64 riscv64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.18.7-gentoo-riscv64-riscv64-with-glibc2.35
KiB Mem:    16376580 total,   4649788 free
KiB Swap:          0 total,         0 free
Head commit of repository gentoo: e654408f64fe23d7b1a98d4c8922ea361f3396b8

Head commit of repository ryans: 3898fe825c949182d672419799869905ff55035b

sh bash 5.1_p16
ld GNU ld (Gentoo 2.38 p4) 2.38
app-misc/pax-utils:        1.3.4::gentoo
app-shells/bash:           5.1_p16::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.36.0::gentoo
dev-lang/python:           3.9.13::gentoo, 3.10.5::gentoo, 3.11.0_beta4-r2::gentoo
dev-lang/rust:             1.62.0::gentoo
dev-util/cmake:            3.23.2::gentoo
dev-util/meson:            0.63.0::gentoo
sys-apps/baselayout:       2.8-r2::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-apps/systemd:          251.3::gentoo
sys-devel/autoconf:        2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.38-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           14.0.6::gentoo
sys-devel/gcc:             11.3.0::gentoo, 12.1.1_p20220625::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/llvm:            14.0.6::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.18-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.35-r8::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://hub.fastgit.xyz/gentoo/gentoo.git
    priority: -1000

ryans
    location: /var/db/repos/ryans
    sync-type: git
    sync-uri: https://github.com/bekcpear/ryans-repos.git
    masters: gentoo
    priority: 100

ACCEPT_KEYWORDS="riscv ~riscv"
ACCEPT_LICENSE="*"
CBUILD="riscv64-unknown-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="riscv64-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
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 /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY 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"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="https://mirrors.tuna.tsinghua.edu.cn/gentoo"
LANG="C.UTF8"
LDFLAGS="-fuse-ld=mold -Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/var/cache/binpkgs"
PORTAGE_BINHOST="ftp://10.0.8.8/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 a52 aac acl acpi activities alsa bluetooth branding bzip2 cairo cdda cdr cli crypt cups dbus declarative dri dts dvd dvdr encode exif flac fortran gdbm gif gpm gtk gui iconv icu ipv6 jpeg kde kwallet lcms libglvnd libnotify mad mng mp3 mp4 mpeg ncurses nls nptl ogg opengl openmp pam pango pcre pdf plasma png policykit ppds qml qt5 readline riscv sdl seccomp semantic-desktop spell split-usr ssl startup-notification svg systemd tiff truetype udev udisks unicode upower usb vorbis widgets wxwidgets x264 xattr xcb xml xv xvid zlib" ADA_TARGET="gnat_2020" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache 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" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="fbdev v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat 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, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS

=================================================================
                        Package Settings
=================================================================

media-libs/mesa-22.1.3::gentoo was built with the following:
USE="X gles2 llvm wayland zstd (-d3d9) -debug -gles1 -lm-sensors (-opencl) -osmesa (-selinux) -test -unwind -vaapi (-valgrind) (-vdpau) -vulkan -vulkan-overlay -xa -xvmc -zink" VIDEO_CARDS="(-freedreno) (-intel) (-lima) -nouveau (-panfrost) -r300 -r600 -radeon (-radeonsi) (-v3d) (-vc4) -virgl (-vivante) (-vmware)"
FEATURES="unknown-features-warn protect-owned unmerge-logs userpriv assume-digests ebuild-locks sfperms fixlafiles distlocks buildpkg-live userfetch binpkg-docompress sandbox xattr binpkg-dostrip merge-sync qa-unresolved-soname-deps parallel-fetch strict usersync binpkg-multi-instance usersandbox news multilib-strict binpkg-logs preserve-libs unmerge-orphans config-protect-if-modified"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
Comment 2 Han Gao 2022-07-27 14:00:36 UTC
Created attachment 794981 [details]
build.log.xz

emerge-info
Comment 3 Han Gao 2022-07-27 14:23:29 UTC
(In reply to Han Gao from comment #2)
> Created attachment 794981 [details]
> build.log.xz
> 
> emerge-info

It's not emerge info, it's build.log.
Comment 4 Alex Fan archtester 2022-07-28 05:09:53 UTC
looks to me R_RISCV_SET32 is missing in ehframe applyloc(). Maybe it is due to carelessness or some other reasons. I have submitted a pr to mold.
Comment 5 Larry the Git Cow gentoo-dev 2022-07-28 10:17:32 UTC
The bug has been referenced in the following commit(s):

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

commit b53e78583cc4390f7660936543b7417af040e141
Author:     Han Gao <rabenda.cn@gmail.com>
AuthorDate: 2022-07-28 09:32:30 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-07-28 10:13:19 +0000

    sys-devel/mold: fix riscv R_RISCV_SET32 in EhFrameSection
    
    Bug: https://bugs.gentoo.org/861488
    Signed-off-by: Han Gao <rabenda.cn@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>

 .../mold/files/mold-1.3.1-fix-riscv-set32.patch    | 25 ++++++
 sys-devel/mold/mold-1.3.1-r1.ebuild                | 99 ++++++++++++++++++++++
 2 files changed, 124 insertions(+)