This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: make full gcc unsuccessful for powerpc on Solaris (target=powerpc -elf), also linking with 'core' target gcc unsuccessful


"Bertin, Philippe" wrote:
> 
> /data/users/phbe/cross/gcc-2.95.3/gcc/xgcc
> -B/data/users/phbe/cross/gcc-2.95.3/gcc/
> -B/data/users/phbe/cross/executable/powerpc-elf/bin/ -c -DHAVE_CONFIG_H -g
> -O2 -I. -I./../../include  vsprintf.c
> vsprintf.c: In function `vsprintf':
> vsprintf.c:47: structure has no member named `_flag'
> vsprintf.c:47: `_IOWRT' undeclared (first use in this function)
> vsprintf.c:47: (Each undeclared identifier is reported only once
> vsprintf.c:47: for each function it appears in.)
> vsprintf.c:47: `_IOSTRG' undeclared (first use in this function)
> vsprintf.c:48: structure has no member named `_ptr'
> vsprintf.c:49: structure has no member named `_cnt'
> make: *** [vsprintf.o] Error 1

 Something went wrong in the libiberty-configure, 'vsprintf()' is already
included in 'libc.a' from newlib... Using the '--with-newlib' or defining
a temporary real target for the produced executables, should enable the
libiberty-configure to succeed ok...

> extract of failing (cross-)link
> bash-2.04$ powerpc-elf-gcc
> -Wl,-L~/cross/newlib-1.9.0/powerpc-elf/newlib,-L$prefix/powerpc-elf/lib,-L.,
> -lgp-new,-lc test.c
> /data/users/phbe/cross/executable/powerpc-elf/bin/ld: warning: cannot find
> entry symbol _start; defaulting to 01800074
> /var/tmp/ccQpvIvL.o: In function `main':
> /var/tmp/ccQpvIvL.o(.text+0x40): undefined reference to `<other library
> symbol>'
> /var/tmp/ccQpvIvL.o(.text+0x60): undefined reference to `printf'

 The 'powerpc-elf' probably is, just as the name says, one of those unreal
'elves'... Some, like the 'arm-elf' ('devil' or 'angel' as the target), may
be a little more 'real', but always it is more easy to hit to the target if
the target is a real one... One can create executables only for a real target,
like an opsys or a target board with a known firmware or known I/O-addresses,
memory map etc. supported with proper glue routines.

 Quoting the GCC-manual, "Invoking / Submodel Options / RS6000 and PowerPC
Options" :

------------------------------ clip --------------------------------------
-msim
	On embedded PowerPC systems, assume that the startup module is called
	sim-crt0.o and that the standard C libraries are libsim.a and libc.a.
	This is the default for powerpc-*-eabisim.  configurations.

-mmvme
	On embedded PowerPC systems, assume that the startup module is called
	crt0.o and the standard C libraries are libmvme.a and libc.a.

-mads
	On embedded PowerPC systems, assume that the startup module is called
	crt0.o and the standard C libraries are libads.a and libc.a.

-myellowknife
	On embedded PowerPC systems, assume that the startup module is called
	crt0.o and the standard C libraries are libyk.a and libc.a.
------------------------------ clip --------------------------------------

 The Germans would say something like : "Wenn du willst bin laden, du musst
erst deine ziel finden...", so what about using for instance a yellow knife
as an temporary goal or as an tool to achieve your goal ? ;-)

 Using one of these four supported real targets as an temporary one while
building GCC, has been a workaround to pass the sanity check in libiberty.
A 'make CFLAGS="-msim -g -O2"' has worked around the "C compiler cannot
create...", if the '--with-newlib' was forgotten during the main 'configure'.

 After having newlib built and installed, a 

    powerpc-elf-gcc -msim -O -o hello.x hello.c

should produce an PowerPC/ELF executable for the PSIM-simulator coming with
GDB from a "Hello World" application...

Cheers, Kai


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]