Author: probinson Date: Thu Jul 13 14:25:47 2017 New Revision: 307964 URL: http://llvm.org/viewvc/llvm-project?rev=307964&view=rev Log: [PS4] Disable LTO unit features under ThinLTO, like for Darwin.
Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp cfe/trunk/test/Driver/lto-unit.c Modified: cfe/trunk/lib/Driver/ToolChains/Clang.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Clang.cpp?rev=307964&r1=307963&r2=307964&view=diff ============================================================================== --- cfe/trunk/lib/Driver/ToolChains/Clang.cpp (original) +++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp Thu Jul 13 14:25:47 2017 @@ -2070,10 +2070,11 @@ void Clang::ConstructJob(Compilation &C, 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"); } Modified: cfe/trunk/test/Driver/lto-unit.c URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/lto-unit.c?rev=307964&r1=307963&r2=307964&view=diff ============================================================================== --- cfe/trunk/test/Driver/lto-unit.c (original) +++ cfe/trunk/test/Driver/lto-unit.c Thu Jul 13 14:25:47 2017 @@ -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" _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits