[llvm-bugs] [Bug 37438] New: Clang fails to build with -DLLVM_ENABLE_MODULES=ON

via llvm-bugs llvm-bugs at lists.llvm.org
Sun May 13 12:20:13 PDT 2018


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

            Bug ID: 37438
           Summary: Clang fails to build with -DLLVM_ENABLE_MODULES=ON
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Modules
          Assignee: unassignedclangbugs at nondot.org
          Reporter: anastasis.gramm2 at gmail.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org

Created attachment 20299
  --> https://bugs.llvm.org/attachment.cgi?id=20299&action=edit
clang build error

I am using system clang to compile the trunk clang.

$ clang --version # system clang
clang version 6.0.0 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix

I used the following cmake flags for the configuration:
$ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug \
  -DLLVM_ENABLE_MODULES=On -DCMAKE_C_COMPILER=clang \
  -DCMAKE_CXX_COMPILER=clang++ ~/code/llvm

ninja opt worked fine and the build time was almost halfed.
ninja clang OTOH produces the attached errors. (short version below)

---
FAILED: tools/clang/lib/Basic/CMakeFiles/clangBasic.dir/Attributes.cpp.o
While building module 'Clang_Basic' imported from
/home/gramanas/code/llvm/tools/clang/lib/Basic/Attributes.cpp:1:
In file included from <module-includes>:15:
In file included from
/home/gramanas/code/llvm/tools/clang/include/clang/Basic/Attributes.h:13:
In file included from
/home/gramanas/code/llvm/tools/clang/include/clang/Basic/LangOptions.h:22:
/home/gramanas/code/llvm/tools/clang/include/clang/Basic/Visibility.h:53:3:
error: declaration of 'uint8_t' must be imported from module
'Clang_Basic.CommentOptions' before it is required
  uint8_t linkage_    : 3;
  ^
/usr/include/bits/stdint-uintn.h:24:19: note: previous declaration is here
typedef __uint8_t uint8_t;
                  ^
/home/gramanas/code/llvm/tools/clang/lib/Basic/Attributes.cpp:1:10: fatal
error: could not build module 'Clang_Basic'
#include "clang/Basic/Attributes.h"
 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.
ninja: build stopped: subcommand failed.
---

I tried more configurations in the past weeks like with
ccache enabled and with shared libraries and everything 
wroks just fine. It's only when I enable the modules
the it crashes.

-- 
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/20180513/1dad6229/attachment.html>


More information about the llvm-bugs mailing list