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

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



2012/9/14 Neil Williams <codehelp@debian.org>:
> 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?)

It's impossible and I'm not the maintainer of the machine. It runs and
old RedHat Linux version and the maintainers probably do not approve
the change :(

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

The example I pasted is very simple. I need to compile programs that
link with recent libraries that are not installed in the ia64 machine.
For example, libgomp for OpenMP or modern versions of Lapack, PLASMA,
etc. And install lolaccly all dependencies from source is not an
option. This is the reason for the static link with the libraries in
the host machine in which I compile

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

Mmmm. I have hor enough knowledge about gdb to do this...

>
> --
>
>
> Neil Williams
> =============
> http://www.linux.codehelp.co.uk/
>



-- 
*****************************************
José Luis García Pallero
jgpallero@gmail.com
(o<
/ / \
V_/_
Use Debian GNU/Linux and enjoy!
*****************************************


Reply to: