dslm4515 / CMLFS

Clang-Built Musl Linux From Scratch
MIT License
105 stars 18 forks source link

Missing lvm-c headers #6

Closed dslm4515 closed 3 years ago

dslm4515 commented 3 years ago

When building mesa, build fails due to missing llvm-c headers:

In file included from ../src/gallium/winsys/amdgpu/drm/amdgpu_winsys.c:44:
../src/amd/llvm/ac_llvm_util.h:31:10: fatal error: 'llvm-c/TargetMachine.h' file not found
#include <llvm-c/TargetMachine.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

If I check that directory on the system:

/usr/include/llvm-c
├── Remarks.h
└── lto.h

... and compare it to the LLVM built in MLFS:

usr/
└── include
    └── llvm-c
        ├── Analysis.h
        ├── BitReader.h
        ├── BitWriter.h
        ├── Comdat.h
        ├── Core.h
        ├── DataTypes.h
        ├── DebugInfo.h
        ├── Disassembler.h
        ├── DisassemblerTypes.h
        ├── Error.h
        ├── ErrorHandling.h
        ├── ExecutionEngine.h
        ├── ExternC.h
        ├── IRReader.h
        ├── Initialization.h
        ├── LinkTimeOptimizer.h
        ├── Linker.h
        ├── Object.h
        ├── Orc.h
        ├── OrcBindings.h
        ├── Remarks.h
        ├── Support.h
        ├── Target.h
        ├── TargetMachine.h
        ├── Transforms
        │   ├── AggressiveInstCombine.h
        │   ├── Coroutines.h
        │   ├── IPO.h
        │   ├── InstCombine.h
        │   ├── PassManagerBuilder.h
        │   ├── Scalar.h
        │   ├── Utils.h
        │   └── Vectorize.h
        ├── Types.h
        └── lto.h

Looks like when the system LLVM was built, some headers were not copied/generated. I will compare builds between CMLFS and BMLFS, as both should be identical (assuming both were compiled by the same patches and source)

dslm4515 commented 3 years ago

Looks like these header directories are missing, as compared to a LLVM build from BMLFS:

/usr/include/clang
/usr/include/lld
/usr/include/llvm
/usr/include/llvm-c
dslm4515 commented 3 years ago

Also lots of missing static libraries like libLLVMX86Disassembler.a

andzai1995 commented 3 years ago

Try to copy includes from $LLVMSRC/include or from $LLVMSRC/build/include, or try to make a Release build of LLVM/Clang. CMLFS now uses MinSizeRel by default.

dslm4515 commented 3 years ago

I forgot about that.

Yes, when i compile llvm for like MLFS, its built as Release and not MinSizeRel

dslm4515 commented 3 years ago

Made the change with 00ffe39da96881852f89b9c8928cdab36e4fd09a

andzai1995 commented 3 years ago

Made the change with 00ffe39

Bug wasn't fixed. Removal of cmake option -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON fixes it. Make a patch, please. Thank you.

dslm4515 commented 3 years ago

Bug wasn't fixed. Removal of cmake option -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON fixes it. Make a patch, please. Thank you.

Applied via commit fe18c5a