Mold doesn't work with intel-oneapi-tbb installed

Description:

Mold uses libtbb (/usr/lib/libtbb.so.12) from onetbb. However, with intel-oneapi-tbb installed, mold uses /opt/intel/oneapi/tbb/2021.12/lib/libtbb.so.12. It will results in an error:

$ mold
mold: symbol lookup error: mold: undefined symbol: _ZN3tbb6detail2r127get_thread_reference_vertexEPNS0_2d126wait_tree_vertex_interfaceE

So one needs to specify the library path:

$ LD_LIBRARY_PATH=/usr/lib/ mold
mold: fatal: -m option is missing

intel-oneapi-tbb is indirectly required by blender, so I believe that marking this package as a conflicting one would not be appropriate.

Additional info:

  • package version: 2.37.1-1