Build uClinux on Linux host using Sourcery G++ Lite Edition
Robert S. Grimes
rsg at alum.mit.edu
Wed Aug 22 02:29:16 UTC 2007
Hi,
So far, I've build uClinux, the kernel, and my applications within the
uClinux build system by putting my apps into the user directory. Up to
know, I've been using the uClinux tools to do this. However, I can't
get a C++ program to link in this environment. Specifically, I get
these two errors:
libsrc/QSPIManager.cc:40: undefined reference to `__cxa_guard_acquire'
libsrc/QSPIManager.cc:40: undefined reference to `__cxa_guard_release'
collect2: ld returned 1 exit status
Nobody on the uClinux mailing list seems to know how to fix this, but
someone suggested I try the CodeSourcery tools. So I downloaded the
ColdFire uClinux tools for Linux hosts, but I don't know how to use them
to build uClinux. This is the package I got:
freescale-coldfire-4.2-8-m68k-uclinux-i686-pc-linux-gnu.tar.bz2.tar
I can compile a C++ program outside of the uClinux/kernel tree, and it
runs on my target! Yes! But, this simple program doesn't use any of
the uClinux header files. Specifically, I need to use the mcf_qspi
driver to use the ColdFire's QSPI controller for communicating to SPI
peripherals. So I need to include files (for example, mcf_qspi.h) that
are provided within the uClinux tree. Right now, my actual applications
won't even compile using CodeSourcery, because of this issue.
What is the best way to do fix this?
Seems I have four basic options, listed in increasing degrees of pain.
1. Somehow figure out how to use the uClinux tools to build my
applications (resolve the above errors).
2. Figure out how to use CodeSourcery tools to build the entire
uClinux tree.
3. Build using CodeSourcery tools outside the uClinux build system,
and somehow figure out how to point CodeSourcery's tools into the tree
at the appropriate places (wherever these are).
4. Rewrite in C and use uClinux tools
The only one I know how to do myself, right now, is the fourth option,
but I'd really, really rather not be forced to do that; I've adapted and
written much already. The first seems the least painful, if someone
could just tell me what the missing magic is, as I've been using the
tools for some time now, and have had no troubles (only C programs until
now). For CodeSourcery, I'd much prefer option 2 over 3, unless 3 can
be done reliably. I'm much too green in this area (uClinux and Linux
kernel development), so both these options scare me. I have been
developing embedded systems for 24 years, so I'm not a novice in general...
Help!
Thanks!
-Bob
More information about the coldfire-gnu-discuss
mailing list