Linux/mips compile should not use -mips2 - Mailing list pgsql-hackers

From Oliver Elphick
Subject Linux/mips compile should not use -mips2
Date
Msg-id 1016706473.21169.113.camel@linda
Whole thread Raw
Responses Re: Linux/mips compile should not use -mips2
List pgsql-hackers
I sent a message about this yesterday, but it does not appear to have
got to the list.

According to the attached message, mips builds for Linux should not use
-mips2 in the compilation or linking.  It appears that this can be
prevented by removing the mips special case from src/template/linux.

-----Forwarded Message-----

From: rmurray@debian.org
To: Oliver Elphick <olly@lfix.co.uk>
Subject: Re: [Fwd: Mail delivery failed: returning message to sender]
Date: 20 Mar 2002 07:48:38 -0800

On Wed, Mar 20, 2002 at 09:52:52AM +0000, Oliver Elphick wrote:
> > Upstream automatically passes -mips2 to gcc on mips platforms.  In the case
> > of Linux, this should not be done, as the main reason to use it (ll/sc) is
> > handled by glibc and emulated by the kernel.  It also makes all of postgresql
> > unusable on DECstation mipsel machines,...
> 
> The build failure appears to be that
> debian/tmp/usr/lib/postgresql/bin/postgres has somehow been deleted
> during the build.  (The build log shows it being installed correctly.) 
> Are you saying that this is related to use of -mips2, or is that a
> totally separate problem?

No, the kernel doesn't always have the greatest error messages...

test.c:
main(void)
{       return 1;
}

rmurray@resume:~$ gcc -o t test.c ; ls -l t ; ./t
-rwxr-xr-x    1 rmurray  rmurray      7628 Mar 20 16:43 t
rmurray@resume:~$ gcc -mips2 -o t test.c ; ls -l t ; ./t
-rwxr-xr-x    1 rmurray  rmurray      7628 Mar 20 16:44 t
bash: ./t: No such file or directory

The reason this worked in the past is due to a bug in binutils -- it wasn't
setting the mips2 bit in the elf header of the binary.  That bug has now
been fixed, and the kernel refuses to run anything with a mips# bit set
in the header, as it is used to indicate an irix binary, according to the
comments in elf.h.

-- 
Ryan Murray, Debian Developer (rmurray@cyberhqz.com, rmurray@debian.org)
The opinions expressed here are my own.



pgsql-hackers by date:

Previous
From: Michael Meskes
Date:
Subject: Vacation
Next
From: "Zeugswetter Andreas SB SD"
Date:
Subject: Re: Function call crashes server