Can't build lld on BigSur (due to lack of dylibs under /usr/lib/ ) ?

Hi,

I'm trying to build `lld` on BigSur but it couldn't find
/usr/lib/libxml2.dylib

$ cd llvm-project/build
$ cmake -G Ninja -DLLVM_ENABLE_PROJECTS='lld' ../llvm/
$ ninja lld
ninja: error: '/usr/lib/libxml2.dylib', needed by 'bin/lld', missing and no
known rule to make it

Any idea how to resolve this?

(I've tried `brew install libxml2` but I couldn't symlink the dylib to
/usr/lib because it's read-only and I can't change it on this machine)

Thanks,

Vy

I wasn’t able to repro this on Big Sur 11.2.3 (and CMake 3.17.3). Is this on a clean build? Which version of Xcode (or the Command Line Tools) are you using? That dylib won’t exist because Big Sur moved all system dylibs into the shared cache, but CMake should be finding and using the tbd from the SDK.

I wasn’t able to repro this on Big Sur 11.2.3 (and CMake 3.17.3). Is this on a clean build? Which version of Xcode (or the Command Line Tools) are you using? That dylib won’t exist because Big Sur moved all system dylibs into the shared cache, but CMake should be finding and using the tbd from the SDK.

Ah, good question! I was not doing a clean build. Half of the stuff was built from Catalina, then I upgraded the OS, and tried to build again(d’oh!)
Nuking the build dir and doing a clean build resolved this. Mystery’s solved!Thanks!!!

Vy