[clang] 40aab04 - [test] Migrate -gcc-toolchain with space separator to --gcc-toolchain=

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 20 15:25:05 PDT 2021


Author: Fangrui Song
Date: 2021-08-20T15:24:58-07:00
New Revision: 40aab0412fe7a14781e133627c2bb0a22761eac8

URL: https://github.com/llvm/llvm-project/commit/40aab0412fe7a14781e133627c2bb0a22761eac8
DIFF: https://github.com/llvm/llvm-project/commit/40aab0412fe7a14781e133627c2bb0a22761eac8.diff

LOG: [test] Migrate -gcc-toolchain with space separator to --gcc-toolchain=

Space separated driver options are uncommon but Clang traditionally
did not do a good job. --gcc-toolchain= is the preferred form.

Added: 
    

Modified: 
    clang/test/Driver/fuse-ld.c
    clang/test/Driver/gcc-toolchain.cpp
    libc/benchmarks/CMakeLists.txt
    libcxx/benchmarks/CMakeLists.txt
    lldb/packages/Python/lldbsuite/test/make/Android.rules
    llvm/docs/HowToCrossCompileBuiltinsOnArm.rst

Removed: 
    


################################################################################
diff  --git a/clang/test/Driver/fuse-ld.c b/clang/test/Driver/fuse-ld.c
index 74a2e5f4d9654..dfcf31e25ffa6 100644
--- a/clang/test/Driver/fuse-ld.c
+++ b/clang/test/Driver/fuse-ld.c
@@ -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
 

diff  --git a/clang/test/Driver/gcc-toolchain.cpp b/clang/test/Driver/gcc-toolchain.cpp
index 7cdba0841b8cd..e3a1670110a5f 100644
--- a/clang/test/Driver/gcc-toolchain.cpp
+++ b/clang/test/Driver/gcc-toolchain.cpp
@@ -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.

diff  --git a/libc/benchmarks/CMakeLists.txt b/libc/benchmarks/CMakeLists.txt
index 3eece745096f9..2f06836b0fadd 100644
--- a/libc/benchmarks/CMakeLists.txt
+++ b/libc/benchmarks/CMakeLists.txt
@@ -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}")
 

diff  --git a/libcxx/benchmarks/CMakeLists.txt b/libcxx/benchmarks/CMakeLists.txt
index c4b8247da63b1..8e33f8ebcf0cf 100644
--- a/libcxx/benchmarks/CMakeLists.txt
+++ b/libcxx/benchmarks/CMakeLists.txt
@@ -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)
 

diff  --git a/lldb/packages/Python/lldbsuite/test/make/Android.rules b/lldb/packages/Python/lldbsuite/test/make/Android.rules
index 7339c22d2e4c4..32f786aa34756 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Android.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Android.rules
@@ -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 \

diff  --git a/llvm/docs/HowToCrossCompileBuiltinsOnArm.rst b/llvm/docs/HowToCrossCompileBuiltinsOnArm.rst
index 0c2699b4a8981..2e199a0170176 100644
--- a/llvm/docs/HowToCrossCompileBuiltinsOnArm.rst
+++ b/llvm/docs/HowToCrossCompileBuiltinsOnArm.rst
@@ -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
@@ -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.


        


More information about the cfe-commits mailing list