[uClinux-dev] porting CppTestKit woes

Travis Griggs tgriggs at keyww.com
Wed Nov 7 14:03:07 EST 2001


We've got some guys who have gotten CppTestKit 
<http://sourceforge.net/projects/cpptestkit/> running for a variety of 
the platforms we develop C code on. It runs fine on normal x86 linux. 
But we can't get it to link for uClinux. It seems to compile fine. 
Looking at what some of the other uClinux user programs did, we modified 
the Makefile (blank lines remove for brevity):

ROOTDIR = ~/coldfire/uClinux-coldfire
include $(ROOTDIR)/user/arch/coldfire/build.mk
OBJS =  TestTkCore.o TkSamples.o TkSetup.o TkTeardown.o \
     TkSuite.o TkTest.o TkTestCollector.o TkTestResult.o \
         TkTestMonitor.o TkDumbMonitor.o TkUtility.o
TEST_OBJS = DumbConsole.o TkSamples.o TkSetupSample.o \
     TkPaths.o TkPathsTest.o
BASEHDRS = TkConfig.h TestKit.h \
         TkTest.h TkTestCollector.h TkTestResult.h \
         TkTestMonitor.h TkDumbMonitor.h \
         TkUtility.h TkSetup.h TkTeardown.h TkSuite.h
CPPFLAGS= -ansi -I../inc
VPATH = ../src ../inc
all:    DumbConsole Test
clean:
         rm -f *.o *.a *~
deepclean: clean
         rm -f *.exe
libTkCore.a: ${OBJS}
         ${AR} ${ARFLAGS} libTkCore.a ${OBJS}
libTestKit.a: ${OBJS}
         ${AR} ${ARFLAGS} libTestKit.a ${OBJS}
DumbConsole: libTkCore.a ${TEST_OBJS}
         ${CXX} $(LDFLAGS) $(CXXFLAGS) -o DumbConsole ${TEST_OBJS} -L. 
-lTkCore $(LDLIBS) $(CXXLIBS)
Test:
         ./DumbConsole

It all appears to compile fine. I can do each of the .o targets fine. I 
can do the .a's fine. But when I do that final DumbConsole rule, I get 
errors, and I don't get why. The output from doing that make looks like:

m68k-elf-g++ -Os -m5200 -DCONFIG_COLDFIRE -Dlinux -D__linux__ -Dunix 
-D__uClinux__ -DEMBED -g -msep-data 
-I~/coldfire/uClinux-coldfire/lib/libc/i
nclude -I~/coldfire/uClinux-coldfire/lib/libm 
-I~/coldfire/uClinux-coldfire/vendors/include 
-I~/coldfire/uClinux-coldfire/linux/include  -fno-buil
tin -Wl,-elf2flt -Os -m5200 -DCONFIG_COLDFIRE -Dlinux -D__linux__ -Dunix 
-D__uClinux__ -DEMBED -g -msep-data  -I~/coldfire/uClinux-coldfire/lib/li
bc/include -I~/coldfire/uClinux-coldfire/lib/libm 
-I~/coldfire/uClinux-coldfire/vendors/include 
-I~/coldfire/uClinux-coldfire/linux/include  -fno-
builtin  -fname-mangling-version-0 -o DumbConsole DumbConsole.o 
TkSamples.o TkSetupSample.o TkPaths.o TkPathsTest.o -L. -lTkCore 
~/coldfire/uClinu
x-coldfire/lib/libc/libc.a
DumbConsole.elf2flt: In function `TestKit::tDumbMonitor::Run(int, char **)':
/home/treis/coldfire/CppTestKit/uClinux/../src/TkDumbMonitor.cpp:59: 
undefined reference to `_stdin'
DumbConsole.elf2flt: In function `new_eh_context':
/home/davidm/work/m68k-elf-tools/m68k-elf-gcc/gcc/../../gcc-2.95.3/gcc/libgcc2.c(.text+0x4bc2): 
undefined reference to `malloc'
DumbConsole.elf2flt: In function `__eh_alloc':
/home/davidm/work/m68k-elf-tools/m68k-elf-gcc/gcc/../../gcc-2.95.3/gcc/cp/exception.cc:152: 
undefined reference to `malloc'
DumbConsole.elf2flt: In function `__eh_free':
/home/davidm/work/m68k-elf-tools/m68k-elf-gcc/gcc/../../gcc-2.95.3/gcc/cp/exception.cc:165: 
undefined reference to `free'
DumbConsole.elf2flt: In function `end_fde_sort':
/home/davidm/work/m68k-elf-tools/m68k-elf-gcc/gcc/../../gcc-2.95.3/gcc/frame.c(.text+0x5cf8): 
undefined reference to `free'
DumbConsole.elf2flt: In function `frame_init':
/home/davidm/work/m68k-elf-tools/m68k-elf-gcc/gcc/../../gcc-2.95.3/gcc/frame.c(.text+0x5e06): 
undefined reference to `malloc'
/home/davidm/work/m68k-elf-tools/m68k-elf-gcc/gcc/../../gcc-2.95.3/gcc/frame.c(.text+0x5e16): 
undefined reference to `malloc'
DumbConsole.elf2flt: In function `execute_cfa_insn':
/home/davidm/work/m68k-elf-tools/m68k-elf-gcc/gcc/../../gcc-2.95.3/gcc/frame.c:627: 
undefined reference to `malloc'
/home/davidm/work/m68k-elf-tools/m68k-elf-gcc/gcc/../../gcc-2.95.3/gcc/frame.c:627: 
undefined reference to `free'
DumbConsole.elf2flt: In function `__register_frame':
/home/davidm/work/m68k-elf-tools/m68k-elf-gcc/gcc/../../gcc-2.95.3/gcc/frame.c(.text+0x63fc): 
undefined reference to `malloc'
DumbConsole.elf2flt: In function `__register_frame_table':
/home/davidm/work/m68k-elf-tools/m68k-elf-gcc/gcc/../../gcc-2.95.3/gcc/frame.c(.text+0x6456): 
undefined reference to `malloc'
DumbConsole.elf2flt: In function `__deregister_frame_info':
/home/davidm/work/m68k-elf-tools/m68k-elf-gcc/gcc/../../gcc-2.95.3/gcc/frame.c(.text+0x649c): 
undefined reference to `free'
DumbConsole.elf2flt: In function `__deregister_frame':
/home/davidm/work/m68k-elf-tools/m68k-elf-gcc/gcc/../../gcc-2.95.3/gcc/frame.c(.text+0x64d8): 
undefined reference to `free'
DumbConsole.elf2flt: In function `__builtin_delete':
/home/davidm/work/m68k-elf-tools/m68k-elf-gcc/gcc/../../gcc-2.95.3/gcc/cp/new2.cc:54: 
undefined reference to `free'
collect2: ld returned 1 exit status
make: *** [DumbConsole] Error 1

Can anyone give me any hints about what to go look at to get this 
resolved? Like I say, with a slightly modified Makefile, it 
compiles/runs for standard linux just fine.

TIA

-- 
Travis Griggs
Member: 3rd Boolean State Software Collective
Key Technology
"It had better be a pretty good meeting to be better than no meeting at 
all"-- Boyd K. Packer

This message resent by the uclinux-dev at uclinux.org list server http://www.uClinux.org/



More information about the uClinux-dev mailing list