[PATCH] D110128: [Driver] Correctly handle static C++ standard library

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 21 11:39:16 PDT 2021


MaskRay added inline comments.


================
Comment at: clang/test/Driver/linux-ld.c:499
 
+// RUN: %clangxx -no-canonical-prefixes -x c++ %s -### -o %t.o 2>&1 \
+// RUN:     -target x86_64-unknown-linux-gnu \
----------------
`-no-canonical-prefixes` is only useful when the CHECK lines inspect the spelling of clang.
Otherwise `-no-canonical-prefixes` can be omitted.

Omit `-o %t.o` since it is not used.


================
Comment at: clang/test/Driver/linux-ld.c:504
+// CHECK-BASIC-LIBCXX-SHARED: "--push-state"
+// CHECK-BASIC-LIBCXX-SHARED: "--as-needed"
+// CHECK-BASIC-LIBCXX-SHARED: "-lc++"
----------------
To improve the robustness of the test, use the `-SAME: {{^}}` style in linux-cross.cpp, or just place these consecutive options on the same line.


================
Comment at: clang/test/Driver/linux-ld.c:509
+// RUN: %clangxx -no-canonical-prefixes -x c++ %s -### -o %t.o 2>&1 \
+// RUN:     -target x86_64-unknown-linux-gnu \
+// RUN:     -stdlib=libc++ -static-libstdc++ \
----------------
Prefer `--target=` to `-target `


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110128/new/

https://reviews.llvm.org/D110128



More information about the cfe-commits mailing list