h8300 on testsuite and -wrap
Jeff Law
law@redhat.com
Fri Sep 26 22:45:00 GMT 2008
Joel Sherrill wrote:
> Hi,
>
> I am trying to run the gcc test suite on h8300-rtems
> and getting lots of failures which look like this:
>
>
>
> /home/joel/work-gnat/svn/b-gcc1-h8300/gcc/xgcc
> -B/home/joel/work-gnat/svn/b-gcc1-h8300/gcc/
> /home/joel/work-gnat/svn/gcc/gcc/testsuite/gcc.c-torture/execute/20001031-1.c
> gcc_tg.o -w -O1 -DSTACK_SIZE=2048 -mh -mint32
> -B/home/joel/work-gnat/svn/bsp-install/h8300-rtems4.10/h8sim/lib/
> -specs bsp_specs -qrtems
> /home/joel/work-gnat/svn/b-gcc1-h8300/rtems_gcc_main.o -Wl,-wrap,exit
> -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -lm -o
> /home/joel/work-gnat/svn/b-gcc1-h8300/gcc/testsuite/gcc/20001031-1.x1
> -L /home/joel/work-gnat/svn/install/h8300-rtems4.10/lib/h8300h/ -lm
> /tmp/ccKBizhg.o: In function `.L20':
> 20001031-1.c:(.text+0x99): undefined reference to `__wrap__exit'
> gcc_tg.o: In function `___wrap_exit':
> testglue.c:(.text+0x173): undefined reference to `___real_exit'
> gcc_tg.o: In function `.L9':
> testglue.c:(.text+0x23d): undefined reference to `___real__exit'
> gcc_tg.o: In function `___wrap_abort':
> testglue.c:(.text+0x271): undefined reference to `___real_abort'
> gcc_tg.o: In function `___wrap_main':
> testglue.c:(.text+0x2b9): undefined reference to `___real_main'
> testglue.c:(.text+0x2c1): undefined reference to `__wrap__exit'
> /home/joel/work-gnat/svn/bsp-install/h8300-rtems4.10/h8sim/lib/librtemscpu.a(libposix_a-psignal.o):
> In function `_POSIX_signals_Abnormal_termination_handler':
> /home/joel/work-gnat/svn//rtems/c/src/../../cpukit/posix/src/psignal.c:41:
> undefined reference to `__wrap__exit'
>
> The arguments passed to ld look correct but looking
> into this with a simple h8300-elf-gcc build, I noticed
> that since gcc puts a leading _ on the symbols, you
> have to pass "-Wl,-wrap,_malloc" NOT -Wl,-wrap,malloc".
>
> Where is the leading underscore not getting dealt with
> so the wrap functions get invoked.
>
> FWIW I didn't see any h8300-elf results since last year
> and wonder if this is a known issue.
I ran into it as well when testing IRA. Hell if I can remember what I
did to fix it though....
jeff
More information about the Gcc
mailing list