[cfe-dev] Test failuire: Driver/baremetal.cpp

David A. Greene via cfe-dev cfe-dev at lists.llvm.org
Thu Jul 26 10:11:59 PDT 2018


Yes, that's fine by me.  We don't have a cross-linker gold, so I want to
make sure this isn't testing that a cross-linker is found.

                            -David

Rui Ueyama <ruiu at google.com> writes:

> Hi,
>
> I wonder if this test really needs to depend on lld. Maybe you can
> replace `ld.lld` with `ld` so that the test passes for any linker?
>
> On Thu, Jul 26, 2018 at 9:21 AM David Greene via cfe-dev
> <cfe-dev at lists.llvm.org> wrote:
>
>     I've configured clang to use gold, which seems to cause
>     test/Driver/baremetal.cpp to fail. The test works like this:
>     
>     // RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
>     // RUN: -target armv6m-none-eabi \
>     // RUN: -T semihosted.lds \
>     // RUN: -L some/directory/user/asked/for \
>     // RUN: --sysroot=%S/Inputs/baremetal_arm \
>     // RUN: | FileCheck --check-prefix=CHECK-V6M-C %s
>     // CHECK-V6M-C: "[[PREFIX_DIR:.*]]{{[/\\]+}}{{[^/^\\]+}}
>     {{[/\\]+}}clang{{.*}}" "-cc1" "-triple" "thumbv6m-none--eabi"
>     // CHECK-V6M-C-SAME: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
>     // CHECK-V6M-C-SAME: "-isysroot" "[[SYSROOT:[^"]*]]"
>     // CHECK-V6M-C-SAME: "-internal-isystem" "[[SYSROOT]]
>     {{[/\\]+}}include{{[/\\]+}}c++{{[/\\]+}}v1"
>     // CHECk-V6M-C-SAME: "-internal-isystem" "[[SYSROOT]]
>     {{[/\\]+}}include"
>     // CHECK-V6M-C-SAME: "-x" "c++" "{{.*}}baremetal.cpp"
>     // CHECK-V6M-C-NEXT: "{{[^"]*}}ld.lld{{(\.exe)?}}" "{{.*}}.o"
>     "-Bstatic"
>     
>     The NEXT line is problematic as it assumes ld.lld. I did not build
>     lld,
>     though I could simply to get the test working. But building lld is
>     not
>     enough as I configured with CLANG_DEFAULT_LINKER=gold. It seems
>     like
>     the RUN line needs -fuse-ld=lld.
>     
>     Is there a REQUIRES clause for lld being present and default? I
>     could
>     not find somthing appropriate in lit's config.available_features.
>     
>     It's certainly possible I'm doing something wrong, as I assume
>     many
>     people use gold with clang. Maybe those people don't run the
>     tests?
>     
>     I am happy to update the test if someone can point me to a good
>     REQUIRES
>     clause.
>     
>     Thanks!
>     
>     -David
>     _______________________________________________
>     cfe-dev mailing list
>     cfe-dev at lists.llvm.org
>     http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


More information about the cfe-dev mailing list