Gcc issues in Intrepid and later
From Openembedded
Q: Why does the build of gcc-cross fail in Ubuntu Intrepid (same is still true for Jaunty)?
A: Ubuntu 8.10 (Intrepid) introduced a change to the default compiler flags. It is possible to fix this behaviour by adding the following line to your local.conf file:
BUILD_CPPFLAGS += "-Wno-format-security -U_FORTIFY_SOURCE"
If that change doesn't resolve all the build failures, you can use an older version of gcc (4.1). To install and use gcc 4.1, type the following commands in a terminal:
- (NOTE (rowa): I had problems compiling "gcc-cross" with gcc 4.1, as the switch "-Wno-overlength-strings" is not recognized. This was with the stable branch. Switching back to 4.3 solved this issue.)
- (Note from Laibsch: gcc-cross-4.2.2 would not build for me for armv5te no matter what I did. 4.3.3 built fine.)
sudo apt-get install gcc-4.1 g++-4.1 sudo rm /usr/bin/gcc sudo rm /usr/bin/g++ sudo ln -s /usr/bin/gcc-4.1 /usr/bin/gcc sudo ln -s /usr/bin/g++-4.1 /usr/bin/g++
You can switch back to the current version of gcc (4.3 in Ubuntu Intrepid as of 2009/04/13) by issuing the following commands:
sudo rm /usr/bin/gcc sudo rm /usr/bin/g++ sudo ln -s /usr/bin/gcc-4.3 /usr/bin/gcc sudo ln -s /usr/bin/g++-4.3 /usr/bin/g++
If you still get an error in the dbus package, try adding the following to ~/gumstix/gumstix-oe/tmp/work/i686-linux/dbus/dbus-sysdeps-unix.c after the preexisting includes and macros:
struct ucred {
unsigned int pid;
unsigned int uid;
unsigned int gid;
};
And, if you still have a problem with sumversion.c, edit (replacing xxxxxx with connex, verdex, or basix, as appropriate) ~/gumstix/gumstix-oe/tmp/work/gumstix-custom-xxxxxx-angstrom-linux-gnueabi/gumstix-kernel-2.6.21-r1/linux-2.6.21/scripts/mod/sumversion.c and add the following line after the other include statements:
#include <limits.h>
For more information, check out this discussion. Thanks to Na'Tosha for the above fixes.
