MIPS code size strangeness
Eugene Grosbein
eugen at grosbein.net
Thu Nov 24 17:41:05 UTC 2016
On 24.11.2016 23:28, Eugene Grosbein wrote:
> On 24.11.2016 05:11, Adrian Chadd wrote:
>> It's the mips-xtoolchain or xtoolchain-mips-gcc or something
>
> Thanks!
>
> I've changed the port devel/powerpc64-gcc (master port for devel/mips-gcc) slightly
> to build gcc-6.2.0 instead of gcc-5.3.0 and it builds and installs just fine
> using command make FREEBSD_EXTENSION=yes install
>
> Then, I've installed devel/mips-xtoolchain-gcc and run buildworld using CROSS_TOOLCHAIN=mips-gcc.
> It fails:
>
> --- cancelpoints_sem_new.o ---
> {standard input}: Assembler messages:
> {standard input}:1347: Error: opcode not supported on this processor: mips1 (mips1) `ll $5,4($4)'
> {standard input}:1350: Error: opcode not supported on this processor: mips1 (mips1) `sc $5,4($4)'
> {standard input}:1360: Error: opcode not supported on this processor: mips1 (mips1) `sync'
> {standard input}:1456: Error: opcode not supported on this processor: mips1 (mips1) `ll $4,0($17)'
> {standard input}:1459: Error: opcode not supported on this processor: mips1 (mips1) `sc $4,0($17)'
> {standard input}:1469: Error: opcode not supported on this processor: mips1 (mips1) `sync'
> {standard input}:1697: Error: opcode not supported on this processor: mips1 (mips1) `sync'
> {standard input}:1702: Error: opcode not supported on this processor: mips1 (mips1) `ll $5,4($4)'
> {standard input}:1705: Error: opcode not supported on this processor: mips1 (mips1) `sc $5,4($4)'
> *** [cancelpoints_sem_new.o] Error code 1
>
> I try to build code for TP-Link WDR3600.
> I'm not familiar with MIPS assembler. Is there a way to alter gcc6 code generator to avoid this error?
I've managed to build FreeBSD12/mips using gcc6 and additional src.conf knobs:
CROSS_TOOLCHAIN=mips-gcc
WITHOUT_CROSS_COMPILER=yes
CROSSENV+=CFLAGS="-march=mips32"
This time, ucl_hash_replace() function takes 628 bytes (0x274) instead of 25000:
# nm -C -D --print-size --size-sort libprivateucl.so.1 | grep ucl_hash_replace
0003098c 00000274 T ucl_hash_replace
However, libprivateucl.so.1 still takes 247224 bytes in case of FreeBSD12/mips
comparing with 136064 bytes in case of FreeBSD11/amd64.
More information about the freebsd-mips
mailing list