multiple definitions of assert

Daron Chabot daron.chabot at gmail.com
Tue Jun 16 20:37:27 UTC 2009


I've tripped over this bug building Till's GeSys app:

########################## begin log
###############################################
powerpc-rtems4.10-g++
-B/home/dchabot/opt/rtems/powerpc-rtems4.10/mvme3100/lib/ -specs
bsp_specs -qrtems   -g -Wall  -g    -mcpu=powerpc -msoft-float
-D__ppc_generic -DUSE_POSIX  -DUSE_RTC_DRIVER
"-DEARLY_CMDLINE_GET(arg)=do { *(arg) = BSP_commandline_string; }
while (0)" -DWINS_LINE_DISC -DUSE_TECLA -DNFS_SUPPORT     -I. -Invram
-DHAVE_CEXP -I../cexp     -Wl,-Map,o-optimize/linkmap
-Wl,--trace-symbol,__end  -mcpu=powerpc -msoft-float -D__ppc_generic
-o o-optimize/rtems.exe  o-optimize/init.o
o-optimize/rtems_netconfig.o o-optimize/config.o o-optimize/addpath.o
o-optimize/ctrlx.o o-optimize/term.o o-optimize/missing.o
o-optimize/pairxtract.o   o-optimize/allsyms.o   -lcexp -lbfd
-lspencer_regexp -lopcodes -liberty -ltecla_r  -lnfs -lm -lrtems++
/home/dchabot/opt/rtems-head/bin/../lib/gcc/powerpc-rtems4.10/4.3.3/../../../../powerpc-rtems4.10/lib/nof/libc.a(lib_a-assert.o):
In function `__assert_func':
/home/dchabot/RTEMS/tools-rtems-head/build/powerpc-rtems4.10/nof/newlib/libc/stdlib/../../../../../../gcc-4.3.3/newlib/libc/stdlib/assert.c:57:
multiple definition of `__assert_func'
/home/dchabot/opt/rtems/powerpc-rtems4.10/mvme3100/lib/librtemscpu.a(libcsupport_a-__assert.o):/home/dchabot/RTEMS/build-rtems-head/powerpc-rtems4.10/c/mvme3100/cpukit/libcsupport/../../../../../../rtems-head/c/src/../../cpukit/libcsupport/src/__assert.c:32:
first defined here
############################# end log
###################################################

I'm using binutils-2.19.1, gcc-4.3.3, and newlib-1.17.0 with the
latest patches for all.

RTEMS itself is from the cvs HEAD (last week).

Till pointed me at this thread:
    http://www.rtems.org/ml/rtems-users/2009/march/msg00042.html

It seems one multiple definition has slipped through...

I've attached a patch to cpukit/libcsupport/__assert.c to allow my app
to compile, but I'm not sure whether the fix properly belongs in RTEMS
or in newlib ?

Thanks.


-- dc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rtems-4.10-libcsupport_assert.diff
Type: text/x-patch
Size: 640 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/users/attachments/20090616/34bc66e6/attachment.bin>


More information about the users mailing list