Skip to content

Commit d4daa25

Browse files
committed
Add support for E2K architecture
1 parent 1cfb16f commit d4daa25

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

libdnf/dnf-context.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ static const struct {
123123
"sparcv9", "sparcv9v", NULL } },
124124
{ "x86_64", { "x86_64", "amd64", "ia32e", NULL } },
125125
{ "loongarch64", { "loongarch64", NULL } },
126+
{ "e2k", { "e2k", "e2kv4", "e2kv5", "e2kv6", NULL } },
126127
{ NULL, { NULL } }
127128
};
128129

libdnf/hy-util.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ hy_detect_arch(char **arch)
139139
strcpy(un.machine, "mipsel");
140140
else if (!strcmp(un.machine, "mips64"))
141141
strcpy(un.machine, "mips64el");
142+
#endif
143+
#if defined(__e2k__)
144+
if (__builtin_cpu_is("elbrus-v4") || __builtin_cpu_is("elbrus-8c") || __builtin_cpu_is("elbrus-1c+"))
145+
strcpy(un.machine, "e2kv4");
146+
else if (__builtin_cpu_is("elbrus-v5") || __builtin_cpu_is("elbrus-8c2"))
147+
strcpy(un.machine, "e2kv5");
148+
else if (__builtin_cpu_is("elbrus-v6") || __builtin_cpu_is("elbrus-12c") || __builtin_cpu_is("elbrus-16c") || __builtin_cpu_is("elbrus-2c3"))
149+
strcpy(un.machine, "e2kv6");
142150
#endif
143151
*arch = g_strdup(un.machine);
144152
return 0;

0 commit comments

Comments
 (0)