<div dir="ltr"><div>Good day Jon,<br><br>Thank you for the suggestion.<br>I rebuilt my llvm/clang with the additional '--with-extra-ld-options' option but clang was still unable to find my gcc.<br>Perhaps the devtoolset-gcc-4.7 was installed in an unusual location and explicitly adding the path is the only way?<br>
<br>One thing I tried was to modify clang/lib/Frontend/InitHeaderSearch.cpp.<br>I got the idea from an old thread:<br> <a href="http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-April/021039.html">http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-April/021039.html</a><br>
But still not ok. It was this thread that made me assume that the --with-gcc-toolchain option was enough.<br>Looking for something else to go on, I tried to add some paths in the file you mentioned, Toolchains.cpp.<br>Maybe there were some mistakes in my mod since the result was still not ok. I will try again later.<br>
<br>There is another angle I have yet to try which is the procedure provided here:<br><a href="http://llvm.org/docs/GettingStarted.html#getting-a-modern-host-c-toolchain">http://llvm.org/docs/GettingStarted.html#getting-a-modern-host-c-toolchain</a><br>
Currently, I have problems compiling gcc 4.8.2 so I can't say yet what will be the result.<br></div>Will try other versions.<br><div><br>Thank you very much for the support.<br><br>Best regards,<br>David<br><br></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 9, 2014 at 3:17 AM, Jonathan Roelofs <span dir="ltr"><<a href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
David,<br>
<br>
On my machine, gcc 4.7 is installed in /usr/local/tools/gcc-4.7.3<br>
<br>
I configure from a build directory:<br>
$ mkdir build && cd build<br>
$ ../llvm/configure --with-gcc-toolchain=/usr/local/tools/gcc-4.7.3
--with-extra-ld-options=-Wl,-rpath,/usr/local/tools/gcc-4.7.3/lib/
--enable-optimized<div class=""><br>
<br>
<div>On 5/8/14, 5:56 AM, DbdM Tbt wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Good day,<br>
I would like to ask about the behavior of '--with-gcc-toolchain'
configuration option.<br>
I am currently trying out clang 3.4 with gcc 4.7 and for this, I
used the centos devtools repo.<br>
GCC 4.7 is installed into /opt/centos/devtoolset-1.0/.<br>
I configured clang 3.4 like below:<br>
CC=/opt/centos/devtoolset-1.0/root/usr/bin/gcc
CXX=/opt/centos/devtoolset-1.0/root/usr/bin/g++
<configure>
--with-gcc-toolchain=/opt/centos/devtoolset-1.0/root/usr/<br>
<br>
Make is ok but when I try clang-check it doesn't seem to find
'iostream'.<br>
I thought with the option --with-gcc-toolchain, clang and its
tools will automatically be pointed the gcc 4.7 directories.<br>
Perhaps I am missing something here or my assumptions are
flawed. Can someone share some insights?.<br>
<br>
Using the -v option on clang-check, the "Selected GCC
installation:" is blank and the list of include directories
don't include the 4.7 directories.<br>
</div>
</blockquote></div>
The GCCInsatllationDetector in clang/lib/Driver/ToolChains.h looks
for crtbegin.o files in places like:<br>
/usr/local/tools/gcc-4.7.3/lib/gcc/<triple>/<major.minor.patch>/crtbegin.o<br>
<br>
In my case, that is:<br>
/usr/local/tools/gcc-4.7.3/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/crtbegin.o<br>
<br>
But there are a bunch of formats for this kind of stuff. See
Generic_GCC::GCCInstallationDetector::init in
clang/lib/Driver/ToolChains.cpp (and the things that it calls).<br>
<br>
Cheers,<br>
Jon<br>
<blockquote type="cite"><div class="">
<div dir="ltr">Explicitly specifying the include directories (-I
option) in the clang-check invocation will work but is there
another workaround?<br>
I would prefer to resolve such issues in the 'environment setup'
aspect and not during 'application usage'.<br>
<br>
Thank you very much,<br>
David<br>
<br>
</div>
<br>
<fieldset></fieldset>
<br>
</div><pre>_______________________________________________
cfe-dev mailing list
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
<pre cols="200">--
Jon Roelofs
<a href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.com</a>
CodeSourcery / Mentor Embedded </pre>
</font></span></div>
</blockquote></div><br></div>