Incorrect linker behavior

When you build oneDAL application using clang++ and static linking, you might encounter the following issue:

/usr/bin/ld: BFD (GNU Binutils for Ubuntu) <version> assertion fail ../../bfd/elf.c

Intel® oneAPI DPC++/C++ Compiler produces zero size relocation section in oneDAL libraries, which causes incorrect linker behavior.

How to Fix

Use linker keys -Bstatic and -Bdynamic for linking oneDAL libs. For example:

  • Previous linking approach:

    -Wl, --start-group
    <daal_lib_path>/libonedal_core.a <daal_lib_path>/libonedal_thread.a
    
  • New linking approach:

    -Wl, --start-group
    -Wl, -L<daal_lib_path>, -Bstatic,
    -lonedal_core, -lonedal_thread,
    -Bdynamic