Bug 213458 - MIPS ERL kernel build fails on octeon-sdk/cvmx-srio.c with external GCC 5.3.0
Summary: MIPS ERL kernel build fails on octeon-sdk/cvmx-srio.c with external GCC 5.3.0
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: mips Any
: --- Affects Only Me
Assignee: freebsd-mips (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-13 18:17 UTC by Ed Maste
Modified: 2016-10-13 18:17 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer 2016-10-13 18:17:29 UTC
make CROSS_TOOLCHAIN=mips64-gcc TARGET_ARCH=mips64 KERNCONF=ERL buildkernel

fails with:

/usr/local/bin/mips64-portbld-freebsd10.1-gcc -isystem /tank/emaste/obj/mips.mips64/tank/emaste/src/freebsd/tmp/usr/include -L/tank/emaste/obj/mips.mips64/tank/emaste/src/freebsd/tmp/usr/lib -B/tank/emaste/obj/mips.mips64/tank/emaste/src/freebsd/tmp/usr/lib --sysroot=/tank/emaste/obj/mips.mips64/tank/emaste/src/freebsd/tmp -B/usr/local/mips64-freebsd/bin/ -c -O -pipe  -g -nostdinc  -I. -I/tank/emaste/src/freebsd/sys -I/tank/emaste/src/freebsd/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h  -fno-pic -mno-abicalls -G0 -DKERNLOADADDR=0xffffffff80100000 -march=octeon -mabi=64 -MD  -MF.depend.cvmx-srio.o -MTcvmx-srio.o -msoft-float -ffreestanding -fwrapv -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error=address -Wno-error=aggressive-loop-optimizations -Wno-error=array-bounds -Wno-error=attributes -Wno-error=cast-qual -Wno-error=enum-compare -Wno-error=inline -Wno-error=maybe-uninitialized -Wno-error=overflow -Wno-error=sequence-point -Wno-error=strict-overflow -Wno-error=unused-but-set-variable  -fno-common -fms-extensions -finline-limit=8000 --param inline-unit-growth=10000 --param large-function-growth=100000 --param max-inline-insns-single=10000  -std=iso9899:1999 -Werror  /tank/emaste/src/freebsd/sys/contrib/octeon-sdk/cvmx-srio.c
{standard input}: Assembler messages:
{standard input}:75: Error: opcode not supported on this processor: octeon (mips64r2) `saa $2,($3)'
{standard input}:4568: Error: opcode not supported on this processor: octeon (mips64r2) `saa $11,($3)'
{standard input}:4892: Error: opcode not supported on this processor: octeon (mips64r2) `saa $9,($2)'
{standard input}:5145: Error: opcode not supported on this processor: octeon (mips64r2) `saa $3,($6)'
*** Error code 1 (ignored)

This issue was also reported on Linux (https://community.ubnt.com/t5/EdgeMAX/kernel-compilation/td-p/466677/page/4). A Gentoo wiki page explains that the support was only in a Cavium-provided toolchain, not upstream (https://wiki.gentoo.org/wiki/MIPS/ERLite-3).

jmallett added saa/saad instructions to our base gas in r208737 (https://svnweb.freebsd.org/changeset/base/208737, see contrib/binutils/gas/config/tc-mips.c) but support is not in the FreeBSD mips binutils port.

This issue should probably be addressed by adding support to the binutils port, and also adding a workaround to the base system.