maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   arm-linux-gnueabi-gcc, two N900s, two results! (https://talk.maemo.org/showthread.php?t=85916)

reinob 2012-08-06 21:24

arm-linux-gnueabi-gcc, two N900s, two results!
 
Running Ubuntu 12.04 with gcc-4.6-arm-linux-gnueabi, version 4.6.3-1ubuntu5cross1.62.

I made a hello-world program and compiled it like this:

$ arm-linux-gnueabi-gcc -v -marm -o hello hello.c

I then copied hello to two N900s running Maemo5 PR1.3. One is running Nokia-OMAP kernel, the other KP50 (this is at least the most obvious difference).

Code:

OMAP$ ./hello
./hello: line 1: syntax error: unexpected word (expecting ")")

and
Code:

OMAP$ ldd ./hello
        libm.so.6 => /lib/libm.so.6 (0x4002f000)
        libc.so.6 => /lib/libc.so.6 (0x400a5000)
        /lib/ld-linux.so.3 (0x40000000)

On KP50 the executable runs fine and prints the message. Weird is also that ldd gives a different result:

Code:

KP50$ ldd ./hello
        libc.so.6 => /lib/libc.so.6 (0x40031000)
        /lib/ld-linux.so.3 (0x40000000)

How can this be?
I guess I'm missing something obvious. But libc6 is the same on both N900s.

I'd appreciate any pointers!
Thanks in advance.

misiak 2012-08-06 21:37

Re: arm-linux-gnueabi-gcc, two N900s, two results!
 
could you post source code and binary which you tested?

reinob 2012-08-06 22:05

Re: arm-linux-gnueabi-gcc, two N900s, two results!
 
1 Attachment(s)
binary attached. had to gzip it for the forum.
src is your usual #include <stdio.h>, int main(void) .. printf(..)

thanks

Hurrian 2012-08-06 22:43

Re: arm-linux-gnueabi-gcc, two N900s, two results!
 
Which libgcc are you using? IIRC GCC 4.6 needed new libs.

misiak 2012-08-06 23:01

Re: arm-linux-gnueabi-gcc, two N900s, two results!
 
it would be superb if you could test on both devices using stock omap1 kernel and power kernel (e.g. post results on 1st device omap, 1st device pk, 2nd device omap and 2nd device pk), because it may be related to some other stuff as Hurrian suggested. Usual can differ x[
Code:

#include <stdio.h>
int main(void) {
  printf("hello world!\n");
  return 0;
}

right? or without return at the end or something less or more? Sorry for being picky ;)

reinob 2012-08-07 07:44

Re: arm-linux-gnueabi-gcc, two N900s, two results!
 
@misiak,

Will try (but from now on my time will be very limited..)

Note that I also tried making static executables. The outcome was the same.

Note also that I haven't played with binfmt_misc or anything. I'm also using -marm to avoid any thumb/thumb2 issues.

freemangordon 2012-08-07 09:49

Re: arm-linux-gnueabi-gcc, two N900s, two results!
 
well, I don't see any reason libm.so to be linked.

do you have some busybox-power or such installed?

reinob 2012-08-07 12:19

Re: arm-linux-gnueabi-gcc, two N900s, two results!
 
On the N900 where it runs OK:
KP50, busybox-power 1.20.1power2

On the N900 where it doesn't run OK:
Nokia kernel, busybox-power 1.20.1power2

Just in case, /etc/ld.so.conf is identical in both. /lib/ld.linux.so.3 is (in both) a symlink to /lib/ld-2.5.so (both identical).

I also suspected busybox. But I can't understand why.

According to /proc/cpuinfo Nokia Kernel does not have thumbee and neon support (which KP has). But I compiled with -marm.

Still it could be that the kernel doesn't think it's an executable it can handle and gives it to busybox?


All times are GMT. The time now is 19:48.

vBulletin® Version 3.8.8