This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: Help with cross compiling


On Fri, 12 Feb 1999, Ian Lance Taylor wrote:

> 
> You must set CC, as you guessed, to be a program which will generate
> m68k-linux-gnu binaries.  You will need a version of the compiler
> which is able to generate executables.  That probably means that you
> will need to copy over or build startup files and libraries that you
> can use when building m68k-linux-gnu executables.

I do have the glibc-2.1 includes and libs incorporated into the
cross compiler (i.e. with-headers=, with-libs=).

That brings to mind another question. I've been able to generate
statically linked M68K executables from some of the simpler
packages like sysvinit-2.76 for example.  When I try to make
dynamically linked executables, the linker is evidently trying
to use the libc.so that is on the host, not the one that is in
with the M68k cross compiler. i.e.

root@pc1:/drives/work3/src/sysvinit-2.76/src # make
m68k-unknown-linux-gnu-gcc  -c -Wall -O2 -D_GNU_SOURCE init.c
m68k-unknown-linux-gnu-gcc  -c -Wall -O2 -D_GNU_SOURCE -DINIT_MAIN utmp.c
-o init_utmp.o
m68k-unknown-linux-gnu-gcc  -s  -o init init.o init_utmp.o 
/lib/libc.so.6: file not recognized: File format not recognized
collect2: ld returned 1 exit status
make: *** [init] Error 1

Assuming I made the cross compiler properly, shouldn't it resolve
using the libraries (with-libs=) I used to build it?

> 
>    Am I trying to do something that is possible?  If so are there any
>    instructions or
>    a FAQ somewhere that shows how?
> 
> It is certainly possible.  I don't know about a FAQ.  You may want to
> read the GNU configure and build system documentation I wrote up at
>     http://www.cygnus.com/~ian/configure/
> Read the section on a Canadian Cross.
> 
I'll take a look at it.  Thanks!






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