Re: [v850] cross compiler - file v850.md

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have tried to rebuild a clean version of gcc with "make" but I am
still experiencing the same problem. By the way, one of the files
created during the installation tries to include files that don't
exist :
/tools/gnu/v850-elf/include/stdlib.h :
[...]
#include "ghs_null.h"		/* defines NULL and size_t */
#include "ghs_wchar.h"		/* defines wchar_t */
[...]

and those files are not known by google or my whole computer, even the
source of gcc, so I think that there is maybe a bug there.

I am currently using the include dir : /tools/gnu/v850-elf/include/
and I have replace the include with :
#include "null.h"
#include "wchar.h"


I have also tried this based on your remark :

$ strings /tools/gnu/lib/gcc/v850-elf/4.3.0/v850e/libgcc.a  | grep
callt | head -n100
[...]
__callt_save_interrupt
__callt_return_interrupt
__callt_save_all_interrupt
__callt_restore_all_interrupt
[...]

So you were right, the libgcc.a contains the symbols I am looking for
but they seem to be not used by ld. Actually by using the --verbose
option in the makefile, I have seen that the libgcc.a used must be
this one :

/tools/gnu/lib/gcc/v850-elf/4.3.0/libgcc.a
and both libs were installed in the same time (based on their creation time)
So I have checked this lib :
$ strings /tools/gnu/lib/gcc/v850-elf/4.3.0/libgcc.a  | grep callt
[...]
_callt_save_interrupt.o/
_callt_save_all_interrupt.o/
[...]

these are the only calls to callt_save_interrupt.o, so it's logical
that the linker doesn't find the symbols. I have then tried to rename
this lib libgcc.a.old to prevent the linker to use it, and I have
added the path for the good one in the makefile but I have an curious
error.

This is the makefile I am using :

