diff options
20 files changed, 206 insertions, 106 deletions
@@ -235,6 +235,29 @@ URI: ghttps://github.com/openembedded/bitbake.git | |||
235 | branch: master | 235 | branch: master |
236 | revision: HEAD | 236 | revision: HEAD |
237 | ``` | 237 | ``` |
238 | # Using Devtool and Upstream Development | ||
239 | |||
240 | All LLVM based recipes use single llvm source directory, As a LLVM | ||
241 | developer, you might want to work on your own repository to build | ||
242 | related recipes, devtool can we useful in establishing such a workflow | ||
243 | there is a script provided `scripts/devtool-clang.sh` which can assist | ||
244 | in setting up all the recipes to use custom LLVM repository, in order | ||
245 | to setup repository make sure that it has all the needed patches applied | ||
246 | or else it will fail to build. Such a tree is already prepared and kept | ||
247 | in sync at | ||
248 | |||
249 | https://github.com/kraj/llvm-project | ||
250 | |||
251 | There are branches under `oe` namespace which carry the needed OE patches | ||
252 | |||
253 | ``` | ||
254 | cd $TOPDIR/workspace/sources | ||
255 | git clone https://github.com/kraj/llvm-project -b oe/main llvm-project | ||
256 | ``` | ||
257 | |||
258 | Once project is setup and meta-clang is added, run `devtool-clang.sh` | ||
259 | script which will do the needed for setting up external sources for the | ||
260 | yocto recipes, now yocto will use custom LLVM tree for its needs. | ||
238 | 261 | ||
239 | # Contributing | 262 | # Contributing |
240 | 263 | ||
diff --git a/conf/layer.conf b/conf/layer.conf index ee3446c..b46c715 100644 --- a/conf/layer.conf +++ b/conf/layer.conf | |||
@@ -7,7 +7,7 @@ BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend" | |||
7 | BBFILE_COLLECTIONS += "clang-layer" | 7 | BBFILE_COLLECTIONS += "clang-layer" |
8 | BBFILE_PATTERN_clang-layer := "^${LAYERDIR}/" | 8 | BBFILE_PATTERN_clang-layer := "^${LAYERDIR}/" |
9 | BBFILE_PRIORITY_clang-layer = "7" | 9 | BBFILE_PRIORITY_clang-layer = "7" |
10 | LAYERSERIES_COMPAT_clang-layer = "nanbield scarthgap" | 10 | LAYERSERIES_COMPAT_clang-layer = "scarthgap styhead" |
11 | LAYERDEPENDS_clang-layer = "core" | 11 | LAYERDEPENDS_clang-layer = "core" |
12 | 12 | ||
13 | BBFILES_DYNAMIC += " \ | 13 | BBFILES_DYNAMIC += " \ |
@@ -33,7 +33,7 @@ INHERIT += "clang" | |||
33 | # Do not include clang in SDK unless user wants to | 33 | # Do not include clang in SDK unless user wants to |
34 | CLANGSDK ??= "0" | 34 | CLANGSDK ??= "0" |
35 | 35 | ||
36 | LLVMVERSION = "18.1.4" | 36 | LLVMVERSION = "18.1.6" |
37 | 37 | ||
38 | require conf/nonclangable.conf | 38 | require conf/nonclangable.conf |
39 | require conf/nonscanable.conf | 39 | require conf/nonscanable.conf |
diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf index 27165f4..8bfef2c 100644 --- a/conf/nonclangable.conf +++ b/conf/nonclangable.conf | |||
@@ -613,6 +613,7 @@ LDFLAGS:append:pn-libcgroup:toolchain-clang = "${@bb.utils.contains('DISTRO_FEAT | |||
613 | LDFLAGS:append:pn-kernel-selftest:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" | 613 | LDFLAGS:append:pn-kernel-selftest:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" |
614 | LDFLAGS:append:pn-openldap:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" | 614 | LDFLAGS:append:pn-openldap:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" |
615 | LDFLAGS:append:pn-liburing:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" | 615 | LDFLAGS:append:pn-liburing:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" |
616 | LDFLAGS:append:pn-frame:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" | ||
616 | # | x86_64-yoe-linux-musl-ld.lld: error: version script assignment of 'global' to symbol 'pam_sm_chauthtok' failed: symbol not defined | 617 | # | x86_64-yoe-linux-musl-ld.lld: error: version script assignment of 'global' to symbol 'pam_sm_chauthtok' failed: symbol not defined |
617 | LDFLAGS:append:pn-wtmpdb:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" | 618 | LDFLAGS:append:pn-wtmpdb:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" |
618 | TUNE_CCARGS:remove:pn-kernel-selftest:toolchain-clang = "-mfpmath=sse" | 619 | TUNE_CCARGS:remove:pn-kernel-selftest:toolchain-clang = "-mfpmath=sse" |
diff --git a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.29.1.bb b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.29.1.bb index ec3811e..496b777 100644 --- a/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.29.1.bb +++ b/dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.29.1.bb | |||
@@ -58,7 +58,7 @@ do_install_ptest() { | |||
58 | install -d ${D}${PTEST_PATH}/tests/cc | 58 | install -d ${D}${PTEST_PATH}/tests/cc |
59 | install ${B}/tests/cc/test_libbcc_no_libbpf ${B}/tests/cc/libusdt_test_lib.so ${D}${PTEST_PATH}/tests/cc | 59 | install ${B}/tests/cc/test_libbcc_no_libbpf ${B}/tests/cc/libusdt_test_lib.so ${D}${PTEST_PATH}/tests/cc |
60 | cp -rf ${S}/tests/python ${D}${PTEST_PATH}/tests/python | 60 | cp -rf ${S}/tests/python ${D}${PTEST_PATH}/tests/python |
61 | install ${WORKDIR}/ptest_wrapper.sh ${D}${PTEST_PATH}/tests | 61 | install ${UNPACKDIR}/ptest_wrapper.sh ${D}${PTEST_PATH}/tests |
62 | install ${S}/examples/networking/simulation.py ${D}${PTEST_PATH}/tests/python | 62 | install ${S}/examples/networking/simulation.py ${D}${PTEST_PATH}/tests/python |
63 | } | 63 | } |
64 | 64 | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.20.1.bb b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.20.1.bb index 355f427..cf829dc 100644 --- a/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.20.1.bb +++ b/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.20.1.bb | |||
@@ -44,12 +44,6 @@ do_install_ptest() { | |||
44 | fi | 44 | fi |
45 | } | 45 | } |
46 | 46 | ||
47 | def llvm_major_version(d): | ||
48 | pvsplit = d.getVar('LLVMVERSION').split('.') | ||
49 | return pvsplit[0] | ||
50 | |||
51 | LLVM_MAJOR_VERSION = "${@llvm_major_version(d)}" | ||
52 | |||
53 | EXTRA_OECMAKE = " \ | 47 | EXTRA_OECMAKE = " \ |
54 | -DCMAKE_ENABLE_EXPORTS=1 \ | 48 | -DCMAKE_ENABLE_EXPORTS=1 \ |
55 | -DCMAKE_BUILD_TYPE=Release \ | 49 | -DCMAKE_BUILD_TYPE=Release \ |
diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index 8bfc4d1..cb8a48f 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc | |||
@@ -1,18 +1,15 @@ | |||
1 | LLVM_RELEASE = "" | 1 | LLVM_RELEASE = "" |
2 | LLVM_DIR = "llvm${LLVM_RELEASE}" | 2 | LLVM_DIR = "llvm${LLVM_RELEASE}" |
3 | 3 | ||
4 | LLVM_GIT ?= "git://github.com/llvm" | 4 | LLVM_HTTP ?= "https://github.com/llvm" |
5 | LLVM_GIT_PROTOCOL ?= "https" | ||
6 | 5 | ||
7 | MAJOR_VER = "18" | 6 | MAJOR_VER = "18" |
8 | MINOR_VER = "1" | 7 | MINOR_VER = "1" |
9 | PATCH_VER = "4" | 8 | PATCH_VER = "6" |
10 | # could be 'rcX' or 'git' or empty ( for release ) | 9 | # could be 'rcX' or 'git' or empty ( for release ) |
11 | VER_SUFFIX = "" | 10 | VER_SUFFIX = "" |
12 | SRCREV ?= "e6c3289804a67ea0bb6a86fadbe454dd93b8d855" | ||
13 | 11 | ||
14 | PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}${VER_SUFFIX}" | 12 | PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}${VER_SUFFIX}" |
15 | BRANCH = "release/18.x" | ||
16 | 13 | ||
17 | LLVMMD5SUM = "8a15a0759ef07f2682d2ba4b893c9afe" | 14 | LLVMMD5SUM = "8a15a0759ef07f2682d2ba4b893c9afe" |
18 | CLANGMD5SUM = "ff42885ed2ab98f1ecb8c1fc41205343" | 15 | CLANGMD5SUM = "ff42885ed2ab98f1ecb8c1fc41205343" |
diff --git a/recipes-devtools/clang/clang/0036-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch b/recipes-devtools/clang/clang/0036-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch new file mode 100644 index 0000000..84a0d2b --- /dev/null +++ b/recipes-devtools/clang/clang/0036-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch | |||
@@ -0,0 +1,90 @@ | |||
1 | From e54d4a15f31b8f84dc24ae14efc65713b1a6d6d7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 14 May 2024 22:04:43 -0700 | ||
4 | Subject: [PATCH] llvm: Add libunwind.pc.in and llvm-config scripts | ||
5 | |||
6 | These are added by OE project | ||
7 | |||
8 | Upstream-Status: Inappropriate [ OE-Specific ] | ||
9 | |||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | libunwind/libunwind.pc.in | 9 ++++++ | ||
13 | llvm/tools/llvm-config/llvm-config | 52 ++++++++++++++++++++++++++++++ | ||
14 | 2 files changed, 61 insertions(+) | ||
15 | create mode 100644 libunwind/libunwind.pc.in | ||
16 | create mode 100644 llvm/tools/llvm-config/llvm-config | ||
17 | |||
18 | diff --git a/libunwind/libunwind.pc.in b/libunwind/libunwind.pc.in | ||
19 | new file mode 100644 | ||
20 | index 000000000000..a93d676604f9 | ||
21 | --- /dev/null | ||
22 | +++ b/libunwind/libunwind.pc.in | ||
23 | @@ -0,0 +1,9 @@ | ||
24 | +prefix=/usr | ||
25 | +exec_prefix=/usr | ||
26 | +libdir=@LIBDIR@ | ||
27 | +includedir=/usr/include | ||
28 | + | ||
29 | +Name: libunwind | ||
30 | +Description: libunwind base library | ||
31 | +Version: @VERSION@ | ||
32 | +Libs: -lunwind | ||
33 | diff --git a/llvm/tools/llvm-config/llvm-config b/llvm/tools/llvm-config/llvm-config | ||
34 | new file mode 100644 | ||
35 | index 000000000000..6a0dd54b8eab | ||
36 | --- /dev/null | ||
37 | +++ b/llvm/tools/llvm-config/llvm-config | ||
38 | @@ -0,0 +1,52 @@ | ||
39 | +#!/bin/bash | ||
40 | +# | ||
41 | +# Wrapper script for llvm-config. Supplies the right environment variables | ||
42 | +# for the target and delegates to the native llvm-config for anything else. This | ||
43 | +# is needed because arguments like --ldflags, --cxxflags, etc. are set by the | ||
44 | +# native compile rather than the target compile. | ||
45 | +# | ||
46 | +SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" | ||
47 | +NEXT_LLVM_CONFIG="$(which -a llvm-config | sed -n 2p)" | ||
48 | +export YOCTO_ALTERNATE_EXE_PATH="${YOCTO_ALTERNATE_EXE_PATH:="$(readlink -f "$SCRIPT_DIR/../llvm-config")"}" | ||
49 | +if [ -n "$( echo $base_libdir | sed -n '/lib64/p')" ]; then | ||
50 | + export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib64"}" | ||
51 | +else | ||
52 | + export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib"}" | ||
53 | +fi | ||
54 | +if [[ $# == 0 ]]; then | ||
55 | + exec "$NEXT_LLVM_CONFIG" | ||
56 | +fi | ||
57 | + | ||
58 | +remain="" | ||
59 | +output="" | ||
60 | +for arg in "$@"; do | ||
61 | + case "$arg" in | ||
62 | + --cppflags) | ||
63 | + output="${output} ${CPPFLAGS}" | ||
64 | + ;; | ||
65 | + --cflags) | ||
66 | + output="${output} ${CFLAGS}" | ||
67 | + ;; | ||
68 | + --cxxflags) | ||
69 | + output="${output} ${CXXFLAGS}" | ||
70 | + ;; | ||
71 | + --ldflags) | ||
72 | + output="${output} ${LDFLAGS}" | ||
73 | + ;; | ||
74 | + --shared-mode) | ||
75 | + output="${output} shared" | ||
76 | + ;; | ||
77 | + --link-shared) | ||
78 | + break | ||
79 | + ;; | ||
80 | + *) | ||
81 | + remain="${remain} ${arg}" | ||
82 | + ;; | ||
83 | + esac | ||
84 | +done | ||
85 | + | ||
86 | +if [ "${remain}" != "" ]; then | ||
87 | + output="${output} "$("$NEXT_LLVM_CONFIG" ${remain}) | ||
88 | +fi | ||
89 | + | ||
90 | +echo "${output}" | ||
diff --git a/recipes-devtools/clang/clang/libunwind.pc.in b/recipes-devtools/clang/clang/libunwind.pc.in deleted file mode 100644 index a93d676..0000000 --- a/recipes-devtools/clang/clang/libunwind.pc.in +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | prefix=/usr | ||
2 | exec_prefix=/usr | ||
3 | libdir=@LIBDIR@ | ||
4 | includedir=/usr/include | ||
5 | |||
6 | Name: libunwind | ||
7 | Description: libunwind base library | ||
8 | Version: @VERSION@ | ||
9 | Libs: -lunwind | ||
diff --git a/recipes-devtools/clang/clang/llvm-config b/recipes-devtools/clang/clang/llvm-config deleted file mode 100644 index 6a0dd54..0000000 --- a/recipes-devtools/clang/clang/llvm-config +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | # | ||
3 | # Wrapper script for llvm-config. Supplies the right environment variables | ||
4 | # for the target and delegates to the native llvm-config for anything else. This | ||
5 | # is needed because arguments like --ldflags, --cxxflags, etc. are set by the | ||
6 | # native compile rather than the target compile. | ||
7 | # | ||
8 | SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" | ||
9 | NEXT_LLVM_CONFIG="$(which -a llvm-config | sed -n 2p)" | ||
10 | export YOCTO_ALTERNATE_EXE_PATH="${YOCTO_ALTERNATE_EXE_PATH:="$(readlink -f "$SCRIPT_DIR/../llvm-config")"}" | ||
11 | if [ -n "$( echo $base_libdir | sed -n '/lib64/p')" ]; then | ||
12 | export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib64"}" | ||
13 | else | ||
14 | export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib"}" | ||
15 | fi | ||
16 | if [[ $# == 0 ]]; then | ||
17 | exec "$NEXT_LLVM_CONFIG" | ||
18 | fi | ||
19 | |||
20 | remain="" | ||
21 | output="" | ||
22 | for arg in "$@"; do | ||
23 | case "$arg" in | ||
24 | --cppflags) | ||
25 | output="${output} ${CPPFLAGS}" | ||
26 | ;; | ||
27 | --cflags) | ||
28 | output="${output} ${CFLAGS}" | ||
29 | ;; | ||
30 | --cxxflags) | ||
31 | output="${output} ${CXXFLAGS}" | ||
32 | ;; | ||
33 | --ldflags) | ||
34 | output="${output} ${LDFLAGS}" | ||
35 | ;; | ||
36 | --shared-mode) | ||
37 | output="${output} shared" | ||
38 | ;; | ||
39 | --link-shared) | ||
40 | break | ||
41 | ;; | ||
42 | *) | ||
43 | remain="${remain} ${arg}" | ||
44 | ;; | ||
45 | esac | ||
46 | done | ||
47 | |||
48 | if [ "${remain}" != "" ]; then | ||
49 | output="${output} "$("$NEXT_LLVM_CONFIG" ${remain}) | ||
50 | fi | ||
51 | |||
52 | echo "${output}" | ||
diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 2891a3a..a29770b 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb | |||
@@ -429,7 +429,7 @@ SYSROOT_PREPROCESS_FUNCS:append:class-target = " clang_sysroot_preprocess" | |||
429 | 429 | ||
430 | clang_sysroot_preprocess() { | 430 | clang_sysroot_preprocess() { |
431 | install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/ | 431 | install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/ |
432 | install -m 0755 ${S}/../llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/ | 432 | install -m 0755 ${S}/llvm/tools/llvm-config/llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/ |
433 | ln -sf llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/llvm-config${PV} | 433 | ln -sf llvm-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/llvm-config${PV} |
434 | # LLDTargets.cmake references the lld executable(!) that some modules/plugins link to | 434 | # LLDTargets.cmake references the lld executable(!) that some modules/plugins link to |
435 | install -d ${SYSROOT_DESTDIR}${bindir} | 435 | install -d ${SYSROOT_DESTDIR}${bindir} |
diff --git a/recipes-devtools/clang/common-source.inc b/recipes-devtools/clang/common-source.inc index cd95453..d8a0f68 100644 --- a/recipes-devtools/clang/common-source.inc +++ b/recipes-devtools/clang/common-source.inc | |||
@@ -7,9 +7,9 @@ deltask do_patch | |||
7 | 7 | ||
8 | SRC_URI = "" | 8 | SRC_URI = "" |
9 | 9 | ||
10 | do_configure[depends] += "llvm-project-source-${PV}:do_patch" | 10 | do_configure[depends] += "llvm-project-source-${PV}:do_preconfigure" |
11 | do_populate_lic[depends] += "llvm-project-source-${PV}:do_unpack" | 11 | do_populate_lic[depends] += "llvm-project-source-${PV}:do_unpack" |
12 | do_create_spdx[depends] += "llvm-project-source-${PV}:do_patch" | 12 | do_create_spdx[depends] += "llvm-project-source-${PV}:do_preconfigure" |
13 | 13 | ||
14 | # spdx shared workdir detection fails as not WORKDIR is altered but S and B | 14 | # spdx shared workdir detection fails as not WORKDIR is altered but S and B |
15 | # return always true to fix that | 15 | # return always true to fix that |
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index a8a9929..07f84f8 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc | |||
@@ -5,11 +5,11 @@ LIC_FILES_CHKSUM = "file://llvm/LICENSE.TXT;md5=${LLVMMD5SUM} \ | |||
5 | " | 5 | " |
6 | LICENSE = "Apache-2.0-with-LLVM-exception" | 6 | LICENSE = "Apache-2.0-with-LLVM-exception" |
7 | 7 | ||
8 | BASEURI ??= "${LLVM_GIT}/llvm-project.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH}" | 8 | BASEURI = "${LLVM_HTTP}/llvm-project/releases/download/llvmorg-${PV}/llvm-project-${PV}.src.tar.xz" |
9 | SRC_URI[sha256sum] = "bd4b4cb6374bcd5fc5a3ba60cb80425d29da34f316b8821abc12c0db225cf6b4" | ||
10 | |||
9 | SRC_URI = "\ | 11 | SRC_URI = "\ |
10 | ${BASEURI} \ | 12 | ${BASEURI} \ |
11 | file://llvm-config \ | ||
12 | file://libunwind.pc.in \ | ||
13 | file://0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch \ | 13 | file://0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch \ |
14 | file://0002-compiler-rt-support-a-new-embedded-linux-target.patch \ | 14 | file://0002-compiler-rt-support-a-new-embedded-linux-target.patch \ |
15 | file://0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch \ | 15 | file://0003-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch \ |
@@ -44,12 +44,13 @@ SRC_URI = "\ | |||
44 | file://0033-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch \ | 44 | file://0033-compiler-rt-Undef-_TIME_BITS-along-with-_FILE_OFFSET.patch \ |
45 | file://0034-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch \ | 45 | file://0034-ToolChains-Gnu.cpp-ARMLibDirs-search-also-in-lib32.patch \ |
46 | file://0035-compiler-rt-Fix-cmake-check-for-_Float16-and-__bf16.patch \ | 46 | file://0035-compiler-rt-Fix-cmake-check-for-_Float16-and-__bf16.patch \ |
47 | file://0036-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch \ | ||
47 | " | 48 | " |
48 | # Fallback to no-PIE if not set | 49 | # Fallback to no-PIE if not set |
49 | GCCPIE ??= "" | 50 | GCCPIE ??= "" |
50 | 51 | ||
51 | S = "${TMPDIR}/work-shared/llvm-project-source-${PV}-${PR}/git" | 52 | S = "${TMPDIR}/work-shared/llvm-project-source-${PV}-${PR}/llvm-project-${PV}.src" |
52 | B = "${WORKDIR}/llvm-project-source-${PV}/build.${HOST_SYS}.${TARGET_SYS}" | 53 | B ?= "${WORKDIR}/llvm-project-source-${PV}/build.${HOST_SYS}.${TARGET_SYS}" |
53 | 54 | ||
54 | # We need to ensure that for the shared work directory, the do_patch signatures match | 55 | # We need to ensure that for the shared work directory, the do_patch signatures match |
55 | # The real WORKDIR location isn't a dependency for the shared workdir. | 56 | # The real WORKDIR location isn't a dependency for the shared workdir. |
diff --git a/recipes-devtools/clang/compiler-rt-sanitizers_git.bb b/recipes-devtools/clang/compiler-rt-sanitizers_git.bb index 06c0e06..7abdb49 100644 --- a/recipes-devtools/clang/compiler-rt-sanitizers_git.bb +++ b/recipes-devtools/clang/compiler-rt-sanitizers_git.bb | |||
@@ -22,6 +22,8 @@ DEPENDS:append:class-nativesdk = " clang-native clang-crosssdk-${SDK_ARCH} nativ | |||
22 | PACKAGECONFIG ??= "" | 22 | PACKAGECONFIG ??= "" |
23 | PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" | 23 | PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" |
24 | PACKAGECONFIG[static-libcxx] = "-DSANITIZER_USE_STATIC_CXX_ABI=ON -DSANITIZER_USE_STATIC_LLVM_UNWINDER=ON -DCOMPILER_RT_ENABLE_STATIC_UNWINDER=ON,," | 24 | PACKAGECONFIG[static-libcxx] = "-DSANITIZER_USE_STATIC_CXX_ABI=ON -DSANITIZER_USE_STATIC_LLVM_UNWINDER=ON -DCOMPILER_RT_ENABLE_STATIC_UNWINDER=ON,," |
25 | # Context Profiling | ||
26 | PACKAGECONFIG[ctx-profile] ="-DCOMPILER_RT_BUILD_CTX_PROFILE=ON,-DCOMPILER_RT_BUILD_CTX_PROFILE=OFF" | ||
25 | 27 | ||
26 | HF = "" | 28 | HF = "" |
27 | HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" | 29 | HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" |
diff --git a/recipes-devtools/clang/compiler-rt_git.bb b/recipes-devtools/clang/compiler-rt_git.bb index dad6fbd..6ed9bc8 100644 --- a/recipes-devtools/clang/compiler-rt_git.bb +++ b/recipes-devtools/clang/compiler-rt_git.bb | |||
@@ -48,6 +48,8 @@ BUILD_NM:toolchain-clang = "llvm-nm" | |||
48 | PACKAGECONFIG ??= "" | 48 | PACKAGECONFIG ??= "" |
49 | PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" | 49 | PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" |
50 | PACKAGECONFIG[profile] ="-DCOMPILER_RT_BUILD_PROFILE=ON,-DCOMPILER_RT_BUILD_PROFILE=OFF" | 50 | PACKAGECONFIG[profile] ="-DCOMPILER_RT_BUILD_PROFILE=ON,-DCOMPILER_RT_BUILD_PROFILE=OFF" |
51 | # Context Profiling, might need to enable 'profile' too | ||
52 | PACKAGECONFIG[ctx-profile] ="-DCOMPILER_RT_BUILD_CTX_PROFILE=ON,-DCOMPILER_RT_BUILD_CTX_PROFILE=OFF" | ||
51 | 53 | ||
52 | HF = "" | 54 | HF = "" |
53 | HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" | 55 | HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" |
diff --git a/recipes-devtools/clang/libclc_git.bb b/recipes-devtools/clang/libclc_git.bb index 2c4ed0a..590cc01 100644 --- a/recipes-devtools/clang/libclc_git.bb +++ b/recipes-devtools/clang/libclc_git.bb | |||
@@ -15,19 +15,18 @@ DEPENDS += "qemu-native clang spirv-tools spirv-llvm-translator spirv-llvm-trans | |||
15 | 15 | ||
16 | OECMAKE_SOURCEPATH = "${S}/libclc" | 16 | OECMAKE_SOURCEPATH = "${S}/libclc" |
17 | 17 | ||
18 | EXTRA_OECMAKE += " \ | 18 | EXTRA_OECMAKE += "\ |
19 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ | 19 | -DLIBCLC_CUSTOM_LLVM_TOOLS_BINARY_DIR=${STAGING_BINDIR_NATIVE} \ |
20 | -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ | 20 | -DLLVM_CLANG=${STAGING_BINDIR_NATIVE}/clang \ |
21 | -DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper \ | 21 | -DLLVM_AS=${STAGING_BINDIR_NATIVE}/llvm-as \ |
22 | -DLLVM_CLANG=${STAGING_BINDIR_NATIVE}/clang \ | 22 | -DLLVM_LINK=${STAGING_BINDIR_NATIVE}/llvm-link \ |
23 | -DLLVM_AS=${STAGING_BINDIR_NATIVE}/llvm-as \ | 23 | -DLLVM_OPT=${STAGING_BINDIR_NATIVE}/opt \ |
24 | -DLLVM_LINK=${STAGING_BINDIR_NATIVE}/llvm-link \ | 24 | -DLLVM_SPIRV=${STAGING_BINDIR_NATIVE}/llvm-spirv \ |
25 | -DLLVM_OPT=${STAGING_BINDIR_NATIVE}/opt \ | 25 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ |
26 | -DLLVM_SPIRV=${STAGING_BINDIR_NATIVE}/llvm-spirv \ | 26 | -DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper \ |
27 | -Dclc_comp_in:FILEPATH=${OECMAKE_SOURCEPATH}/cmake/CMakeCLCCompiler.cmake.in \ | 27 | -Dclc_comp_in:FILEPATH=${OECMAKE_SOURCEPATH}/cmake/CMakeCLCCompiler.cmake.in \ |
28 | -Dll_comp_in:FILEPATH=${OECMAKE_SOURCEPATH}/cmake/CMakeLLAsmCompiler.cmake.in \ | 28 | -Dll_comp_in:FILEPATH=${OECMAKE_SOURCEPATH}/cmake/CMakeLLAsmCompiler.cmake.in \ |
29 | -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ | 29 | -DCMAKE_POSITION_INDEPENDENT_CODE=ON" |
30 | " | ||
31 | 30 | ||
32 | do_configure:prepend () { | 31 | do_configure:prepend () { |
33 | # Write out a qemu wrapper that will be used by cmake | 32 | # Write out a qemu wrapper that will be used by cmake |
diff --git a/recipes-devtools/clang/libcxx_git.bb b/recipes-devtools/clang/libcxx_git.bb index 9d4f033..b0a2f2e 100644 --- a/recipes-devtools/clang/libcxx_git.bb +++ b/recipes-devtools/clang/libcxx_git.bb | |||
@@ -105,12 +105,14 @@ do_install:append() { | |||
105 | install -Dm 0644 ${S}/libunwind/include/$f ${D}${includedir}/$f | 105 | install -Dm 0644 ${S}/libunwind/include/$f ${D}${includedir}/$f |
106 | done | 106 | done |
107 | install -d ${D}${libdir}/pkgconfig | 107 | install -d ${D}${libdir}/pkgconfig |
108 | sed -e 's,@LIBDIR@,${libdir},g;s,@VERSION@,${PV},g' ${S}/../libunwind.pc.in > ${D}${libdir}/pkgconfig/libunwind.pc | 108 | sed -e 's,@LIBDIR@,${libdir},g;s,@VERSION@,${PV},g' ${S}/libunwind/libunwind.pc.in > ${D}${libdir}/pkgconfig/libunwind.pc |
109 | fi | 109 | fi |
110 | } | 110 | } |
111 | 111 | ||
112 | PACKAGES:append:runtime-llvm = " libunwind" | 112 | PACKAGES:append:runtime-llvm = " libunwind" |
113 | FILES:libunwind:runtime-llvm = "${libdir}/libunwind.so.*" | 113 | FILES:libunwind:runtime-llvm = "${libdir}/libunwind.so.*" |
114 | # Package library module manifest path | ||
115 | FILES:${PN}-dev += "${datadir}/libc++/v1/ ${libdir}/libc++.modules.json" | ||
114 | 116 | ||
115 | BBCLASSEXTEND = "native nativesdk" | 117 | BBCLASSEXTEND = "native nativesdk" |
116 | TOOLCHAIN:forcevariable = "clang" | 118 | TOOLCHAIN:forcevariable = "clang" |
diff --git a/recipes-devtools/clang/llvm-project-source.inc b/recipes-devtools/clang/llvm-project-source.inc index 103373a..50e9154 100644 --- a/recipes-devtools/clang/llvm-project-source.inc +++ b/recipes-devtools/clang/llvm-project-source.inc | |||
@@ -25,6 +25,8 @@ TARGET_OS = "linux" | |||
25 | baselib = "lib" | 25 | baselib = "lib" |
26 | PACKAGE_ARCH = "all" | 26 | PACKAGE_ARCH = "all" |
27 | 27 | ||
28 | B = "${WORKDIR}/build" | ||
29 | |||
28 | # space separated list of additional distro vendor values we want to support e.g. | 30 | # space separated list of additional distro vendor values we want to support e.g. |
29 | # "yoe webos" or "-yoe -webos" '-' is optional | 31 | # "yoe webos" or "-yoe -webos" '-' is optional |
30 | CLANG_EXTRA_OE_VENDORS ?= "${TARGET_VENDOR} ${SDK_VENDOR}" | 32 | CLANG_EXTRA_OE_VENDORS ?= "${TARGET_VENDOR} ${SDK_VENDOR}" |
@@ -34,7 +36,8 @@ CLANG_EXTRA_OE_VENDORS ?= "${TARGET_VENDOR} ${SDK_VENDOR}" | |||
34 | CLANG_EXTRA_OE_DISTRO ?= "poky:poky" | 36 | CLANG_EXTRA_OE_DISTRO ?= "poky:poky" |
35 | # Match with MULTILIB_GLOBAL_VARIANTS | 37 | # Match with MULTILIB_GLOBAL_VARIANTS |
36 | MULTILIB_VARIANTS = "lib32 lib64 libx32" | 38 | MULTILIB_VARIANTS = "lib32 lib64 libx32" |
37 | python add_distro_vendor() { | 39 | |
40 | python do_preconfigure() { | ||
38 | import subprocess | 41 | import subprocess |
39 | case = "" | 42 | case = "" |
40 | triple = "" | 43 | triple = "" |
@@ -92,5 +95,5 @@ python add_distro_vendor() { | |||
92 | } | 95 | } |
93 | 96 | ||
94 | do_patch[vardepsexclude] = "MULTILIBS" | 97 | do_patch[vardepsexclude] = "MULTILIBS" |
95 | do_patch[postfuncs] += "add_distro_vendor" | 98 | addtask do_preconfigure after do_patch |
96 | do_create_spdx[depends] += "${PN}:do_patch" | 99 | do_create_spdx[depends] += "${PN}:do_preconfigure" |
diff --git a/recipes-devtools/clang/nativesdk-clang-glue.bb b/recipes-devtools/clang/nativesdk-clang-glue.bb index 4e0c6fa..1ef67d9 100644 --- a/recipes-devtools/clang/nativesdk-clang-glue.bb +++ b/recipes-devtools/clang/nativesdk-clang-glue.bb | |||
@@ -7,7 +7,7 @@ LICENSE = "Apache-2.0-with-LLVM-exception" | |||
7 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" | 7 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" |
8 | SECTION = "devel" | 8 | SECTION = "devel" |
9 | 9 | ||
10 | inherit nativesdk | 10 | inherit_defer nativesdk |
11 | DEPENDS += "nativesdk-clang" | 11 | DEPENDS += "nativesdk-clang" |
12 | 12 | ||
13 | do_install() { | 13 | do_install() { |
diff --git a/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb index 78f025b..9226fc0 100644 --- a/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb +++ b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb | |||
@@ -1,14 +1,14 @@ | |||
1 | LICENSE = "NCSA" | 1 | LICENSE = "NCSA" |
2 | LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=47e311aa9caedd1b3abf098bd7814d1d" | 2 | LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=47e311aa9caedd1b3abf098bd7814d1d" |
3 | 3 | ||
4 | BRANCH = "main" | 4 | BRANCH = "llvm_release_180" |
5 | SRC_URI = "git://github.com/KhronosGroup/SPIRV-LLVM-Translator;protocol=https;branch=${BRANCH} \ | 5 | SRC_URI = "git://github.com/KhronosGroup/SPIRV-LLVM-Translator;protocol=https;branch=${BRANCH} \ |
6 | git://github.com/KhronosGroup/SPIRV-Headers;protocol=https;destsuffix=git/SPIRV-Headers;name=headers;branch=main \ | 6 | git://github.com/KhronosGroup/SPIRV-Headers;protocol=https;destsuffix=git/SPIRV-Headers;name=headers;branch=main \ |
7 | " | 7 | " |
8 | 8 | ||
9 | PV = "18.0.0+git" | 9 | PV = "18.1.0+git" |
10 | SRCREV = "0e87aefecf7c5006e315427189bff87878e392c1" | 10 | SRCREV = "16b2900747a3cc7993eeb39d4a8442b432a3fda0" |
11 | SRCREV_headers = "d3c2a6fa95ad463ca8044d7fc45557db381a6a64" | 11 | SRCREV_headers = "1c6bb2743599e6eb6f37b2969acc0aef812e32e3" |
12 | 12 | ||
13 | SRCREV_FORMAT = "default_headers" | 13 | SRCREV_FORMAT = "default_headers" |
14 | 14 | ||
@@ -21,7 +21,6 @@ inherit cmake pkgconfig python3native | |||
21 | # Specify any options you want to pass to cmake using EXTRA_OECMAKE: | 21 | # Specify any options you want to pass to cmake using EXTRA_OECMAKE: |
22 | # for CMAKE_SHARED_LIBS=OFF see https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/1868 | 22 | # for CMAKE_SHARED_LIBS=OFF see https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/1868 |
23 | EXTRA_OECMAKE = "\ | 23 | EXTRA_OECMAKE = "\ |
24 | -DBASE_LLVM_VERSION=${LLVMVERSION} \ | ||
25 | -DBUILD_SHARED_LIBS=OFF \ | 24 | -DBUILD_SHARED_LIBS=OFF \ |
26 | -DCMAKE_BUILD_TYPE=Release \ | 25 | -DCMAKE_BUILD_TYPE=Release \ |
27 | -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ | 26 | -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ |
diff --git a/scripts/devtool-clang.sh b/scripts/devtool-clang.sh new file mode 100755 index 0000000..be8359a --- /dev/null +++ b/scripts/devtool-clang.sh | |||
@@ -0,0 +1,48 @@ | |||
1 | #!/usr/bin/env sh | ||
2 | # Clone the repository first if not already done locally | ||
3 | # git clone https://github.com/kraj/llvm-project -b oe/main /mnt/b/yoe/master/workspace/sources/llvm-project | ||
4 | # | ||
5 | # if local repository exists then make a clone/copy | ||
6 | # git clone /home/kraj/work/llvm-project /mnt/b/yoe/master/workspace/sources/llvm-project | ||
7 | # | ||
8 | layerloc="$(dirname "$0")/../conf/layer.conf" | ||
9 | workspace="$(dirname "$0")/../../../workspace" | ||
10 | |||
11 | # Change target and SDK host as needed | ||
12 | target=riscv64 | ||
13 | sdkhost=x86_64 | ||
14 | |||
15 | origver=$(grep "LLVMVERSION =" < "$layerloc" | awk '{print $3}' | tr -d '"') | ||
16 | |||
17 | major=$(grep -e "set(LLVM_VERSION_MAJOR [0-9]" < "$workspace"/sources/llvm-project/cmake/Modules/LLVMVersion.cmake| cut -d ' ' -f 4 | sed "s/)//") | ||
18 | minor=$(grep -e "set(LLVM_VERSION_MINOR [0-9]" < "$workspace"/sources/llvm-project/cmake/Modules/LLVMVersion.cmake| cut -d ' ' -f 4 | sed "s/)//") | ||
19 | patch=$(grep -e "set(LLVM_VERSION_PATCH [0-9]" < "$workspace"/sources/llvm-project/cmake/Modules/LLVMVersion.cmake| cut -d ' ' -f 4 | sed "s/)//") | ||
20 | |||
21 | recipes="\ | ||
22 | llvm-project-source-$origver \ | ||
23 | clang \ | ||
24 | clang-cross-$target \ | ||
25 | clang-crosssdk-$sdkhost \ | ||
26 | clang-cross-canadian-$target \ | ||
27 | nativesdk-clang-glue \ | ||
28 | compiler-rt \ | ||
29 | compiler-rt-sanitizers \ | ||
30 | libclc \ | ||
31 | libcxx \ | ||
32 | openmp \ | ||
33 | " | ||
34 | |||
35 | for recipe in $recipes; do | ||
36 | devtool modify -n "$recipe" "$workspace/sources/llvm-project" | ||
37 | sed -i "/pn-$recipe /p;s/pn-$recipe /pn-nativesdk-$recipe /g" "$workspace"/appends/"$recipe"*.bbappend | ||
38 | sed -i "/pn-$recipe /p;s/pn-$recipe /pn-$recipe-native /g" "$workspace"/appends/"$recipe"*.bbappend | ||
39 | done | ||
40 | |||
41 | for f in "$workspace"/appends/*.bbappend; do | ||
42 | { echo "MAJOR_VER = \"$major\"" ; echo "MINOR_VER = \"$minor\"" ; echo "PATCH_VER = \"$patch\"" ; } >> "$f" | ||
43 | done | ||
44 | |||
45 | sed -i -e "s/$origver/$major.$minor.$patch/g" "$workspace"/appends/llvm-project-source.bbappend | ||
46 | sed -i -e "s/:pn-clang-cross-$target//g" "$workspace"/appends/clang-cross_git.bbappend | ||
47 | sed -i -e "s/:pn-clang-cross-canadian-$target//g" "$workspace"/appends/clang-cross-canadian_git.bbappend | ||
48 | sed -i -e "s/:pn-clang-crosssdk-$sdkhost//g" "$workspace"/appends/clang-crosssdk_git.bbappend | ||