commit:     bde2a895cf520687dce7a8e92601041a37529ba0
Author:     Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Thu Feb  2 14:53:44 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Feb 15 08:38:53 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=bde2a895

ELF: add EM_AMDGPU entry

With this, portage is able to detect AMDGPU machine code elf object.

Bug: https://bugs.gentoo.org/795825
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Closes: https://github.com/gentoo/portage/pull/983
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                                        | 3 +++
 lib/portage/dep/soname/multilib_category.py | 2 ++
 lib/portage/util/elf/constants.py           | 1 +
 3 files changed, 6 insertions(+)

diff --git a/NEWS b/NEWS
index 881565634..646073421 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,9 @@
 portage-3.0.45 (UNRELEASED)
 --------------
 
+Features:
+* Support new ELF machine code: AMDGPU
+
 Bug fixes:
 * gpkg: Handle out-of-space errors (bug #891391).
 

diff --git a/lib/portage/dep/soname/multilib_category.py 
b/lib/portage/dep/soname/multilib_category.py
index d195116fe..14a9eea77 100644
--- a/lib/portage/dep/soname/multilib_category.py
+++ b/lib/portage/dep/soname/multilib_category.py
@@ -51,6 +51,7 @@ from portage.util.elf.constants import (
     EM_68K,
     EM_AARCH64,
     EM_ALPHA,
+    EM_AMDGPU,
     EM_ARM,
     EM_ALTERA_NIOS2,
     EM_IA_64,
@@ -77,6 +78,7 @@ _machine_prefix_map = {
     EM_68K: "m68k",
     EM_AARCH64: "arm",
     EM_ALPHA: "alpha",
+    EM_AMDGPU: "amdgpu",
     EM_ALTERA_NIOS2: "nios2",
     EM_ARM: "arm",
     EM_IA_64: "ia64",

diff --git a/lib/portage/util/elf/constants.py 
b/lib/portage/util/elf/constants.py
index 19b72cfa1..022e78d77 100644
--- a/lib/portage/util/elf/constants.py
+++ b/lib/portage/util/elf/constants.py
@@ -35,6 +35,7 @@ EM_IA_64 = 50
 EM_X86_64 = 62
 EM_ALTERA_NIOS2 = 113
 EM_AARCH64 = 183
+EM_AMDGPU = 224
 EM_RISCV = 243
 EM_LOONGARCH = 258
 EM_ALPHA = 0x9026

Reply via email to