Cross compiler won't build
Brett Hunt
huntbs@lycos.com
Fri Jun 7 09:10:00 GMT 2002
Mark,
To answer your question, I have successfully built the cross compiler according to the instructions I pointed you to and used it to successfully build a cross compiled application.
All references to $prefix and $target below should match the variables you set when cross-compiling the tools.
Did you set the path at the end of step 3 to $prefix/bin? And then try compiling using $target-gcc?
If this doesn't solve your problem, was binutils cross-compiled? I'm assuming it was since you followed the directions. So perhaps, it's running the local ld instead of the $prefix/bin/ld. You could try to rearrange your path to find the cross ld first (but this will affect all your compiles, native or not, so be careful to remember to set the path back when you're done). The warning is only if it is finding the wrong ld/collect2 tools.
Try looking at the error and see what the command is that it is executing. Use 'which ld' or 'which collect2' to see if it is finding the right one. Also try 'which $target-ld' or 'which $target-collect2' to see if those are installed and available. Make sure that your path includes $prefix/bin. Then if the compile is trying to use the wrong ld because it is finding it first, you could try setting your path like so:
PATH=$prefix/bin:$PATH
to force it to find the cross-compile version first.
Good luck,
---
brett
On Fri, 7 Jun 2002 10:45:05
Mark Butcher wrote:
>Thanks Brett
>
>That was a great tip.
>
>I cleaned up my installation and followed the instruction (except for the
>bit about Linux). After downloading and building the latest binutils
>version for the target (Mcore) the assembler worked and believe the
>compiler and some libraries where successfully built (worked for about 2
>hours).
>
>The build didn't work completely though and aborted with an error while
>configuring for
>>>Configuring in mcore-elf/libstdc++-v3
>>>..
>>>checking for exception model to use... configure: error: unable to detect
>exception model
>>>make: *** [configure-target-libstdc++-v3] Error 1
>
>It am very sure that this error is not caused by me doing something wrong
>because the instructions are very good - probably the first ones I have
>really understood, with details of exactly what should be entered (typed
>in) and not just instructions which require some more detailed knowledge of
>the environment before being able to follow them.
>
>Although there was an error I continued with the install, which didn't seem
>to compain, after which I have "mcore-elf-gcc.exe" in my bin directory.
>This seems to run but probably the linker doesn't - it gives an error "ld:
>cannot open crt0.o: No such file or directory" Probably this is not the
>target linker because there is no such file in the mcore library (I find it
>in cygwin/lib). I assume the standard linker is being called since the
>linker never got built / installed correctly.
>
>
>You said you are also new to all this. Have you had success in building ?
>Any ideas how to best continue ? I wonder whether the Mcore works with the
>lastes version - I have not been able to find a test report about it
>anywhere.
>
>Cheers
>
>Mark
>
>
>
_______________________________________________________
WIN a first class trip to Hawaii. Live like the King of Rock and Roll
on the big Island. Enter Now!
http://r.lycos.com/r/sagel_mail/http://www.elvis.lycos.com/sweepstakes
More information about the Gcc-help
mailing list