[Mipsel] [mipsel] compilation flags for loongson

Michał Masłowski mtjm at mtjm.eu
Wed Sep 26 08:01:29 GMT 2012


> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <https://lists.parabolagnulinux.org/pipermail/mipsel/attachments/20120926/18d89f8c/attachment.asc>


More information about the Mipsel mailing list