Linux-x86 Compatability

ISSUE: In Interpreter::getCurrentExecutablePath(), dladdr() is a Solarisism. Luckily, getCurrentExecutablePath isn't being currently used anywhere in lli.

ACTION: Wrap the method contents with #ifdef __sun__ ... #else return ""; #endif. If this functionality is actually desired, it would be more portable to hack up main() to join getcwd() with basename(argv[0]) to find the desired pathname.

PATCH: Apply from llvm top-level directory with "patch -p0."

patch (480 Bytes)

ISSUE: In Interpreter::getCurrentExecutablePath(), dladdr() is a
Solarisism. Luckily, getCurrentExecutablePath isn't being currently
used anywhere in lli.

It looks like under my linux box, the dladdr prototype is wrapped with a
#ifdef __USE_GNU

option... If so, perhaps the write patch is to add -DGNU-SOURCES (or
whatever that option is) to the makefiles? Can you verify that this would
fix it?

Thanks again for the help!

-Chris

http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/

Chris Lattner wrote:

ISSUE: In Interpreter::getCurrentExecutablePath(), dladdr() is a
Solarisism. Luckily, getCurrentExecutablePath isn't being currently
used anywhere in lli.
   
It looks like under my linux box, the dladdr prototype is wrapped with a
#ifdef __USE_GNU

option... If so, perhaps the write patch is to add -DGNU-SOURCES (or
whatever that option is) to the makefiles? Can you verify that this would
fix it?

Thanks again for the help!

-Chris

Ooops. My mistake - you are correct. My other patch that #defines _GNU_SOURCE in tools/lli fixes this issue also. So as long as you apply that patch, you cam simply discard this one.