[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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

On Fri, 14 Sep 2012 15:13:50 +0200
José Luis García Pallero <jgpallero@gmail.com> wrote:

> 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.)

Old hardware with old software but have you tried updating the software
to at least a 2.6 kernel (Etch, Lenny or Squeeze?)

> 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

Static linking is not fully supported in Debian and therefore Emdebian.
Sometimes it might work, sometimes it will fail, sometimes it will run
but give you mysterious issues... "behaviour is undefined".

> #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

Then why bother with static linking in the first place?

ia64 packages still exist in Debian, so why stick with the old
versions? Replace what you have with updated packages. Older versions
will be available via archive.debian.org.

>, 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?

You'd have to get a backtrace via gdb. If static linking doesn't work
but dynamic does, there aren't going to be many people in Debian who
will care.


Neil Williams

Attachment: pgp7vn38RO49u.pgp
Description: PGP signature

Reply to: