[Mipsel] [mipsel] compilation flags for loongson

Bertrand Garrigues bertrand.garrigues at laposte.net
Wed Sep 26 20:59:12 GMT 2012


On Wed, 26 Sep 2012 10:01:29 +0200
mtjm at mtjm.eu (Michał Masłowski) wrote:

> > I was wondering which compilation flags are used to build the
> > Parabola distribution for the mips64 architecture. It seems that
> > only the kernel is a mips-64 bit binary, all the progams or libs of
> > the distribution are 32 bits. 
> 
> [0] sets these:
> 
> -O2 -march=loongson2f -mabi=n32 -pipe -mplt -Wa,-mfix-loongson2f-nop
> -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2
> 
> We use the N32 ABI, it has 64-bit registers and 32-bit pointers.  It's
> enough for most programs, I would not consider N64 needed on a machine
> with just 1 GiB of RAM (ld needs more memory when linking debug
> WebKit, it's very slow on an x86_64 machine with just 4 GiB of RAM).
> 
> N64 has bigger programs and changing ABIs without rebuilding whole
> distro would be very difficult.
> 
> > I heard that there was a gcc with special optimization flags for the
> > yeelong, taking full advantage of the mips architecture, but it
> > seems it is not available on the mainstream, so I guess it is not
> > stable yet.
> 
> The "-march=loongson2f -mabi=n32" flags should do it (other sources
> recommend -O3, we use -O2).  O32 which is used in Debian uses 32-bit
> part of integer registers, only 16 of 32 floating point registers and
> have other inefficiences.  There are sources stating a 30% performance
> improvement for N32.
> 
> [0]
> https://projects.parabolagnulinux.org/abslibre.git/tree/libre/pacman/PKGBUILD

Thanks for your explanations, it's very interesting ! I'll check these
flags out. 

Regards, 

Bertrand Garrigues


More information about the Mipsel mailing list