[uClinux-dev] c++ problem undefined reference

David McCullough davidm at snapgear.com
Thu Oct 27 09:25:23 EDT 2005

Jivin Sascha Smejkal lays it down ...
> Hi all,
> got a little further:
> the difference between the two build environments is, that the 
> uClinux-dist-20041215 uses the start files and libraries from the 
> configured libc, whereas the old build environment used the start files 
> from the toolchain for c++ applications.
> Are there any fixes for the coldfire and uClinux-dist-20041215 to compile 
> c++ apps with the m68k-elf-toolchain-20030314?

Does using the start files from the compiler fix the problem ?
Sounds like the start files need fixing if it does :-)

> Another problem arose:
> if I use global static variables which are (should be) initialized they 
> sometimes don't get initialized when running the app. Has anyone 
> encountered the same problem?

Check you have allocated enough stack,  stack overflows usually run into
the data segment and look like corrupted or badly initialised variables.

Try some simple programs to see that they function correctly,  try and
reproduce the error in a small program that other can try/look at,


> Sascha Smejkal schrieb:
> >Hi,
> >
> >We have an environment with many c++ apps. Until now we've used uClinux 
> >with kernel 2.4.17-ac1 (Arcturus), the "old" uC-libc and the toolchain 
> >from 20030314.
> >
> >Now we want to update to uClinux-dist 20041215 with kernel 2.4.27-uc0 
> >and the "new" uClibc included in the distro.
> >
> >Now a problem arose by one of the many c++ applications. The linker 
> >exits with the following error:
> >
> >echo CXXLIBS=-Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -liostream -lio 
> >-liberty -lc -lgcc
> >CXXLIBS=-Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -liostream -lio -liberty -lc 
> >-lgcc
> >/usr/local/bin/m68k-elf-g++ -m5307 -DCONFIG_COLDFIRE -Os -g 
> >-fomit-frame-pointer -m5307 -DCONFIG_COLDFIRE -fno-common -Wall   
> >-Dlinux -D__linux__ -Dunix -D__uClinux__ -DEMBED -nostdinc 
> >-I/develop/projects/csp3000/wao/platform/include 
> >-I/develop/projects/csp3000/wao/platform/include/include -fno-builtin 
> >-msep-data -Wl,-elf2flt -Wl,-move-rodata -nostartfiles 
> >/develop/projects/csp3000/wao/platform/lib/crt0.o 
> >-L/develop/projects/csp3000/wao/platform/lib 
> >-L/develop/projects/csp3000/wao/platform/lib/zlib rpc_types.o rpc_rtc.o 
> >rpc_io.o rpc_tts.o rpc_device_control.o can_io.o tabcfg.o csp_timer.o 
> >bwz.o rtc.o trace.o devicemanager.o version.o csp_can_evts_sstub.o 
> >bwz_srvr_sstub.o io_cmds_cstub.o vr_cmds_cstub.o gctrl_cmds_cstub.o 
> >bwz_clnt_cstub.o ../../lib/librpctrans.a -o bwz -lz -Wl,-Bstatic 
> >-lstdc++ -Wl,-Bdynamic -liostream -lio -liberty -lc -lgcc
> >bwz.elf2flt: In function `_IO_file_stat':
> >/usr/local/lib/gcc-lib/m68k-elf/2.95.3/../../../../m68k-elf/sys-include/sys/stat.h:359: 
> >undefined reference to `__fxstat'
> >collect2: ld returned 1 exit status
> >
> >I've googled around and found some others having the same problem but 
> >didn't a solution.
> >
> >Is it solved in the meantime or has everybody given up?
> >
> >Thanx in advance
> >
> >Sascha Smejkal
> >_______________________________________________
> >uClinux-dev mailing list
> >uClinux-dev at uclinux.org
> >http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> >This message was resent by uclinux-dev at uclinux.org
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev at uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev at uclinux.org

David McCullough, davidm at cyberguard.com.au, Custom Embedded Solutions + Security
Ph:+61 734352815 Fx:+61 738913630 http://www.uCdot.org http://www.cyberguard.com

More information about the uClinux-dev mailing list