This is an archive of the discontinued LLVM Phabricator instance.

Fix the -print-multi-directory flag to print the selected multilib.
ClosedPublic

Authored by chrib on Aug 28 2018, 6:30 AM.

Diff Detail

Event Timeline

chrib created this revision.Aug 28 2018, 6:30 AM
jroelofs accepted this revision.Aug 28 2018, 7:23 PM

LGTM. Thanks for fixing this!

This revision is now accepted and ready to land.Aug 28 2018, 7:23 PM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Sep 4 2018, 11:02 AM

The test fails on my system like so:

--

********************
FAIL: Clang :: Driver/print-multi-directory.c (4696 of 13174)
******************** TEST 'Clang :: Driver/print-multi-directory.c' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/thakis/src/llvm-build-goma/bin/clang -no-canonical-prefixes /usr/local/google/home/thakis/src/llvm-rw/tools/clang/test/Driver/print-multi-directory.c -### -o /usr/local/google/home/thakis/src/llvm-build-goma/tools/clang/test/Driver/Output/print-multi-directory.c.tmp.o 2>&1      -target i386-none-linux      -print-multi-directory    | /usr/local/google/home/thakis/src/llvm-build-goma/bin/FileCheck --check-prefix=CHECK-X86-MULTILIBS /usr/local/google/home/thakis/src/llvm-rw/tools/clang/test/Driver/print-multi-directory.c
: 'RUN: at line 10';   /usr/local/google/home/thakis/src/llvm-build-goma/bin/clang -no-canonical-prefixes /usr/local/google/home/thakis/src/llvm-rw/tools/clang/test/Driver/print-multi-directory.c -### -o /usr/local/google/home/thakis/src/llvm-build-goma/tools/clang/test/Driver/Output/print-multi-directory.c.tmp.o 2>&1      -target i386-none-linux -m64      -print-multi-directory    | /usr/local/google/home/thakis/src/llvm-build-goma/bin/FileCheck --check-prefix=CHECK-X86_64-MULTILIBS /usr/local/google/home/thakis/src/llvm-rw/tools/clang/test/Driver/print-multi-directory.c
: 'RUN: at line 19';   /usr/local/google/home/thakis/src/llvm-build-goma/bin/clang -no-canonical-prefixes /usr/local/google/home/thakis/src/llvm-rw/tools/clang/test/Driver/print-multi-directory.c -### -o /usr/local/google/home/thakis/src/llvm-build-goma/tools/clang/test/Driver/Output/print-multi-directory.c.tmp.o 2>&1      -target arm-linux-androideabi21 -stdlib=libstdc++      -mthumb      -B/usr/local/google/home/thakis/src/llvm-rw/tools/clang/test/Driver/Inputs/basic_android_ndk_tree      --sysroot=/usr/local/google/home/thakis/src/llvm-rw/tools/clang/test/Driver/Inputs/basic_android_ndk_tree/sysroot      -print-multi-directory    | /usr/local/google/home/thakis/src/llvm-build-goma/bin/FileCheck  --check-prefix=CHECK-ARM-MULTILIBS /usr/local/google/home/thakis/src/llvm-rw/tools/clang/test/Driver/print-multi-directory.c
--
Exit Code: 1

Command Output (stderr):
--
/usr/local/google/home/thakis/src/llvm-rw/tools/clang/test/Driver/print-multi-directory.c:6:25: error: CHECK-X86-MULTILIBS: expected string not found in input
// CHECK-X86-MULTILIBS: 32
                        ^
<stdin>:1:1: note: scanning from here
clang version 8.0.0 (trunk 341389)
^
<stdin>:1:28: note: possible intended match here
clang version 8.0.0 (trunk 341389)
                           ^

--
timshen added a subscriber: timshen.Sep 4 2018, 3:11 PM

The test fails on my system like so:

I also observed the same failure.

Bots also fail: http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules/builds/19509/steps/check-all/logs/FAIL%3A%20Clang%3A%3Aprint-multi-directory.c

I'm going to revert this patch.

chrib added a subscriber: jroelofs.Sep 5 2018, 4:36 AM
This comment was removed by chrib.

Understood, The test worked for me because I have both 64 bit and 32 bit libs installed on my default sysroot. Otherwise might fail indeed.

Will amend the test with an explicit sysroot,

chrib added a comment.Sep 6 2018, 7:07 AM

Re-commit patch at r341547 with modified test case to use an explicit root tree for libraries

I saw this test fail in our testing as well. I think the matches are too broad and I suspect this will fail intermittently on the bots too causing confusion:

Command Output (stderr):
--
/vstsdrive/_work/10/s/llvm/tools/clang/test/Driver/print-multi-directory.c:19:32: error: CHECK-X86_64-MULTILIBS-NOT: excluded string found in input
// CHECK-X86_64-MULTILIBS-NOT: 32
                               ^
<stdin>:1:199: note: found here
clang version 8.0.0 (https://yn744hjyhitxavgbejjp2xsdymxivo4b6r7yrbigmz6v3uodg2sq@edgetools.visualstudio.com/llvm/_git/clang 5df831d3873a0affc7c7e1d908978f68222737f1) (llvm/_git/llvm 3e62673386d63e53205e2b6b92955c5506225e38)
                                                                                                                                                                                                      ^~