]> code.ossystems Code Review - openembedded-core.git/commitdiff
rpm: adjust MIPS64 N32 support
authorAlexander Kanavin <alex.kanavin@gmail.com>
Wed, 28 Oct 2020 21:05:54 +0000 (22:05 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 30 Oct 2020 13:03:27 +0000 (13:03 +0000)
upstream has switched from libmagic to elfutils to determine
file 'colors', and so this adapts the existing patch accordingly.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/rpm/files/0001-Add-a-color-setting-for-mips64_n32-binaries.patch

index ac6dcaf101dd9fedf380f863982b4bb3d30e0c8b..331ea849e6973d828fa8b986ee75532229ff8057 100644 (file)
@@ -1,20 +1,21 @@
-From e3eff024826550aec4a6a5baef7210a29faf299d Mon Sep 17 00:00:00 2001
+From 5492ac3c716020a27a25253bbffe810db43202bf Mon Sep 17 00:00:00 2001
 From: Alexander Kanavin <alex.kanavin@gmail.com>
 Date: Thu, 9 Mar 2017 18:54:02 +0200
 Subject: [PATCH] Add a color setting for mips64_n32 binaries
 
 Upstream-Status: Inappropriate [oe-core specific]
 Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
 ---
- build/rpmfc.c | +
+ build/rpmfc.c | 4 ++++
  rpmrc.in      | 2 ++
- 2 files changed, 3 insertions(+)
+ 2 files changed, 6 insertions(+)
 
 diff --git a/build/rpmfc.c b/build/rpmfc.c
-index d38a10916..c8e2f876a 100644
+index 10c380ee9..b7655aa93 100644
 --- a/build/rpmfc.c
 +++ b/build/rpmfc.c
-@@ -622,6 +622,7 @@ exit:
+@@ -639,6 +639,7 @@ exit:
  static const struct rpmfcTokens_s rpmfcTokens[] = {
    { "directory",              RPMFC_INCLUDE },
  
@@ -22,11 +23,21 @@ index d38a10916..c8e2f876a 100644
    { "ELF 32-bit",             RPMFC_ELF32|RPMFC_INCLUDE },
    { "ELF 64-bit",             RPMFC_ELF64|RPMFC_INCLUDE },
  
+@@ -1149,6 +1150,9 @@ static uint32_t getElfColor(const char *fn)
+               color = RPMFC_ELF32;
+               break;
+           }
++            if (ehdr.e_machine == EM_MIPS || ehdr.e_machine == EM_MIPS_RS3_LE)
++                if (ehdr.e_flags & EF_MIPS_ABI2)
++                    color = RPMFC_ELFMIPSN32;
+           elf_end(elf);
+       }
+       close(fd);
 diff --git a/rpmrc.in b/rpmrc.in
-index abc08fc31..f5bc820d8 100644
+index 5bd9ba3e5..f15bb8dad 100644
 --- a/rpmrc.in
 +++ b/rpmrc.in
-@@ -133,6 +133,8 @@ archcolor: mipsr6el 1
+@@ -137,6 +137,8 @@ archcolor: mipsr6el 1
  archcolor: mips64r6 2
  archcolor: mips64r6el 2
  
@@ -35,6 +46,3 @@ index abc08fc31..f5bc820d8 100644
  archcolor: m68k 1
  
  archcolor: m68kmint 1
--- 
-2.11.0
-