Skip to content
Snippets Groups Projects
Commit 6f796753 authored by Bernhard Rosenkränzer's avatar Bernhard Rosenkränzer
Browse files

Support *-ohos-linux-* targets


OHOS is guaranteed to have support for gnu hashes and new dtags. Use
them.

Signed-off-by: default avatarBernhard Rosenkränzer <bernhard.rosenkraenzer.ext@huawei.com>
parent 6db6b836
No related branches found
No related tags found
No related merge requests found
......@@ -283,13 +283,17 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
Distro == Distro::UbuntuKarmic ||
(IsAndroid && Triple.isAndroidVersionLT(23)))
ExtraOpts.push_back("--hash-style=both");
// OHOS targets can handle hash-style=gnu
if (Triple.getVendor() == llvm::Triple::OHOS)
ExtraOpts.push_back("--hash-style=gnu");
}
#ifdef ENABLE_LINKER_BUILD_ID
ExtraOpts.push_back("--build-id");
#endif
if (IsAndroid || Distro.IsOpenSUSE())
if (IsAndroid || Distro.IsOpenSUSE() || Triple.getVendor() == llvm::Triple::OHOS)
ExtraOpts.push_back("--enable-new-dtags");
// The selection of paths to try here is designed to match the patterns which
......@@ -335,7 +339,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
// 64-bit OpenEmbedded sysroots may not have a /usr/lib dir. So they cannot
// find /usr/lib64 as it is referenced as /usr/lib/../lib64. So we handle
// this here.
if (Triple.getVendor() == llvm::Triple::OpenEmbedded &&
if ((Triple.getVendor() == llvm::Triple::OpenEmbedded || Triple.getVendor() == llvm::Triple::OHOS) &&
Triple.isArch64Bit())
addPathIfExists(D, SysRoot + "/usr/" + OSLibDir, Paths);
else
......
......@@ -158,7 +158,8 @@ public:
Mesa,
SUSE,
OpenEmbedded,
LastVendorType = OpenEmbedded
OHOS,
LastVendorType = OHOS
};
enum OSType {
UnknownOS,
......
......@@ -172,6 +172,7 @@ StringRef Triple::getVendorTypeName(VendorType Kind) {
case MipsTechnologies: return "mti";
case Myriad: return "myriad";
case NVIDIA: return "nvidia";
case OHOS: return "ohos";
case OpenEmbedded: return "oe";
case PC: return "pc";
case SCEI: return "scei";
......@@ -491,6 +492,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) {
.Case("mesa", Triple::Mesa)
.Case("suse", Triple::SUSE)
.Case("oe", Triple::OpenEmbedded)
.Case("ohos", Triple::OHOS)
.Default(Triple::UnknownVendor);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment