Investigate if its possible to avoid including llvm headers while compiling with clang

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • DevProd Build
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently scons is including "stow/llvm-v4/lib/clang/12.0.1/include" when compiling with clang:

      "
      /opt/mongodbtoolchain/v4/bin/clang++ -c src/mongo/platform/visibility_test_libcommon.cpp -v

      … omitted …

      #include "..." search starts here:
      #include <...> search starts here:

      /opt/mongodbtoolchain/revisions/4048f1b01b94379afc988a4fdec21a5081ef7489/stow/gcc-v4.tbv/lib/gcc/aarch64-mongodb-linux/11.3.0/../../../../include/c++/11.3.0
      /opt/mongodbtoolchain/revisions/4048f1b01b94379afc988a4fdec21a5081ef7489/stow/gcc-v4.tbv/lib/gcc/aarch64-mongodb-linux/11.3.0/../../../../include/c++/11.3.0/aarch64-mongodb-linux
      /opt/mongodbtoolchain/revisions/4048f1b01b94379afc988a4fdec21a5081ef7489/stow/gcc-v4.tbv/lib/gcc/aarch64-mongodb-linux/11.3.0/../../../../include/c++/11.3.0/backward
      /usr/local/include
      /opt/mongodbtoolchain/revisions/4048f1b01b94379afc988a4fdec21a5081ef7489/stow/llvm-v4.zLY/lib/clang/12.0.1/include
      /usr/include/aarch64-linux-gnu
      /usr/include

      End of search list.
      "

      We're porting this functionality over to bazel to make migration easier by keeping the includes as close to scons as possible. However, it's awkward that we're including llvm headers on top of gcc headers. The break that motivated including this originally was that gcc's stdatomic.h doesn't compile on clang.

      This isn't a required change to migrate to bazel, but figuring this out may prevent future headaches caused by this strange list of header includes.

      See https://github.com/10gen/mongo/pull/15952 for more context.

            Assignee:
            Unassigned
            Reporter:
            Zack Winter
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: