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

Neil Williams <[email protected]>
Newsgroups gmane.linux.debian.devel.embedded
Message-ID <[email protected]>
On Fri, 14 Sep 2012 15:13:50 +0200
José Luis García Pallero <[email protected]> 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
=============
http://www.linux.codehelp.co.uk/
signature.asc (application/pgp-signature, 836 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBCAAGBQJQU0apAAoJEPFn5DyBQ7aCqBsQAI1OQ1znqJe9wUyL4xoKpK55
+EnC9NQQ7uvTW9dC6wGey8gn03yJ5zQ9LjlgjChnSxepebP8hN1XDypy7zEZNY9G
tG47unTObxWPigh1+J55yv995dlIx6ustA6nHX2oJ3pCer/Ps30vIF8+V+GYvJpu
CVOcNPqYvw/Oz5Qb7cX/4NJH99IfbwF848x6I5uMBLRhQ9Bs8w9LoVfs7W0zE1uY
CMUiZO/KIwyQeEtrucBVzniYNVFLK/Pd/9oZ8LlwiYfs45tZ2nvhenDN5GJ0pf45
QIhEJBkeLSdrKjif8GGYUswW2va6FkF2TI6zxMZl2TBEkhRX3qS9D44Zo0tTdcWW
WCqVkjz0OSnZ+CZ+lXKLqulyLoh3cwZVRZ5wmhzc0dzcnH6Yi2n+ho5xNZZzoW8z
uWDKgrcP9QHEVUDKzh7l02lHchxk5uIWE6+nspNtoGLP5jrdUAhxFLLqUh3VYDpe
EUSzWdh/f3tj93EAmuWi/QAynNP5pPLssQLgWIm42w+pltuIEh3cuD33CWCQw9oD
IWoLfl3Akfr7j7PnpCQcb/iKvXFL6H/1ZG2EN0cGaX01Y8MR/plU19VGg/aT0jIt
VbB+kWaptNGBA5jArN/pYQnO/e/fQQIk4h0kVjZ9oRCC6fqv4o6ZnlQydcLcJPSU
Kie7vbzOSdHHytEhjec5
=P49Y
-----END PGP SIGNATURE-----
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.