How to setup a cross-toolchain of BBB with proper sysroot on CentOS or Windows?

Hi, Everyone:

I’m going to setup a cross-toolchain of BBB for developers using CentOS or Windows.

I have read the Cross Toolchain for Debian Wheezy, which told about creating the cross-toolchain. But it did not find a way to generate the sysroot. The sysroot should include all the libraries and headers that I need to distribute. I think it has to be created in some way. Anyone can share something useful to build the sysroot?

Thanks!
dlw

One of the big issues with wheezy, it had fairly old libc, so any of
the pre-built linaro toolchains are just going to cause issues..

So for 'wheezy' it's just best to build on an armhf machine..

Now if you switch to jessie on the bbb. Jessie's multi-arch was much
better, so you can install debian jessie on your x86 and install all
the *armhf* libraries via apt..

here are the jessie cross toolchains:

http://www.emdebian.org/News/2014/20141025.html

In stretch it'll even be easier to cross..

Regards,

2015/12/24/ 03:54,“Robert Nelson” <robertcnelson@gmail.com>wrote:

Hi, Everyone:

I’m going to setup a cross-toolchain of BBB for developers using CentOS or
Windows.

I have read the Cross Toolchain for Debian Wheezy, which told about creating
the cross-toolchain. But it did not find a way to generate the sysroot. The
sysroot should include all the libraries and headers that I need to
distribute. I think it has to be created in some way. Anyone can share
something useful to build the sysroot?

One of the big issues with wheezy, it had fairly old libc, so any of
the pre-built linaro toolchains are just going to cause issues…
Yes, that’s why i am trying to build such a toolchain. I have not looked into your script for wheezy. Is that workable?

So for ‘wheezy’ it’s just best to build on an armhf machine…

Now if you switch to jessie on the bbb. Jessie’s multi-arch was much
better, so you can install debian jessie on your x86 and install all
the armhf libraries via apt…
Since my customers insisted to use windows or CentOS as their dev env, how can I make a tarball of the toolchain and sysroot and run it on CentOS and Windows, no matter Wheezy or Jessie? For sysroot, how can i select necessary libs and headers? I did not find any useful information or discussion on creating sysroot that needs some customization.

here are the jessie cross toolchains:

http://www.emdebian.org/News/2014/20141025.html

In stretch it’ll even be easier to cross…
I am new for BBB. How stable is Jessie comparing with Wheezy? I am building commercial product so stability is the most important thing. But anyway, we will do evaluation.

Thanks!
dlw

2015/12/24/ 03:54,"Robert Nelson" <robertcnelson@gmail.com>wrote:

> Hi, Everyone:
>
> I'm going to setup a cross-toolchain of BBB for developers using CentOS
> or
> Windows.
>
> I have read the Cross Toolchain for Debian Wheezy, which told about
> creating
> the cross-toolchain. But it did not find a way to generate the sysroot.
> The
> sysroot should include all the libraries and headers that I need to
> distribute. I think it has to be created in some way. Anyone can share
> something useful to build the sysroot?

One of the big issues with wheezy, it had fairly old libc, so any of
the pre-built linaro toolchains are just going to cause issues..

Yes, that's why i am trying to build such a toolchain. I have not looked
into your script for wheezy. Is that workable?

So for 'wheezy' it's just best to build on an armhf machine..

Now if you switch to jessie on the bbb. Jessie's multi-arch was much
better, so you can install debian jessie on your x86 and install all
the *armhf* libraries via apt..

Since my customers insisted to use windows or CentOS as their dev env, how
can I make a tarball of the toolchain and sysroot and run it on CentOS and
Windows, no matter Wheezy or Jessie? For sysroot, how can i select necessary
libs and headers? I did not find any useful information or discussion on
creating sysroot that needs some customization.

So for, CentOS, the eaisest thing would be us qemu/debootstrap to
install the "wheezy"/"jessie" sysroot into a chroot...

Windows would be a pain.. (specially wheezy)

here are the jessie cross toolchains:

http://www.emdebian.org/News/2014/20141025.html

In stretch it'll even be easier to cross..

I am new for BBB. How stable is Jessie comparing with Wheezy? I am building
commercial product so stability is the most important thing. But anyway, we
will do evaluation.

So they are both, stable... Jessie has a lot newer components then Wheezy..

As for the kernel, all options are in the repo..

So wither you want to run, "3.8.13" with Jessie or, "4.4.x" with
Wheezy, that's up to you..

Some people like sysv of wheezy, while others like systemd of jessie..

Regards,

Last time I built using Roberts scripts, it built fine for wheezy, but I was also using an i386 wheezy install to built it.

Also, what Robert days for sysv versus systemd is true in my case, but you can also apt-get remove systemd after apt-get install sysv. There are guides all over the web on how this is done, as most long time Debian sys admins seem to dislike systemd with a passion.

Heres one such wiki . . . http://without-systemd.org/wiki/index.php/How_to_remove_systemd_from_a_Debian_jessie/sid_installation

Thanks, William and Robert! I will take your suggestions for my next milestone.

This time I am still trying to build the cross-toolchains for BBB with
Wheezy due to customer requests.

I found the windows cross-toolchain from this website
http://gnutoolchains.com/beaglebone/. That is very helpful for my
project. Just let you know if you were not aware of that.

Meanwhile, I followed Roberts scripts on a Debian 7.x x86_64 machine
and built successfully with updating some package version and small
hacks. I then extracted all the generated deb packages to a folder and
made a tarball of it. Then I copied it to CentOS and tried to build a
"Hello World". But it reported:
    ...toolchain/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux/gnueabihf/bin/ld:
cannot find /usr/arm-linux-gnueabihf/lib/libc.so.6
    ...toolchain/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux/gnueabihf/bin/ld:
cannot find /usr/arm-linux-gnueabihf/lib/libc_noshared.a
    ...toolchain/usr/bin/../lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux/gnueabihf/bin/ld:
cannot find /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3

Looks like the cross-toolchain was good but could not find libc
libraries on CentOS. It was OK on Debian since those libraries were
installed at that place. I tried to give --sysroot or -Wl,-rpath-link
xxx but either worked.

Do you know how to configure the path of those glibc libraries? And
how to configure the sysroot path?

Thanks!
dlw

This time I am still trying to build the cross-toolchains for BBB with
Wheezy due to customer requests.

I’m not sure why you would feel compelled to do so. Cross toolchains already exist.

  1. Linaro - as in what Robert uses to compile uboot / the kernel.
  2. Ubuntu at minimum has cross toolchains for armhf, that works fine out of the box.

And there are probably other cross toolchains out there that I have not bothered to look into yet.