cross-compile toolchain not recognized

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
I have installed a pre-built kernel and toolchain on my host system for
cross-development. When I download existing source packages and try to
cross-build for my target, the native toolchain is invoked.

My cross-toolchain is working, as I have rebuilt the target kernel thru
its own makefile, and compiled individual files by directly invoking the
cross version of gcc. What does not work is when I try to use a
configure script or makefile that did not come with the target distro.
It always finds the native tools regardless of where the source files
are placed.

For instance, I downloaded the source package setserial which has a
configure script. Running ./configure always creates a makefile for the
native tools. Is it normal to have to edit the configure script or
makefile for cross-compiling?




Re: cross-compile toolchain not recognized
Quoted text here. Click to load it

Try presetting the environment variable CC with the name of your cross
compiler. You may also want to do some reading in "info autoconf", there are
also some notes about cross compiling.

Alternatively, a prebuilt toolchain with target binary packages like the
one found at www.elinos.com might be helpful. I suggest that the time you
have spent on this already could've afforded you it ;-)

Regards,
Marius.

--
Marius Groeger        SYSGO Real-Time Solutions GmbH    www.sysgo.de
Software Engineering  Embedded and Real-Time Software   www.osek.de
We've slightly trimmed the long signature. Click to see the full one.
Re: cross-compile toolchain not recognized



Quoted text here. Click to load it
Sure, when I just want to call the compiler I can do "i586-linux-gcc
myfile". The problem is all the utils have the "i586-linux-" prefix on
them, so when I want to make, it is going to call the linker too, and
who knows what else. There is also the problem of using the target
libraries, and not the native ones.

There seem to be a few different configurations in the distributed
packages. Some have everything in the makefile - 'make config','make
dep','make','make install',etc. Others use an autoconf generated
configure script which generates the makefile. In this case, everything
has to be handled in configure. Configure has some options that can be
passed to it like --host, --build, --prefix, but so far I have not
figured out how to make them work for my situation.

I look at config.log, and expect to see CC (i586-linux-gcc), but it
always shows CC( gcc).

Quoted text here. Click to load it
This is pretty much what I have already, but there are certain packages
that do not come with the distro, and need to be recompiled on the host.
If I had room on the target for all the tools, I would be simple.


Re: cross-compile toolchain not recognized
Quoted text here. Click to load it

You have to override CC, LD, AS, ... and all the other things the program uses
before you run configure.

 > There is also the problem of using the target libraries, and not the native
ones.

Not usually a problem, since gcc has compiled-in paths to the right target
libraries.

Quoted text here. Click to load it

Here's an example of how to build libnet-1.1:

TARGET=powerpc-unknown-linux-gnu
CROSS_TOOL=$-
CC=$gcc AR=$ar RANLIB=$ranlib
CFLAGS="$TARGET_CFLAGS" ac_libnet_have_packet_socket=yes ./configure --prefix=/
--host=$TARGET --build=pentium-unknown-linux --with-pf_packet=yes
make

For programs, you might need to set --target instead of --host, I'm not sure.
- Dan


Re: cross-compile toolchain not recognized


Quoted text here. Click to load it
-- So, there exists something that repeatedly prevents
your files being found -- something that tells a script where to go.

Quoted text here. Click to load it


Site Timeline