<div dir="ltr">Hi,<div><br></div><div>  Is there a complete example that shows how to compile and link a kernel with the latest versions (3.9) of clang and libclc ?</div><div><br></div><div>  After building clang and libclc the compile-test.sh script does not appear to work on any of the kernels in the test directory.  The initial error is due to the absence of the file </div><div>nvptx--nvidiacl/lib/builtins.bc.  I tried changing the command to use builtins.opt.bc but other errors occurred.</div><div><br></div><div>  I've seen some examples online but it isn't clear that any of them are up to date.</div><div><br></div><div>  This command:</div><div><br></div><div>clang -O3  --include /usr/local/include/clc/clc.h -I /usr/local/include/clc -Dcl_clang_storage_class_specifiers -x cl -Xclang -mlink-bitcode-file -Xclang /usr/local/lib/clc/tonga-amdgcn--.bc -target amdgcn--amdhsa -mcpu=tonga -Xclang -cl-std=CL2.0 -DCL20 <a href="http://cos.cl">cos.cl</a> -o cos.bc<br></div><div><br></div><div>fails because clang-3.9 attempts to find ld,lld (which I have not installed since my understanding is that it shouldn't be needed for libclc).<br></div><div><br></div><div>(<a href="http://cos.cl">cos.cl</a> is from the libclc tests directory.)</div><div><br></div><div>If I change the above command to produce cos.ll by adding the -S option it works but then</div><div><br></div><div>llvm-link cos.ll /usr/local/lib/clc/tonga-amdgcn--amdhsa.bc -o cos-linked.bc<br></div><div><br></div><div>fails with the error:</div><div><br></div><div><div>llvm-link: output.ll:1:2: error: expected top-level entity</div><div>        .text</div></div><div><br></div><div>  Any help here would be appreciated.</div><div><br></div><div>Thanks,</div><div>Tim Flynn</div><div><br></div><div>  </div></div>