Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 882813 - sys-cluster/ucx-1.13.1 - <unknown>:663: undefined reference to _kmpc_global_thread_num
Summary: sys-cluster/ucx-1.13.1 - <unknown>:663: undefined reference to _kmpc_global_t...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Cluster Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-24 20:59 UTC by Toralf Förster
Modified: 2025-02-08 03:43 UTC (History)
1 user (show)

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


Attachments
emerge-info.txt (emerge-info.txt,17.56 KB, text/plain)
2022-11-24 20:59 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,108.89 KB, text/plain)
2022-11-24 20:59 UTC, Toralf Förster
Details
environment (environment,81.03 KB, text/plain)
2022-11-24 20:59 UTC, Toralf Förster
Details
etc.clang.tar.bz2 (etc.clang.tar.bz2,703 bytes, application/x-bzip)
2022-11-24 20:59 UTC, Toralf Förster
Details
etc.portage.tar.bz2 (etc.portage.tar.bz2,26.20 KB, application/x-bzip)
2022-11-24 20:59 UTC, Toralf Förster
Details
logs.tar.bz2 (logs.tar.bz2,27.26 KB, application/x-bzip)
2022-11-24 20:59 UTC, Toralf Förster
Details
sys-cluster:ucx-1.13.1:20221124-205209.log.bz2 (sys-cluster:ucx-1.13.1:20221124-205209.log.bz2,16.25 KB, application/x-bzip)
2022-11-24 20:59 UTC, Toralf Förster
Details
temp.tar.bz2 (temp.tar.bz2,691.73 KB, application/x-bzip)
2022-11-24 20:59 UTC, Toralf Förster
Details
var.tmp.clang.tar.bz2 (var.tmp.clang.tar.bz2,42.79 KB, application/x-bzip)
2022-11-24 20:59 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2022-11-24 20:59:03 UTC
too long lines were shrinked:

clang -DHAVE_CONFIG_H -I. -I../../..  -DCPU_FLAGS="" -I/var/tmp/portage/sys-cluster/ucx-1.13.1/work/ucx-1.13.1/src -I/var/tmp/portage/sys-cluster/ucx-1.13.1/work/ucx-1.13.1 -I/var/tmp/portage/sys-cluster/ucx-1.13.1/work/ucx-1.13.1/src   -g -Wall -funwind-tables -Wno-missing-field-initializers -Wno-u
/bin/sh ../../../libtool  --tag=CC   --mode=link clang -g -Wall -funwind-tables -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-label -Wno-long-long -Wno-endif-labels -Wno-sign-compare -Wno-multichar -Wno-deprecated-declarations -Winvalid-pch -Wno-pointer-sign -Werror-implicit-func
libtool: link: clang -g -Wall -funwind-tables -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-label -Wno-long-long -Wno-endif-labels -Wno-sign-compare -Wno-multichar -Wno-deprecated-declarations -Winvalid-pch -Wno-pointer-sign -Werror-implicit-function-declaration -Wno-format-zero-
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: lib/.libs/libucxperf.a(libucxperf_la-ucp_tests.o): in function `ucp_perf_test_runner<(ucx_perf_cmd_t)1, (ucx_perf_test_type_t)0, 4u>::ucp_perf_test_prepare_iov_buffers()':
<unknown>:663: undefined reference to `__kmpc_global_thread_num'
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: lib/.libs/libucxperf.a(libucxperf_la-ucp_tests.o): in function `ucp_perf_test_runner<(ucx_perf_cmd_t)1, (ucx_perf_test_type_t)0, 4u>::create_iov_buffer(ucp_dt_iov*, void*)':
/var/tmp/portage/sys-cluster/ucx-1.13.1/work/ucx-1.13.1/src/tools/perf/lib/./libperf_int.h:191: undefined reference to `__kmpc_barrier'

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

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_systemd-j4-20221124-030016

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

CC=clang
CXX=clang++
gcc-config -l:
 [1] x86_64-pc-linux-gnu-12 *
clang/llvm (if any):
clang version 15.0.5
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/15/bin
Configuration file: /etc/clang/clang.cfg
/usr/lib/llvm/15
15.0.5
Python 3.10.8
Available Ruby profiles:
  (none found)
