Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clangd build failure on WSL with GCC 9.3.0 #835

Closed
ArcsinX opened this issue Aug 4, 2021 · 1 comment
Closed

Clangd build failure on WSL with GCC 9.3.0 #835

ArcsinX opened this issue Aug 4, 2021 · 1 comment
Assignees

Comments

@ArcsinX
Copy link

ArcsinX commented Aug 4, 2021

After this commit llvm/llvm-project@0c96a92#diff-c32c7f73f1328b7df01bcf4544f15843fdabc3838436374c35ab930e44463a74
clangd can't be built on WSL with GCC 9.3.0 (unsure if the version is important) with a lot of errors and the reason is here:

[1/108] Building CXX object tools/clang/tools/extra/clangd/CMakeFiles/obj.clangDaemon.dir/Config.cpp.o
FAILED: tools/clang/tools/extra/clangd/CMakeFiles/obj.clangDaemon.dir/Config.cpp.o
/usr/bin/c++  -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/tools/extra/clangd -I/mnt/d/work/llvm-project/clang-tools-extra/clangd -Itools/clang/tools/extra/clangd/../clang-tidy -I/mnt/d/work/llvm-project/clang/include -Itools/clang/include -Iinclude -I/mnt/d/work/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG    -fno-exceptions -fno-rtti -std=c++14 -MD -MT tools/clang/tools/extra/clangd/CMakeFiles/obj.clangDaemon.dir/Config.cpp.o -MF tools/clang/tools/extra/clangd/CMakeFiles/obj.clangDaemon.dir/Config.cpp.o.d -o tools/clang/tools/extra/clangd/CMakeFiles/obj.clangDaemon.dir/Config.cpp.o -c /mnt/d/work/llvm-project/clang-tools-extra/clangd/Config.cpp
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/c++config.h:524,
                 from /usr/include/c++/9/string:38,
                 from /mnt/d/work/llvm-project/clang-tools-extra/clangd/features.h:11,
                 from /usr/include/inttypes.h:25,
                 from /mnt/d/work/llvm-project/llvm/include/llvm-c/DataTypes.h:27,
                 from /mnt/d/work/llvm-project/llvm/include/llvm/Support/DataTypes.h:19,
                 from /mnt/d/work/llvm-project/llvm/include/llvm/ADT/Hashing.h:47,
                 from /mnt/d/work/llvm-project/llvm/include/llvm/ADT/Optional.h:18,
                 from /mnt/d/work/llvm-project/llvm/include/llvm/ADT/STLExtras.h:19,
                 from /mnt/d/work/llvm-project/clang-tools-extra/clangd/support/Context.h:17,
                 from /mnt/d/work/llvm-project/clang-tools-extra/clangd/Config.h:27,
                 from /mnt/d/work/llvm-project/clang-tools-extra/clangd/Config.cpp:9:
/usr/include/x86_64-linux-gnu/c++/9/bits/os_defines.h:44:19: error: missing binary operator before token "("
   44 | #if __GLIBC_PREREQ(2,15) && defined(_GNU_SOURCE)
.....

As we can see, wrong features.h (from clangd sources instead of system header) is used. This looks like the problem of case-insensitivity (because the real name for the file inside clangd sources is Features.h). I tried to rename Features.h to another name and it helped.

I want to fix my WSL build, but unsure what is the legal way to do this =)

@sam-mccall
Copy link
Member

Haha, wow, sorry about that.
I guess I'll just rename the header.

@sam-mccall sam-mccall self-assigned this Aug 5, 2021
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this issue Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants