public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Cross compiler won't build
@ 2002-06-07  7:47 Mark Butcher
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Butcher @ 2002-06-07  7:47 UTC (permalink / raw)
  To: INTERNET:huntbs@lycos.com; +Cc: gcc-help

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cross compiler won't build
@ 2002-06-07 12:55 Mark Butcher
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Butcher @ 2002-06-07 12:55 UTC (permalink / raw)
  To: INTERNET:huntbs@mailcity.com; +Cc: gcc-help

Hi Brett

Another small detail.

I have realised that the problem with the last binutils build was not with
the compiler but with linking a function which could not be found.
print_insn_mcore() is exported in the file mcore-dis.c and seems to be in
the library libopcodes.a which was build somewhere along the line.

Interestingly I have now exactly the same error when repeating the exercise
with the Mcore target again. This means that the original failed build of
the Mcore cross-compiler must screwed something up so that the linker can
not find this library anymore - time to clean up the disk and start again..

I'll get it soon.

Cheers

Mark

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cross compiler won't build
@ 2002-06-07 11:56 Mark Butcher
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Butcher @ 2002-06-07 11:56 UTC (permalink / raw)
  To: INTERNET:huntbs@lycos.com; +Cc: gcc-help

Hi Brett

Here's another piece of information which may be interesting:

I attempted to build another target - this time ARM-ELF. So I created a new
target directory and set up the environment varibles again for this and
started by rebuilding the binutils. Suprisingly the build failed this time
with an error trying to compile (binutils-2.12/opcodes/disassemble.c). The
position in the code which failes is:
#ifdef ARCH_mcore
  case bfd_arch_mcore;
    disassemble = print_insn_mcore;
    break;
#endif
The problem being "undefined reference to ' print_insn_mcore ' ". I haven't
been able to figure out why this error occurs - print_insn_mcore is defined
in a header file (dis_asm.h). I wonder whether there is something left over
somewhere from the previous Mcode build which is disturbing ? Is in
necessary to clear out previous builds (for example by reinstalling cygwin)
when changing targets ?

At the moment it seems like taking one step forward and one step back. How
is your experience - have you managed a build (have just read that you have
- congratulations !) ? Personally I have been working on it for about a
month now in my spare time, which is about one or two hours a day and
possibly up to 10 hours at the weekend. I thought I was getting close today
and took the day free to finally start to use the compiler. The hopes seem
to have been shattered once again - I suppose there must be a reason why
it's so difficult - I have had to learn a lot of new stuff to get this far
but wonder just how much more is needed... Do you know whether some people
give up ?

Cheers

Mark

PS. In answer to your points in your recent mail. I did nollow the
intructions with utmost accuracy, using exactly the same directory
structure and am certain that the binutils were build for cross compiling.
The assembler files were assembled fine and so the assembler must have
understood the Mcore assembler code.
I expect that you are correct when you say that the wrong ld was used,
however I am not sure that it is a path problem (although will repeat the
exercise on a fresh PC at the weekend. After the above attempty I don't
trust anything any more) because I have noticed the following behaviour:
After building there are a number of executables - for example
usr/local/mcore/bin/mcore-elf-gcc.exe which are about 1,5Meg in size. After
the install these seem to be modified and take up only about 250k
aftwareward, in their working form.
I have the file mcore-elf-ld.exe here but have the feeling that it should
be smaller than the present 1,5Meg, probably as a consequence of the build
error I had, causing it not to be installed correctly ??
Next time around I will start with a fresh hard disk, reinstall everything
from scratch, remove any other utilities which may get in the way and
double check all paths at each stage.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cross compiler won't build
@ 2002-06-07  9:10 Brett Hunt
  0 siblings, 0 replies; 5+ messages in thread
From: Brett Hunt @ 2002-06-07  9:10 UTC (permalink / raw)
  To: Mark Butcher; +Cc: gcc-help

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Cross compiler won't build
@ 2002-06-05 16:06 Mark Butcher
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Butcher @ 2002-06-05 16:06 UTC (permalink / raw)
  To: gcc-help

Hi All

Still not getting the Mcore cross compiler to build. My problem is probably
typical since it is documented in a FAQ as follows:

*********************************************************************
5.2 Assembler errors while building GCC's enquire or libgcc.a 

Assembler errors encountered while building enquire or libgcc.a are usually
caused by GCC (the one you just built) not being able to find the right
assembler. Have you installed it in a place where GCC can find it? 

Were GCC and Binutils configured with the same --prefix/--exec-prefix
arguments? 

If the assembler hasn't been installed, the quickest solution is to create
a symbolic link called `as' in the GCC build directory that points to the
assembler to use. 

*********************************************************************

I assume I have this difficulty but don't understand what to do about it.
[Background - successfully configure for Mcore processor and then enter
MAKE - compiles for about 20 mins and the aborts with assembly errors in
lib1.asm]

Here are some direct questions for anyone with the necessary knowledge:


1. When and where should the target assembler be installed ?
2. Is it called gas.exe ? If so, I do not find it anywhere on my computer
3. Is the assembler called from within gcc ? For example if I type "gcc -c
-x assembler-with-cpp crti.asm" I seem to get the same error messages as
during the attempted build.
4. Strangely when I type "gcc -c -x assembler-with-cpp lib1.asm" from the
command line I get no errors and an object file called lib1.o (Probably
because no code is compiled due to missing defines..)
5. What is the relationship between gcc and xgcc ? Is xgcc used during
cross compiling instead of gcc (I suppose it must be) - and where does it
come from ?

Would be grateful for a helping hand - I am indeed learning more and more
about the process but only manage a couple of hours a day study which is
slow and frustrating. A working compiler would certainly boost the moral...

Regards

Mark Butcher

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-06-07 19:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-07  7:47 Cross compiler won't build Mark Butcher
  -- strict thread matches above, loose matches on Subject: below --
2002-06-07 12:55 Mark Butcher
2002-06-07 11:56 Mark Butcher
2002-06-07  9:10 Brett Hunt
2002-06-05 16:06 Mark Butcher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).