[llvm-dev] Clang-12 fails build on MacOS

Steven Wu via llvm-dev llvm-dev at lists.llvm.org
Fri Jul 16 14:03:00 PDT 2021



> On Jul 16, 2021, at 1:58 PM, Blumenthal, Uri - 0553 - MITLL <uri at ll.mit.edu> wrote:
> 
> The error is basically:
> :info:build CMake Error: failed to create symbolic link '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_llvm-12/clang-12/work/build/projects/compiler-rt/lib/builtins/outline_atomic_helpers.dir/outline_atomic_ldadd2_1.S': file already exists
>  
> Understood, thanks!
>  
> Looks like this is caused by https://reviews.llvm.org/D93178 <https://reviews.llvm.org/D93178>. It seems that when you build multiple arm64 slice (in this case, arm64 and arm64e), the LSE builtin will be generated twice. In the rare case that when two same `cmake -E create_symlink` running at the same time, you get that error. Before the change, it was compiling using clang so you don't get this weird race condition.
>  
> The problem is – even when I am forcing Macports to not build “fat” binaries (aka, limit the build to x86_64 only), I’m still getting an error.

This is not related to the architecture you build but the architecture the compiler supports. When you build x86_64 only, the x86_64 compiler supports building binary for arm64 as well, thus it needs to build compiler_rt fat no matter what CMAKE_OS_ARCHITECTURE you set. The supported architecture is inferred from the SDK you built against, which has arm64(e) support.

Steven

>  
> You can probably workaround by manually set `DARWIN_osx_BUILTIN_ARCHS` to remove `arm64e` since you don't really need that. 
>  
> Please see above. I don’t think it helped – at least when I’m building via Macports (where what I’m doing should be the same or equivalent to what you’re suggesting). :-(
>  
> At the meantime, can you file a bug report to bugs.llvm.org <http://bugs.llvm.org/>?
>  
> I was told this reporting mechanism is going away…?
>  
> But sure, if you think it makes sense, I’ll file a report there.
>  
> Thanks!
>  
> 
> 
>> On Jul 16, 2021, at 12:24 PM, Blumenthal, Uri - 0553 - MITLL via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
>>  
>> It seems there’s a problem with parallel builds, but I don’t really know the cause of the problem. You can see the screen log and the complete build log here: https://trac.macports.org/ticket/63026#comment:5 <https://trac.macports.org/ticket/63026#comment:5>
>>  
>> iMac Pro (Intel Core i9, 10 cores), MacOS Big Sur 11.4, Xcode-12.5.1, clang-12.0.1.
>>  
>> It would be great if this problem is resolved.
>>  
>> Thanks!
>> --
>> Regards,
>> Uri Blumenthal                              Voice: (781) 981-1638 
>> Secure Resilient Systems and Technologies   Cell:  (339) 223-5363
>> MIT Lincoln Laboratory                      
>> 244 Wood Street, Lexington, MA  02420-9108      
>>  
>> Web:     https://www.ll.mit.edu/biographies/uri-blumenthal <https://www.ll.mit.edu/biographies/uri-blumenthal>
>> Root CA: https://www.ll.mit.edu/llrca2.pem <https://www.ll.mit.edu/llrca2.pem>
>>  
>> There are two ways to design a system. One is to make is so simple there are obviously no deficiencies.
>> The other is to make it so complex there are no obvious deficiencies.
>>                                                                                                                                      -  C. A. R. Hoare
>>  
>> _______________________________________________
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210716/8d9c7cc7/attachment.html>


More information about the llvm-dev mailing list