This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


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

Re: problems cross-compilng gcc


>This means you are using the wrong version of nm and/or you are compiling
>with the
>wrong version of gcc.
>"nm --help" will give you the supported targets.  This will usually be for
>your
>native processor architecture.  Check your paths.  Use the absolute path
>for the
>correct cross tools version of nm.

Yes, that was it,  I needed to use the cross nm to look at the object file
( duh:-)))

The problem now is that when I build the powerpc kernel  the llibkern.o
object is missing a bunch of symbols ( bcmp.o ,bzero.o,etc) The .o files
for them ( bcmp.o , bzero.o ,etc) are all there in /compile/lib/kern
directory but they are not included in the final libkern.o  object.
I'm unsure if it's the problem with the compiler or the makefile

I did a little test - cross-compiled a simple program that calls a routine
foo  and looked at the object file - the foo symbol was there.

>Did you add a program prefix when configuring/building the cross-compiler
>(--with-program-prefix=powerpc-openbsd-) ?
>I used "--with-program-prefix=powerpc-linux-" for my cross-compiler and
>binutils.
>I then use powerpc-linux-nm, powerpc-linux-ar, powerpc-linux-as,
>powerpc-linux-gcc, powerpc-linux-g++, etc for all my cross-tools.
>

I configured binutils and gcc with the following:

./configure --host=$MACHTYPE --target=powerpc--openbsd --with-headers=
/path_to_ppc_obsd2.5_headers --with-libs /path_to_obsd2.5_ppc_std_libs
--prefix=/usr/cross-tools  -v
where MACHTYPE on my machine is i386-pc-openbsd2.5

It put the binaries in the cross-tools/bin directory under names
powerpc--openbsd-gcc
powerpc--opnebsd-nm ,
powerpc--opnebsd-ld etc

I'm not sure about 2 dashes though. I tried --target= powerpc-openbsd but
then appended powerpc-unknown-openbsd to the name of the binaries. I wonder
if it matters
 What did you specify as a --target ?

thanks for help
Andy



>Andy wrote:
>
>> Day 3
>> This time the events unfolded as follows:
>> I configured the gcc environment using --with-libs and --with-headers
>>options.
>> This forced the configure script to copy the target libs to
>> /cross-tools/powerpc--openbsd/lib and
>> create a directory in /cross-tools/powerpc-openbsd called sys-includes
>> where it copied all the target headers.
>> Then I ran make  all install.
>> It fixed the headers ( or so it said)
>> The errors it produced during build were the same as  before:
>> 1. conflicting types for sys_errlist ( libiberty/strerror.c)
>> 2. unknown fields of the FILE struct and some undefined flags (
>> libiberty/vsprintf.c)
>> 3.undefined PATH_MAX ( libchill/basicio.c)
>> 4.   libiberty/strsignal.c: coid psignal(signo, message)
>> - message declared as const in the header.
>>
>> In addition to that it produced a "parse error" in gcc/include/stdio.h on
>> the following routine declarations:
>>
>> /*
>>
>> int      vasprintf __P((char **, const char *, _BSD_DUMMY_VA_LIST_))
>>                 __attribute__((format (printf, 2, 0)));
>> int      vsnprintf __P((char *, size_t, const char *, _BSD_DUMMY_VA_LIST_))
>>                 __attribute__((format (printf, 3, 0)));
>> int      vscanf __P((const char *, _BSD_DUMMY_VA_LIST_))
>>                 __attribute__((format (scanf, 1, 0)));
>> int      vsscanf __P((const char *, const char *, _BSD_DUMMY_VA_LIST_))
>>                 __attribute__((format (scanf, 2, 0)));*/
>>
>> aparrently it couldn't find  _BSD_DUMMY_VA_LIST_ ( I couldn't)
>>
>> I commented these routines out - well it didn't complain.
>>
>> After that the buid completed successfully
>> couple of questions that arose during the build process:
>> -the  target libraries I told it to use to build the cross-compiler were
>> built with gcc 2.8.1 -- could this be a part of my problem?
>>
>> -It built several copies of libiberty:
>> - gcc*/libiberty
>> - gcc*/powerpc--openbsd/libiberty
>> -gcc*/powerpc--openbsd/soft-float/libiberty
>> Why is this done?
>> BTW the last 2 libiberty libs were the ones that gave me errors
>> <<<>>>
>> Now to the real problem:
>> when I tried to build a kernel with the cross-compiler I was getting
>> unresolved link errors ( routines like bcmp, bcopy, bzero,etc.)
>> These routines are compiled into  libkern.o object  so I examined that and
>> lo! it's all bogus.
>> i.e, nm reports:
>> nm: libkern.o: not object file or archive
>> I did a hex dump - well  there's elf header but no symbol names.
>> I  ran nm on  several objects that my cross-compiler produced and all with
>> the same result:
>> nm reports that it's not an object file or archive.,
>> So, looks like my cross-compiler produces garbage.
>> I'm totally stuck
>> Any ideas ? anyone?
>



------
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]