Page MenuHomePhabricator

[Android] Default to --rtlib=compiler-rt
ClosedPublic

Authored by rprichard on Feb 10 2021, 3:03 AM.

Details

Summary

By default, the driver uses the compiler-rt builtins and links with
-l:libunwind.a.

Restore the previous behavior by passing --rtlib=libgcc.

Diff Detail

Unit TestsFailed

TimeTest
850 msx64 debian > Clang.Driver::linux-ld.c
Script: -- : 'RUN: at line 4'; /mnt/disks/ssd0/agent/llvm-project/build/bin/clang -no-canonical-prefixes /mnt/disks/ssd0/agent/llvm-project/clang/test/Driver/linux-ld.c -### -o /mnt/disks/ssd0/agent/llvm-project/build/tools/clang/test/Driver/Output/linux-ld.c.tmp.o 2>&1 --target=i386-unknown-linux -rtlib=platform --gcc-toolchain="" --sysroot=/mnt/disks/ssd0/agent/llvm-project/clang/test/Driver/Inputs/basic_linux_tree | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck --check-prefix=CHECK-LD-32 /mnt/disks/ssd0/agent/llvm-project/clang/test/Driver/linux-ld.c
8,500 msx64 windows > Clang.Driver::linux-ld.c
Script: -- : 'RUN: at line 4'; c:\ws\w1\llvm-project\premerge-checks\build\bin\clang.exe -no-canonical-prefixes C:\ws\w1\llvm-project\premerge-checks\clang\test\Driver\linux-ld.c -### -o C:\ws\w1\llvm-project\premerge-checks\build\tools\clang\test\Driver\Output\linux-ld.c.tmp.o 2>&1 --target=i386-unknown-linux -rtlib=platform --gcc-toolchain="" --sysroot=C:\ws\w1\llvm-project\premerge-checks\clang\test\Driver/Inputs/basic_linux_tree | c:\ws\w1\llvm-project\premerge-checks\build\bin\filecheck.exe --check-prefix=CHECK-LD-32 C:\ws\w1\llvm-project\premerge-checks\clang\test\Driver\linux-ld.c
220 msx64 windows > Clang.Driver::undefined-libs.cpp
Script: -- : 'RUN: at line 5'; not c:\ws\w1\llvm-project\premerge-checks\build\bin\clang.exe --driver-mode=g++ -stdlib=nostdlib C:\ws\w1\llvm-project\premerge-checks\clang\test\Driver\undefined-libs.cpp 2>&1 | c:\ws\w1\llvm-project\premerge-checks\build\bin\filecheck.exe --check-prefix=STDLIB C:\ws\w1\llvm-project\premerge-checks\clang\test\Driver\undefined-libs.cpp

Event Timeline

rprichard created this revision.Feb 10 2021, 3:03 AM
rprichard requested review of this revision.Feb 10 2021, 3:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 10 2021, 3:03 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
rprichard added subscribers: thakis, glandium.

Adding glandium and thakis for Firefox and Chrome. e.g. I suspect this change would cause the same sort of breakage seen in D95166.

danalbert accepted this revision.Feb 10 2021, 12:20 PM
This revision is now accepted and ready to land.Feb 10 2021, 12:20 PM
pirama added a subscriber: pirama.Mar 9 2021, 9:31 AM
rprichard updated this revision to Diff 329475.Mar 9 2021, 2:53 PM

Rebase this revision.

This revision was landed with ongoing or failed builds.Mar 9 2021, 6:38 PM
This revision was automatically updated to reflect the committed changes.

Hilariously enough, this breaks building compiler-rt itself inside LLVM's runtime builds setup for us. The runtimes build setup builds clang and then uses the just-built clang to build compiler-rt. That build fails to link since my just-built clang doesn't have compiler-rt available, because it's currently trying to build compiler-rt itself. That's a bug in the compiler-rt build system, and I sent out https://lists.llvm.org/pipermail/llvm-dev/2021-March/149137.html to ask what we should do about it.