How to build a crosstool-ng toolchain for a Synology DS 214 with DSM 5.1?

0

I'm trying to build a gcc 4.6 which "just works" on a Synology DS214 with DSM 5.1 (the Synology OS which effectively is a horribly outdated Linux 3.2.x), i.e. allows me to compile applications on the box. I'm experiencing the same following issue with both a cross compiled gcc built with

env CC=/usr/local/arm-marvell-linux-gnueabi/bin/arm-marvell-linux-gnueabi-gcc \
LD=/usr/local/arm-marvell-linux-gnueabi/bin/arm-marvell-linux-gnueabi-ld \
RANLIB=/usr/local/arm-marvell-linux-gnueabi/bin/arm-marvell-linux-gnueabi-ranlib \
AR=/usr/local/arm-marvell-linux-gnueabi/bin/arm-marvell-linux-gnueabi-ar \
CFLAGS=" -I/usr/local/arm-marvell-linux-gnueabi/arm-marvell-linux-gnueabi/libc/include -mhard-float -mfpu=vfpv3-d16" \
LDFLAGS=" -L/usr/local/arm-marvell-linux-gnueabi/arm-marvell-linux-gnueabi/libc/lib" \
auto-apt run ./configure --host=arm-marvell-linux --target=arm-marvell-linux \
--prefix=$USER/syno-prefix --disable-shared --enable-obsolete
make 
make install

with the Synology toolchain on Ubuntu 14.10 amd64 and the recommended parameters for armadaxp CPU and a crosstools-ng(project site) toolchain with eglibc 2.18, gcc 4.6.4, linux 3.2.40 and architecture-levels armv7-a and armadaxp (the latter doesn't work, error "Unknown arch") and CPU tuning for cortex-a9 and CFLAGS -mhard-float -mfpu=vfpv3-d16" because after hours of searching the only hint on necessary architecture parameters was a guide how to compile transmisson on a MyCloud device with armv7l.

Both the cross-compiled gcc and the toolchain cause error

/usr/local/bin/ld: unrecognised emulation mode: armelf_linux_eabi
Supported emulations: armelf_linux armelf armelfb armelfb_linux
collect2: ld returned 1 exit status

(in config.log) when compiling e.g. binutils 2.24 and trafficserver 5.1.0 (adding LDFLAGS=" -marmelf_linux" before configure causes cc1: error: unrecognized command line option '-marmelf_linux'). The error seems to be systematic. How would one get started to figure out the hardware specific parameters for the toolchain parameters in general and in special for the denoted device?

Some infos on the target where gcc ought to run:

# cat /proc/cpuinfo 
Processor   : Marvell PJ4Bv7 Processor rev 2 (v7l)
processor   : 0
BogoMIPS    : 1064.96

processor   : 1
BogoMIPS    : 1064.96

Features    : swp half thumb fastmult vfp edsp vfpv3 tls 
CPU implementer : 0x56
CPU architecture: 7
CPU variant : 0x2
CPU part    : 0x584
CPU revision    : 2

Hardware    : Marvell Armada XP Development Board
Revision    : 0000
Serial      : 0000000000000000

I tried to be started with reading about ARM and floating point units (mostly on Wikipedia), but in order to guess which parameters are necessary it takes a lot for a starter.

EDIT 1: I just figured out that it would be good to set the Toolchain type option to Canadian rather than Cross, but then I still crosstools-ng requires the machine option to be set (fails with error Invalid configuration `': machine `' not recognized) which brings me back to my problem of missing knowledge about CPU and architecture details - and of course there's no way of figuring out to what "machine" actually refers to...

Karl Richter

Posted 2014-12-03T00:14:50.747

Reputation: 1 641

Your title and first sentence don't agree. It seems like "native compiler" is missing from your vocabulary. Seems like you are trying to build a native ARM compiler rather than a "cross-compiler"? You need to properly specify -build in the configuration. http://airs.com/ian/configure/configure_6.html. The error message involving /usr/local/bin/ld indicates the build is still using the build's tools instead of the host's tools (i.e. /usr/local/arm-marvell-linux-gnueabi/bin/arm-marvell-linux-gnueabi-ld)

– sawdust – 2014-12-03T02:54:45.863

Also see How to build native compiler from GCC source code?

– sawdust – 2014-12-03T03:00:04.850

@sawdust crosstool-ng is a tool which builds both cross and canadian toolchains and compilers; added a link for clearification – Karl Richter – 2014-12-03T03:58:42.067

No answers