[PATCH] D121510: [Support] Introduce the BLAKE3 hashing function implementation

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 02:44:11 PDT 2022


nikic added a comment.

In D121510#3450305 <https://reviews.llvm.org/D121510#3450305>, @akyrtzi wrote:

> In D121510#3448419 <https://reviews.llvm.org/D121510#3448419>, @nikic wrote:
>
>> It looks like https://github.com/llvm/llvm-project/commit/5426da8ffa4a6d55adab21026ce6ebe8f1cc6ef2 breaks building LLVM with LLD 13 + ThinLTO in some way I don't quite understand yet.
>> [...]
>> And then there are lots and lots of errors about undefined symbols from libLLVMSupport.a:
>>
>>   2022-04-07T16:05:15.3430029Z ld.lld: error: undefined symbol: llvm::StringMapImpl::LookupBucketFor(llvm::StringRef)
>>   2022-04-07T16:05:15.3430575Z >>> referenced by llvm-config.cpp
>>   2022-04-07T16:05:15.3431724Z >>>               /checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/lto.cache/Thin-b6b9e0.tmp.o:(std::pair<llvm::StringMapIterator<AvailableComponent*>, bool> llvm::StringMap<AvailableComponent*, llvm::MallocAllocator>::try_emplace<>(llvm::StringRef))
>>   2022-04-07T16:05:15.3432297Z 
>>   2022-04-07T16:05:15.3432688Z ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
>>   2022-04-07T16:05:15.3459873Z clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
>>   2022-04-07T16:05:15.3475933Z make[2]: *** [bin/llvm-config] Error 1
>>
>> It kind of seems like symbols from the bitcode files in the archive are no longer found after additional non-bitcode objects were added.
>>
>> Anyone have an idea what the issue here is?
>
> I can't reproduce this with `LLD 13.0.1` + the CMake arguments you posted that enable thinLTO. But given the nature of the error I would focus my attention on `"-DCMAKE_AR=/rustroot/bin/llvm-ar"`, as not emitting a proper archive. I used the `llvm-ar` from TOT llvm and I didn't see an issue, do you see a difference if you use the latest one?

This was a pretty good guess -- it turns out that due to a build system bug, we ended up using `ranlib` rather than `llvm-ranlib` for archive finalization, which means that the bitcode symbols were not included in the archive map. Presumably there is some kind of fallback if the archive map is empty, so we didn't run into this before the archive started including both bitcode and ELF object files. Setting the correct ranlib via `CMAKE_RANLIB` fixes the issue.

Sorry for the noise!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121510/new/

https://reviews.llvm.org/D121510



More information about the llvm-commits mailing list