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

Bug 874564

Summary: games-board/stockfish-16-r1: benchmark.cpp:(.text+0xc5): undefined reference to `__llvm_profile_instrument_memop'
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Matthias Maier <tamiko>
Status: CONFIRMED ---    
Severity: normal CC: 0xfdfefafd
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 870412    
Attachments: emerge-info.txt
emerge-history.txt
environment
etc.portage.tar.bz2
games-board:stockfish-15-r1:20221003-070154.log
use not profile-guided build

Description Toralf Förster gentoo-dev 2022-10-03 08:15:17 UTC
/usr/bin/x86_64-pc-linux-gnu-ld: bitboard.cpp:(.text+0x274): undefined reference to `__llvm_profile_instrument_memop'
/usr/bin/x86_64-pc-linux-gnu-ld: bitboard.cpp:(.text+0x354): undefined reference to `__llvm_profile_instrument_memop'
/usr/bin/x86_64-pc-linux-gnu-ld: bitboard.cpp:(.text+0x3fc): undefined reference to `__llvm_profile_instrument_memop'
/usr/bin/x86_64-pc-linux-gnu-ld: bitboard.o:bitboard.cpp:(.text+0x4d9): more undefined references to `__llvm_profile_instrument_memop' follow
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Makefile:924: stockfish] Error 1
make[2]: Leaving directory '/var/tmp/portage/games-board/stockfish-15-r1/work/Stockfish-sf_15/src'

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

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_hardened-j4-20221002-140811

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

gcc-config -l:
 [1] x86_64-pc-linux-gnu-12.2.0 *
clang/llvm (if any):
clang version 15.0.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/15/bin
/usr/lib/llvm/15
15.0.1
Python 3.10.7
Available Ruby profiles:
  [1]   ruby27 (with Rubygems)
  [2]   ruby30 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.64.0 *
The following VMs are available for generation-2:
*)	Eclipse Temurin JDK 17.0.4.1_p1 [openjdk-bin-17]
2)	Eclipse Temurin JDK 8.345_p01 [openjdk-bin-8]
Available Java Virtual Machines:
  [1]   openjdk-bin-8 
  [2]   openjdk-bin-17  system-vm

The Glorious Glasgow Haskell Compilation System, version 9.0.2
php cli (if any):
  [1]   php7.4 *
  [2]   php8.0
  [3]   php8.1
GNU Make 4.3

  HEAD of ::gentoo
commit af50553c502d12d3163e7ed114fc3646f1d1afd7
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Mon Oct 3 05:33:59 2022 +0000

    2022-10-03 05:33:58 UTC

emerge -qpvO games-board/stockfish
[ebuild  N    ] games-board/stockfish-15-r1  USE="optimize -debug -general-32 -general-64" CPU_FLAGS_X86="avx2 popcnt sse"
Comment 1 Toralf Förster gentoo-dev 2022-10-03 08:15:18 UTC
Created attachment 817378 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2022-10-03 08:15:20 UTC
Created attachment 817381 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2022-10-03 08:15:22 UTC
Created attachment 817384 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2022-10-03 08:15:23 UTC
Created attachment 817387 [details]
etc.portage.tar.bz2
Comment 5 Toralf Förster gentoo-dev 2022-10-03 08:15:24 UTC
Created attachment 817390 [details]
games-board:stockfish-15-r1:20221003-070154.log
Comment 6 Agostino Sarubbo gentoo-dev 2023-02-14 13:35:40 UTC
tinderbox_musl has reproduced this issue with version 15.1 - Updating summary.
Comment 7 Agostino Sarubbo gentoo-dev 2024-02-01 07:56:20 UTC
clang-lld_tinderbox has reproduced this issue with version 16-r1 - Updating summary.
Comment 8 0xfdfefafd 2024-03-29 19:39:53 UTC
Created attachment 889021 [details, diff]
use not profile-guided build

ad-hoc patch
Comment 9 0xfdfefafd 2024-03-29 19:44:28 UTC
I can confirm same error with clang-17. To make it build (i tested stockfish-15-r1 and stockfish-16.1) I changed build type from "profile-build" to "build" in ebuild file (I attach this patch for these versions). This is not ideal, but at least it allows to build the program.
But if you try to clone code from github and build manually with `make profile-build COMP=clang` it builds without problem! Unfortunately, that as far as I could go.