Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: ralf@uni-koblenz.de
To: Alex deVries <adevries@engsoc.carleton.ca>
Cc: ewt@redhat.com, SGI Linux <linux@cthulhu.engr.sgi.com>
Subject: Re: mipseb and mipsel patches to RPM...
Date: Thu, 15 Jan 1998 06:25:01 +0100	[thread overview]
Message-ID: <19980115062501.64925@uni-koblenz.de> (raw)
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

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

  reply	other threads:[~1998-01-15  5:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-14  6:43 The world's worst RPM Alex deVries
1998-01-14 10:28 ` ralf
1998-01-14 16:38   ` Alex deVries
1998-01-14 13:28 ` Oliver Frommel
1998-01-14 13:58   ` ralf
1998-01-14 16:42     ` Alex deVries
1998-01-14 14:36   ` Alan Cox
1998-01-14 14:29     ` ralf
1998-01-14 15:07       ` Alan Cox
1998-01-14 20:58         ` Thomas Bogendoerfer
1998-01-14 22:17           ` Alan Cox
1998-01-14 22:17             ` Alan Cox
1998-01-14 22:25             ` Alex deVries
1998-01-15  0:03               ` ralf
1998-01-15  3:56                 ` mipseb and mipsel patches to RPM Alex deVries
1998-01-15  5:25                   ` ralf [this message]
1998-01-15 18:59                     ` Alex deVries
1998-01-15 19:44                       ` Erik Troan
1998-01-15 19:51                       ` Erik Troan
1998-01-14 23:59           ` The world's worst RPM Miguel de Icaza
1998-01-15 23:42             ` ralf
1998-01-14 14:36     ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19980115062501.64925@uni-koblenz.de \
    --to=ralf@uni-koblenz.de \
    --cc=adevries@engsoc.carleton.ca \
    --cc=ewt@redhat.com \
    --cc=linux@cthulhu.engr.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox