[cfe-dev] Builtin headers

Mikhail Ramalho via cfe-dev cfe-dev at lists.llvm.org
Fri Feb 5 06:55:07 PST 2016


Hello Jacob,

It definitely helped! I finally was able to get it working (I'm using
latest clang 3.8 from trunk).

Unfortunatelly, I couldn't add it to an random folder. When I do something
like:

  compiler_string.push_back("-I" + random_virtual_folder);  //
random_virtual_folder is the random folder, something like /yy4cBWDx/

clang presents the following output:

clang version 3.8.0 (git at github.com:llvm-mirror/clang.git
9c9d4e2a396b6f024fae416c078d59c9c19fa34d) (
https://github.com/llvm-mirror/llvm.git
9be4dc8ab20a009ed5f24610888421ba84f8ec65)
Target: i386-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/mramalho/esbmc/build/ansi-c
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/3.4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/5.3.1
Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/5.3.1
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: 32;@m32
clang Invocation:
 "/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" *"-I"
"/yy4cBWDx/" *"-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"

*ignoring nonexistent directory "/yy4cBWDx/"*
ignoring nonexistent directory
"/home/mramalho/esbmc/build/ansi-c/../lib64/clang/3.8.0/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/include
End of search list.

Bolded is the path being passed to the command line and being later ignored.

But, if I remove the random folder and add to "./", it works correctly.

Thank you for the help.


2016-02-05 8:19 GMT+00:00 Jacob Carlborg via cfe-dev <cfe-dev at lists.llvm.org
>:

> On 2016-02-04 15:43, Mikhail Ramalho via cfe-dev wrote:
>
>> Hi Jacob,
>>
>> I couldn't get it working that way.
>>
>
> 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.
>
> 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:
>
> /94573920482/float.h
>
> And on Windows:
>
> C:\94573920482\float.h
>
> The I add the virtual directory to the command line arguments:
>
> -I/94573920482/
>
> Not sure if any of that helps.
>
>
> --
> /Jacob Carlborg
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>



-- 

Mikhail Ramalho.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160205/c894cf89/attachment.html>


More information about the cfe-dev mailing list