Re: Big endian libgcc for arm7tdmi

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Big endian libgcc for arm7tdmi

Jonathan Larmour-2
Ilija Koco wrote:
> I am porting eCos to a big endian arm7tdmi processor and i get linker
> messages that libgcc.a is little endian. Wehre can i get a big endian lib.
> I am using gcc ver 3.2.1 installed from eCos web site.

Version 3.2.1 does not contain big endian support. Follow the instructions
at http://ecos.sourceware.org/build-toolchain.html to build a GCC with the
big endian patch supplied there.

Jifl
--
--["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Reply | Threaded
Open this post in threaded view
|

Re: Re: Big endian libgcc for arm7tdmi

Ilija Kocho [Илија Кочо]
Many thanks for prompt response Jonathan

The compiler itself seem to work big endian.  have successfully compiled
and executed some code. The problem is that libgcc.a is compiled only
for little endian. I would compile new compiler anyway but then I would
look for later version. What are latest tool/lib versions
tested/recommended for eCos?

regards
Ilija


Jonathan Larmour wrote:

> Ilija Koco wrote:
>> I am porting eCos to a big endian arm7tdmi processor and i get linker
>> messages that libgcc.a is little endian. Wehre can i get a big endian
>> lib.
>> I am using gcc ver 3.2.1 installed from eCos web site.
>
> Version 3.2.1 does not contain big endian support. Follow the
> instructions at http://ecos.sourceware.org/build-toolchain.html to
> build a GCC with the big endian patch supplied there.
>
> Jifl


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Reply | Threaded
Open this post in threaded view
|

Re: Re: Big endian libgcc for arm7tdmi

Ilija Kocho [Илија Кочо]
In reply to this post by Jonathan Larmour-2
I have tried to compile gcc with big-endian, and other patches but
compilation (assembler) fails. At ecos archive i found out that it can
be due to execution of wrong as so I added /usr/bin at the beginning of
PATH i.e.
PATH=/gnutools/bin/:usr/bin:$PATH; export PATH giving (copy-pasted from
set command output):

PATH=/gnutools/bin:/usr/bin:/usr/kerberos/sbin:/home/arm/bin:/opt/ecos/gnutools/arm-elf/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin

but it still fails please see make.out extract below:
It it matters my platform is Linux (Fedora Core 4) gcc version 3.4.2

--------- make.out extract
-------------------------------------------------------
/tmp/build/gcc/gcc/xgcc -B/tmp/build/gcc/gcc/ -nostdinc
-B/tmp/build/gcc/arm-elf/newlib/ -isystem
/tmp/build/gcc/arm-elf/newlib/targ-include -isystem
/root/src/gnutools/gcc-3.2.1/newlib/libc/include
-B/gnutools/arm-elf/bin/ -B/gnutools/arm-elf/lib/ -isystem
/gnutools/arm-elf/include -O2  -DIN_GCC -DCROSS_COMPILE   -W -Wall
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem
./include  -Dinhibit_libc -fno-inline -g  -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I.
-I/root/src/gnutools/gcc-3.2.1/gcc -I/root/src/gnutools/gcc-3.2.1/gcc/.
-I/root/src/gnutools/gcc-3.2.1/gcc/config
-I/root/src/gnutools/gcc-3.2.1/gcc/../include -DL_udivsi3
-xassembler-with-cpp -c
/root/src/gnutools/gcc-3.2.1/gcc/config/arm/lib1funcs.asm -o
libgcc/./_udivsi3.o
/root/src/gnutools/gcc-3.2.1/gcc/config/arm/lib1funcs.asm: Assembler
messages:
/root/src/gnutools/gcc-3.2.1/gcc/config/arm/lib1funcs.asm:1: Error: junk
at end of line, first unrecognized character is `@'
/root/src/gnutools/gcc-3.2.1/gcc/config/arm/lib1funcs.asm:2: Error: junk
at end of line, first unrecognized character is `@'
/root/src/gnutools/gcc-3.2.1/gcc/config/arm/lib1funcs.asm:153: Error: no
such instruction: `work .req r4@XXXX is this safe?'
/root/src/gnutools/gcc-3.2.1/gcc/config/arm/lib1funcs.asm:154: Error: no
such instruction: `dividend .req r0'
------------------make out end
extract---------------------------------------------

Jonathan Larmour wrote:

> Ilija Koco wrote:
>> I am porting eCos to a big endian arm7tdmi processor and i get linker
>> messages that libgcc.a is little endian. Wehre can i get a big endian
>> lib.
>> I am using gcc ver 3.2.1 installed from eCos web site.
>
> Version 3.2.1 does not contain big endian support. Follow the
> instructions at http://ecos.sourceware.org/build-toolchain.html to
> build a GCC with the big endian patch supplied there.
>
> Jifl


--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Reply | Threaded
Open this post in threaded view
|

Re: Re: Big endian libgcc for arm7tdmi

Jonathan Larmour-2
Ilija Koco wrote:

> I have tried to compile gcc with big-endian, and other patches but
> compilation (assembler) fails. At ecos archive i found out that it can
> be due to execution of wrong as so I added /usr/bin at the beginning of
> PATH i.e.
> PATH=/gnutools/bin/:usr/bin:$PATH; export PATH giving (copy-pasted from
> set command output):
>
> PATH=/gnutools/bin:/usr/bin:/usr/kerberos/sbin:/home/arm/bin:/opt/ecos/gnutools/arm-elf/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin
>
> but it still fails please see make.out extract below:
> It it matters my platform is Linux (Fedora Core 4) gcc version 3.4.2

Did you build the binutils first? Are they in /gnutools/bin ?

Jifl

--
--["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Reply | Threaded
Open this post in threaded view
|

Re: Re: Big endian libgcc for arm7tdmi

Ilija Kocho [Илија Кочо]
Jonathan Larmour wrote:

> Ilija Koco wrote:
>> I have tried to compile gcc with big-endian, and other patches but
>> compilation (assembler) fails. At ecos archive i found out that it can
>> be due to execution of wrong as so I added /usr/bin at the beginning of
>> PATH i.e.
>> PATH=/gnutools/bin/:usr/bin:$PATH; export PATH giving (copy-pasted from
>> set command output):
>>
>> PATH=/gnutools/bin:/usr/bin:/usr/kerberos/sbin:/home/arm/bin:/opt/ecos/gnutools/arm-elf/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin
>>
>>
>> but it still fails please see make.out extract below:
>> It it matters my platform is Linux (Fedora Core 4) gcc version 3.4.2
>
> Did you build the binutils first? Are they in /gnutools/bin ?
Well, it works better when you connected :-)
Actually I thought i did, irc that i hit make command but nothing was
built (maybe some mistype) - i wondered because it exited so fast
(immediately)...
Now gcc it compiled once I built binutils.

Now another issue: when I was compiling insight I got an error "label at
end of compound" at line 2752 of file arm-tdep.c
I opened arm-tdep.c and found out that error is at label default: of
switch statement (see listing original). I added break; (see listing
"corrected") and it compiled.
Note: In listings error/"correction" are commented with C++ // comment.
Now insight seem to work but I'm a little bit wondered:

1. I think that there isn't error in original file - is there a problem
with my compiler? GCC version 3.4.2?
2. If this error appears, probably I'm not 1st person that got it - or
am I?! Is there a problem with my configuration?

Listings:

--------listing
original---------------------------------------------------------------

arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
  struct gdbarch_tdep *tdep;
  struct gdbarch *gdbarch;
  enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;

  /* Try to deterimine the ABI of the object we are loading.  */

  if (info.abfd != NULL)
    {
      osabi = gdbarch_lookup_osabi (info.abfd);
      if (osabi == GDB_OSABI_UNKNOWN)
    {
      switch (bfd_get_flavour (info.abfd))
        {
        case bfd_target_aout_flavour:
          /* Assume it's an old APCS-style ABI.  */
          osabi = GDB_OSABI_ARM_APCS;
          break;

        case bfd_target_coff_flavour:
          /* Assume it's an old APCS-style ABI.  */
          /* XXX WinCE?  */
          osabi = GDB_OSABI_ARM_APCS;
          break;

        default:              // ERROR ocured here
          /* Leave it as "unknown".  */
        }
--------end of listing
original---------------------------------------------------------------

--------- listing "corrected"
------------------------------------------------------------------
arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
  struct gdbarch_tdep *tdep;
  struct gdbarch *gdbarch;
  enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;

  /* Try to deterimine the ABI of the object we are loading.  */

  if (info.abfd != NULL)
    {
      osabi = gdbarch_lookup_osabi (info.abfd);
      if (osabi == GDB_OSABI_UNKNOWN)
    {
      switch (bfd_get_flavour (info.abfd))
        {
        case bfd_target_aout_flavour:
          /* Assume it's an old APCS-style ABI.  */
          osabi = GDB_OSABI_ARM_APCS;
          break;

        case bfd_target_coff_flavour:
          /* Assume it's an old APCS-style ABI.  */
          /* XXX WinCE?  */
          osabi = GDB_OSABI_ARM_APCS;
          break;

        default:
            /* Leave it as "unknown".  */
            break;  // I added this line
        }
    }

--------- end of listing "corrected"
------------------------------------------------------------------

regards
Ilija

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Reply | Threaded
Open this post in threaded view
|

Re: Re: Big endian libgcc for arm7tdmi

Jonathan Larmour
Ilija Koco wrote:

>
> Now another issue: when I was compiling insight I got an error "label at
> end of compound" at line 2752 of file arm-tdep.c
> I opened arm-tdep.c and found out that error is at label default: of
> switch statement (see listing original). I added break; (see listing
> "corrected") and it compiled.
> Note: In listings error/"correction" are commented with C++ // comment.
> Now insight seem to work but I'm a little bit wondered:
>
> 1. I think that there isn't error in original file - is there a problem
> with my compiler? GCC version 3.4.2?
> 2. If this error appears, probably I'm not 1st person that got it - or
> am I?! Is there a problem with my configuration?

It's possible you're the first to build a moderately old Insight with a
fairly recent GCC. Your fix is right, don't worry about it :).

Jifl
--
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
Visit us at Embedded World 2006, Nürnberg, Germany, 14-16 Feb, Stand 11-222
------["The best things in life aren't things."]------      Opinions==mine

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss