<div dir="ltr">Hi,<div><br></div><div>I am trying to build libclc for arm or x86_64 by slightly modifying the configure file(adding x86_64 and arm as available target).</div><div><br></div><div>I just bumped into some problems: It can't build all the functions correctly. </div>
<div><br></div><div>x86_64: <a href="http://cross.cl">cross.cl</a> <a href="http://dot.cl">dot.cl</a> <a href="http://fmax.cl">fmax.cl</a>, <a href="http://fmin.cl">fmin.cl</a> ... etc are ok. When it comes to <a href="http://hypot.cl">hypot.cl</a>, it fails.</div>
<div><br></div><div>the following are the error msg.</div><div><br></div><div><div>LLVM-CC x86_64--linux/lib/math/hypot.cl.bc</div><div>Intrinsic name not mangled correctly for type arguments!</div><div>double (double)* @llvm.sqrt.v2f32</div>
<div>Broken module found, compilation aborted!</div><div>0  <a href="http://libLLVM-3.4svn.so">libLLVM-3.4svn.so</a> 0x00002ae689a530f2 llvm::sys::PrintStackTrace(_IO_FILE*) + 34</div><div>1  <a href="http://libLLVM-3.4svn.so">libLLVM-3.4svn.so</a> 0x00002ae689a524d9</div>
<div>2  libpthread.so.0   0x00002ae68aa6fcb0</div><div>3  libc.so.6         0x00002ae68b1ca425 gsignal + 53</div><div>4  libc.so.6         0x00002ae68b1cdb8b abort + 379</div><div>5  <a href="http://libLLVM-3.4svn.so">libLLVM-3.4svn.so</a> 0x00002ae689284838</div>
<div>6  <a href="http://libLLVM-3.4svn.so">libLLVM-3.4svn.so</a> 0x00002ae689292523</div><div>7  <a href="http://libLLVM-3.4svn.so">libLLVM-3.4svn.so</a> 0x00002ae689269e2f llvm::FPPassManager::runOnFunction(llvm::Function&) + 607</div>
<div>8  <a href="http://libLLVM-3.4svn.so">libLLVM-3.4svn.so</a> 0x00002ae689269f67 llvm::FunctionPassManagerImpl::run(llvm::Function&) + 167</div><div>9  <a href="http://libLLVM-3.4svn.so">libLLVM-3.4svn.so</a> 0x00002ae68926a11d llvm::FunctionPassManager::run(llvm::Function&) + 205</div>
<div>10 clang             0x0000000000765125 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 3429</div>
<div>11 clang             0x00000000007626cd</div><div>12 clang             0x000000000090a1b4 clang::ParseAST(clang::Sema&, bool, bool) + 372</div><div>13 clang             0x00000000005dc45a clang::FrontendAction::Execute() + 282</div>
<div>14 clang             0x00000000005bf6f0 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 352</div><div>15 clang             0x00000000005a54ea clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1722</div>
<div>16 clang             0x000000000059e850 cc1_main(char const**, char const**, char const*, void*) + 1232</div><div>17 clang             0x000000000059ce0e main + 622</div><div>18 libc.so.6         0x00002ae68b1b576d __libc_start_main + 237</div>
<div>19 clang             0x000000000059e211</div><div>Stack dump:</div><div>0.  Program arguments: /home/mtk04454/packages/llvm-svn/bin/clang -cc1 -triple x86_64--linux -emit-llvm-bc -disable-free -main-file-name <a href="http://hypot.cl">hypot.cl</a> -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.22 -coverage-file /home/mtk04454/libclc.build/x86_64--linux/lib/math/hypot.cl.bc -resource-dir /home/mtk04454/packages/llvm-svn/bin/../lib/clang/3.4 -dependency-file x86_64--linux/lib/math/hypot.cl.bc.d -MT x86_64--linux/lib/math/hypot.cl.bc -D cl_clang_storage_class_specifiers -D cl_khr_fp64 -I ../libclc/generic/lib/math -I ../libclc/generic/include -internal-isystem /usr/local/include -internal-isystem /home/mtk04454/packages/llvm-svn/bin/../lib/clang/3.4/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir /home/mtk04454/libclc.build -ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-runtime=gcc -fobjc-default-synthesize-properties -fdiagnostics-show-option -vectorize-slp -o x86_64--linux/lib/math/hypot.cl.bc -x cl ../libclc/generic/lib/math/<a href="http://hypot.cl">hypot.cl</a></div>
<div>1.  <eof> parser at end of file</div><div>2.  Per-function optimization</div><div>3.  Running pass 'Module Verifier' on function '@_Z5hypotDv2_fS_'</div><div>clang: error: unable to execute command: Aborted (core dumped)</div>
<div>clang: error: clang frontend command failed due to signal (use -v to see invocation)</div><div>clang version 3.4 (trunk 188858)</div><div>Target: x86_64--linux</div><div>Thread model: posix</div></div><div><br></div>
<div>===</div><div><br></div><div>It says it does not mangle correctly, but it does not show up at r600 and ptx.</div><div><br></div><div>Does anyone know how to build libclc for arm or x86_64 correctly?</div><div><br></div>
<div>Thanks your kindly help very much.</div></div>