[llvm-bugs] [Bug 47254] New: [feature request] New option --no-override-resource-dir to clang-scan-deps to avoid resource-dir discovery

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 20 06:56:34 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47254

            Bug ID: 47254
           Summary: [feature request] New option
                    --no-override-resource-dir to clang-scan-deps to avoid
                    resource-dir discovery
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Tooling
          Assignee: unassignedclangbugs at nondot.org
          Reporter: romain.geissler at amadeus.com
                CC: llvm-bugs at lists.llvm.org

Hi,

In this commit in clang-scan-deps
https://github.com/llvm/llvm-project/commit/26fa9e31f58a7ff693f3a5d8c2eb1b6a5a13b133
was added the logic of infering the "resources-dir" of the underlying compiler
(somehow hoping it's clang) and then pass this resources dir to the current
clang-scan-deps process (which is clang based, but maybe not the exact same
clang version, nor installed in the same place). For now the only way to bypass
this logic is to explicitly pass a "-resource-dir" argument.

I have the scenario where my compilation database contains entries, but not
using clang as the compiler, but gcc (in my company the main compiler is stil
gcc, and this won't change for now). However I wish I could use the faster
clang-scan-deps to generate dependencies. I already have some small patches in
clang to ignore the very few gcc-only flags that our company uses, so that for
example passing "-ffat-lto-objects to our own copy of clang doesn't raise any
warning.

Right now if I use "clang-scan-deps" on my gcc-based compilation database, I
have warnings for every entry of the database, it's actually gcc warning about
unknown command argument "-print-resource-dir". I can't just redirect
clang-scan-deps'stderr to /dev/null as I really want to know when there are
errors and which ones, yet I don't want my stderr output to be clobbered by all
these "-print-resource-dir" issues from gcc. In my case, I also have somehow
the garantee that the llvm toolchain containing clang-scan-deps and either the
gcc or clang compiler are really from the same toolchain (same installation
folder). So really the "-resource-dir" that should be used can be the default
one of "clang-scan-deps".

So, would it be possible to have a new optional flag possibly named
"--no-override-resource-dir" to avoid doing this resource dir inference and
overring altogether (ie give back the behavior of "clang-scan-deps" prior to
commit
https://github.com/llvm/llvm-project/commit/26fa9e31f58a7ff693f3a5d8c2eb1b6a5a13b133
?

Cheers,
Romain

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200820/8f861396/attachment.html>


More information about the llvm-bugs mailing list