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

LLVM11: llvmtools: LLVM fails to build llvm-tblgen #14

Closed
dslm4515 opened this issue Jun 27, 2021 · 25 comments
Closed

LLVM11: llvmtools: LLVM fails to build llvm-tblgen #14

dslm4515 opened this issue Jun 27, 2021 · 25 comments
Assignees
Labels
wontfix This will not be worked on

Comments

@dslm4515
Copy link
Owner

Re-built llvmtools and made sure libcxx did not require libatomic.

now llvm/clang for llvmtools fails to build:

FAILED: include/llvm/IR/Attributes.inc 
cd /mnt/cmlfs/sources/llvm/build && /mnt/cmlfs/sources/llvm/build/bin/llvm-tblgen -gen-attrs -I /mnt/cmlfs/sources/llvm/include/llvm/IR -I /mnt/cmlfs/sources/llvm/build/include -I /mnt/cmlfs/sources/llvm/include /mnt/cmlfs/sources/llvm/include/llvm/IR/Attributes.td --write-if-changed -o include/llvm/IR/Attributes.inc -d include/llvm/IR/Attributes.inc.d
/bin/sh: /mnt/cmlfs/sources/llvm/build/bin/llvm-tblgen: No such file or directory
[220/3316] Building CXX object lib/BinaryFormat/CMakeFiles/LLVMBinaryFormat.dir/MsgPackDocument.cpp.o
ninja: build stopped: subcommand failed.

Originally posted by @dslm4515 in #12 (comment)

@dslm4515
Copy link
Owner Author

Added -DLLVM_TABLEGEN=/cgnutools/bin/llvm-tblgen to cmake command. Not sure if this will cause llvm binaries to have GCC dependencies.

So far build has surpassed 220 built targets!

@andzai1995
Copy link

andzai1995 commented Jun 27, 2021

Added -DLLVM_TABLEGEN=/cgnutools/bin/llvm-tblgen to cmake command. Not sure if this will cause llvm binaries to have GCC dependencies.

So far build has surpassed 220 built targets!

Could you add a file "../files/libunwind-llvm12/compact_unwind_encoding.h" for libunwind in BMLFS repo, because I want to try build llvm 12 and catch errors, too?

@dslm4515
Copy link
Owner Author

Added -DLLVM_TABLEGEN=/cgnutools/bin/llvm-tblgen to cmake command. Not sure if this will cause llvm binaries to have GCC dependencies.
So far build has surpassed 220 built targets!

Could you add a file "../files/libunwind-llvm12/compact_unwind_encoding.h" for libunwind in BMLFS repo, because I want to try build llvm 12 and catch errors, too?

I actually have llvm12 working for bmlfs. Let me check which branch...

@dslm4515
Copy link
Owner Author

dslm4515 commented Jun 27, 2021

Ops. I forgot to extract the missing header from libunwind! Sorry. Misread

@andzai1995
Copy link

There is some code in file build-scripts/llvm12.build:

# Fix missing header for lld, https://bugs.llvm.org/show_bug.cgi?id=49228
mkdir -pv tools/lld/include/mach-o
cp -v ../files/libunwind-llvm12/compact_unwind_encoding.h tools/lld/include/mach-o

When I cloned BMLFS repo, this file is absent.

@dslm4515
Copy link
Owner Author

There is some code in file build-scripts/llvm12.build:

# Fix missing header for lld, https://bugs.llvm.org/show_bug.cgi?id=49228
mkdir -pv tools/lld/include/mach-o
cp -v ../files/libunwind-llvm12/compact_unwind_encoding.h tools/lld/include/mach-o

When I cloned BMLFS repo, this file is absent.

Sorry. I’ll upload it

@andzai1995
Copy link

andzai1995 commented Jun 27, 2021

There is some code in file build-scripts/llvm12.build:

# Fix missing header for lld, https://bugs.llvm.org/show_bug.cgi?id=49228
mkdir -pv tools/lld/include/mach-o
cp -v ../files/libunwind-llvm12/compact_unwind_encoding.h tools/lld/include/mach-o

When I cloned BMLFS repo, this file is absent.

Sorry. I’ll upload it

It is the same file like in $LLVMSRC/projects/libunwind/include/mach-o? Or this file is different?

it’s the same

@dslm4515
Copy link
Owner Author

I’ve uploaded the file to master branch of BMLFS

@dslm4515
Copy link
Owner Author

Now clang-tblgen is not built....

[1752/3316] Building StmtDataCollectors.inc...
FAILED: tools/clang/include/clang/AST/StmtDataCollectors.inc 
cd /mnt/cmlfs/sources/llvm/build && /mnt/cmlfs/sources/llvm/build/bin/clang-tblgen -gen-clang-data-collectors -I /mnt/cmlfs/sources/llvm/tools/clang/include/clang/AST -I /mnt/cmlfs/sources/llvm/tools/clang/include -I /mnt/cmlfs/sources/llvm/build/tools/clang/include -I /mnt/cmlfs/sources/llvm/build/include -I /mnt/cmlfs/sources/llvm/include /mnt/cmlfs/sources/llvm/tools/clang/include/clang/AST/StmtDataCollectors.td --write-if-changed -o tools/clang/include/clang/AST/StmtDataCollectors.inc -d tools/clang/include/clang/AST/StmtDataCollectors.inc.d
/bin/sh: /mnt/cmlfs/sources/llvm/build/bin/clang-tblgen: No such file or directory
[1753/3316] Building CXX object tools/ver...selistorder.dir/verify-uselistorder.cpp.o
ninja: build stopped: subcommand failed.

@owl4ce
Copy link
Contributor

owl4ce commented Jun 27, 2021

There is some code in file build-scripts/llvm12.build:

# Fix missing header for lld, https://bugs.llvm.org/show_bug.cgi?id=49228
mkdir -pv tools/lld/include/mach-o
cp -v ../files/libunwind-llvm12/compact_unwind_encoding.h tools/lld/include/mach-o

When I cloned BMLFS repo, this file is absent.

no need

@dslm4515
Copy link
Owner Author

Now clang-tblgen is not built....

[1752/3316] Building StmtDataCollectors.inc...
FAILED: tools/clang/include/clang/AST/StmtDataCollectors.inc 
cd /mnt/cmlfs/sources/llvm/build && /mnt/cmlfs/sources/llvm/build/bin/clang-tblgen -gen-clang-data-collectors -I /mnt/cmlfs/sources/llvm/tools/clang/include/clang/AST -I /mnt/cmlfs/sources/llvm/tools/clang/include -I /mnt/cmlfs/sources/llvm/build/tools/clang/include -I /mnt/cmlfs/sources/llvm/build/include -I /mnt/cmlfs/sources/llvm/include /mnt/cmlfs/sources/llvm/tools/clang/include/clang/AST/StmtDataCollectors.td --write-if-changed -o tools/clang/include/clang/AST/StmtDataCollectors.inc -d tools/clang/include/clang/AST/StmtDataCollectors.inc.d
/bin/sh: /mnt/cmlfs/sources/llvm/build/bin/clang-tblgen: No such file or directory
[1753/3316] Building CXX object tools/ver...selistorder.dir/verify-uselistorder.cpp.o
ninja: build stopped: subcommand failed.

clang-tblgen is built but cannot execute...due to libraries not loading from llvmtools/lib:

$ LD_LIBRARY_PATH=/llvmtools/lib ldd   build/bin/clang-tblgen 
        /lib/ld-musl-x86_64.so.1 (0x7f75911d9000)
        libexecinfo.so.1 => /llvmtools/lib/libexecinfo.so.1 (0x7f7591038000)
        libc++.so.1 => /llvmtools/lib/libc++.so.1 (0x7f7590f6d000)
        libc++abi.so.1 => /llvmtools/lib/libc++abi.so.1 (0x7f7590f10000)
        libunwind.so.1 => /llvmtools/lib/libunwind.so.1 (0x7f7590efd000)
        libc.so => /lib/ld-musl-x86_64.so.1 (0x7f75911d9000)

perhaps, I should have added LD_LIBRARY_PATH=/llvmtools/lib:/cgnutools/lib:/usr/lib:/lib when compiling? Maybe llvm-tblgen would have been built too?

@owl4ce
Copy link
Contributor

owl4ce commented Jun 28, 2021

is this issue related to build llvm in llvmtools?

@owl4ce
Copy link
Contributor

owl4ce commented Jun 28, 2021

is this issue related to build llvm in llvmtools?

For LLVM 12, I just fine while building. See #12 (comment)

Now moving to chroot steps. I'll report if an issue appeared.

@dslm4515
Copy link
Owner Author

is this issue related to build llvm in llvmtools?

yes for llvm11 (master). First build fails after 4mins for llvm-tblgen not built or unable to execute. So i reconfigured with using llvm-tblgen from cgnutools. Build progresses for 58mins then fails on unable to execute built clang-tblgen

@dslm4515
Copy link
Owner Author

is this issue related to build llvm in llvmtools?

For LLVM 12, I just fine while building. See #12 (comment)

Now moving to chroot steps. I'll report if an issue appeared.

Before you were contributing, i was working on LLVM12 branch...lol, but i was stuck on libcxx of llvmtools (by now, you, and others already fixed that). I thought i'd work on master (llvm11) to have it updated with latest software versions of June 18th 2021.

Hopefully, no GCC dependencies for llvmtools!

@owl4ce
Copy link
Contributor

owl4ce commented Jun 28, 2021

I use GNU Make for LLVM, so mostly never install ninja (and less dependencies) until entering chroot (meson). I prefer Samurai.

May I ask. What packages that requires meson?

@dslm4515
Copy link
Owner Author

I use GNU Make for LLVM, so mostly never install ninja (and less dependencies) until entering chroot (meson).

Good point. I like ninja for the clean text output... although, make can do that too.

Make is pretty common and less dependencies, i'd likely switch from ninja to make

@owl4ce
Copy link
Contributor

owl4ce commented Jun 28, 2021

I use GNU Make for LLVM, so mostly never install ninja (and less dependencies) until entering chroot (meson).

Good point. I like ninja for the clean text output... although, make can do that too.

Make is pretty common and less dependencies, i'd likely switch from ninja to make

Right, Ninja can show the total of source code and not showing the enter-close directory like Make.

@dslm4515
Copy link
Owner Author

I use GNU Make for LLVM, so mostly never install ninja (and less dependencies) until entering chroot (meson). I'm prefer Samurai.

May I ask. What packages that requires meson?

Samurai looks good. I do hate how ninja is either built with python or cmake. I may replace ninja with samurai in both CMLFS and MLFS.

For CMLFS, meson is not used. It is built so that a CMLFS system can build packages that use meson as their build system.... I forgot the original reason meson was added to LFS.

@owl4ce
Copy link
Contributor

owl4ce commented Jun 28, 2021

For CMLFS, meson is not used. It is built so that a CMLFS system can build packages that use meson as their build system.... I forgot the original reason meson was added to LFS.

I think so!

@owl4ce
Copy link
Contributor

owl4ce commented Jun 28, 2021

In LFS Appendix, meson is used when building Systemd.

@owl4ce
Copy link
Contributor

owl4ce commented Jun 28, 2021

Try this, and don't forget to enable --zlib-compat.
https://github.com/zlib-ng/zlib-ng

@dslm4515
Copy link
Owner Author

Try this
https://github.com/zlib-ng/zlib-ng

I noticed hasn't been updated for a while. I suppose i'll switch to zlib-ng, just like how i dropped pkg-config for pkgconf

@owl4ce
Copy link
Contributor

owl4ce commented Jun 28, 2021

And maybe pigz instead of gzip, but pigz requires zlib (zlib-ng works too). Cons: pigz doesn't have wrapper script such as for grep (zgrep). Can be installed for both, gzip just for wrapper script if needed 😄 lol

@dslm4515 dslm4515 changed the title llvmtools: LLVM fails to build llvm-tblgen LLVM11: llvmtools: LLVM fails to build llvm-tblgen Jun 28, 2021
@dslm4515
Copy link
Owner Author

I'm closing this as I don't think anyone will want to build LLVM-11 for CMLFS.

@dslm4515 dslm4515 self-assigned this Mar 29, 2022
@dslm4515 dslm4515 added the wontfix This will not be worked on label Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants