<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">The linker on AIX uses -e to indicate
the executable's entry point. Remove "-export-dynamic" from your
linking options.<br>
<br>
-K<br>
<br>
<br>
On 8/30/2012 9:44 AM, Marcel Bink wrote:<br>
</div>
<blockquote
cite="mid:5D35FFC912854047B220F668682B6037B75FA1@ccv-arn-exmb03.ccveu.local"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.E-mailStijl17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Has anyone succeeded in
building llvm on AIX?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Currently I am
investigating several tools for code analyses and I came
upon Clang. We at CCV run our core business applications on
RS6000/AIX. At our department we develop those applications.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The reviews on clang
look very promising. I was able to build and run it on Linux
(SuSE 12.1) without any problems. I tested it with valgrind
sources and was impressed by the issues it found.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Building it on AIX is a
total disaster however. I had to add some code (added
dladdr() function), change Makefiles etc. but that wasn’t to
much of an issue.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I first tried to build
it using cmake<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">That stopped at the
point of not being able to find
</span><b><span style="font-family:"Courier New""
lang="EN-US">mach-o/dyld.h</span></b><span lang="EN-US">.
After fixing that, lots of 'undeclared' (symbols), 'unknown
type name' and 'dereferencing pointer to incomplete type'
errors came up.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">After that, I made a new
build directory and followed the 'Getting Started with LLVM'
instructions. That is, using configure.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Running make returned
the following errors:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">llvm-3.1/llvm/lib/Support/DynamicLibrary.cpp:
In static member function 'static
llvm::sys::DynamicLibrary
llvm::sys::DynamicLibrary::getPermanentLibrary(const
char*, std::string*)':<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">llvm-3.1/llvm/lib/Support/DynamicLibrary.cpp:77:56:
error: 'dlopen' was not declared in this scope<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">llvm-3.1/llvm/lib/Support/DynamicLibrary.cpp:79:35:
error: 'dlerror' was not declared in this scope<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">llvm-3.1/llvm/lib/Support/DynamicLibrary.cpp:96:19:
error: 'dlclose' was not declared in this scope<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">llvm-3.1/llvm/lib/Support/DynamicLibrary.cpp:
In member function 'void*
llvm::sys::DynamicLibrary::getAddressOfSymbol(const
char*)':<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">llvm-3.1/llvm/lib/Support/DynamicLibrary.cpp:104:32:
error: 'dlsym' was not declared in this scope<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">llvm-3.1/llvm/lib/Support/DynamicLibrary.cpp:
In static member function 'static void*
llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(const
char*)':<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">llvm-3.1/llvm/lib/Support/DynamicLibrary.cpp:145:39:
error: 'dlsym' was not declared in this scope<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">llvm-3.1/llvm/lib/Support/DynamicLibrary.cpp:
In member function 'void*
llvm::sys::DynamicLibrary::getAddressOfSymbol(const
char*)':<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">llvm-3.1/llvm/lib/Support/DynamicLibrary.cpp:105:1:
warning: control reaches end of non-void function
[-Wreturn-type]<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I don't remember how I
fixed that. </span>
<b><span style="font-family:"Courier New""
lang="EN-US">dlfcn.h</span></b><span lang="EN-US"> was
already included in
</span><b><span style="font-family:"Courier New""
lang="EN-US">DynamicLibrary.cpp</span></b><span
lang="EN-US">. Anyway, somehow I managed.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Now building llvm stops
at the point of linking
</span><b><span style="font-family:"Courier New""
lang="EN-US">fpcmp</span></b><span lang="EN-US">. It
compiles
</span><b><span style="font-family:"Courier New""
lang="EN-US">fpcmp.cpp</span></b><span lang="EN-US">
alright, but make comes with the following messages:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">llvm[2]: Compiling fpcmp.cpp for
Release build<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">llvm[2]: Linking Release
executable fpcmp (without symbols)<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">ld: 0706-027 The -R $ORIGIN/../lib
flag is ignored.<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">ld: 0706-027 The -R
/ccvunix/cdndev/user/cdndadm/Tools/llvm-3.0/build/Release/bin
flag is ignored.<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">ld: 0711-327 WARNING: Entry point
not found: xport-dynamic<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">ld: 0711-244 ERROR: No csects or
exported symbols have been saved.<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">collect2: error: ld returned 8
exit status<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">make[2]: ***
[/ccvunix/cdndev/user/cdndadm/Tools/llvm-3.0/build/Release/bin/fpcmp]
Error 1<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">make[2]: Leaving directory
`/ccvunix/cdndev/user/cdndadm/Tools/llvm-3.0/build/utils/fpcmp'<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">make[1]: *** [fpcmp/.makeall]
Error 2<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">make[1]: Leaving directory
`/ccvunix/cdndev/user/cdndadm/Tools/llvm-3.0/build/utils'<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span style="font-family:"Courier
New"" lang="EN-US">make: *** [all] Error 1<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I’ve searched the
internet and tried al suggestions that were given for this
error message. None of them, however, in combination with
llvm. Nothing worked. I really would like to use clang, but
I am desperate on how to continue. I tried cross compiling
it on the linux machine, but that wasn’t a straight forward
action either. At least not for me. I started with llvm
version 3.1 and tried 3.0. Alas, no luck.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I tried gcc version
4.2.0-3, version 4.6.2 and version 4.7.1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I'm working on a RS6000,
AIX 6.1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Does anyone have any
ideas on how to solve this?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal">Thanks<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Marcel<o:p></o:p></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation</pre>
</body>
</html>