[uClinux-dev] Compile/Run Problems in uClinux (m68knommu, Coldfire)
Wolfgang Wegner
wolfgang at leila.ping.de
Tue Oct 23 05:16:15 EDT 2007
Dear list,
I hope I am on the right track here...
I am having serious problems getting a program to compile and run
in uClinux. Platform is m68k-nommu (MCF5373L, actually).
What I have:
- A complete development environment from Emlix (came with a
senTec COBRA5329 board), using m68k-elf-gcc (GCC) 3.4.3 (Emlix Linux 3.4.3-6)
- from the same package:
uClinux-dist-emlix-1.1.tar.bz2
(contains uClibc 0.9.27, linux 2.6.17-uc0)
- uClinux-dist-20070130 from the m68k port page of uClinux.org, patched with
uClinux-dist-20070130-20071017.patch.gz
What I can get:
- if I configure and compile manually, I get a running kernel from both
uClinux-dist versions
- if I compile manually with these flags:
CC = m68k-uclinux-gcc
CPPFLAGS = -I$(TOP)/include -I/usr/include
CFLAGS = -Wall -m5307
LDFLAGS = -Wl, -elf2flt="$(FLTFLAGS)" -m5307
LDLIBS = -lpthread
FLTFLAGS = -s 262144
I get simple executables that work under my self-compiled kernel.
(However, with some bad limitation - see below...)
What does not work:
- using threads with libpthreads in my application. Calling pthread_create
simply stops all execution (of course, the binary is statically linked).
- compile either distribution of uClinux. The Emlix one once compiled, but
now I get :
lib/libc.elf2flt(.text+0x2d966): In function `__do_global_ctors':
../../gcc/libgcc2.c:1623: undefined reference to `atexit'
collect2: ld returned 1 exit status
make[2]: *** [lib/libc] Error 1
make[2]: Leaving directory `/projects/local/uClinux-dist-test/uClibc'
Honestly, I do not know what I did to break it...
- compile the kernel from within uClinux-dist
When I try to compile the kernel from within uClibc-dist, the kernel
quietly does not run - or I do not see it is running? No idea...
I did not yet really figure out how to debug a kernel, so I do not
know what is happening there, I simply do not get any console output
after starting it from the bootloader. Compiling manually from the
same tree gives a working kernel.
- run any binary from the Emlix uclinux-dist-test under my self-compiled
kernel - when starting it as the init process, I get something like
"mmap failed" and the kernel barfs because it can not start init.
- compile the newer uCinux-dist; I always get linker errors like
thdm.elf2flt(.text+0x7cbe):__cxa_atexit.c: undefined reference to `__preinit_array_end'
thdm.elf2flt(.text+0x7cde):__cxa_atexit.c: undefined reference to `__init_array_start'
thdm.elf2flt(.text+0x7ce2):__cxa_atexit.c: undefined reference to `__init_array_end'
thdm.elf2flt(.data.rel+0x4304): undefined reference to `_errno'
thdm.elf2flt(.data.rel+0x430c): undefined reference to `_h_errno'
collect2: ld returned 1 exit status
make[3]: *** [thdm] Error 1
make[3]: Leaving directory `/projects/new/uClinux-dist/user/threaddemos'
My problem is I do not really understand the make system of uClinux-dist.
Why is there a difference if I compile from within uClinux-dist or by
calling make ARCH=m68knommu CROSS_COMPILE=m68k-uclinux- by hand?
My questions:
- Can anybody give a hint why there is a difference between compiling
the kernel manually or from within uClinux-dist?
- can anybody give a hint why the newer uClinux-dist is not compilable
and gives the above linker error? Is it a compiler version problem?
If so, which compiler/binutils should I use? I wanted to try crosstool,
but they do not support uClibc, so it seems I have to do this by hand.
- Is the problem with threads not running related to the way I do the
compilation (and thus why uClinux-dist binaries do not run under my
own kernel)?
Sorry for the long text - in case anybody made it up to here: thank you,
any hints or comments are most welcome!
Best regards,
Wolfgang
More information about the uClinux-dev
mailing list