Available Rust versions:
  [1]   rust-bin-1.65.0 *
The Glorious Glasgow Haskell Compilation System, version 9.0.2
php cli (if any):

  HEAD of ::gentoo
commit c0944ed7ad1099517efd4896617583f0a3d31f17
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Thu Nov 24 20:02:03 2022 +0000

    2022-11-24 20:02:02 UTC

emerge -qpvO sys-cluster/ucx
[ebuild  N    ] sys-cluster/ucx-1.13.1  USE="numa openmp"
Comment 1 Toralf Förster gentoo-dev 2022-11-24 20:59:04 UTC
Created attachment 836549 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2022-11-24 20:59:06 UTC
Created attachment 836551 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2022-11-24 20:59:07 UTC
Created attachment 836553 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2022-11-24 20:59:08 UTC
Created attachment 836555 [details]
etc.clang.tar.bz2
Comment 5 Toralf Förster gentoo-dev 2022-11-24 20:59:09 UTC
Created attachment 836557 [details]
etc.portage.tar.bz2
Comment 6 Toralf Förster gentoo-dev 2022-11-24 20:59:11 UTC
Created attachment 836559 [details]
logs.tar.bz2
Comment 7 Toralf Förster gentoo-dev 2022-11-24 20:59:12 UTC
Created attachment 836561 [details]
sys-cluster:ucx-1.13.1:20221124-205209.log.bz2
Comment 8 Toralf Förster gentoo-dev 2022-11-24 20:59:15 UTC
Created attachment 836563 [details]
temp.tar.bz2
Comment 9 Toralf Förster gentoo-dev 2022-11-24 20:59:16 UTC
Created attachment 836565 [details]
var.tmp.clang.tar.bz2
Comment 10 Zhixu Liu 2025-02-06 16:38:33 UTC
can't reproduce this at first.

after download etc.portage.tar.bz2, problem reproduced, but it's weired, ...

then check /etc/portage/bashrc, after many test and print debug, it turns out to be a bug of /etc/portge/bashrc?

> if [[ -n \${PORTAGE_USE_CLANG_HOOK_GCC} ]] ; then
>      real_compiler="${BROOT:-/}"/usr/bin/${CHOST}-gcc
> fi

here, if var PORTAGE_USE_CLAN_HOOK_GCC (-n test length obly) exist, real_compiler will be gcc always, in /etc/portage/make.conf:

> PORTAGE_USE_CLANG_HOOK_GCC=1

despite CC is clang, real compiler is gcc always. If gcc is used always, should have no problem. But

> /bin/sh ../../../../libtool  --tag=CXX   --mode=link clang++ -g -Wall -funwind-tables -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-label -Wno-long-long -Wno-endif-labels -Wno-sign-compare -Wno-multichar -Wno-deprecated-declarations -Winvalid-pch -fopenmp -pipe -march=native -fno-diagnostics-color -O2 -Werror=implicit-function-declaration -Werror=implicit-int -nostdlib -fno-exceptions -fno-rtti -std=c++11  -fopenmp -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -o libucxperf.la  libucxperf_la-libperf.lo libucxperf_la-libperf_memory.lo libucxperf_la-libperf_thread.lo libucxperf_la-uct_tests.lo libucxperf_la-ucp_tests.lo /var/tmp/portage/sys-cluster/ucx-1.13.1/work/ucx-1.13.1/src/uct/libuct.la /var/tmp/portage/sys-cluster/ucx-1.13.1/work/ucx-1.13.1/src/ucp/libucp.la /var/tmp/portage/sys-cluster/ucx-1.13.1/work/ucx-1.13.1/src/ucs/libucs.la -lrt -lrt

clang++ is used, and clang++ is not wrapped.
-nostdlib is provided which will cause -lomp not added automatically.

finally, gcc was called as link, w/o -lomp (it clang's openmp) of course, so cause this bug.

if PORTAGE_USE_CLANG_HOOK_GCC is commented, clang will be used always, build will be fine, because link is called with -fopen, so -lomp will be added automatically.

Any problem with this analysis?