From f835720d35bff52f1e0968b9309b4d19df0c858a Mon Sep 17 00:00:00 2001 From: Gleb Fotengauer-Malinovskiy Date: Thu, 26 Jul 2018 17:41:48 +0300 Subject: [PATCH] =?UTF-8?q?rpmrc:=20=D0=B0dd=20mips64*=20and=20mips*r6=20s?= =?UTF-8?q?upport?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rpmrc.c | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 7d61a1e..2cd2cb8 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -1196,10 +1196,46 @@ static void defaultMachine(/*@out@*/ const char ** arch, # if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) /* little endian */ - strcpy(un.machine, "mipsel"); +# if defined(__mips64) + /* 64-bit */ +# if !defined(__mips_isa_rev) || __mips_isa_rev < 6 + /* r1-r5 */ + strcpy(un.machine, "mips64el"); +# else + /* r6 */ + strcpy(un.machine, "mips64r6el"); +# endif +# else + /* 32-bit */ +# if !defined(__mips_isa_rev) || __mips_isa_rev < 6 + /* r1-r5 */ + strcpy(un.machine, "mipsel"); +# else + /* r6 */ + strcpy(un.machine, "mipsr6el"); +# endif +# endif # elif defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) /* big endian */ - strcpy(un.machine, "mips"); +# if defined(__mips64) + /* 64-bit */ +# if !defined(__mips_isa_rev) || __mips_isa_rev < 6 + /* r1-r5 */ + strcpy(un.machine, "mips64"); +# else + /* r6 */ + strcpy(un.machine, "mips64r6"); +# endif +# else + /* 32-bit */ +# if !defined(__mips_isa_rev) || __mips_isa_rev < 6 + /* r1-r5 */ + strcpy(un.machine, "mips"); +# else + /* r6 */ + strcpy(un.machine, "mipsr6"); +# endif +# endif # endif # if defined(__hpux) && defined(_SC_CPU_VERSION)