Skip to content

Commit 3adf3b8

Browse files
committed
Revert "[OHOS] Add support for OpenHarmony"
This reverts commit c417b7a. Huawei is currently under U.S. government sanctions. Additionally, their approach to PC restrictions contradicts the principles of open-source software, particularly in relation to LLVM. By promoting a locked-down ecosystem on PC, they undermine the fundamental openness that LLVM aims to support. The 23,999 CNY (3,333.46 USD) and 29,999 CNY (4,166.86 USD) PCs appear to restrict users to an app store environment, preventing installation of alternative operating systems, running executables, and sideloading applications. This level of control limits user freedom and is inconsistent with the core philosophy of open-source software. The pricing is excessively high without offering hardware value that justifies the cost, seemingly catering more to materialism, extreme nationalism and profit-driven motives rather than genuine innovation or user benefit. They market their OS as "open," but in practice, it does not prioritize openness for end users. Instead, the term appears to be more of a promotional slogan rather than a true commitment to open-source principles or user freedom. Furthermore, Huawei representatives have engaged in discussions on GitHub without actively contributing patches, including within the Microsoft VSCode project. Given that VSCode does not support locked-down operating systems such as iOS, the relevance of their involvement is questionable—especially considering that Huawei Next is a locked-down PC incapable of running independent programs. A development environment should enable programmers to execute the code they write. The Chinese open-source community, generally speaking, does not support Huawei’s approach in this regard. As a response, this patch removes support for Huawei OpenHarmony and its variants, as well as Harmony Next (a walled-garden OS), from the LLVM upstream repository.
1 parent 835bba9 commit 3adf3b8

File tree

9 files changed

+6
-39
lines changed

9 files changed

+6
-39
lines changed

llvm/include/llvm/BinaryFormat/MinidumpConstants.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ HANDLE_MDMP_PLATFORM(0x8202, Solaris) // Solaris
119119
HANDLE_MDMP_PLATFORM(0x8203, Android) // Android
120120
HANDLE_MDMP_PLATFORM(0x8204, PS3) // PS3
121121
HANDLE_MDMP_PLATFORM(0x8205, NaCl) // Native Client (NaCl)
122-
HANDLE_MDMP_PLATFORM(0x8206, OpenHOS) // OpenHarmony OS
123122

124123
HANDLE_MDMP_PROTECT(0x01, NoAccess, PAGE_NO_ACCESS)
125124
HANDLE_MDMP_PROTECT(0x02, ReadOnly, PAGE_READ_ONLY)

llvm/include/llvm/TargetParser/Triple.h

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ class Triple {
237237
WASI, // Experimental WebAssembly OS
238238
Emscripten,
239239
ShaderModel, // DirectX ShaderModel
240-
LiteOS,
241240
Serenity,
242241
Vulkan, // Vulkan SPIR-V
243242
LastOSType = Vulkan
@@ -299,7 +298,6 @@ class Triple {
299298
Mesh,
300299
Amplification,
301300
OpenCL,
302-
OpenHOS,
303301
Mlibc,
304302

305303
PAuthTest,
@@ -825,18 +823,9 @@ class Triple {
825823
getEnvironment() == Triple::MuslEABIHF ||
826824
getEnvironment() == Triple::MuslF32 ||
827825
getEnvironment() == Triple::MuslSF ||
828-
getEnvironment() == Triple::MuslX32 ||
829-
getEnvironment() == Triple::OpenHOS || isOSLiteOS();
826+
getEnvironment() == Triple::MuslX32;
830827
}
831828

832-
/// Tests whether the target is OHOS
833-
/// LiteOS default enviroment is also OHOS, but omited on triple.
834-
bool isOHOSFamily() const { return isOpenHOS() || isOSLiteOS(); }
835-
836-
bool isOpenHOS() const { return getEnvironment() == Triple::OpenHOS; }
837-
838-
bool isOSLiteOS() const { return getOS() == Triple::LiteOS; }
839-
840829
/// Tests whether the target is DXIL.
841830
bool isDXIL() const {
842831
return getArch() == Triple::dxil;
@@ -912,7 +901,6 @@ class Triple {
912901
getEnvironment() == Triple::EABIHF ||
913902
getEnvironment() == Triple::GNUEABIHF ||
914903
getEnvironment() == Triple::GNUEABIHFT64 ||
915-
getEnvironment() == Triple::OpenHOS ||
916904
getEnvironment() == Triple::MuslEABIHF || isAndroid()) &&
917905
isOSBinFormatELF();
918906
}
@@ -1122,7 +1110,7 @@ class Triple {
11221110
/// Note: Android API level 29 (10) introduced ELF TLS.
11231111
bool hasDefaultEmulatedTLS() const {
11241112
return (isAndroid() && isAndroidVersionLT(29)) || isOSOpenBSD() ||
1125-
isWindowsCygwinEnvironment() || isOHOSFamily();
1113+
isWindowsCygwinEnvironment();
11261114
}
11271115

11281116
/// True if the target uses TLSDESC by default.

llvm/lib/Target/ARM/ARMSubtarget.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,7 @@ class ARMSubtarget : public ARMGenSubtargetInfo {
369369
}
370370
bool isTargetMuslAEABI() const {
371371
return (TargetTriple.getEnvironment() == Triple::MuslEABI ||
372-
TargetTriple.getEnvironment() == Triple::MuslEABIHF ||
373-
TargetTriple.getEnvironment() == Triple::OpenHOS) &&
372+
TargetTriple.getEnvironment() == Triple::MuslEABIHF) &&
374373
!isTargetDarwin() && !isTargetWindows();
375374
}
376375

llvm/lib/Target/ARM/ARMTargetMachine.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,7 @@ ARMBaseTargetMachine::ARMBaseTargetMachine(const Target &T, const Triple &TT,
245245
TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
246246
TargetTriple.getEnvironment() == Triple::GNUEABIHFT64 ||
247247
TargetTriple.getEnvironment() == Triple::MuslEABI ||
248-
TargetTriple.getEnvironment() == Triple::MuslEABIHF ||
249-
TargetTriple.getEnvironment() == Triple::OpenHOS) &&
248+
TargetTriple.getEnvironment() == Triple::MuslEABIHF) &&
250249
!(TargetTriple.isOSWindows() || TargetTriple.isOSDarwin()))
251250
this->Options.EABIVersion = EABI::GNU;
252251
else

