Re: [PATCH] sys-utils: sparc-utils 'sparc64' binary sets ADDR_LIMIT_32BIT.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 21 September 2007, LaMont Jones wrote:
> On Fri, Sep 21, 2007 at 03:03:31PM -0400, Mike Frysinger wrote:
> > On Friday 21 September 2007, LaMont Jones wrote:
> > > The sparc64 binary in the existing sparc-utils package sets
> > > ADDR_LIMIT_32BIT. Cause setarch to behave likewise when invoked as
> > > 'sparc64'.
> >
> > last time this was proposed (for `ppc64`), the answer was "no, use the -B
> > flag") ...
>
> I'm kind of stuck here, since util-linux 2.13 replaces sparc-utils,
> which already exhibits the behavior.  So Debian is stuck with the code
> at the very least.

i'm not saying i'm against it (i proposed we do it for ppc64 after all), just 
filling in some background for people ...

the attached patch is how i solved the issue back then ... perhaps it would 
work here as well ...
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.

--- setarch.c
+++ setarch.c
@@ -98,6 +98,7 @@
     }
 
   pers_value = transitions[i].perval | options;
+retry_set_pers:
   res = set_pers(pers_value);
   if(res == -EINVAL)
     return 1;
@@ -112,6 +113,15 @@
 	     && strcmp(un.machine, "i686")
 	     && strcmp(un.machine, "athlon")))
 	{
+	  /* if we are switching to 64bit mode and it failed,
+	   * see if it was because we need to enforce the 32bit
+	   * memory limit (-B) ... */
+	  if(pers_value == PER_LINUX)
+	    {
+	      fprintf(stderr, "Unable to set arch to %s, retrying with 32bit memory limit (-B) ...\n", pers);
+	      pers_value = PER_LINUX_32BIT;
+	      goto retry_set_pers;
+	    }
 	  fprintf(stderr, "Unable to set arch to %s\n", pers);
 	  exit(1);
 	}

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux