GCC Cross Compile glibc Problems

The host is BBB RevC running the Debian distribution dated May 14, 2014 (Wheezy)
I am trying to cross compile C code for the host.

I am running the GCC cross compiler (arm-linux-gnueabihf) inside Eclipse under Ubuntu 14.04 on Intel 64 bit machine.

[Basically the Derek Molloy recommended environment]

It seems that the BBB Debian (Wheezy) release comes with glibc-2.13

It seems that GCC cross tool chain comes with glibc-2.19

As long as I compile simple (not useful) programs, things compile and run.

As soon as I start to do usefully complex programming, I get run time errors
saying that glibc-2.15 is required.

What is the best way out of this road-block?

Is there an earlier version of the GCC cross compiler that uses glib-2.13?
Can I force the current GCC cross compiler to link to armhf glib-2.13?

Can I update the BBB Debian Wheezy to glibc-2.19 without breaking
other things in the distribution? Normal attempts at updating say
2.13 is the latest.

I saw an earlier thread talking about loading an experimental glibc-2.18 on the BBB.
What are the (any bad?) side effects of that.

Thanks,
— Graham

Can you be more specific when referring to "run time errors " ?

I pretty much did the exact thing you’ve mentioned as far as I can tell, but am using Lubuntu 14.04. A simple hello world app compiled and ran fine, but I have not tested anything more extensive.

The successfully/clean compiled binary named LM is located at

/home/debian/bin

root@BBB3:/home/debian/bin# ./LM
./LM: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.15’ not found (required by ./LM)
root@BBB3:/home/debian/bin#

Upon a command to run it, the error message above is displayed, and the run aborts.

Hello_World runs fine. Simple I/O programs run fine.

Apparently my more complex programs use functionality introduced in 2.15 and later and there is no
way to run them on the stable Debian 7 (Wheezy) distribution.

I have since discovered that Debian 8 (Jessie) comes with glibc 2.19.

There is a “test” version of Jessie on the elinux.org website. I will try that.

The problem is that Debian 8 is not yet frozen, and has no announced

release date that I can find, which means that it more than 6 months

away. Probably a year.

Debian is currently multiple years behind the GCC compiler.

The previous Beaglebone Angstrom release came with glibc 2.16 which would

probably also run this specific compiled code. But I have run across other

BBB users that get a similar message, asking for glibc_2.17. So, it

just depends upon what is in your code.

— Graham

The successfully/clean compiled binary named LM is located at
/home/debian/bin

root@BBB3:/home/debian/bin# ./LM
./LM: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.15' not found
(required by ./LM)
root@BBB3:/home/debian/bin#

I do have a script here to generate an x86 cross compiler, that
matches glibc/gcc on the wheezy image..

https://github.com/RobertCNelson/cross-compiler

however you have to run it on a wheezy/x86 machine..

Upon a command to run it, the error message above is displayed, and the run
aborts.
Hello_World runs fine. Simple I/O programs run fine.

Apparently my more complex programs use functionality introduced in 2.15 and
later and there is no
way to run them on the stable Debian 7 (Wheezy) distribution.

I have since discovered that Debian 8 (Jessie) comes with glibc 2.19.
There is a "test" version of Jessie on the elinux.org website. I will try
that.
The problem is that Debian 8 is not yet frozen, and has no announced
release date that I can find, which means that it more than 6 months
away. Probably a year.

Well the freeze is the 5th of Nov, and only bug fixes will be allowed
till it is released.

note for jessie: there is a "cross-gcc" package:

https://ftp-master.debian.org/new/cross-gcc-defaults_0.2.html

but it's still in 'new' so it might not make the freeze..

Regards,

Robert:

Thanks for your response.

I was aware of your cross-compiler, but would prefer to remain consistent with all of our other development environments.

Switching to the “test” version of jessie on the elinux.org website eliminated my glibc problems.

Now I need to get to debugging the code. It runs on a Davinci, but now I need to get it running on the Sitara/Beaglebone.

I am interested in the “cross-gcc-defaults” for jessie, but am getting a “404 Not Found” at that url. It must have been moved recently, since Google also shows it at that location.

Thanks,

— Graham