llvm/lib/TargetParser/AArch64TargetParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void AArch64::fillValidCPUArchList(SmallVectorImpl<StringRef> &Values) {
138138

139139
bool AArch64::isX18ReservedByDefault(const Triple &TT) {
140140
return TT.isAndroid() || TT.isOSDarwin() || TT.isOSFuchsia() ||
141-
TT.isOSWindows() || TT.isOHOSFamily();
141+
TT.isOSWindows();
142142
}
143143

144144
// Allows partial match, ex. "v8a" matches "armv8a".

llvm/lib/TargetParser/ARMTargetParser.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,7 @@ StringRef ARM::computeDefaultTargetABI(const Triple &TT, StringRef CPU) {
568568
default:
569569
if (TT.isOSNetBSD())
570570
return "apcs-gnu";
571-
if (TT.isOSFreeBSD() || TT.isOSOpenBSD() || TT.isOSHaiku() ||
572-
TT.isOHOSFamily())
571+
if (TT.isOSFreeBSD() || TT.isOSOpenBSD() || TT.isOSHaiku())
573572
return "aapcs-linux";
574573
return "aapcs";
575574
}

llvm/lib/TargetParser/Triple.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ StringRef Triple::getOSTypeName(OSType Kind) {
318318
case Win32: return "windows";
319319
case ZOS: return "zos";
320320
case ShaderModel: return "shadermodel";
321-
case LiteOS: return "liteos";
322321
case XROS: return "xros";
323322
case Vulkan: return "vulkan";
324323
}
@@ -381,7 +380,6 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) {
381380
case Amplification: return "amplification";
382381
case OpenCL:
383382
return "opencl";
384-
case OpenHOS: return "ohos";
385383
case PAuthTest:
386384
return "pauthtest";
387385
case LLVM:
@@ -713,7 +711,6 @@ static Triple::OSType parseOS(StringRef OSName) {
713711
.StartsWith("wasi", Triple::WASI)
714712
.StartsWith("emscripten", Triple::Emscripten)
715713
.StartsWith("shadermodel", Triple::ShaderModel)
716-
.StartsWith("liteos", Triple::LiteOS)
717714
.StartsWith("serenity", Triple::Serenity)
718715
.StartsWith("vulkan", Triple::Vulkan)
719716
.Default(Triple::UnknownOS);
@@ -768,7 +765,6 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
768765
.StartsWith("mesh", Triple::Mesh)
769766
.StartsWith("amplification", Triple::Amplification)
770767
.StartsWith("opencl", Triple::OpenCL)
771-
.StartsWith("ohos", Triple::OpenHOS)
772768
.StartsWith("pauthtest", Triple::PAuthTest)
773769
.StartsWith("llvm", Triple::LLVM)
774770
.StartsWith("mlibc", Triple::Mlibc)

llvm/test/CodeGen/AArch64/arm64-platform-reg.ll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
; RUN: llc -mtriple=arm64-freebsd-gnu -mattr=+reserve-x18 -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE --check-prefix=CHECK-RESERVE-X18
33
; RUN: llc -mtriple=arm64-linux-gnu -o - %s | FileCheck %s
44
; RUN: llc -mtriple=aarch64-linux-android -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE --check-prefix=CHECK-RESERVE-X18
5-
; RUN: llc -mtriple=aarch64-linux-ohos -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE --check-prefix=CHECK-RESERVE-X18
65
; RUN: llc -mtriple=aarch64-fuchsia -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE --check-prefix=CHECK-RESERVE-X18
76
; RUN: llc -mtriple=aarch64-windows -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE --check-prefix=CHECK-RESERVE-X18
87

llvm/unittests/TargetParser/TripleTest.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,18 +1289,6 @@ TEST(TripleTest, ParsedIDs) {
12891289
EXPECT_EQ(Triple::UnknownOS, T.getOS());
12901290
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
12911291

1292-
T = Triple("arm-unknown-linux-ohos");
1293-
EXPECT_EQ(Triple::arm, T.getArch());
1294-
EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
1295-
EXPECT_EQ(Triple::Linux, T.getOS());
1296-
EXPECT_EQ(Triple::OpenHOS, T.getEnvironment());
1297-
1298-
T = Triple("arm-unknown-liteos");
1299-
EXPECT_EQ(Triple::arm, T.getArch());
1300-
EXPECT_EQ(Triple::UnknownVendor, T.getVendor());
1301-
EXPECT_EQ(Triple::LiteOS, T.getOS());
1302-
EXPECT_EQ(Triple::UnknownEnvironment, T.getEnvironment());
1303-
13041292
T = Triple("x86_64-pc-serenity");
13051293
EXPECT_EQ(Triple::x86_64, T.getArch());
13061294
EXPECT_EQ(Triple::PC, T.getVendor());

0 commit comments

Comments
 (0)