]> granicus.if.org Git - clang/commitdiff
[PS4] Disable LTO unit features under ThinLTO, like for Darwin.
authorPaul Robinson <paul.robinson@sony.com>
Thu, 13 Jul 2017 21:25:47 +0000 (21:25 +0000)
committerPaul Robinson <paul.robinson@sony.com>
Thu, 13 Jul 2017 21:25:47 +0000 (21:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@307964 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains/Clang.cpp
test/Driver/lto-unit.c

index e759e3ec619af6fe258b5095c4216f8d0cbc3d02..d0f90d0d83ce8d09109916c82b47e04ea617f1a1 100644 (file)
@@ -2070,10 +2070,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
     if (D.isUsingLTO()) {
       Args.AddLastArg(CmdArgs, options::OPT_flto, options::OPT_flto_EQ);
 
-      // The Darwin linker currently uses the legacy LTO API, which does not
-      // support LTO unit features (CFI, whole program vtable opt) under
-      // ThinLTO.
-      if (!getToolChain().getTriple().isOSDarwin() ||
+      // The Darwin and PS4 linkers currently use the legacy LTO API, which
+      // does not support LTO unit features (CFI, whole program vtable opt)
+      // under ThinLTO.
+      if (!(getToolChain().getTriple().isOSDarwin() ||
+            getToolChain().getTriple().isPS4()) ||
           D.getLTOMode() == LTOK_Full)
         CmdArgs.push_back("-flto-unit");
     }
index 8a800fa4dcd64aeb567e34c3d816e126f411d7d4..1f1a2861670e4ce9e8b0ac092008c7c47ba9272f 100644 (file)
@@ -2,6 +2,8 @@
 // RUN: %clang -target x86_64-unknown-linux -### %s -flto=thin 2>&1 | FileCheck --check-prefix=UNIT %s
 // RUN: %clang -target x86_64-apple-darwin13.3.0 -### %s -flto=full 2>&1 | FileCheck --check-prefix=UNIT %s
 // RUN: %clang -target x86_64-apple-darwin13.3.0 -### %s -flto=thin 2>&1 | FileCheck --check-prefix=NOUNIT %s
+// RUN: %clang -target x86_64-scei-ps4 -### %s -flto=full 2>&1 | FileCheck --check-prefix=UNIT %s
+// RUN: %clang -target x86_64-scei-ps4 -### %s -flto=thin 2>&1 | FileCheck --check-prefix=NOUNIT %s
 
 // UNIT: "-flto-unit"
 // NOUNIT-NOT: "-flto-unit"