[OpenWrt-Devel] Toolchain for armv7-ar?

Florin floring2502 at gmail.com
Thu Nov 9 06:25:05 EST 2017


Hi Ajay,

There have been lots of discussions recently as OpenWrt is developing into LEDE, a linux for generic embedded systems, not only for routers.
The Atmel Cortex M4 120Mhz will probably be very slow running my toolchain, especially if the RAM is only 512kB. My Cortex A9 is 800MHz and 128MB of RAM and runs pretty fast when setting 1GB of swap file o USB-3.0 HDD.
First of all, which C library are you using, glibc or uclibc on your framework? I've built my toolchain specifically for glibc-2.20 with root filesystem residing on /opt. Since I've ported binutils-2.26.1 from Debian source, it will work with sysroots but gcc is not yet with sysroots enabled; I am going to enable it  while upgrading to the latest gcc-4.9.4 from Debian source (the last gcc-4.9 to be supported); this time will also have gcj and OpenJDK running, but it's still work in progress (I am debianizing it and couldn't find out why libphobos compilation is never run by dpkg-build, although it is configured and doesn't give any error; - any Debian exprt knows about it? - ). 

Openssl is already available for this kind of optware, there is a version in the link I've sent you (but it's dynamic and should reside in /opt/lib). I have a more recent version myself, including the dev package with statically linked library, but you need to make sure the toolchain will work for you.
Also, does your platform run opkg?  If so, I can make a link for the essential packages for the toolchain to work and give them to you (they will install in /opt as stated above).

Best wishes,
Florin
 
From: Ajay Garg [mailto:ajaygargnsit at gmail.com] 
Sent: Thursday, November 09, 2017 12:10 PM
To: Florin
Cc: Karl Palsson; openwrt-devel
Subject: Re: [OpenWrt-Devel] Toolchain for armv7-ar?

Thanks Karl and Florin for the replies.

Ok, so the first thing I need to understand is OpenWRT is for building linux(-like) systems (only) for routers .. thanks guys for this clearance.

Florin,
I'll tell you my usecase in a bit of detail.
* We have a framework, with openssl-client code written.
* We port our framework to multiple platforms/devices, and then link libcrypto.a and libssl.a as and when required.

For the SOC with processor https://www.digikey.com/product-detail/en/microchip-technology/ATSAM4E8CA-AUR/ATSAM4E8CA-AURCT-ND/4140758, everything has been done, but we are stuck on integrating openssl due to being unable to build compatible libcrypto.a and libssl.a for the same.
I almost got things done by tweaking things with the "Freescale i.MX 6" configuration, but failed when I added the -mthumb option.
Since then, I have been trying all sorts of things, to firstly build a toolchain (in ubuntu-14.04 host) supporting -mthumb, and then compile libcrypto.a and libssl.a for the same.
So, if there is a (existing/available) toolchain in openwrt that would compile for armv7-a with -mthumb, I think all I need to do is go into packages/libs/openssl, and fire "make -B". Kindly let know if something can be done for the same.

Once again, thanks everyone for the help so far ... looking forward to learning more from you experts..

Thanks and Regards,
Ajay


On Thu, Nov 9, 2017 at 2:32 PM, Florin <floring2502 at gmail.com> wrote:
I've got a toolchain (gcc-4.9.2 + binutils-2.26.1) running on armv7-a and
ipk packages  compiled with/for it:

floring at huawei:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/usr/libexec/gcc/arm-linux-gnueabi/4.9.2/lto-wrapper
Target: arm-linux-gnueabi
Configured with: ../configure --host=arm-linux-gnueabi
--target=arm-linux-gnueabi --prefix=/opt/usr --with-gmp=/opt/usr
--with-mpfr=/opt/usr --with-mpc=/opt/usr --with-isl=/opt/usr
--with-cloog=/opt/usr --enable-languages=c,c++,go,objc,obj-c++
--disable-multilib
LDFLAGS_FOR_TARGET=-Wl,--dynamic-linker=/opt/lib/ld-linux.so.3
LDFLAGS_FOR_HOST=-Wl,--dynamic-linker=/opt/lib/ld-linux.so.3
LDFLAGS=-Wl,--dynamic-linker=/opt/lib/ld-linux.so.3
Thread model: posix
gcc version 4.9.2 (GCC)

The architecture is a Huawei-ES880 (Cortex A9 without FPU) router running
Zyxmon's DD-WRT mod for Northstar platforms. I've even been able to compile
and run Xorg, GTK 2 and 3 and Qt 4.8.2 as optware on it, and I am  currently
working on upgrading gcc and "debianize" it. So I kinda run a complete linux
on this architecture.
I've started it from cross-compiling glibc and gcc and installing them on
scratch /opt filesystem, and to simplify things I used some of Zyxmon's
Qnapware (http://qnapware.zyxmon.org/binaries-armv7/); If you only need some
essential packages, this link would be enough.

I am doing it as a hobby, but my problem is that I don't have a large
traffic subscription so I cannot make it largely public. If you need more
than the packages in Qnapware, especially the native arm-v7a toolchain, then
I could share my work. Keep in mind that these embedded systems have limited
RAM so you need to setup at least 1GB of swap space and set TMPDIR variable
on external HDD directory for making all these work.

Florin

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org]
> On Behalf Of Karl Palsson
> Sent: Wednesday, November 08, 2017 10:54 PM
> To: Ajay Garg
> Cc: openwrt-devel
> Subject: Re: [OpenWrt-Devel] Toolchain for armv7-ar?
>
>
> That part is armv7-m (not -a, not -r). They don't generally run linux at
all, so
> don't have toolchains targetting linux, and don't generally have existing
> targets in openwrt.
>
> You _can_ run linux on them, but it's a farrrr bigger task than just,
"which
> toolchain do I need to select in menuconfig"
>
> Cheers,
> Karl P
>
> Ajay Garg <ajaygargnsit at gmail.com> wrote:
> > Experts,
> >
> > Waiting for your kind reply/replies.
> >
> >
> > Thanks and Regards,
> > Ajay
> >
> > On 7 Nov 2017 11:22 a.m., "Ajay Garg" <ajaygargnsit at gmail.com>
> > wrote:
> >
> > > Hi All.
> > >
> > > I have been trying to build the toolchain+packages (especially
> > > openssl) using openwrt, but have been unable to do so for a armv7-ar
> architecture.
> > >
> > > The processor on our SOC is
> > > https://www.digikey.com/product-detail/en/microchip-
> > > technology/ATSAM4E8CA-AUR/ATSAM4E8CA-AURCT-ND/4140758
> > >
> > > So, is there an (already existing) configuration (in "make
> > > menuconfig", or
> > > otherwise) that builds everything (toolchain plus packages) for
armv7-ar?
> > >
> > >
> > > Will be grateful to listen from you experts.
> > >
> > >
> > > Thanks and Regards,
> > > Ajay
> > >
> > _______________________________________________
> > openwrt-devel mailing list
> > openwrt-devel at lists.openwrt.org
> > https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



-- 
Regards,
Ajay
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list