Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to use DieHard to work around bugs in Citrix IAClient on Linux. I compiled as per the instructions but when I try to use the result, I get this output:

> export LD_PRELOAD=/path/to/DieHard/src/libdiehard.so
> /opt/Citrix/ICAClient/wfica -log $PWD/launch.ica
ERROR: ld.so: object '/home/adigulla/packages/DieHard/src/libdiehard.so' from LD_PRELOAD cannot be preloaded: ignored.

What is causing this error?

Note: I used this command to compile the source on a x86_64 system:

g++ -m32 -finline-functions -malign-double -pipe -march=pentium4 -O3 -DNDEBUG  -I. -Iinclude -Iinclude/layers -Iinclude/util -Iinclude/math -Iinclude/static -Iinclude/rng -Iinclude/hoard -Iinclude/superblocks -IHeap-Layers -DDIEHARD_DIEHARDER=0 -D_REENTRANT=1 -DDIEHARD_MULTITHREADED=1 -shared -D'CUSTOM_PREFIX(x)=diehard##x' Heap-Layers/wrappers/gnuwrapper.cpp source/libdieharder.cpp -Bsymbolic -o libdiehard.so -ldl -lpthread

The result seems to be a 32bit library:

> file /path/to/DieHard/src/libdiehard.so
libdiehard.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=0x053addc2defba6b46714eb5d70fdbede6a401ca8, not stripped
share|improve this question
    
Try to use gdb to debug and post the output of it. gdb /opt/Citrix/ICAClient/wfica -log $PWD/launch.ica – user555 Jul 10 '13 at 9:33
    
When I do that, then ld.so tries to apply the library to GDB as well. This doesn't do any harm but I can't set a breakpoint since the shared object isn't loaded by ld.so. I guess I need to use gdb ld.so but how do I do dynamic linking manually? – Aaron Digulla Jul 10 '13 at 11:54
up vote 0 down vote accepted

DieHard author here.

On a 64-bit Linux system, you should build DieHard using the following make command:

make linux-gcc-x86-64

This will produce a 64-bit shared library, which will be usable by 64-bit executables. Also, you can debug code that relies on LD_PRELOAD by setting that environment variable inside gdb:

$ gdb yourprogram
(gdb) set environment LD_PRELOAD /path/to/DieHard/src/libdiehard.so
(gdb) run
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .