Static compilation: segmentation fault in execution [host=x86_64, target: ia64]

José Luis García Pallero <[email protected]>
Newsgroups gmane.linux.debian.devel.embedded
Message-ID <CAFemY3Y0stB=LRarBbtCeUMS9_BtY+-asd5+ywuagBFJXV=pwA@mail.gmail.com>
Hello:

I have installed in my x86_64 machine running Debian Sid the cross
compiler for ia64 from emdebian squeeze. I need to run my programs in
an old Altix 3700 Bx2 machine with 64 CPUs, and I need the cross
compiler because the machine has very old compilers (no OpenMP, etc.)
Because the machine has old libraries and kernel (Linux 2.4) I need to
generate the executables statically linked. The problem is when I run
them.

I have problems with a simple Hello world program

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

If I compile it dynamically linked, the executable runs without
problems in the ia64 environment, but if I compile it statically
linked (ia64-linux-gnu-gcc -static hello.c -o hello), when I try to
run in the ia64 machine I obtain a segmentation fault:

ia64-linux-gnu-gcc -static hello.c -o hello_static
./hello_static
Segmentation fault

Is it a bug?

Thanks

-- 
*****************************************
José Luis García Pallero
[email protected]
(o<
/ / \
V_/_
Use Debian GNU/Linux and enjoy!
*****************************************
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.