I get the following problem building LLVM 2.7 on AIX 6:
gmake: Entering directory `/home/home/ac/psimmons/llvm/llvm-2.7/lib/System'
llvm: Compiling Path.cpp for Release build
In file included from Path.cpp:262:
Unix/Path.inc: In static member function 'static llvm::sys::Path llvm::sys::Path::GetTemporaryDirectory(std::string*)':
Unix/Path.inc:142: error: 'mkdtemp' was not declared in this scope
Unix/Path.inc: In static member function 'static llvm::sys::Path llvm::sys::Path::GetMainExecutable(const char*, void*)':
Unix/Path.inc:365: error: 'Dl_info' was not declared in this scope
Unix/Path.inc:365: error: expected `;' before 'DLInfo'
Unix/Path.inc:366: error: 'DLInfo' was not declared in this scope
Unix/Path.inc:366: error: 'dladdr' was not declared in this scope
gmake: *** [/home/home/ac/psimmons/llvm/llvm-2.7/lib/System/Release/Path.o] Error 1
gmake: Leaving directory `/home/home/ac/psimmons/llvm/llvm-2.7/lib/System'
gmake: *** [all] Error 1
Is this a known problem? How should I go about fixing this?
mkdtemp is missing on at least AIX 5.1:
though it's part of the posix standard.
The dynamic library routines like dladdr and dlinfo don't really seem
to exist on AIX, but that's what you'll need a replacement for. The
way to go about fixing this would be to find the routines that do
exist that will perform something resembling the same tasks and port
the code to use them on AIX.
Sorry there's not much more I can do to help.
Documentation on some AIX routines to do the same thing can be found at http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=/com.ibm.xlcpp8a.doc/proguide/ref/dynamic_load.htm.
Interestingly enough, the same page suggests that AIX does, in fact, support dlopen() and friends for POSIX compatibility. You might need to find out if there's a header file or a #define (e.g. _POSIX) that you need to include/define to get dlopen() and friends working on AIX. The above web page provides the name of an AIX document which should aid in determining how to use dlopen() on AIX.
-- John T.
Eric Christopher wrote:
While dlopen() is part of POSIX, dladdr() and dlinfo() are not. So the
problem is really that Path.inc assumes that if HAVE_DLFNC_H is defined
then it also has dladdr/dlinfo.
The solution is to use realpath(), which is part of POSIX: