[PATCH] D70919: [Hexagon] Avoid passing unsupported options to lld when -fuse-ld=lld is used
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 13 16:32:09 PST 2020
MaskRay added a comment.
In D70919#1818355 <https://reviews.llvm.org/D70919#1818355>, @nathanchance wrote:
> I am seeing the same failure that @leonardchan reported above. This is related to `-DCLANG_DEFAULT_LINKER=lld`:
>
> $ cmake -G Ninja \
> -Wno-dev \
> -DCMAKE_BUILD_TYPE=Release \
> -DCLANG_DEFAULT_LINKER=lld \
> -DPYTHON_EXECUTABLE=$(command -v python3) \
> -DLLVM_ENABLE_PROJECTS="clang;lld" \
> -DCMAKE_C_COMPILER=clang \
> -DCMAKE_CXX_COMPILER=clang++ \
> ../llvm && \
> ninja lld check-clang
> ...
> Failing Tests (1):
> Clang :: Driver/hexagon-toolchain-elf.c
>
> Expected Passes : 16530
> Expected Failures : 21
> Unsupported Tests : 98
> Unexpected Failures: 1
> ...
> $ cmake -G Ninja \
> -Wno-dev \
> -DCMAKE_BUILD_TYPE=Release \
> -DPYTHON_EXECUTABLE=$(command -v python3) \
> -DLLVM_ENABLE_PROJECTS="clang;lld" \
> -DCMAKE_C_COMPILER=clang \
> -DCMAKE_CXX_COMPILER=clang++ \
> ../llvm && \
> ninja lld check-clang
> ...
> Expected Passes : 16531
> Expected Failures : 21
> Unsupported Tests : 98
> ...
>
>
> The test assumes that if `-fuse-ld` is not passed, we are not using `ld.lld` but that is clearly false when `-DCLANG_DEFAULT_LINKER=lld` is set. It seems like an explicit `-fuse-ld=ld` should be used so we are guaranteed to hit https://elixir.bootlin.com/llvm/llvmorg-10-init/source/clang/lib/Driver/ToolChain.cpp#L501?
>
> diff --git a/clang/test/Driver/hexagon-toolchain-elf.c b/clang/test/Driver/hexagon-toolchain-elf.c
> index cf7d8bdb393..c9b5e20c41a 100644
> --- a/clang/test/Driver/hexagon-toolchain-elf.c
> +++ b/clang/test/Driver/hexagon-toolchain-elf.c
> @@ -538,11 +538,12 @@
> // CHECK080: "-Wreturn-type"
>
> // -----------------------------------------------------------------------------
> -// Default, not passing -fuse-ld
> +// Default, using system linker
> // -----------------------------------------------------------------------------
> // RUN: %clang -### -target hexagon-unknown-elf \
> // RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
> // RUN: -mcpu=hexagonv60 \
> +// RUN: -fuse-ld=ld \
> // RUN: %s 2>&1 \
> // RUN: | FileCheck -check-prefix=CHECK081 %s
> // REQUIRES: hexagon-registered-target
>
Looking
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70919/new/
https://reviews.llvm.org/D70919
More information about the cfe-commits
mailing list