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

New package: llvm17 #46935

Closed
wants to merge 32 commits into from
Closed

Conversation

Calandracas606
Copy link

@Calandracas606 Calandracas606 commented Oct 28, 2023

Testing the changes

  • I tested the changes in this PR: YES

New package

Local build testing

  • I built this PR locally for my native architecture, x86_64-musl
    Additional builds:
  • x86_64
  • aarch64-musl (cross)
  • aarch64 (cross)
  • i686
  • armv6l-musl (cross)

[ci skip]

srcpkgs/llvm17/template Outdated Show resolved Hide resolved
srcpkgs/llvm17/template Outdated Show resolved Hide resolved
srcpkgs/llvm17/template Outdated Show resolved Hide resolved
srcpkgs/llvm17/template Outdated Show resolved Hide resolved
srcpkgs/llvm17/template Outdated Show resolved Hide resolved
srcpkgs/llvm17/template Outdated Show resolved Hide resolved
@Calandracas606 Calandracas606 changed the title WIP: New package: llvm17 [WIP] New package: llvm17 Oct 28, 2023
@Calandracas606
Copy link
Author

@classabbyamp classabbyamp added the new-package This PR adds a new package label Oct 29, 2023
srcpkgs/llvm15/template Outdated Show resolved Hide resolved
static const char *const PPCLELibDirs[] = {"/lib32", "/lib"};
static const char *const PPCLETriples[] = {"powerpcle-linux-gnu",
- "powerpcle-unknown-linux-gnu",
- "powerpcle-linux-musl"};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's seems that this patch, besides of adding musl triplets, actually remove one for ppcle arch though I think it doesn't matter since void doesn't have support of this arch anyway.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the most part, the patches were copied from the llvm15 package. Upstream has done some work on ppc though, so some of void's ppc patches are no longer needed.

@Calandracas606
Copy link
Author

Primary holdup currently is RISCV tablegen failing when crosscompiling. I think the problem is that the llvm-tblgen binary is properly compiled for the host arch, but the llvm-min-tblgen is being built for the target arch

@Calandracas606
Copy link
Author

Primary holdup currently is RISCV tablegen failing when crosscompiling. I think the problem is that the llvm-tblgen binary is properly compiled for the host arch, but the llvm-min-tblgen is being built for the target arch

Actually, the llvm-min-tblgen found in NATIVE/bin/llvm-min-tblgen is being used, instead of the one HOST/bin/

@Calandracas606 Calandracas606 force-pushed the llvm17 branch 2 times, most recently from e69eb60 to 6f47912 Compare October 31, 2023 14:48
@Calandracas606
Copy link
Author

Cross compilation now working

make ${makejobs} -C tools/clang/utils/TableGen
make ${makejobs} -C tools/clang/tools/extra/clang-tidy/misc/ConfusableTable
make ${makejobs} -C tools/clang/tools/extra/pseudo/gen
make ${makejobs} -C tools/llvm-config
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

llvm-config needed for cross

Comment on lines 170 to 201
[ "$_lldb_enable" = "yes" ] && configure_args+=" -DLLDB_TABLEGEN=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
configure_args+=" -DLLDB_TABLEGEN_EXE=${wrksrc}/llvm/build/HOST/bin/lldb-tblgen"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LLDB_TABLEGEN_EXE needs to be set for cross. LLDB_TABLEGEN is probably not needed, but I will do further testing

ppc*) configure_args+=" -DCLANG_ENABLE_CLANGD=OFF" ;;
esac

_enabled_projects="clang;clang-tools-extra;compiler-rt;lld;mlir;flang;polly;libclc;bolt"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabled flang, mlir (flang dependancy), polly, libclc, and bolt.

Comment on lines 35 to 36
makedepends="python3-devel zlib-devel elfutils-devel libffi-devel libedit-devel
libxml2-devel binutils-devel ocaml ocaml-findlib lua53-devel"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added ocaml for ocaml bindings, and lua for lldb scripting.

-DLLDB_PYTHON_EXE_RELATIVE_PATH=bin/python${py3_ver}
-DLLDB_PYTHON_EXT_SUFFIX=$_ext_suffix"
hostmakedepends="perl python3 zlib-devel libffi-devel swig python3-Sphinx
python3-recommonmark python3-sphinx-automodapi git python3-sphinx-markdown-tables python3-yaml pkg-config"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python3-sphinx-markdown-tables is a new package needed for flang documentation

@Calandracas606 Calandracas606 force-pushed the llvm17 branch 2 times, most recently from 14f4ccd to a82593e Compare November 3, 2023 02:53
Copy link
Author

@Calandracas606 Calandracas606 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed documentation, crossbuilds.

Next step is to remove packages from llvm15, then rev bump all packages with llvm dependencies

Comment on lines 92 to 95
case "$XBPS_TARGET_MACHINE" in
x86_64*|aarch64*) _flang_enable=yes;;
esac
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flang does not allow 32 bit, and explicitly supports only x86_64 and aarch64

@Calandracas606 Calandracas606 force-pushed the llvm17 branch 2 times, most recently from 7a48db0 to 41fda05 Compare November 3, 2023 15:11
Copy link
Author

@Calandracas606 Calandracas606 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating Mesa required some patching, and needed updates to SPRIV too

Will definitely need mesa to be tested, especially with the patches

srcpkgs/mesa/template Outdated Show resolved Hide resolved
@Calandracas606 Calandracas606 force-pushed the llvm17 branch 2 times, most recently from 1b1cc59 to b5012e9 Compare November 3, 2023 22:51
@Calandracas606 Calandracas606 marked this pull request as ready for review November 4, 2023 02:22
@Calandracas606
Copy link
Author

This merge request is in a sate where I feel that a review would be beneficial

@Calandracas606
Copy link
Author

Successfully crossbuilt llvm17 and all reverse dependencies for aarch64-musl

@Calandracas606 Calandracas606 marked this pull request as draft November 5, 2023 15:49
@Calandracas606
Copy link
Author

SPIRV-Tools failing on musl

@Calandracas606 Calandracas606 force-pushed the llvm17 branch 2 times, most recently from 448214e to 34aeacf Compare February 8, 2024 00:17
@dkwo
Copy link
Contributor

dkwo commented Feb 8, 2024

@Duncaen could you double check this shlibs?
libclang-cpp.so.15 libclang-cpp-15.0.7_1
it seems the builders are rebuilding llvm twice (from aarch64_builder):

> llvm-17_1: running post-pkg hook: 00-register-pkg ...
=> Registering new packages to /host/binpkgs
Inconsistent shlibs:
  libclang-cpp.so.15 (provided by: libclang-cpp; used by: CastXML, bcc, ccls, clazy, include-what-you-use, mesa-opencl, qt6-tools)

and then

=> SPIRV-LLVM-Translator-17.0.0_1: building with [cmake] for armv6l-musl...
   [host] clang-17_1: not found
   [host] llvm-17_1: not found

@dkwo
Copy link
Contributor

dkwo commented Feb 8, 2024

nevermind, it's due to crosscompilation.

@Calandracas606
Copy link
Author

I think this is completed and can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-package This PR adds a new package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants