Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 930157 - dev-libs/level-zero-1.16.14 - /.../ld: lib/libze_loader.so.1.16.14: undefined reference to fmt::v9::detail::throw_format_error(char const )
Summary: dev-libs/level-zero-1.16.14 - /.../ld: lib/libze_loader.so.1.16.14: undefined...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Jan Henke
URL: https://github.com/oneapi-src/level-z...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2024-04-17 18:01 UTC by Toralf Förster
Modified: 2024-04-20 22:05 UTC (History)
7 users (show)

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


Attachments
emerge-info.txt (emerge-info.txt,19.74 KB, text/plain)
2024-04-17 18:01 UTC, Toralf Förster
Details
dev-libs:level-zero-1.16.14:20240417-175422.log (dev-libs:level-zero-1.16.14:20240417-175422.log,65.43 KB, text/plain)
2024-04-17 18:01 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,222.05 KB, text/plain)
2024-04-17 18:01 UTC, Toralf Förster
Details
environment (environment,97.81 KB, text/plain)
2024-04-17 18:01 UTC, Toralf Förster
Details
etc.clang.tar.xz (etc.clang.tar.xz,1.15 KB, application/x-xz)
2024-04-17 18:01 UTC, Toralf Förster
Details
etc.portage.tar.xz (etc.portage.tar.xz,11.25 KB, application/x-xz)
2024-04-17 18:01 UTC, Toralf Förster
Details
qlist-info.txt.xz (qlist-info.txt.xz,63.50 KB, application/x-xz)
2024-04-17 18:01 UTC, Toralf Förster
Details
temp.tar.xz (temp.tar.xz,22.78 KB, application/x-xz)
2024-04-17 18:01 UTC, Toralf Förster
Details
level-zero-1.16.14-spdlog-libfmt.patch (level-zero-1.16.14-spdlog-libfmt.patch,1.78 KB, patch)
2024-04-20 13:48 UTC, Sam James
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2024-04-17 18:01:37 UTC
too long lines were shrinked:

[45/51] : && /usr/bin/x86_64-pc-linux-gnu-g++ -fPIC -O2 -pipe -march=native -fno-diagnostics-color -std=c++14 -fpermissive -fPIC -Wall  -Wnon-virtual-dtor -fvisibility=hidden -fvisibility-inlines-hidden -fno-strict-aliasing  -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--defsym=__gentoo_c
[46/51] /usr/bin/cmake -E cmake_symlink_library lib/libze_null.so.1.16.14  lib/libze_null.so.1 lib/libze_null.so && :
[47/51] /usr/bin/x86_64-pc-linux-gnu-g++ -DLOADER_VERSION_MAJOR=1 -DLOADER_VERSION_MINOR=16 -DLOADER_VERSION_PATCH=14 -I/var/tmp/portage/dev-libs/level-zero-1.16.14/work/level-zero-1.16.14/include -I/var/tmp/portage/dev-libs/level-zero-1.16.14/work/level-zero-1.16.14/source/wrapper/include -I/var/tm
[48/51] : && /usr/bin/x86_64-pc-linux-gnu-g++ -O2 -pipe -march=native -fno-diagnostics-color -std=c++14 -fpermissive -fPIC -Wall  -Wnon-virtual-dtor -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--defsym=__gentoo_check_ldflags__=0    -rdynamic samples/zello_world/CMakeFiles/zello_world.dir
FAILED: bin/zello_world 
: && /usr/bin/x86_64-pc-linux-gnu-g++ -O2 -pipe -march=native -fno-diagnostics-color -std=c++14 -fpermissive -fPIC -Wall  -Wnon-virtual-dtor -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--defsym=__gentoo_check_ldflags__=0    -rdynamic samples/zello_world/CMakeFiles/zello_world.dir/zello_w
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: lib/libze_loader.so.1.16.14: undefined reference to `fmt::v9::detail::throw_format_error(char const*)'
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: lib/libze_loader.so.1.16.14: undefined reference to `typeinfo for fmt::v9::format_error'
/usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: lib/libze_loader.so.1.16.14: undefined reference to `fmt::v9::format_error::~format_error()'

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 23.0_desktop_gnome_systemd-20240412-195623

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-14 *
clang/llvm (if any):
clang version 18.1.3
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
/usr/lib/llvm/18
18.1.3
Python 3.11.9
Available Ruby profiles:
  [1]   ruby31 (with Rubygems)
  [2]   ruby32 (with Rubygems)
  [3]   ruby33 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.77.1 *
The following VMs are available for generation-2:
1)	Eclipse Temurin JDK 11.0.22_p7 [openjdk-bin-11]
2)	Eclipse Temurin JDK 17.0.10_p7 [openjdk-bin-17]
*)	Eclipse Temurin JDK 21.0.2_p13 [openjdk-bin-21]
4)	Eclipse Temurin JDK 8.402_p06 [openjdk-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-bin-8 
  [2]   openjdk-bin-11 
  [3]   openjdk-bin-17 
  [4]   openjdk-bin-21  system-vm

The Glorious Glasgow Haskell Compilation System, version 9.2.8
php cli (if any):
  [1]   php8.1 *
  [2]   php8.3
go version go1.22.2 linux/amd64

  HEAD of ::gentoo
commit 315dcd49bb18a38761c26d275fafa8c6d3eb64a0
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Wed Apr 17 17:34:19 2024 +0000

    2024-04-17 17:34:19 UTC

emerge -qpvO dev-libs/level-zero
[ebuild  N    ] dev-libs/level-zero-1.16.14
Comment 1 Toralf Förster gentoo-dev 2024-04-17 18:01:38 UTC
Created attachment 891002 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2024-04-17 18:01:39 UTC
Created attachment 891003 [details]
dev-libs:level-zero-1.16.14:20240417-175422.log
Comment 3 Toralf Förster gentoo-dev 2024-04-17 18:01:41 UTC
Created attachment 891004 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2024-04-17 18:01:42 UTC
Created attachment 891005 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2024-04-17 18:01:43 UTC
Created attachment 891006 [details]
etc.clang.tar.xz
Comment 6 Toralf Förster gentoo-dev 2024-04-17 18:01:44 UTC
Created attachment 891007 [details]
etc.portage.tar.xz
Comment 7 Toralf Förster gentoo-dev 2024-04-17 18:01:45 UTC
Created attachment 891008 [details]
qlist-info.txt.xz
Comment 8 Toralf Förster gentoo-dev 2024-04-17 18:01:46 UTC
Created attachment 891009 [details]
temp.tar.xz
Comment 9 Conrad Kostecki gentoo-dev 2024-04-17 20:54:15 UTC
@sam: any idea on this?
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-04-20 13:36:46 UTC
(In reply to Conrad Kostecki from comment #9)
> @sam: any idea on this?

heh, I ended up finding those bug for *another* reason (looking at bug 930199).

Sorry, I've been missing pings and stuff a lot the last few weeks as everything is so busy.

Now, for the issue itself... the link line doesn't have -lfmt or whatever. fine. 

But where is the libfmt use even coming from?
```
/var/tmp/portage/dev-libs/level-zero-1.16.14/work $ grep -rsin libfmt
/var/tmp/portage/dev-libs/level-zero-1.16.14/work $ grep -rsin fmt
grep: level-zero-1.16.14/.git/objects/d4/d5bc76a8f1c873a2dbb2b31a4ecef92a80e862: binary file matches
grep: level-zero-1.16.14_build/source/CMakeFiles/ze_loader.dir/lib/ze_lib.cpp.o: binary file matches
grep: level-zero-1.16.14_build/source/CMakeFiles/ze_loader.dir/loader/linux/loader_init.cpp.o: binary file matches
grep: level-zero-1.16.14_build/source/CMakeFiles/ze_loader.dir/loader/ze_ldrddi.cpp.o: binary file matches
grep: level-zero-1.16.14_build/source/CMakeFiles/ze_loader.dir/loader/ze_loader.cpp.o: binary file matches
grep: level-zero-1.16.14_build/source/CMakeFiles/ze_loader.dir/loader/ze_loader_api.cpp.o: binary file matches
grep: level-zero-1.16.14_build/source/CMakeFiles/ze_loader.dir/loader/zes_ldrddi.cpp.o: binary file matches
grep: level-zero-1.16.14_build/source/CMakeFiles/ze_loader.dir/loader/zet_ldrddi.cpp.o: binary file matches
grep: level-zero-1.16.14_build/source/CMakeFiles/ze_loader.dir/loader/zel_tracing_ldrddi.cpp.o: binary file matches
grep: level-zero-1.16.14_build/source/layers/validation/CMakeFiles/ze_validation_layer.dir/handle_lifetime_tracking/zes_handle_lifetime.cpp.o: binary file matches
grep: level-zero-1.16.14_build/source/layers/validation/CMakeFiles/ze_validation_layer.dir/zet_valddi.cpp.o: binary file matches
grep: level-zero-1.16.14_build/source/layers/tracing/CMakeFiles/ze_tracing_layer.dir/ze_trcddi.cpp.o: binary file matches
grep: level-zero-1.16.14_build/source/utils/CMakeFiles/utils.dir/logging.cpp.o: binary file matches
grep: level-zero-1.16.14_build/samples/zello_world/CMakeFiles/zello_world.dir/zello_world.cpp.o: binary file matches
grep: level-zero-1.16.14_build/lib/libutils.a: binary file matches
grep: level-zero-1.16.14_build/lib/libze_loader.so.1.16.14: binary file matches
grep: level-zero-1.16.14_build/lib/libze_tracing_layer.so.1.16.14: binary file matches
grep: level-zero-1.16.14_build/.ninja_deps: binary file matches
```

Checking level-zero's deps, we just have:
```
    DEPEND="dev-libs/spdlog:="
