This is the mail archive of the crossgcc@sourceware.org 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: Problem with pathing crt1.o in crosstool


On 1/20/06, michael.miller@prga.com <michael.miller@prga.com> wrote:
> I built a tool chain from Dan Kegel's 0.38 crosstool...
> I used all defaults when creating the tool chain
> and everything seems to have built and installed.
> The testhello script looks like it worked fine.

OK...

> When I tried to build the kernel via
>   make ARCH=arm CROSS_COMPILE=arm-xscale-linux-gnu- zImage
> the compilation went OK but I got a link error
>  from ld because crt1.o wasn't found.
> When I try to compile a simple helloworld test program
> I also get the crt1.o not found error from ld,
> which suggests something is wrong with the pathing.

So, how the heck did testhello pass?
How are you building the hello world program?

> A check of the crosstool ld's configuration via "-Wl,-v" shows it is using built-in specs with no path to the crt<x>.o files. Even if I were to copy these to the local directory I'm sure I would have problems finding the crtBegin.o and gcc libs since these come from a different directory. Before trying to build the kernel I setup the environment variables as:
>
> ccpath=/opt/crosstool/gcc-3.4.4-glibc-2.3.5/arm-xscale-linux-gnu
> export GCC_EXEC_PREFIX=$ccpath/lib/
> export C_INCLUDE_PATH=$ccpath/include/:$ccpath/lib/gcc/arm-xscale-linux-gnu/3.4.4/include/:$ccpath/arm-xscale-linux-gnu/include/
> export CPLUS_INCLUDE_PATH=$C_INCLUDE_PATH
> export INFOPATH=$ccpath/info
> export LIBRARY_PATH=$ccpath/lib/gcc/arm-xscale-linux-gnu/3.4.4
> export COMPILER_PATH=$ccpath/bin/:$ccpath/arm-xscale-linux-gnu/bin/
> export PATH=$ccpath/bin:$ccpath/arm-xscale-linux-gnu/bin:$PATH
> export MACHTYPE=arm-xscale-linux-gnu

Yikes.  I think never do any of that crap.  Instead, I just set
CROSS_COMPILE to an absolute prefix, e.g.
CROSS_COMPILE=/opt/crosstool/gcc-3.4.4-glibc-2.3.5/arm-xscale-linux-gnu/bin/arm-xscale-linux-gnu-

> Do I need to tweak the specs before I build the tool chain so that it points to my final destination under /opt/crosstool?

Lord, no.  You're making things too hard, I think...
- Dan

--
Wine for Windows ISVs: http://kegel.com/wine/isv

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


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