Page MenuHome

Fix build with Clang on Linux
ClosedPublic

Authored by Stefano Bonicatti (smjert) on Jun 15 2020, 3:01 AM.

Details

Summary

Building Blender using Clang on Linux
ends up with a linker error when linking USD,
specifically "/usr/bin/ld: -f may not be used without -shared".
This is because USD is linked with "-Wl,-force_load <lib>"
which is unsupported on Linux by ld or lld and
it's only supported on macOS.

Use "-Wl,--whole-archive <lib> -Wl,--no-whole-archive" instead,
and also link TBB libraries.

Diff Detail

Repository
rB Blender

Event Timeline

Stefano Bonicatti (smjert) requested review of this revision.Jun 15 2020, 3:01 AM
Stefano Bonicatti (smjert) created this revision.

Simplify code, to clarify that the important distinction for linker flags is not between Clang and GCC, but macOS and Linux.

This revision is now accepted and ready to land.Jun 19 2020, 3:42 PM
This revision was automatically updated to reflect the committed changes.