Adding Loongarch64 to OpenBSD parts (#149737)
Adding Loongarch64 to OpenBSD parts (cherry picked from commit 5eecbc018bfdf6f262647de739f35230596a1b8f)
This commit is contained in:
parent
ee86ae0a69
commit
aae69e9f84
@ -769,6 +769,9 @@ std::unique_ptr<TargetInfo> AllocateTarget(const llvm::Triple &Triple,
|
||||
case llvm::Triple::FreeBSD:
|
||||
return std::make_unique<FreeBSDTargetInfo<LoongArch64TargetInfo>>(Triple,
|
||||
Opts);
|
||||
case llvm::Triple::OpenBSD:
|
||||
return std::make_unique<OpenBSDTargetInfo<LoongArch64TargetInfo>>(Triple,
|
||||
Opts);
|
||||
default:
|
||||
return std::make_unique<LoongArch64TargetInfo>(Triple, Opts);
|
||||
}
|
||||
|
@ -496,6 +496,7 @@ public:
|
||||
case llvm::Triple::sparcv9:
|
||||
this->MCountName = "_mcount";
|
||||
break;
|
||||
case llvm::Triple::loongarch64:
|
||||
case llvm::Triple::riscv64:
|
||||
break;
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
if (Nopie || Profiling)
|
||||
CmdArgs.push_back("-nopie");
|
||||
|
||||
if (Triple.isRISCV64()) {
|
||||
if (Triple.isLoongArch64() || Triple.isRISCV64()) {
|
||||
CmdArgs.push_back("-X");
|
||||
if (Args.hasArg(options::OPT_mno_relax))
|
||||
CmdArgs.push_back("--no-relax");
|
||||
|
@ -127,9 +127,12 @@
|
||||
// UNWIND-TABLES: "-funwind-tables=2"
|
||||
// NO-UNWIND-TABLES-NOT: "-funwind-tables=2"
|
||||
|
||||
// Check that the -X and --no-relax flags are passed to the linker on riscv64
|
||||
// Check that the -X and --no-relax flags are passed to the linker
|
||||
// RUN: %clang --target=loongarch64-unknown-openbsd -mno-relax -### %s 2>&1 \
|
||||
// RUN: | FileCheck --check-prefix=LA64-FLAGS %s
|
||||
// RUN: %clang --target=riscv64-unknown-openbsd -mno-relax -### %s 2>&1 \
|
||||
// RUN: | FileCheck -check-prefix=RISCV64-FLAGS %s
|
||||
// LA64-FLAGS: "-X" "--no-relax"
|
||||
// RISCV64-FLAGS: "-X" "--no-relax"
|
||||
|
||||
// Check passing LTO flags to the linker
|
||||
|
Loading…
x
Reference in New Issue
Block a user