<div dir="ltr"><pre class="gmail-bz_comment_text" style="white-space:pre-wrap;width:50em;color:rgb(0,0,0)">It isn't present because to reproduce the bug, we only copy the included header files:</pre><pre class="gmail-bz_comment_text" style="white-space:pre-wrap;width:50em;color:rgb(0,0,0)">$ clang -Xclang -header-include-file -Xclang included_files.txt -fsyntax-only T.cpp && sed -i '/<command line>/d' included_files.txt

$ cat included_files.txt | xargs -I$ cp --parents $ includes/</pre><pre class="gmail-bz_comment_text" style="white-space:pre-wrap;width:50em;color:rgb(0,0,0)">$ clang++ -fsyntax-only --sysroot="./includes/" T.cpp -v</pre><pre class="gmail-bz_comment_text" style="white-space:pre-wrap;width:50em;color:rgb(0,0,0)">What's the idea behind checking for crtbegin.o specifically?</pre></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 9, 2017 at 6:30 PM, 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"><span class="">
    <p><br>
    </p>
    <br>
    <div class="m_4250661651221827137moz-cite-prefix">On 3/8/17 1:36 PM,
      <a class="m_4250661651221827137moz-txt-link-abbreviated" href="mailto:kinan.sarmini@gmail.com" target="_blank">kinan.sarmini@gmail.com</a> wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">It does find the toolchain in the directory given
        by the sysroot flag, and lists it as a candidate GCC
        Installation. The problem is it also checks for the existence of
        crtbegin.o in the corresponding lib directory (and considers the
        installation invalid when crtbegin.o is not present),</div>
    </blockquote>
    <br></span>
    Why isn't it present?<span class=""><br>
    <br>
    <blockquote type="cite">
      <div dir="ltr"> which clearly isn't required when only doing
        syntax checking.</div>
    </blockquote>
    <blockquote type="cite">
      <div dir="ltr"> As I see it, one way to fix this is to make the
        GCC installation detector aware of the compilation mode (or
        final phase), but I'm not sure whether this kind of dependency
        is good. Any ideas? <br>
      </div>
    </blockquote>
    <br></span>
    Specializing this check so that it only looks for crtbegin.o when it
    absolutely needs it seems like a bad idea to me: you'll have very
    complicated logic to compute all the possible sets of driver options
    where it wouldn't be used.<br>
    <br>
    <br>
    Jon<div><div class="h5"><br>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Tue, Mar 7, 2017 at 6:10 PM,
            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"><span><br>
                <br>
                On 3/7/17 6:32 AM, Vassil Vassilev via cfe-dev wrote:<br>
                <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  On 02/03/17 12:58, <a href="mailto:kinan.sarmini@gmail.com" target="_blank">kinan.sarmini@gmail.com</a> via
                  cfe-dev wrote:<br>
                  <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                    Hello everyone,<br>
                    <br>
                    a quick intro: I'm planning to participate in Google
                    Summer of Code<br>
                    this year as a student, and I'm really interested in
                    the llvm project<br>
                    in general and clang in particular. To increase my
                    chances of getting<br>
                    accepted and to get a better understanding of the
                    project and its code<br>
                    base, I'm currently working on fixing some open
                    bugs.<br>
                    <br>
                    I started working on bug #26834 (as suggested by
                    Vassil Vassilev), and<br>
                    i have a couple of questions. I hope this is the
                    right place to ask.<br>
                    I'm still new to the project, so please bear with me
                    as my questions<br>
                    might be silly.<br>
                    So regarding bug #26834: I've figured that the
                    reason the right<br>
                    headers aren't being added is because every
                    candidate gcc installation<br>
                    is scanned for Multilibs, and if they aren't
                    detected, then the gcc<br>
                    installation is ignored. Now I'm not sure which one
                    is the right<br>
                    behavior, i.e. is the check for Multilibs necessary<br>
                    ( <a href="https://github.com/llvm-mirror/clang/blob/master/lib/Driver/ToolChains.cpp#L2798" rel="noreferrer" target="_blank">https://github.com/llvm-mirror<wbr>/clang/blob/master/lib/Driver/<wbr>ToolChains.cpp#L2798</a><br>
                    )?<br>
                  </blockquote>
                  Maybe you can ping the person who worked in that area
                  (git blame should<br>
                  tell you).<br>
                  <br>
                  If you know how to fix the issue, fix it, run the test
                  suite and if all<br>
                  is green submit a patch for review at: <a href="http://reviews.llvm.org/" rel="noreferrer" target="_blank">http://reviews.llvm.org/</a> adding<br>
                  as reviewers the people worked in that area.<br>
                </blockquote>
                <br>
              </span>
              Feel free to add me as a reviewer.<br>
              <br>
              I suspect the bug is that clang calls the target triple:
              "x86_64-unknown-linux-gnu" and gcc calls it:
              "x86_64-linux-gnu", and thus doesn't find the toolchain
              there.<br>
              <br>
              Maybe for ".*-none-.*-.*" and ".*-unknown-.*-.*" triples
              we ought to search the corresponding ".*-.*-.*"
              directories?<br>
              <br>
              The output from '-v' ought to tell you about which
              candidate gcc installations/multilibs it found, if
              everything is working correctly.<br>
              <br>
              <br>
              Cheers,<br>
              <br>
              Jon Roelofs
              <div class="m_4250661651221827137m_-7416931777178828671m_6000584523671452559HOEnZb">
                <div class="m_4250661651221827137m_-7416931777178828671m_6000584523671452559h5"><br>
                  <br>
                  <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                    <br>
                    -- Vassil<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      <br>
                      Thanks!<br>
                      <br>
                      --<br>
                      Regards,<br>
                      Kinan.<br>
                      <br>
                      <br>
                      ______________________________<wbr>_________________<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/<wbr>mailman/listinfo/cfe-dev</a><br>
                    </blockquote>
                    <br>
                    <br>
                    <br>
                    <br>
                    ______________________________<wbr>_________________<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/<wbr>mailman/listinfo/cfe-dev</a><br>
                    <br>
                  </blockquote>
                  <br>
                </div>
              </div>
              <span class="m_4250661651221827137m_-7416931777178828671m_6000584523671452559HOEnZb"><font color="#888888">
                  -- <br>
                  Jon Roelofs<br>
                  <a href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.com</a><br>
                  CodeSourcery / Mentor Embedded<br>
                </font></span></blockquote>
          </div>
          <br>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          <div class="m_4250661651221827137m_-7416931777178828671m_6000584523671452559gmail_signature" data-smartmail="gmail_signature">
            <div dir="ltr">Regards,
              <div>Kinan.</div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <pre class="m_4250661651221827137moz-signature" cols="72">-- 
Jon Roelofs
<a class="m_4250661651221827137moz-txt-link-abbreviated" href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.com</a>
CodeSourcery / Mentor Embedded</pre>
  </div></div></div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Regards,<div>Kinan.</div></div></div>
</div>