LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Busybox Syntax error: word unexpected (expecting ")") (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/busybox-syntax-error-word-unexpected-expecting-834916/)

asprakash 09-28-2010 05:25 AM

Busybox Syntax error: word unexpected (expecting ")")
 
Hi,
When I tried compile an simple hello world program on ARM9 board by using Busybox 1.15.3, I am getting the error,
Syntax error: word unexpected (expecting ")")

"file busybox" output:: busybox: ELF 32-bit LSB executable, ARM, version 1, statically linked, for GNU/Linux 2.4.3, stripped

"file Hello" output:: hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped


Help me solve the issue.

-Prakash

GrapefruiTgirl 09-28-2010 05:27 AM

Probably would be a good idea to show us the source code of this program you're trying to compile; the error might be just as simple as it reads: You're missing a ")" somewhere. Shouldn't be hard to spot, but it would help to see the code.

asprakash 09-28-2010 07:59 AM

Hi,
Its an simple hello world program using by C language.

/********************************/
#include<stdio.h>
void main()
{
printf("Hello world\n");

}
/*******************************/

Tested the above program in x86. Its working fine.
I guess there is something wrong to the library links.
It is not helpful for me, http://www.mail-archive.com/uclibc@u.../msg03394.html

-Prakash

GrapefruiTgirl 09-28-2010 08:10 AM

Hm, that is odd.

Not sure what to suggest, but the program compiled and ran for me (yes, totally different architecture), and here's the `file` and `ldd` info, in case it helps at all:
Code:

sasha@reactor: gcc -o hello hello.c
sasha@reactor: hello
Hello world
sasha@reactor: ldd hello
        linux-vdso.so.1 =>  (0x00007fff4cbff000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f0c30061000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f0c303d6000)
sasha@reactor: file hello
hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
sasha@reactor:


asprakash 09-28-2010 09:38 AM

Thanks for the hint.
Seems, the binary on ARM is looking for some libraries. I tried the same ldd for ARM version of hello executable. But getting the error,
ldd: exited with unknown exit code (126)

-Prakash

jf.argentino 10-02-2010 05:40 AM

This is something like binaries incompatibility, IMHO nothing to deal with busybox, busybox is just a light version of useful tools for embedded system. I'll look to the cross-compiler version used for the libc of your target and the libc you're linking your application with....

asprakash 10-13-2010 02:22 AM

[Solved]
 
You are correct.
I copied the libc and ld-linux library from the arm cross-compiler libc into my target root filesystems /lib. Now the program is working fine.

-Prakash


All times are GMT -5. The time now is 05:35 PM.