llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.75k stars 11.89k forks source link

Building LLVM of all components fails #56948

Open zky97 opened 2 years ago

zky97 commented 2 years ago

Build and compile environment OS Windows11 python version 3.10.0 cmake version 3.23.1 ninja version 1.11.0 MinGW64 version 8.1.0_x86_64-posix-seh-rev0, GNU Make version 4.2.1 RAM 64GB cmake command:

cmake -G "Ninja" -DLLVM_PARALLEL_LINK_JOBS="1" -DLLVM_PARALLEL_LINK_JOBS="1" \
            ../llvm \
            -DCMAKE_BUILD_TYPE="Debug" \
            -DCMAKE_INSTALL_PREFIX="G:\LLVM\Build" \
            -DCMAKE_C_FLAGS="-Wa,-mbig-obj" \
            -DCMAKE_CXX_FLAGS="-Wa,-mbig-obj" \
            -DLLVM_LIBC_MPFR_INSTALL_PATH="C:\Users\zky19\MPFR" \
            -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;cross-project-tests;libclc;lld;lldb;polly;bolt;mlir;flang" \
            -DLLVM_ALL_RUNTIMES="ALL" \
            -DCMAKE_CXX_STANDARD="14" \
            -DLLVM_ENABLE_Z3_SOLVER="ON" \
            -DLLVM_OPTIMIZED_TABLEGEN="ON" \
            -DLLVM_TARGET_ARCH="host" \
            -DLLVM_USE_CRT_DEBUG="MT"

Prompt when compiling with Ninja:

Failed to close file obj file too large

and

G:/LLVM/Source/lld/ELF/Symbols.cpp:28:35: error: static assertion failed: SymbolUnion too large
static_assert(sizeof(SymbolUnion) <= 64, "SymbolUnion too large");
robert-edward-lee commented 1 year ago

Build and compile environment OS Windows10 python version 3.11.2 cmake version 3.25.2 GNU Make 4.2.1 MinGW64 version 8.1.0_x86_64-posix-seh-rev0, RAM 32GB tag llvmorg-15.0.7 cmake command:

cmake \
    -B build \
    -D CMAKE_BUILD_TYPE=Release \
    -D LLVM_ENABLE_RTTI=ON \
    -D LLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld" \
    -D CMAKE_INSTALL_PREFIX=D:/ProgramTools/llvm/llvm15.0.7 \
    -G "Unix Makefiles" \
    -S llvm

same out:

[ 91%] Building CXX object tools/lld/ELF/CMakeFiles/lldELF.dir/Symbols.cpp.obj
C:/ProgramTools/llvm/src/lld/ELF/Symbols.cpp:28:35: error: static assertion failed: SymbolUnion too large
 static_assert(sizeof(SymbolUnion) <= 64, "SymbolUnion too large");
               ~~~~~~~~~~~~~~~~~~~~^~~~~
mingw32-make[2]: *** [tools/lld/ELF/CMakeFiles/lldELF.dir/build.make:572: tools/lld/ELF/CMakeFiles/lldELF.dir/Symbols.cpp.obj] Error 1
akif999 commented 1 year ago

Does anyone have information that this issue has been resolved?

akif999 commented 1 year ago

@zky97 @robert-edward-lee I have tried the following. As a result, I guess that it can not be built with ver 8.1.0 of mingw64. So, I recommend trying the latest MinGw.

robert-edward-lee commented 1 year ago

@akif999 MinGW 11.2.0 is able to build too

but if you comment out this line, everything will be built too, heh)