forked from OSchip/llvm-project
Make PS4 use -fno-use-init-array only as the ABI does not support .init_array.
Reviewed by Paul Robinson
This commit is contained in:
parent
b0da094983
commit
5db37f3bca
|
@ -434,3 +434,15 @@ SanitizerMask toolchains::PS4CPU::getSupportedSanitizers() const {
|
||||||
Res |= SanitizerKind::Vptr;
|
Res |= SanitizerKind::Vptr;
|
||||||
return Res;
|
return Res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void toolchains::PS4CPU::addClangTargetOptions(
|
||||||
|
const ArgList &DriverArgs,
|
||||||
|
ArgStringList &CC1Args,
|
||||||
|
Action::OffloadKind DeviceOffloadingKind) const {
|
||||||
|
// PS4 does not use init arrays.
|
||||||
|
if (DriverArgs.hasArg(clang::driver::options::OPT_fuse_init_array))
|
||||||
|
getDriver().Diag(clang::diag::err_drv_unsupported_opt_for_target)
|
||||||
|
<< "-fuse-init-array" << getTriple().str();
|
||||||
|
|
||||||
|
CC1Args.push_back("-fno-use-init-array");
|
||||||
|
}
|
||||||
|
|
|
@ -88,6 +88,11 @@ public:
|
||||||
// capable of unit splitting.
|
// capable of unit splitting.
|
||||||
bool canSplitThinLTOUnit() const override { return false; }
|
bool canSplitThinLTOUnit() const override { return false; }
|
||||||
|
|
||||||
|
void addClangTargetOptions(
|
||||||
|
const llvm::opt::ArgList &DriverArgs,
|
||||||
|
llvm::opt::ArgStringList &CC1Args,
|
||||||
|
Action::OffloadKind DeviceOffloadingKind) const override;
|
||||||
|
|
||||||
llvm::DenormalMode getDefaultDenormalModeForType(
|
llvm::DenormalMode getDefaultDenormalModeForType(
|
||||||
const llvm::opt::ArgList &DriverArgs,
|
const llvm::opt::ArgList &DriverArgs,
|
||||||
Action::OffloadKind DeviceOffloadKind,
|
Action::OffloadKind DeviceOffloadKind,
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
// REQUIRES: x86-registered-target
|
||||||
|
|
||||||
|
// Test that the driver always emits -fno-use-init-array on the PS4 target
|
||||||
|
// since its ABI does not support the .init_array section.
|
||||||
|
|
||||||
|
// RUN: %clang -c %s -target x86_64-scei-ps4 -### 2>&1 \
|
||||||
|
// RUN: | FileCheck %s
|
||||||
|
// RUN: %clang -c %s -target x86_64-scei-ps4 -fno-use-init-array -### 2>&1 \
|
||||||
|
// RUN: | FileCheck %s
|
||||||
|
// RUN: %clang -c %s -target x86_64-scei-ps4 -fuse-init-array -### 2>&1 \
|
||||||
|
// RUN: | FileCheck %s --check-prefix=CHECK-ERROR
|
||||||
|
|
||||||
|
// CHECK: "-fno-use-init-array"
|
||||||
|
// CHECK-NOT: "-fuse-init-array"
|
||||||
|
|
||||||
|
// CHECK-ERROR: unsupported option '-fuse-init-array' for target 'x86_64-scei-ps4'
|
||||||
|
|
Loading…
Reference in New Issue