Author Topic: Using Gcc Directly On The Z  (Read 7532 times)

larrycow

  • Newbie
  • *
  • Posts: 15
    • View Profile
Using Gcc Directly On The Z
« on: March 04, 2006, 06:52:23 am »
I'm trying to compile some world-hailing test program on my zaurus. I installed gcc and, as far as I know, everything needed. But when I'm trying to

Code: [Select]
arm-linux-gcc hello.c  -o hello
I got an ugly

Code: [Select]
/usr/lib/gcc/arm-linux/3.4.3/../../../../arm-linux/bin/ld:/usr/lib/gcc/arm-linux/3.4.3/../../../libc.so: file format not recognized; treating as linker script
/usr/lib/gcc/arm-linux/3.4.3/../../../../arm-linux/bin/ld:/usr/lib/gcc/arm-linux/3.4.3/../../../libc.so:4: syntax error
collect2: ld returned 1 exit status

Would anyone understand this? And, better, explain me why?

Thanks alot.

asm-nai

  • Newbie
  • *
  • Posts: 29
    • View Profile
Using Gcc Directly On The Z
« Reply #1 on: March 06, 2006, 08:18:27 pm »
Quote
I'm trying to compile some world-hailing test program on my zaurus. I installed gcc and, as far as I know, everything needed. But when I'm trying to

Code: [Select]
arm-linux-gcc hello.c  -o hello
I got an ugly

Code: [Select]
/usr/lib/gcc/arm-linux/3.4.3/../../../../arm-linux/bin/ld:/usr/lib/gcc/arm-linux/3.4.3/../../../libc.so: file format not recognized; treating as linker script
/usr/lib/gcc/arm-linux/3.4.3/../../../../arm-linux/bin/ld:/usr/lib/gcc/arm-linux/3.4.3/../../../libc.so:4: syntax error
collect2: ld returned 1 exit status

Would anyone understand this? And, better, explain me why?

Thanks alot.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=116953\"][{POST_SNAPBACK}][/a][/div]

Hi.

You should edit "/usr/lib/libc.so".

 
From
Code: [Select]
/*GNU ld script
  Use the shared library,but some functions are only in
  the static library,so try that secondarily. */
OUTPUT_FORMAT(elf32-littlearm)
GROUP( /lib/libc.so.6 /usr/lib/libc_nonshared.a AS_NEEDED( /lib/ld-linux.so.2) )

To
Code: [Select]
/*GNU ld script
  Use the shared library,but some functions are only in
  the static library,so try that secondarily. */
OUTPUT_FORMAT(elf32-littlearm)
GROUP( /lib/libc.so.6 /usr/lib/libc_nonshared.a  )

Bilding consists of this well in my environment .
GPE on SL-C3000

larrycow

  • Newbie
  • *
  • Posts: 15
    • View Profile
Using Gcc Directly On The Z
« Reply #2 on: March 08, 2006, 03:34:08 pm »
Actually, my /usr/lib/libc.so looks more like this:

Code: [Select]
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
*** BUG in libc/scripts/output-format.sed *** elf32-bigarm,elf32-littlearm
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )

I guess the BUG line can explain a lot of things, but I can't see how to work around this.

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

larrycow

  • Newbie
  • *
  • Posts: 15
    • View Profile
Using Gcc Directly On The Z
« Reply #4 on: March 29, 2006, 05:45:36 pm »
I tried again on the new 3.5.4 release. Loads of packages to install, but at least it looks better (*-symlinks.ipk is the way...).

Still, I can't compile the simplest C program on Earth. Well, actually I can't link it. The linker told me that

Code: [Select]
root@collie:~# gcc -o hello hello.c
/usr/lib/gcc/arm-linux/3.4.4/../../../../arm-linux/bin/ld: cannot find /lib/libc.so.6 inside /usr/bin/../../usr
collect2: ld returned 1 exit status

Would anyone have an idea?

Hakkikkt

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • http://
Using Gcc Directly On The Z
« Reply #5 on: April 08, 2006, 09:32:23 am »
Hoi,
I had  a similar problem with libc6. You should check that you have libc6 installed.
If this is already the case, you should check that libc6.so.6 is in the path ...

Greetings, Georg
« Last Edit: April 08, 2006, 09:32:50 am by Hakkikkt »