#####
CC=/tools/gnu/bin/v850-elf-gcc.exe
CFLAGS=-mv850e -I/tools/gnu/v850-elf/include/
LDFLAGS=--verbose -Wl, -L/tools/gnu/lib/gcc/v850-elf/4.3.0/v850e/
EXEC=test
SRC= $(wildcard src/*.c)
OBJ= $(SRC:.c=.o)

all: $(EXEC)

$(EXEC): $(OBJ)
	$(CC) -o $@ $(LDFLAGS) $^

%.o: %.c
	$(CC) -o $@ -c $(CFLAGS) $<

clean:
	rm -rf src/*.o
	rm -rf *.i
	rm -rf *.s
#####

and the output when I try to include the good library :

#####
$ make -w clean && make 2>&1 | tee make.out
make: Entering directory `/home/poulpe/test_sylvain'
rm -rf src/*.o
rm -rf *.i
rm -rf *.s
make: Leaving directory `/home/poulpe/test_sylvain'
/tools/gnu/bin/v850-elf-gcc.exe -o src/Display.o -c -mv850e -I/tools/gnu/v850-el
f/include/ src/Display.c
/tools/gnu/bin/v850-elf-gcc.exe -o src/main.o -c -mv850e -I/tools/gnu/v850-elf/i
nclude/ src/main.c
src/main.c: In function 'main':
src/main.c:39: warning: return type of 'main' is not 'int'
/tools/gnu/bin/v850-elf-gcc.exe -o test --verbose -Wl, -L/tools/gnu/lib/gcc/v850
-elf/4.3.0/v850e/  src/Display.o src/main.o
Using built-in specs.
Target: v850-elf
Configured with: /tmp/src/gcc-4.3.0/configure --target=v850-elf --prefix=/tools
--exec-prefix=/tools/gnu --with-gnu-as --with-gnu-ld --with-newlib --enable-lang
uages=c,c++ -v
Thread model: single
gcc version 4.3.0 (GCC)
COMPILER_PATH=/tools/gnu/libexec/gcc/v850-elf/4.3.0/:/tools/gnu/libexec/gcc/v850
-elf/4.3.0/:/tools/gnu/libexec/gcc/v850-elf/:/tools/gnu/lib/gcc/v850-elf/4.3.0/:
/tools/gnu/lib/gcc/v850-elf/:/tools/gnu/lib/gcc/v850-elf/4.3.0/../../../../../gn
u/v850-elf/bin/
LIBRARY_PATH=/tools/gnu/lib/gcc/v850-elf/4.3.0/:/tools/gnu/lib/gcc/v850-elf/4.3.
0/../../../../../gnu/v850-elf/lib/
COLLECT_GCC_OPTIONS='-o' 'test' '-v' '-L/tools/gnu/lib/gcc/v850-elf/4.3.0/v850e/
'
 /tools/gnu/libexec/gcc/v850-elf/4.3.0/collect2.exe -o test /tools/gnu/lib/gcc/v
850-elf/4.3.0/../../../../../gnu/v850-elf/lib/crt0.o -L/tools/gnu/lib/gcc/v850-e
lf/4.3.0/v850e/ -L/tools/gnu/lib/gcc/v850-elf/4.3.0 -L/tools/gnu/lib/gcc/v850-el
f/4.3.0/../../../../../gnu/v850-elf/lib  src/Display.o src/main.o -lgcc -lc -lgc
c
/tools/gnu/lib/gcc/v850-elf/4.3.0/../../../../../gnu/v850-elf/bin/ld: : No such
file: No such file or directory
collect2: ld returned 1 exit status
make: *** [test] Error 1
#####

And the output with the bad library (no -Wl option in makefile and
libgcc.a.old renamed to libgcc.a)

#####
$ make -w clean && make 2>&1 | tee make.out
make: Entering directory `/home/sboivineau/test_sylvain'
rm -rf src/*.o
rm -rf *.i
rm -rf *.s
make: Leaving directory `/home/sboivineau/test_sylvain'
/tools/gnu/bin/v850-elf-gcc.exe -o src/Display.o -c -mv850e -I/tools/gnu/v850-el
f/include/ src/Display.c
/tools/gnu/bin/v850-elf-gcc.exe -o src/main.o -c -mv850e -I/tools/gnu/v850-elf/i
nclude/ src/main.c
src/main.c: In function 'main':
src/main.c:39: warning: return type of 'main' is not 'int'
/tools/gnu/bin/v850-elf-gcc.exe -o test --verbose  src/Display.o src/main.o
Using built-in specs.
Target: v850-elf
Configured with: /tmp/src/gcc-4.3.0/configure --target=v850-elf --prefix=/tools
--exec-prefix=/tools/gnu --with-gnu-as --with-gnu-ld --with-newlib --enable-lang
uages=c,c++ -v
Thread model: single
gcc version 4.3.0 (GCC)
COMPILER_PATH=/tools/gnu/libexec/gcc/v850-elf/4.3.0/:/tools/gnu/libexec/gcc/v850
-elf/4.3.0/:/tools/gnu/libexec/gcc/v850-elf/:/tools/gnu/lib/gcc/v850-elf/4.3.0/:
/tools/gnu/lib/gcc/v850-elf/:/tools/gnu/lib/gcc/v850-elf/4.3.0/../../../../../gn
u/v850-elf/bin/
LIBRARY_PATH=/tools/gnu/lib/gcc/v850-elf/4.3.0/:/tools/gnu/lib/gcc/v850-elf/4.3.
0/../../../../../gnu/v850-elf/lib/
COLLECT_GCC_OPTIONS='-o' 'test' '-v'
 /tools/gnu/libexec/gcc/v850-elf/4.3.0/collect2.exe -o test /tools/gnu/lib/gcc/v
850-elf/4.3.0/../../../../../gnu/v850-elf/lib/crt0.o -L/tools/gnu/lib/gcc/v850-e
lf/4.3.0 -L/tools/gnu/lib/gcc/v850-elf/4.3.0/../../../../../gnu/v850-elf/lib src
/Display.o src/main.o -lgcc -lc -lgcc
src/main.o: In function `_main':
main.c:(.text+0x10): undefined reference to `___DI'
main.c:(.text+0x2c): undefined reference to `___EI'
src/main.o: In function `_INTP4':
main.c:(.text+0x24e): undefined reference to `__callt_save_interrupt'
main.c:(.text+0x24e): relocation truncated to fit: R_V850_CALLT_6_7_OFFSET again
st undefined symbol `__callt_save_interrupt'
main.c:(.text+0x250): undefined reference to `__callt_save_all_interrupt'
main.c:(.text+0x250): relocation truncated to fit: R_V850_CALLT_6_7_OFFSET again
st undefined symbol `__callt_save_all_interrupt'
main.c:(.text+0x344): undefined reference to `__callt_restore_all_interrupt'
main.c:(.text+0x344): relocation truncated to fit: R_V850_CALLT_6_7_OFFSET again
st undefined symbol `__callt_restore_all_interrupt'
main.c:(.text+0x346): undefined reference to `__callt_return_interrupt'
main.c:(.text+0x346): relocation truncated to fit: R_V850_CALLT_6_7_OFFSET again
st undefined symbol `__callt_return_interrupt'
src/main.o: In function `_INTP5':
main.c:(.text+0x360): undefined reference to `__callt_save_interrupt'
main.c:(.text+0x360): relocation truncated to fit: R_V850_CALLT_6_7_OFFSET again
st undefined symbol `__callt_save_interrupt'
main.c:(.text+0x362): undefined reference to `__callt_save_all_interrupt'
main.c:(.text+0x362): relocation truncated to fit: R_V850_CALLT_6_7_OFFSET again
st undefined symbol `__callt_save_all_interrupt'
main.c:(.text+0x368): undefined reference to `___EI'
src/main.o: In function `_INTP9':
main.c:(.text+0x412): undefined reference to `__callt_save_interrupt'
main.c:(.text+0x412): relocation truncated to fit: R_V850_CALLT_6_7_OFFSET again
st undefined symbol `__callt_save_interrupt'
main.c:(.text+0x414): undefined reference to `__callt_save_all_interrupt'
main.c:(.text+0x414): relocation truncated to fit: R_V850_CALLT_6_7_OFFSET again
st undefined symbol `__callt_save_all_interrupt'
main.c:(.text+0x482): undefined reference to `__callt_restore_all_interrupt'
main.c:(.text+0x482): relocation truncated to fit: R_V850_CALLT_6_7_OFFSET again
st undefined symbol `__callt_restore_all_interrupt'
main.c:(.text+0x484): undefined reference to `__callt_return_interrupt'
main.c:(.text+0x484): relocation truncated to fit: R_V850_CALLT_6_7_OFFSET again
st undefined symbol `__callt_return_interrupt'
collect2: ld returned 1 exit status
make: *** [test] Error 1
#####

Thanks for your help




2008/4/10, Brian Dessent <brian@xxxxxxxxxxx>:
> p0ulp3 wrote:
>
>  > /tmp/src/gcc-4.3.0/configure --target=v850-elf --prefix=/tools
>  > --exec-prefix=/tools/gnu --with-gnu-as --with-gnu-ld --with-newlib -v
>  > 2>&1 | tee configure.out
>  >
>  > make -w all-gcc install-gcc LANGUAGES="c c++" 2>&1 | tee make.out
>
>
> You should really do --enable-languages=c,c++ when configuring and skip
>  overloading LANGUAGES at make time.  I think that's a gcc 3.x-ism that
>  is obsolete with the toplevel bootstrap changes in 4.x (just like "make
>  bootstrap" is now obsolete and is replaced by
>  --{enable,disable}-bootstrap.)
>
>
>  > main.c:(.text+0x24e): undefined reference to `__callt_save_interrupt'
>
>
> I suspect that this function is part of libgcc.  When you use the
>  "all-gcc" or "install-gcc" targets you tell the build system to build
>  only the bare compiler itself, not any of its supporting target
>  libraries.  So it's no surprise then that you can't link with the
>  result, because libgcc is an essential support library that gcc uses for
>  all kinds of internal functions.
>
>  This "make all-gcc" target is not supposed to make a fully working
>  compiler, it's only to be used in situations where you don't yet have
>  target libc headers and thus can't link libgcc.  You're supposed to use
>  the resulting bare gcc to then configure/build/install your libc and
>  headers, and then use those to rebuild gcc correctly and in full,
>  without the all-gcc hack.
>
>
>  > After a search, I have realized that those symbols are defined in the
>  > file v850.md but this file and the complete directory is not present
>  > on my installation. Actually I can see the directory here :
>
>
> .md files are never installed, they are source code for the compiler,
>  similar to all the other .c files.  You're chasing after the wrong thing
>  here.  You need to build libgcc, i.e. "make" not "make all-gcc".
>
>
>  Brian
>

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux