public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Problems with ecosSWtools and thumb-elf
@ 1999-07-12  5:23 Geir Harris Hedemark
  1999-07-12  6:23 ` Ian Lance Taylor
  1999-07-12  6:39 ` Jonathan Larmour
  0 siblings, 2 replies; 8+ messages in thread
From: Geir Harris Hedemark @ 1999-07-12  5:23 UTC (permalink / raw)
  To: ecos-discuss

I have been looking into using ecos and its tools for an embedded
ARM7TDMI ASIC we are doing.

I seem to be able to compile to the arm-elf target without problems,
but when I compile for the thumb-elf target, things move into an
endless loop when libgcc1 and libgcc2 is compiled.

I am compiling on a Solaris 2.6 box. config.status looks like this for
the thumb-arb target:

../ecosSWtools-arm-990321/src/configure
--with-gcc-version-trigger=/data/nova/imp/software/ecosSWtools-arm-990321/src/gcc/version.c
--host=sparc-sun-solaris2.6 --target=thumb-elf
--prefix=/local/hacks/arm --nf --norecursion

My $PATH is pruned maximally. That should not cause any problems,
especially since arm-elf seems to compile ok and provide usable code.

Two questions: Has anyone run into similar problems and been able to
solve them? I have looked at the gcc Makefiles, and they have
significant differences, but none I am competent enough to point an
accusatory finger at.

If not, could someone please throw the appropriate .a files in my
direction (libgcc1.a and libgcc2.a, I guess)? I don't have access to
any commercial tools I can compile the assembly files with since we
wanted to check the cygnus tools out before spending an enourmous
amount of money.

Geir

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

* Re: [ECOS] Problems with ecosSWtools and thumb-elf
  1999-07-12  5:23 [ECOS] Problems with ecosSWtools and thumb-elf Geir Harris Hedemark
@ 1999-07-12  6:23 ` Ian Lance Taylor
  1999-07-12  6:39 ` Jonathan Larmour
  1 sibling, 0 replies; 8+ messages in thread
From: Ian Lance Taylor @ 1999-07-12  6:23 UTC (permalink / raw)
  To: geir; +Cc: ecos-discuss

   From: Geir Harris Hedemark <geir@dod.no>
   Date: 12 Jul 1999 14:23:27 +0200

   I seem to be able to compile to the arm-elf target without problems,
   but when I compile for the thumb-elf target, things move into an
   endless loop when libgcc1 and libgcc2 is compiled.

Are you sure it is an endless loop?  gcc compiles those libraries
several times with slightly different options (probably about 8
different choices for thumb-elf).  Take a close look at the
compilation lines to see whether the options might be different each
time around the loop.  If so, the loop will eventually terminate.

Ian

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

* Re: [ECOS] Problems with ecosSWtools and thumb-elf
  1999-07-12  5:23 [ECOS] Problems with ecosSWtools and thumb-elf Geir Harris Hedemark
  1999-07-12  6:23 ` Ian Lance Taylor
@ 1999-07-12  6:39 ` Jonathan Larmour
  1999-07-12  7:39   ` Geir Harris Hedemark
  1999-07-13  3:35   ` Geir Harris Hedemark
  1 sibling, 2 replies; 8+ messages in thread
From: Jonathan Larmour @ 1999-07-12  6:39 UTC (permalink / raw)
  To: geir; +Cc: ecos-discuss

In article < xq3pv1yoy4g.fsf@hridil.ifi.uio.no > you write:
>I have been looking into using ecos and its tools for an embedded
>ARM7TDMI ASIC we are doing.
>
>I seem to be able to compile to the arm-elf target without problems,
>but when I compile for the thumb-elf target, things move into an
>endless loop when libgcc1 and libgcc2 is compiled.

Are you sure that this isn't just multilib generation? There are a lot
of multilibs to build as I recall.

But in any case, there were some problems with the thumb support in the
eCosSWtools compiler we put out. We have fixed these now, but since
thumb-elf isn't a supported eCos toolchain target, we won't be doing
an update.

In fact, the best thing to do is use egcs. Most eCos targets should now
work with egcs (although I know sparclite doesn't). If anyone is feeling
energetic, they could give that a try.

egcs is at http://egcs.cygnus.com/ You may also want to use the latest
binutils from http://sourceware.cygnus.com/binutils and gdb from
http://sourceware.cygnus.com/gdb

If you do go down that route, let the list know how you get on, and just
ask if you have any problems. I'm sure someone should be able to help.

Jifl
-- 
Cygnus Solutions, 35 Cambridge Place, Cambridge, UK.  Tel: +44 (1223) 728762
"I used to have an open mind but || Get yer free open source RTOS's here...
 my brains kept falling out."    || http://sourceware.cygnus.com/ecos
Help fight spam! http://spam.abuse.net/  These opinions are all my own fault

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

* Re: [ECOS] Problems with ecosSWtools and thumb-elf
  1999-07-12  6:39 ` Jonathan Larmour
@ 1999-07-12  7:39   ` Geir Harris Hedemark
  1999-07-13  3:35   ` Geir Harris Hedemark
  1 sibling, 0 replies; 8+ messages in thread
From: Geir Harris Hedemark @ 1999-07-12  7:39 UTC (permalink / raw)
  To: Jonathan Larmour; +Cc: ecos-discuss

I will just answer this one message. Thanks to all of the other people
who have answered.

jlarmour@cygnus.co.uk (Jonathan Larmour) writes:
> Are you sure that this isn't just multilib generation? There are a lot
> of multilibs to build as I recall.

No, I am not sure. The makefile looked like it compiled the same thing
over and over, and since it looked identical...

I will have a further look tomorrow.

> In fact, the best thing to do is use egcs. Most eCos targets should now
> work with egcs (although I know sparclite doesn't). If anyone is feeling
> energetic, they could give that a try.

Why not. It is too hot to sleep at night anyway.

> If you do go down that route, let the list know how you get on, and just
> ask if you have any problems. I'm sure someone should be able to help.

I will.

Geir

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

* Re: [ECOS] Problems with ecosSWtools and thumb-elf
  1999-07-12  6:39 ` Jonathan Larmour
  1999-07-12  7:39   ` Geir Harris Hedemark
@ 1999-07-13  3:35   ` Geir Harris Hedemark
  1999-07-13 10:47     ` Jonathan Larmour
  1 sibling, 1 reply; 8+ messages in thread
From: Geir Harris Hedemark @ 1999-07-13  3:35 UTC (permalink / raw)
  To: ecos-discuss

jlarmour@cygnus.co.uk (Jonathan Larmour) writes:
> If you do go down that route, let the list know how you get on, and just
> ask if you have any problems. I'm sure someone should be able to help.

I did. I picked up binutils-2.9.1 and egcs-1.1.2. I compiled and
installed binutils first, then egcs. The options to configure were
--target=thumb-coff --prefix=/local/hacks/arm. For some reason there
is no elf support for thumb in binutils-2.9.1. Or was it egcs? I
forget.

1:

Since I will use this in an embedded system which will not run *nix or
even have a filesystem or a terminal, I did not have or need the
standard *.h files (stdio.h and so on). Had to define "inhibit_libc"
when compiling libgcc2.c so xgcc would not barf on some
includes. According to the code, that can lead to problems.

2:

The makefile did not find the assembler by itself, even if I was
compiling egcs with the same prefix as binutils. I had to have
thumb-coff-as in my path.

3:

The tests failed. It said:
checking whether the C compiler (/data/nova/imp/software/gnu/build-egcs/gcc/xgcc -B/data/nova/imp/software/gnu/build-egcs/gcc/ -g -O2 ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
make: *** [configure-target-libiberty] Error 1

However, I was able to generate a .s and a .o file without
problems. If I tried to generate a a.out file directly, ld told me:

/local/hacks/arm/thumb-coff/bin/ld: cannot open crt0.o: No such file or directory
collect2: ld returned 1 exit status

I cannot find this file. However when I link things manually:

DEFAULT:
	$(cc) $(ccflags) -c boot.c
	$(ld) $(ldflags) -Map=image.map -o image.coff boot.o
	$(objcopy) --output-target=tekhex -S --verbose image.coff image.hex

it works ok, assuming I take responsibility for start points and the like.

ldflags = -O2 --cref -M -L/local/hacks/arm/thumb-coff/lib

4:

When I try to use objdump to disassemble what I have just compiled
from tekhex or binary format, I get four-byte instructions, not thumb
code. Disassembling from coff works ok, I get sensible thumb code.

Seems I have solved my most immediate problem(s), but egcs seems to
have poorer cross-target support than the ecos tools. Is this correct?

Geir

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

* Re: [ECOS] Problems with ecosSWtools and thumb-elf
  1999-07-13  3:35   ` Geir Harris Hedemark
@ 1999-07-13 10:47     ` Jonathan Larmour
  1999-07-15  7:13       ` Geir Harris Hedemark
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Larmour @ 1999-07-13 10:47 UTC (permalink / raw)
  To: geir; +Cc: ecos-discuss

In article < xq3k8s496s9.fsf@hridil.ifi.uio.no > you write:
>jlarmour@cygnus.co.uk (Jonathan Larmour) writes:
>> If you do go down that route, let the list know how you get on, and just
>> ask if you have any problems. I'm sure someone should be able to help.
>
>I did. I picked up binutils-2.9.1 and egcs-1.1.2. I compiled and
>installed binutils first, then egcs. The options to configure were
>--target=thumb-coff --prefix=/local/hacks/arm. For some reason there
>is no elf support for thumb in binutils-2.9.1. Or was it egcs? I
>forget.

Not in egcs-1.1.2, no. That's my fault for not specifying which version.
Sorry :-(. The place to get the latest snapshot is
ftp://egcs.cygnus.com/pub/egcs/snapshots/index.html

When gcc-2.95 comes out, you could use that instead.

I believe binutils-2.9.1 should be adequate though.

>Since I will use this in an embedded system which will not run *nix or
>even have a filesystem or a terminal, I did not have or need the
>standard *.h files (stdio.h and so on). Had to define "inhibit_libc"
>when compiling libgcc2.c so xgcc would not barf on some
>includes. According to the code, that can lead to problems.

If you download newlib from ftp://ftp.cygnus.com/pub/newlib/ , and put
symlinks in your egcs tree to the "newlib" and "libgloss" directories
in that distribution, that should work around some of the problems
you had further down. You also won't need to define inhibit_libc I
believe.

>The makefile did not find the assembler by itself, even if I was
>compiling egcs with the same prefix as binutils. I had to have
>thumb-coff-as in my path.

That doesn't surprise me. I think using the PATH is probably the right
thing.

>The tests failed. It said:
[snip] see above

>Seems I have solved my most immediate problem(s), but egcs seems to
>have poorer cross-target support than the ecos tools. Is this correct?

No, not if you have all the parts in place. We should ensure there is
documentation of how to do this for people in future.

Jifl
-- 
Cygnus Solutions, 35 Cambridge Place, Cambridge, UK.  Tel: +44 (1223) 728762
"I used to have an open mind but || Get yer free open source RTOS's here...
 my brains kept falling out."    || http://sourceware.cygnus.com/ecos
Help fight spam! http://spam.abuse.net/  These opinions are all my own fault

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

* Re: [ECOS] Problems with ecosSWtools and thumb-elf
  1999-07-13 10:47     ` Jonathan Larmour
@ 1999-07-15  7:13       ` Geir Harris Hedemark
  1999-07-15  7:35         ` Jonathan Larmour
  0 siblings, 1 reply; 8+ messages in thread
From: Geir Harris Hedemark @ 1999-07-15  7:13 UTC (permalink / raw)
  To: Jonathan Larmour; +Cc: ecos-discuss

jlarmour@cygnus.co.uk (Jonathan Larmour) writes:
> I believe binutils-2.9.1 should be adequate though.

No, it wasn't. The 2.9.1 bfd does not know the arm-unknown-elf target.
*Sigh*

Anyway, trying "make MAKE='make -j 2'" fucked up the compilation. Not
recommended. A "make clean; make" seemed to straighten things out.

> If you download newlib from ftp://ftp.cygnus.com/pub/newlib/ , and put
> symlinks in your egcs tree to the "newlib" and "libgloss" directories
> in that distribution, that should work around some of the problems
> you had further down. You also won't need to define inhibit_libc I
> believe.

Something like

ln -s ../newlib.../newlib newlib
ln -s ../newlib.../libgloss libgloss

?

The egcs configure script say:

geirhh 100 %: ../egcs-19990714/configure --target=arm-elf --prefix=/local/hacks/arm
Configuring for a sparc-sun-solaris2.6 host.
*** This configuration is not supported in the following subdirectories:
     target-libgloss
    (Any other directories should still work fine.)

And this probably makes the whole thing barf when I come to the
fixincludes stage.

It does not seem like egcs supports the thumb-elf target at all.

Geir

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

* Re: [ECOS] Problems with ecosSWtools and thumb-elf
  1999-07-15  7:13       ` Geir Harris Hedemark
@ 1999-07-15  7:35         ` Jonathan Larmour
  0 siblings, 0 replies; 8+ messages in thread
From: Jonathan Larmour @ 1999-07-15  7:35 UTC (permalink / raw)
  To: Geir Harris Hedemark; +Cc: ecos-discuss

Geir Harris Hedemark wrote:
> 
> jlarmour@cygnus.co.uk (Jonathan Larmour) writes:
> > I believe binutils-2.9.1 should be adequate though.
> 
> No, it wasn't. The 2.9.1 bfd does not know the arm-unknown-elf target.
> *Sigh*

Oh well, FWIW it is _definitely_ in a recent binutils snapshot.

> > If you download newlib from ftp://ftp.cygnus.com/pub/newlib/ , and put
> > symlinks in your egcs tree to the "newlib" and "libgloss" directories
> > in that distribution, that should work around some of the problems
> > you had further down. You also won't need to define inhibit_libc I
> > believe.
> 
> Something like
> 
> ln -s ../newlib.../newlib newlib
> ln -s ../newlib.../libgloss libgloss
> 
> ?

Yep. Although it seems that libgloss may be irrelevant after all.

> The egcs configure script say:
> 
> geirhh 100 %: ../egcs-19990714/configure --target=arm-elf --prefix=/local/hacks/arm
> Configuring for a sparc-sun-solaris2.6 host.
> *** This configuration is not supported in the following subdirectories:
>      target-libgloss
>     (Any other directories should still work fine.)
> 
> And this probably makes the whole thing barf when I come to the
> fixincludes stage.

Not sure. Can you send me (not the list) the output at the point it goes
wrong?

Ta,

Jifl
-- 
Cygnus Solutions, 35 Cambridge Place, Cambridge, UK.  Tel: +44 (1223) 728762
"I used to have an open mind but || Get yer free open source RTOS's here...
 my brains kept falling out."    || http://sourceware.cygnus.com/ecos
Help fight spam! http://spam.abuse.net/  These opinions are all my own fault

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

end of thread, other threads:[~1999-07-15  7:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-12  5:23 [ECOS] Problems with ecosSWtools and thumb-elf Geir Harris Hedemark
1999-07-12  6:23 ` Ian Lance Taylor
1999-07-12  6:39 ` Jonathan Larmour
1999-07-12  7:39   ` Geir Harris Hedemark
1999-07-13  3:35   ` Geir Harris Hedemark
1999-07-13 10:47     ` Jonathan Larmour
1999-07-15  7:13       ` Geir Harris Hedemark
1999-07-15  7:35         ` Jonathan Larmour

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).