```
and I know that spdlog and libfmt have a relationship (spdlog depends on libfmt).

so, my first guess is, we're using spdlog and either not linking against spdlog's libraries at all (I think both spdlog and libfmt might be available as header-only and shared lib versions), or, if we are, we're hardcoding just -lspdlog or w/e and not asking CMake properly.
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-04-20 13:39:05 UTC
in fact, I think it really wants to use bundled spdlog, but it's not available in the tarball, but DOESN'T fail on that (???), and then it ends up accidentally using the system copy without any sort of dep information (just via #include)
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-04-20 13:39:45 UTC
my total guess is that newer cmake either exposes this as a flaw in the level-zero build (it's suspicious that it doesn't seem to use the right vars for this anyway) and/or it's also a cmake bug (why didn't it fail when fetchcontent failed? or am I just missing how FC works?)
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-04-20 13:40:36 UTC
I guess https://github.com/oneapi-src/level-zero/commit/0eda14664e96fe313c7772fe83c95d21a8288823 broke it or made it worse
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-04-20 13:48:22 UTC
Created attachment 891182 [details, diff]
level-zero-1.16.14-spdlog-libfmt.patch

attached level-zero-1.16.14-spdlog-libfmt.patch which WFM, please run with it - thanks!
Comment 15 Conrad Kostecki gentoo-dev 2024-04-20 22:04:58 UTC
Thanks sam. I filled an upstream bug for that. Your patch did worked for me, so I will commit that.
Comment 16 Larry the Git Cow gentoo-dev 2024-04-20 22:05:17 UTC
The bug has been closed via the following commit(s):

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

commit e8e90cbd18d713cb3e0fa8189cd411ef15b961b2
Author:     Conrad Kostecki <conikost@gentoo.org>
AuthorDate: 2024-04-20 22:00:56 +0000
Commit:     Conrad Kostecki <conikost@gentoo.org>
CommitDate: 2024-04-20 22:00:56 +0000

    dev-libs/level-zero: fix compilation
    
    Closes: https://bugs.gentoo.org/930157
    Signed-off-by: Conrad Kostecki <conikost@gentoo.org>

 .../files/level-zero-1.16.14-spdlog-libfmt.patch   | 60 ++++++++++++++++++++++
 ...1.16.14.ebuild => level-zero-1.16.14-r1.ebuild} |  8 ++-
 2 files changed, 67 insertions(+), 1 deletion(-)