Bug#1088922: please apply patch from upstream: Add cmake check for libatomic requirement when building with gcc

Johannes Schauer Marin Rodrigues josch at debian.org
Mon Dec 2 22:31:36 GMT 2024


Source: onetbb
Version: 2021.12.0-1
Severity: important
X-Debbugs-Cc: glaubitz at physik.fu-berlin.de

Control: forwarded -1 https://github.com/uxlfoundation/oneTBB/issues/1454
Control: affects -1 src:vcmi

Hi,

my package vcmi currently FTBFS on armel with:

/usr/bin/c++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wpointer-arith -Wuninitialized -Wmismatched-tags -Wno-unused-parameter -Wno-switch -Wno-reorder -Wno-sign-compare -Wno-varargs -Wl,-z,relro -Wl,-z,now CMakeFiles/vcmiserver.dir/StdInc.cpp.o CMakeFiles/vcmiserver.dir/EntryPoint.cpp.o -o ../bin/vcmiserver  -Wl,-rpath,"\$ORIGIN::::::::::::::::::::::::" /usr/lib/arm-linux-gnueabi/libminizip.so ../bin/libvcmiservercommon.a ../bin/libvcmi.so /usr/lib/arm-linux-gnueabi/libz.so -ldl -lrt /usr/lib/arm-linux-gnueabi/libboost_filesystem.so.1.83.0 /usr/lib/arm-linux-gnueabi/libboost_program_options.so.1.83.0 /usr/lib/arm-linux-gnueabi/libboost_locale.so.1.83.0 /usr/lib/arm-linux-gnueabi/libboost_thread.so.1.83.0 /usr/lib/arm-linux-gnueabi/libboost_atomic.so.1.83.0 /usr/lib/arm-linux-gnueabi/libboost_chrono.so.1.83.0 /usr/lib/arm-linux-gnueabi/libboost_date_time.so.1.83.0 /usr/lib/arm-linux-gnueabi/libminizip.so
/usr/bin/ld: ../bin/libvcmi.so: undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: ../bin/libvcmi.so: undefined reference to `__atomic_load_8'
collect2: error: ld returned 1 exit status

The problem is a missing -latomic. Adding the -latomic to the vcmi build system
itself would be wrong because the flag is only required if vcmi uses
tbb::parallel_for. So this is an issue with tbb and I linked the upstream issue
with this bug above. Here is a minimal reproducer:

cmake_minimum_required(VERSION 3.16.0)
project(tbbtest)
find_package(TBB REQUIRED)
add_executable(hello hello.cc)
target_link_libraries(hello PRIVATE TBB::tbb)

#include "tbb/parallel_for.h"
#include <iostream>
int main(int,char**) {
  tbb::parallel_for(
    tbb::blocked_range<size_t>(0,10),
    [&](const tbb::blocked_range<size_t>& r) {
      for (size_t i=r.begin();i<r.end();++i) std::cout << "hello" << std::endl;
    }
  );
  return 0;
}

In the issue, a pull request by John Paul Adrian Glaubitz is mentioned:
https://github.com/uxlfoundation/oneTBB/pull/987 But that pull request only
adds -latomic to the onetbb build itself and does not propagate it to software
that is built with libtbb-dev.

Filing with severity important since this issue currently blocks my package to
migrate to testing.

Thanks!

cheers, josch



More information about the debian-science-maintainers mailing list