Skip to content

Commit

Permalink
[test] Migrate -gcc-toolchain with space separator to --gcc-toolchain=
Browse files Browse the repository at this point in the history
Space separated driver options are uncommon but Clang traditionally
did not do a good job. --gcc-toolchain= is the preferred form.
  • Loading branch information
MaskRay committed Aug 20, 2021
1 parent 9e9d705 commit 40aab04
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions clang/test/Driver/fuse-ld.c
Expand Up @@ -60,19 +60,19 @@

// RUN: %clang %s -### -fuse-ld=ld \
// RUN: -target arm-linux-androideabi \
// RUN: -gcc-toolchain %S/Inputs/basic_android_tree 2>&1 \
// RUN: --gcc-toolchain=%S/Inputs/basic_android_tree 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-ANDROID-ARM-LD-TC
// CHECK-ANDROID-ARM-LD-TC: Inputs/basic_android_tree/lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin{{/|\\+}}ld

// RUN: %clang %s -### -fuse-ld=bfd \
// RUN: -target arm-linux-androideabi \
// RUN: -gcc-toolchain %S/Inputs/basic_android_tree 2>&1 \
// RUN: --gcc-toolchain=%S/Inputs/basic_android_tree 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK-ANDROID-ARM-BFD-TC
// CHECK-ANDROID-ARM-BFD-TC: Inputs/basic_android_tree/lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin{{/|\\+}}ld.bfd

// RUN: %clang %s -### -fuse-ld=gold \
// RUN: -target arm-linux-androideabi \
// RUN: -gcc-toolchain %S/Inputs/basic_android_tree 2>&1 \
// RUN: --gcc-toolchain=%S/Inputs/basic_android_tree 2>&1 \
// RUN: | FileCheck %s -check-prefix=CHECK-ANDROID-ARM-GOLD-TC
// CHECK-ANDROID-ARM-GOLD-TC: Inputs/basic_android_tree/lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin{{/|\\+}}ld.gold

Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/gcc-toolchain.cpp
Expand Up @@ -8,7 +8,7 @@
//
// Additionally check that the legacy spelling of the flag works.
// RUN: %clangxx %s -### --target=x86_64-linux-gnu --sysroot= \
// RUN: -gcc-toolchain %S/Inputs/ubuntu_14.04_multiarch_tree/usr -stdlib=libstdc++ --rtlib=libgcc 2>&1 | \
// RUN: --gcc-toolchain=%S/Inputs/ubuntu_14.04_multiarch_tree/usr -stdlib=libstdc++ --rtlib=libgcc 2>&1 | \
// RUN: FileCheck %s
//
// Test for header search toolchain detection.
Expand Down
2 changes: 1 addition & 1 deletion libc/benchmarks/CMakeLists.txt
Expand Up @@ -10,7 +10,7 @@ set(LLVM_LINK_COMPONENTS Support)
set(GOOGLE_BENCHMARK_TARGET_FLAGS ${BENCHMARK_DIALECT_FLAG})
if (LIBCXX_BENCHMARK_GCC_TOOLCHAIN)
set(GOOGLE_BENCHMARK_TARGET_FLAGS
-gcc-toolchain ${LIBCXX_BENCHMARK_GCC_TOOLCHAIN})
--gcc-toolchain=${LIBCXX_BENCHMARK_GCC_TOOLCHAIN})
endif()
string(REPLACE ";" " " GOOGLE_BENCHMARK_TARGET_FLAGS "${GOOGLE_BENCHMARK_TARGET_FLAGS}")

Expand Down
2 changes: 1 addition & 1 deletion libcxx/benchmarks/CMakeLists.txt
Expand Up @@ -47,7 +47,7 @@ ExternalProject_Add(google-benchmark-libcxx
set(BENCHMARK_NATIVE_TARGET_FLAGS)
if (LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN)
set(BENCHMARK_NATIVE_TARGET_FLAGS
-gcc-toolchain ${LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN})
--gcc-toolchain=${LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN})
endif()
split_list(BENCHMARK_NATIVE_TARGET_FLAGS)

Expand Down
4 changes: 2 additions & 2 deletions lldb/packages/Python/lldbsuite/test/make/Android.rules
Expand Up @@ -66,8 +66,8 @@ OBJCOPY ?= $(GCC_TOOLCHAIN)/bin/$(TOOL_PREFIX)-objcopy
ARCHIVER ?= $(GCC_TOOLCHAIN)/bin/$(TOOL_PREFIX)-ar

ifeq "$(findstring clang,$(CC))" "clang"
ARCH_CFLAGS += -target $(TRIPLE) -gcc-toolchain $(GCC_TOOLCHAIN)
ARCH_LDFLAGS += -target $(TRIPLE) -gcc-toolchain $(GCC_TOOLCHAIN)
ARCH_CFLAGS += -target $(TRIPLE) --gcc-toolchain=$(GCC_TOOLCHAIN)
ARCH_LDFLAGS += -target $(TRIPLE) --gcc-toolchain=$(GCC_TOOLCHAIN)
endif

ARCH_CFLAGS += --sysroot=$(NDK_ROOT)/sysroot \
Expand Down
6 changes: 3 additions & 3 deletions llvm/docs/HowToCrossCompileBuiltinsOnArm.rst
Expand Up @@ -137,8 +137,8 @@ The cmake try compile stage fails
At an early stage cmake will attempt to compile and link a simple C program to
test if the toolchain is working.

This stage can often fail at link time if the ``--sysroot`` and
``--gcc-toolchain`` options are not passed to the compiler. Check the
This stage can often fail at link time if the ``--sysroot=`` and
``--gcc-toolchain=`` options are not passed to the compiler. Check the
``CMAKE_C_FLAGS`` and ``CMAKE_C_COMPILER_TARGET`` flags.

It can be useful to build a simple example outside of cmake with your toolchain
Expand All @@ -148,7 +148,7 @@ Clang uses the host header files
--------------------------------
On debian based systems it is possible to install multiarch support for
arm-linux-gnueabi and arm-linux-gnueabihf. In many cases clang can successfully
use this multiarch support when -gcc-toolchain and --sysroot are not supplied.
use this multiarch support when ``--gcc-toolchain=`` and ``--sysroot=`` are not supplied.
Unfortunately clang adds ``/usr/local/include`` before
``/usr/include/arm-linux-gnueabihf`` leading to errors when compiling the hosts
header files.
Expand Down

0 comments on commit 40aab04

Please sign in to comment.