Hello from a newcomer! + Bug 26834

Hello everyone,

a quick intro: I’m planning to participate in Google Summer of Code this year as a student, and I’m really interested in the llvm project in general and clang in particular. To increase my chances of getting accepted and to get a better understanding of the project and its code base, I’m currently working on fixing some open bugs.

I started working on bug #26834 (as suggested by Vassil Vassilev), and i have a couple of questions. I hope this is the right place to ask. I’m still new to the project, so please bear with me as my questions might be silly.
So regarding bug #26834: I’ve figured that the reason the right headers aren’t being added is because every candidate gcc installation is scanned for Multilibs, and if they aren’t detected, then the gcc installation is ignored. Now I’m not sure which one is the right behavior, i.e. is the check for Multilibs necessary ( https://github.com/llvm-mirror/clang/blob/master/lib/Driver/ToolChains.cpp#L2798 )?

Thanks!

Maybe you can ping the person who worked in that area (git blame should tell you). If you know how to fix the issue, fix it, run the test suite and if all is green submit a patch for review at: adding as reviewers the people worked in that area. – Vassil

Hello everyone,

a quick intro: I'm planning to participate in Google Summer of Code
this year as a student, and I'm really interested in the llvm project
in general and clang in particular. To increase my chances of getting
accepted and to get a better understanding of the project and its code
base, I'm currently working on fixing some open bugs.

I started working on bug #26834 (as suggested by Vassil Vassilev), and
i have a couple of questions. I hope this is the right place to ask.
I'm still new to the project, so please bear with me as my questions
might be silly.
So regarding bug #26834: I've figured that the reason the right
headers aren't being added is because every candidate gcc installation
is scanned for Multilibs, and if they aren't detected, then the gcc
installation is ignored. Now I'm not sure which one is the right
behavior, i.e. is the check for Multilibs necessary
( https://github.com/llvm-mirror/clang/blob/master/lib/Driver/ToolChains.cpp#L2798
)?

Maybe you can ping the person who worked in that area (git blame should
tell you).

If you know how to fix the issue, fix it, run the test suite and if all
is green submit a patch for review at: http://reviews.llvm.org/ adding
as reviewers the people worked in that area.

Feel free to add me as a reviewer.

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.

Maybe for ".*-none-.*-.*" and ".*-unknown-.*-.*" triples we ought to search the corresponding ".*-.*-.*" directories?

The output from '-v' ought to tell you about which candidate gcc installations/multilibs it found, if everything is working correctly.

Cheers,

Jon Roelofs

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), which clearly isn’t required when only doing syntax checking. 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?

It isn't present because to reproduce the bug, we only copy the included header files:
$ 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/
$ clang++ -fsyntax-only --sysroot="./includes/" T.cpp -v
What's the idea behind checking for crtbegin.o specifically?