<div dir="ltr">Hello Jacob,<div><br></div><div>It definitely helped! I finally was able to get it working (I'm using latest clang 3.8 from trunk).</div><div><br></div><div>Unfortunatelly, I couldn't add it to an random folder. When I do something like:</div><div><br></div><div> compiler_string.push_back("-I" + random_virtual_folder); // random_virtual_folder is the random folder, something like /yy4cBWDx/<br></div><div><br></div><div>clang presents the following output:</div><div><br></div><div><div>clang version 3.8.0 (git@github.com:llvm-mirror/clang.git 9c9d4e2a396b6f024fae416c078d59c9c19fa34d) (<a href="https://github.com/llvm-mirror/llvm.git">https://github.com/llvm-mirror/llvm.git</a> 9be4dc8ab20a009ed5f24610888421ba84f8ec65)</div><div>Target: i386-unknown-linux-gnu</div><div>Thread model: posix</div><div>InstalledDir: /home/mramalho/esbmc/build/ansi-c</div><div>Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/3.4.6</div><div>Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/5.3.1</div><div>Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/5.3.1</div><div>Candidate multilib: .;@m64</div><div>Candidate multilib: 32;@m32</div><div>Selected multilib: 32;@m32</div><div>clang Invocation:</div><div> "/home/mramalho/esbmc/build/ansi-c/c2goto" "-cc1" "-triple" "i386-unknown-linux-gnu" "-fsyntax-only" "-disable-free" "-disable-llvm-verifier" "-main-file-name" "esbmc_intrinsics.h" "-mrelocation-model" "static" "-mthread-model" "posix" "-mdisable-fp-elim" "-fmath-errno" "-masm-verbose" "-mconstructor-aliases" "-fuse-init-array" "-target-cpu" "pentium4" "-v" "-dwarf-column-info" "-debugger-tuning=gdb" "-resource-dir" "/home/mramalho/esbmc/build/ansi-c/../lib64/clang/3.8.0" <b>"-I" "/yy4cBWDx/" </b>"-D" "pthread_join=pthread_join_noswitch" "-D" "pthread_mutex_lock=pthread_mutex_lock_noassert" "-D" "pthread_mutex_unlock=pthread_mutex_unlock_noassert" "-D" "pthread_cond_wait=pthread_cond_wait_nocheck" "-D" "__NO_CTYPE" "-D" "realloc=__ESBMC_realloc" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/home/mramalho/esbmc/build/ansi-c/../lib64/clang/3.8.0/include" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-fdebug-compilation-dir" "/home/mramalho/esbmc/build/ansi-c" "-ferror-limit" "19" "-fmessage-length" "91" "-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-x" "c" "/esbmc_intrinsics.h"</div><div><br></div><div><b>ignoring nonexistent directory "/yy4cBWDx/"</b></div><div>ignoring nonexistent directory "/home/mramalho/esbmc/build/ansi-c/../lib64/clang/3.8.0/include"</div><div>ignoring nonexistent directory "/include"</div><div>#include "..." search starts here:</div><div>#include <...> search starts here:</div><div> /usr/local/include</div><div> /usr/include</div><div>End of search list.</div></div><div><br></div><div>Bolded is the path being passed to the command line and being later ignored.</div><div><br></div><div>But, if I remove the random folder and add to "./", it works correctly.</div><div><br></div><div>Thank you for the help.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-05 8:19 GMT+00:00 Jacob Carlborg via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2016-02-04 15:43, Mikhail Ramalho via cfe-dev wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Jacob,<br>
<br>
I couldn't get it working that way.<br>
</blockquote>
<br></span>
Hmm, strange. I just verified running my tool inside a docker container. I have three embedded internal Clang headers, it can find those but no other internal headers.<br>
<br>
I'm not sure how the C++ interface works but I had to explicitly add the path to the virtual directory to the command line arguments. Basically what I have is a randomly generated string as the virtual directory, based on the root of the file system. The full path of the internal headers are the virtual directory plus the filename of the internal header. Example, the full path of "float.h" could be on Posix:<br>
<br>
/94573920482/float.h<br>
<br>
And on Windows:<br>
<br>
C:\94573920482\float.h<br>
<br>
The I add the virtual directory to the command line arguments:<br>
<br>
-I/94573920482/<br>
<br>
Not sure if any of that helps.<div class="HOEnZb"><div class="h5"><br>
<br>
-- <br>
/Jacob Carlborg<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><br></div><div>Mikhail Ramalho.</div></div></div>
</div>