linux-mips
[Top] [All Lists]

Re: mipseb and mipsel patches to RPM...

To: Alex deVries <adevries@engsoc.carleton.ca>
Subject: Re: mipseb and mipsel patches to RPM...
From: ralf@uni-koblenz.de
Date: Thu, 15 Jan 1998 06:25:01 +0100
Cc: ewt@redhat.com, SGI Linux <linux@cthulhu.engr.sgi.com>
In-reply-to: <Pine.LNX.3.95.980114214632.6815B-100000@lager.engsoc.carleton.ca>; from Alex deVries on Wed, Jan 14, 1998 at 10:56:58PM -0500
References: <19980115010335.21821@uni-koblenz.de> <Pine.LNX.3.95.980114214632.6815B-100000@lager.engsoc.carleton.ca>
Sender: owner-linux@cthulhu.engr.sgi.com
On Wed, Jan 14, 1998 at 10:56:58PM -0500, Alex deVries wrote:

You can solve the byteorder detection issue more efficient at compile
time by something like:

#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL)
/* little endian */
                    strcpy(un.machine, "mipsel");
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB)
/* big endian */
                    strcpy(un.machine, "mipseb");
#else
/* This doesn't happen (TM) */
#endif
#endif

Other than that my patch is almost down to the byte the same.

  Ralf

> diff -rc rpm-2.4.99.orig/lib/rpmrc.c rpm-2.4.99/lib/rpmrc.c
> *** rpm-2.4.99.orig/lib/rpmrc.c       Tue Jan 13 16:08:24 1998
> --- rpm-2.4.99/lib/rpmrc.c    Wed Jan 14 19:07:28 1998
> ***************
> *** 669,674 ****
> --- 669,681 ----
>       char * chptr;
>       struct canonEntry * canon;
>   
> + #if defined (__mips)
> +     union {
> +       long l;
> +       char c[sizeof (long)];
> +     } u;
> + #endif
> + 
>       if (!gotDefaults) {
>       uname(&un);
>       if (!strcmp(un.sysname, "AIX")) {
> ***************
> *** 681,686 ****
> --- 688,702 ----
>       chptr = un.machine;
>       while (*chptr++)
>           if (*chptr == '/') *chptr = '-';
> + 
> + #if defined(__mips)
> +             u.l = 1;
> +             if (u.c[sizeof (long) - 1] == 1) {
> +                 strcpy(un.machine, "mipseb");
> +             } else {
> +                 strcpy(un.machine, "mipsel");
> +            }
> + #endif
>   
>       #if defined(__hpux) && defined(_SC_CPU_VERSION)
>       {
> diff -rc rpm-2.4.99.orig/lib-rpmrc.in rpm-2.4.99/lib-rpmrc.in
> *** rpm-2.4.99.orig/lib-rpmrc.in      Tue Jan 13 16:08:23 1998
> --- rpm-2.4.99/lib-rpmrc.in   Wed Jan 14 18:41:13 1998
> ***************
> *** 41,47 ****
>   arch_canon:         sun4c:  sparc   3
>   arch_canon:     sun4d:  sparc   3
>   # This is really a place holder for MIPS.
> ! arch_canon: mips:   mips    4
>   arch_canon: ppc:    ppc     5
>   arch_canon: m68k:   m68k    6
>   arch_canon: IP:     sgi     7
> --- 41,47 ----
>   arch_canon:         sun4c:  sparc   3
>   arch_canon:     sun4d:  sparc   3
>   # This is really a place holder for MIPS.
> ! arch_canon: mipseb: mipseb  4
>   arch_canon: ppc:    ppc     5
>   arch_canon: m68k:   m68k    6
>   arch_canon: IP:     sgi     7
> ***************
> *** 50,55 ****
> --- 50,56 ----
>   arch_canon:    9000/712:       hppa1.1 9
>   
>   arch_canon:    sun4u:   usparc  10
> + arch_canon: mipsel: mipsel  11
>   
>   #############################################################
>   # Canonical OS names and numbers
> ***************
> *** 118,124 ****
>   arch_compat: sparc: noarch
>   
>   arch_compat: ppc: noarch
> ! arch_compat: mips: noarch
>   
>   arch_compat: hppa1.1: hppa1.0
>   arch_compat: hppa1.0: noarch
> --- 119,126 ----
>   arch_compat: sparc: noarch
>   
>   arch_compat: ppc: noarch
> ! arch_compat: mipseb: noarch
> ! arch_compat: mipsel: noarch
>   
>   arch_compat: hppa1.1: hppa1.0
>   arch_compat: hppa1.0: noarch
> ***************
> *** 137,140 ****
>   buildarch_compat: alpha: noarch
>   buildarch_compat: m68k: noarch
>   buildarch_compat: ppc: noarch
> ! buildarch_compat: mips: noarch
> --- 139,144 ----
>   buildarch_compat: alpha: noarch
>   buildarch_compat: m68k: noarch
>   buildarch_compat: ppc: noarch
> ! buildarch_compat: mipsel: noarch
> ! buildarch_compat: mipseb: noarch
> ! 
> diff -rc rpm-2.4.99.orig/rpm.magic rpm-2.4.99/rpm.magic
> *** rpm-2.4.99.orig/rpm.magic Tue Jan 13 16:08:23 1998
> --- rpm-2.4.99/rpm.magic      Wed Jan 14 16:43:43 1998
> ***************
> *** 10,17 ****
>   >>8 beshort         1               i386
>   >>8 beshort         2               Alpha
>   >>8 beshort         3               Sparc
> ! >>8 beshort         4               MIPS
>   >>8 beshort         5               PowerPC
>   >>8 beshort         6               68000
>   >>8 beshort         7               SGI
>   >>10        string          x               %s
> --- 10,18 ----
>   >>8 beshort         1               i386
>   >>8 beshort         2               Alpha
>   >>8 beshort         3               Sparc
> ! >>8 beshort         4               MIPS big endian
>   >>8 beshort         5               PowerPC
>   >>8 beshort         6               68000
>   >>8 beshort         7               SGI
> + >>8 beshort         11              MIPS little endian
>   >>10        string          x               %s

<Prev in Thread] Current Thread [Next in Thread>