]> granicus.if.org Git - clang/commit
[Driver] Check normalized triples for multiarch runtime path
authorPetr Hosek <phosek@chromium.org>
Wed, 22 Aug 2018 22:56:46 +0000 (22:56 +0000)
committerPetr Hosek <phosek@chromium.org>
Wed, 22 Aug 2018 22:56:46 +0000 (22:56 +0000)
commit2fe3058f3a166ad7189d96e4589bd3eb401ddfd6
treeeebea3d80b2830cf8b0560130ee26c69d90a5c4a
parentdcb6b80cd34123d9022122a35219a154bfca20dc
[Driver] Check normalized triples for multiarch runtime path

Previously we only used target triple as provided which matches the
GCC behavior, but it also means that all clients have to be consistent
in their spelling of target triples since e.g. x86_64-linux-gnu and
x86_64-unknown-linux-gnu will result in Clang driver looking at two
different paths when searching for runtime libraries.

Unfortunatelly, as it turned out many clients aren't consistent in
their spelling of target triples, e.g. many Linux distributions use
the shorter spelling but config.guess and rustc insist on using the
normalized variant which is causing issues. To avoid having to ship
multiple copies of runtimes for different triple spelling or rely on
symlinks which are not portable, we should also check the normalized
triple when constructing paths for multiarch runtimes.

Differential Revision: https://reviews.llvm.org/D50547

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340471 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
include/clang/Driver/ToolChain.h
lib/Driver/ToolChain.cpp
test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.asan-preinit.a [new file with mode: 0644]
test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.asan.so [new file with mode: 0644]
test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.builtins.a [new file with mode: 0644]
test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.fuzzer.a [new file with mode: 0644]
test/Driver/Inputs/resource_dir_with_per_target_subdir/aarch64-fuchsia/lib/libclang_rt.scudo.so [new file with mode: 0644]
test/Driver/Inputs/resource_dir_with_per_target_subdir/i386-linux-gnu/lib/libclang_rt.builtins.a [new file with mode: 0644]
test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.asan-preinit.a [new file with mode: 0644]
test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.asan.so [new file with mode: 0644]
test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.builtins.a [new file with mode: 0644]
test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.fuzzer.a [new file with mode: 0644]
test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-fuchsia/lib/libclang_rt.scudo.so [new file with mode: 0644]
test/Driver/Inputs/resource_dir_with_per_target_subdir/x86_64-linux-gnu/lib/libclang_rt.builtins.a [new file with mode: 0644]