[PATCH] D136258: [PowerPC] Fix check for ieeelongdouble support

Nikita Popov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 27 01:36:53 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG0cbf003c78cd: [PowerPC] Fix check for ieeelongdouble support (authored by nikic).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136258

Files:
  clang/lib/Driver/ToolChains/Gnu.cpp
  clang/lib/Driver/ToolChains/PPCLinux.cpp
  clang/test/Driver/Inputs/powerpc64le-linux-gnu-tree/gcc-11.2.0/lib/gcc/powerpc64le-linux-gnu/11.2.0/.keep
  clang/test/Driver/Inputs/powerpc64le-linux-gnu-tree/gcc-11.2.0/lib/gcc/powerpc64le-linux-gnu/11.2.0/crtbegin.o
  clang/test/Driver/Inputs/powerpc64le-linux-gnu-tree/gcc-12/lib/gcc/powerpc64le-linux-gnu/12/crtbegin.o
  clang/test/Driver/Inputs/powerpc64le-linux-gnu-tree/gcc-12/lib64/ld64.so.2
  clang/test/Driver/ppc-float-abi-warning.cpp


Index: clang/test/Driver/ppc-float-abi-warning.cpp
===================================================================
--- clang/test/Driver/ppc-float-abi-warning.cpp
+++ clang/test/Driver/ppc-float-abi-warning.cpp
@@ -3,6 +3,11 @@
 // RUN:  --gcc-toolchain=%S/Inputs/powerpc64le-linux-gnu-tree/gcc-11.2.0 \
 // RUN:  -mabi=ieeelongdouble -stdlib=libstdc++ 2>&1 | FileCheck %s
 // RUN: %clang -### --driver-mode=g++ -target powerpc64le-linux-gnu %s \
+// RUN:  --gcc-toolchain=%S/Inputs/powerpc64le-linux-gnu-tree/gcc-12 \
+// RUN:  --dyld-prefix=%S/Inputs/powerpc64le-linux-gnu-tree/gcc-12 \
+// RUN:  -mabi=ieeelongdouble -stdlib=libstdc++ 2>&1 | \
+// RUN:  FileCheck %s --check-prefix=NOWARN
+// RUN: %clang -### --driver-mode=g++ -target powerpc64le-linux-gnu %s \
 // RUN:  -mabi=ieeelongdouble -stdlib=libc++ 2>&1 | FileCheck %s
 // RUN: %clang -### --driver-mode=g++ -target powerpc64le-linux-gnu %s\
 // RUN:  -mabi=ieeelongdouble -stdlib=libc++ -Wno-unsupported-abi 2>&1 | \
Index: clang/lib/Driver/ToolChains/PPCLinux.cpp
===================================================================
--- clang/lib/Driver/ToolChains/PPCLinux.cpp
+++ clang/lib/Driver/ToolChains/PPCLinux.cpp
@@ -82,6 +82,7 @@
       (StdLib == CST_Libstdcxx &&
        GCCInstallation.getVersion().isOlderThan(12, 1, 0));
 
-  return GlibcSupportsFloat128(Linux::getDynamicLinker(Args)) &&
+  std::string Linker = Linux::getDynamicLinker(Args);
+  return GlibcSupportsFloat128((Twine(D.DyldPrefix) + Linker).str()) &&
          !(D.CCCIsCXX() && HasUnsupportedCXXLib);
 }
Index: clang/lib/Driver/ToolChains/Gnu.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Gnu.cpp
+++ clang/lib/Driver/ToolChains/Gnu.cpp
@@ -1884,8 +1884,15 @@
                                           StringRef RHSPatchSuffix) const {
   if (Major != RHSMajor)
     return Major < RHSMajor;
-  if (Minor != RHSMinor)
+  if (Minor != RHSMinor) {
+    // Note that versions without a specified minor sort higher than those with
+    // a minor.
+    if (RHSMinor == -1)
+      return true;
+    if (Minor == -1)
+      return false;
     return Minor < RHSMinor;
+  }
   if (Patch != RHSPatch) {
     // Note that versions without a specified patch sort higher than those with
     // a patch.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136258.471063.patch
Type: text/x-patch
Size: 2303 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221027/1a6afc4d/attachment.bin>


More information about the cfe-commits mailing list