summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md23
-rw-r--r--conf/layer.conf4
-rw-r--r--conf/nonclangable.conf1
-rw-r--r--dynamic-layers/meta-python/recipes-devtools/bcc/bcc_0.29.1.bb2
-rw-r--r--dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.20.1.bb6
-rw-r--r--recipes-devtools/clang/clang.inc7
-rw-r--r--recipes-devtools/clang/clang/0036-llvm-Add-libunwind.pc.in-and-llvm-config-scripts.patch90
-rw-r--r--recipes-devtools/clang/clang/libunwind.pc.in9
-rw-r--r--recipes-devtools/clang/clang/llvm-config52
-rw-r--r--recipes-devtools/clang/clang_git.bb2
-rw-r--r--recipes-devtools/clang/common-source.inc4
-rw-r--r--recipes-devtools/clang/common.inc11
-rw-r--r--recipes-devtools/clang/compiler-rt-sanitizers_git.bb2
-rw-r--r--recipes-devtools/clang/compiler-rt_git.bb2
-rw-r--r--recipes-devtools/clang/libclc_git.bb25
-rw-r--r--recipes-devtools/clang/libcxx_git.bb4
-rw-r--r--recipes-devtools/clang/llvm-project-source.inc9
-rw-r--r--recipes-devtools/clang/nativesdk-clang-glue.bb2
-rw-r--r--recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb9
-rwxr-xr-xscripts/devtool-clang.sh48
20 files changed, 206 insertions, 106 deletions
diff --git a/README.md b/README.md
index 599237c..3a7e427 100644
--- a/README.md
+++ b/README.md
@@ -235,6 +235,29 @@ URI: ghttps://github.com/openembedded/bitbake.git
235branch: master 235branch: master
236revision: HEAD 236revision: HEAD
237``` 237```
238# Using Devtool and Upstream Development
239
240All LLVM based recipes use single llvm source directory, As a LLVM
241developer, you might want to work on your own repository to build
242related recipes, devtool can we useful in establishing such a workflow
243there is a script provided `scripts/devtool-clang.sh` which can assist
244in setting up all the recipes to use custom LLVM repository, in order
245to setup repository make sure that it has all the needed patches applied
246or else it will fail to build. Such a tree is already prepared and kept
247in sync at
248
249https://github.com/kraj/llvm-project
250
251There are branches under `oe` namespace which carry the needed OE patches
252
253```
254cd $TOPDIR/workspace/sources
255git clone https://github.com/kraj/llvm-project -b oe/main llvm-project
256```
257
258Once project is setup and meta-clang is added, run `devtool-clang.sh`
259script which will do the needed for setting up external sources for the
260yocto 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"
7BBFILE_COLLECTIONS += "clang-layer" 7BBFILE_COLLECTIONS += "clang-layer"
8BBFILE_PATTERN_clang-layer := "^${LAYERDIR}/" 8BBFILE_PATTERN_clang-layer := "^${LAYERDIR}/"
9BBFILE_PRIORITY_clang-layer = "7" 9BBFILE_PRIORITY_clang-layer = "7"
10LAYERSERIES_COMPAT_clang-layer = "nanbield scarthgap" 10LAYERSERIES_COMPAT_clang-layer = "scarthgap styhead"
11LAYERDEPENDS_clang-layer = "core" 11LAYERDEPENDS_clang-layer = "core"
12 12
13BBFILES_DYNAMIC += " \ 13BBFILES_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
34CLANGSDK ??= "0" 34CLANGSDK ??= "0"
35 35
36LLVMVERSION = "18.1.4" 36LLVMVERSION = "18.1.6"
37 37
38require conf/nonclangable.conf 38require conf/nonclangable.conf
39require conf/nonscanable.conf 39require 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
613LDFLAGS:append:pn-kernel-selftest:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 613LDFLAGS:append:pn-kernel-selftest:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
614LDFLAGS:append:pn-openldap:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 614LDFLAGS:append:pn-openldap:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
615LDFLAGS:append:pn-liburing:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 615LDFLAGS:append:pn-liburing:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
616LDFLAGS: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
617LDFLAGS:append:pn-wtmpdb:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}" 618LDFLAGS:append:pn-wtmpdb:toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' -Wl,--undefined-version', '', d)}"
618TUNE_CCARGS:remove:pn-kernel-selftest:toolchain-clang = "-mfpmath=sse" 619TUNE_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
47def llvm_major_version(d):
48 pvsplit = d.getVar('LLVMVERSION').split('.')
49 return pvsplit[0]
50
51LLVM_MAJOR_VERSION = "${@llvm_major_version(d)}"
52
53EXTRA_OECMAKE = " \ 47EXTRA_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 @@
1LLVM_RELEASE = "" 1LLVM_RELEASE = ""
2LLVM_DIR = "llvm${LLVM_RELEASE}" 2LLVM_DIR = "llvm${LLVM_RELEASE}"
3 3
4LLVM_GIT ?= "git://github.com/llvm" 4LLVM_HTTP ?= "https://github.com/llvm"
5LLVM_GIT_PROTOCOL ?= "https"
6 5
7MAJOR_VER = "18" 6MAJOR_VER = "18"
8MINOR_VER = "1" 7MINOR_VER = "1"
9PATCH_VER = "4" 8PATCH_VER = "6"
10# could be 'rcX' or 'git' or empty ( for release ) 9# could be 'rcX' or 'git' or empty ( for release )
11VER_SUFFIX = "" 10VER_SUFFIX = ""
12SRCREV ?= "e6c3289804a67ea0bb6a86fadbe454dd93b8d855"
13 11
14PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}${VER_SUFFIX}" 12PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}${VER_SUFFIX}"
15BRANCH = "release/18.x"
16 13
17LLVMMD5SUM = "8a15a0759ef07f2682d2ba4b893c9afe" 14LLVMMD5SUM = "8a15a0759ef07f2682d2ba4b893c9afe"
18CLANGMD5SUM = "ff42885ed2ab98f1ecb8c1fc41205343" 15CLANGMD5SUM = "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 @@
1From e54d4a15f31b8f84dc24ae14efc65713b1a6d6d7 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 14 May 2024 22:04:43 -0700
4Subject: [PATCH] llvm: Add libunwind.pc.in and llvm-config scripts
5
6These are added by OE project
7
8Upstream-Status: Inappropriate [ OE-Specific ]
9
10Signed-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
18diff --git a/libunwind/libunwind.pc.in b/libunwind/libunwind.pc.in
19new file mode 100644
20index 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
33diff --git a/llvm/tools/llvm-config/llvm-config b/llvm/tools/llvm-config/llvm-config
34new file mode 100644
35index 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 @@
1prefix=/usr
2exec_prefix=/usr
3libdir=@LIBDIR@
4includedir=/usr/include
5
6Name: libunwind
7Description: libunwind base library
8Version: @VERSION@
9Libs: -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#
8SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
9NEXT_LLVM_CONFIG="$(which -a llvm-config | sed -n 2p)"
10export YOCTO_ALTERNATE_EXE_PATH="${YOCTO_ALTERNATE_EXE_PATH:="$(readlink -f "$SCRIPT_DIR/../llvm-config")"}"
11if [ -n "$( echo $base_libdir | sed -n '/lib64/p')" ]; then
12 export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib64"}"
13else
14 export YOCTO_ALTERNATE_LIBDIR="${YOCTO_ALTERNATE_LIBDIR:="/lib"}"
15fi
16if [[ $# == 0 ]]; then
17 exec "$NEXT_LLVM_CONFIG"
18fi
19
20remain=""
21output=""
22for 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
46done
47
48if [ "${remain}" != "" ]; then
49 output="${output} "$("$NEXT_LLVM_CONFIG" ${remain})
50fi
51
52echo "${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
430clang_sysroot_preprocess() { 430clang_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
8SRC_URI = "" 8SRC_URI = ""
9 9
10do_configure[depends] += "llvm-project-source-${PV}:do_patch" 10do_configure[depends] += "llvm-project-source-${PV}:do_preconfigure"
11do_populate_lic[depends] += "llvm-project-source-${PV}:do_unpack" 11do_populate_lic[depends] += "llvm-project-source-${PV}:do_unpack"
12do_create_spdx[depends] += "llvm-project-source-${PV}:do_patch" 12do_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"
6LICENSE = "Apache-2.0-with-LLVM-exception" 6LICENSE = "Apache-2.0-with-LLVM-exception"
7 7
8BASEURI ??= "${LLVM_GIT}/llvm-project.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH}" 8BASEURI = "${LLVM_HTTP}/llvm-project/releases/download/llvmorg-${PV}/llvm-project-${PV}.src.tar.xz"
9SRC_URI[sha256sum] = "bd4b4cb6374bcd5fc5a3ba60cb80425d29da34f316b8821abc12c0db225cf6b4"
10
9SRC_URI = "\ 11SRC_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
49GCCPIE ??= "" 50GCCPIE ??= ""
50 51
51S = "${TMPDIR}/work-shared/llvm-project-source-${PV}-${PR}/git" 52S = "${TMPDIR}/work-shared/llvm-project-source-${PV}-${PR}/llvm-project-${PV}.src"
52B = "${WORKDIR}/llvm-project-source-${PV}/build.${HOST_SYS}.${TARGET_SYS}" 53B ?= "${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
22PACKAGECONFIG ??= "" 22PACKAGECONFIG ??= ""
23PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" 23PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF"
24PACKAGECONFIG[static-libcxx] = "-DSANITIZER_USE_STATIC_CXX_ABI=ON -DSANITIZER_USE_STATIC_LLVM_UNWINDER=ON -DCOMPILER_RT_ENABLE_STATIC_UNWINDER=ON,," 24PACKAGECONFIG[static-libcxx] = "-DSANITIZER_USE_STATIC_CXX_ABI=ON -DSANITIZER_USE_STATIC_LLVM_UNWINDER=ON -DCOMPILER_RT_ENABLE_STATIC_UNWINDER=ON,,"
25# Context Profiling
26PACKAGECONFIG[ctx-profile] ="-DCOMPILER_RT_BUILD_CTX_PROFILE=ON,-DCOMPILER_RT_BUILD_CTX_PROFILE=OFF"
25 27
26HF = "" 28HF = ""
27HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" 29HF: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"
48PACKAGECONFIG ??= "" 48PACKAGECONFIG ??= ""
49PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF" 49PACKAGECONFIG[crt] = "-DCOMPILER_RT_BUILD_CRT:BOOL=ON,-DCOMPILER_RT_BUILD_CRT:BOOL=OFF"
50PACKAGECONFIG[profile] ="-DCOMPILER_RT_BUILD_PROFILE=ON,-DCOMPILER_RT_BUILD_PROFILE=OFF" 50PACKAGECONFIG[profile] ="-DCOMPILER_RT_BUILD_PROFILE=ON,-DCOMPILER_RT_BUILD_PROFILE=OFF"
51# Context Profiling, might need to enable 'profile' too
52PACKAGECONFIG[ctx-profile] ="-DCOMPILER_RT_BUILD_CTX_PROFILE=ON,-DCOMPILER_RT_BUILD_CTX_PROFILE=OFF"
51 53
52HF = "" 54HF = ""
53HF:class-target = "${@ bb.utils.contains('TUNE_CCARGS_MFLOAT', 'hard', 'hf', '', d)}" 55HF: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
16OECMAKE_SOURCEPATH = "${S}/libclc" 16OECMAKE_SOURCEPATH = "${S}/libclc"
17 17
18EXTRA_OECMAKE += " \ 18EXTRA_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
32do_configure:prepend () { 31do_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
112PACKAGES:append:runtime-llvm = " libunwind" 112PACKAGES:append:runtime-llvm = " libunwind"
113FILES:libunwind:runtime-llvm = "${libdir}/libunwind.so.*" 113FILES:libunwind:runtime-llvm = "${libdir}/libunwind.so.*"
114# Package library module manifest path
115FILES:${PN}-dev += "${datadir}/libc++/v1/ ${libdir}/libc++.modules.json"
114 116
115BBCLASSEXTEND = "native nativesdk" 117BBCLASSEXTEND = "native nativesdk"
116TOOLCHAIN:forcevariable = "clang" 118TOOLCHAIN: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"
25baselib = "lib" 25baselib = "lib"
26PACKAGE_ARCH = "all" 26PACKAGE_ARCH = "all"
27 27
28B = "${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
30CLANG_EXTRA_OE_VENDORS ?= "${TARGET_VENDOR} ${SDK_VENDOR}" 32CLANG_EXTRA_OE_VENDORS ?= "${TARGET_VENDOR} ${SDK_VENDOR}"
@@ -34,7 +36,8 @@ CLANG_EXTRA_OE_VENDORS ?= "${TARGET_VENDOR} ${SDK_VENDOR}"
34CLANG_EXTRA_OE_DISTRO ?= "poky:poky" 36CLANG_EXTRA_OE_DISTRO ?= "poky:poky"
35# Match with MULTILIB_GLOBAL_VARIANTS 37# Match with MULTILIB_GLOBAL_VARIANTS
36MULTILIB_VARIANTS = "lib32 lib64 libx32" 38MULTILIB_VARIANTS = "lib32 lib64 libx32"
37python add_distro_vendor() { 39
40python 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
94do_patch[vardepsexclude] = "MULTILIBS" 97do_patch[vardepsexclude] = "MULTILIBS"
95do_patch[postfuncs] += "add_distro_vendor" 98addtask do_preconfigure after do_patch
96do_create_spdx[depends] += "${PN}:do_patch" 99do_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"
7LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab" 7LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0-with-LLVM-exception;md5=0bcd48c3bdfef0c9d9fd17726e4b7dab"
8SECTION = "devel" 8SECTION = "devel"
9 9
10inherit nativesdk 10inherit_defer nativesdk
11DEPENDS += "nativesdk-clang" 11DEPENDS += "nativesdk-clang"
12 12
13do_install() { 13do_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 @@
1LICENSE = "NCSA" 1LICENSE = "NCSA"
2LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=47e311aa9caedd1b3abf098bd7814d1d" 2LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=47e311aa9caedd1b3abf098bd7814d1d"
3 3
4BRANCH = "main" 4BRANCH = "llvm_release_180"
5SRC_URI = "git://github.com/KhronosGroup/SPIRV-LLVM-Translator;protocol=https;branch=${BRANCH} \ 5SRC_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
9PV = "18.0.0+git" 9PV = "18.1.0+git"
10SRCREV = "0e87aefecf7c5006e315427189bff87878e392c1" 10SRCREV = "16b2900747a3cc7993eeb39d4a8442b432a3fda0"
11SRCREV_headers = "d3c2a6fa95ad463ca8044d7fc45557db381a6a64" 11SRCREV_headers = "1c6bb2743599e6eb6f37b2969acc0aef812e32e3"
12 12
13SRCREV_FORMAT = "default_headers" 13SRCREV_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
23EXTRA_OECMAKE = "\ 23EXTRA_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#
8layerloc="$(dirname "$0")/../conf/layer.conf"
9workspace="$(dirname "$0")/../../../workspace"
10
11# Change target and SDK host as needed
12target=riscv64
13sdkhost=x86_64
14
15origver=$(grep "LLVMVERSION =" < "$layerloc" | awk '{print $3}' | tr -d '"')
16
17major=$(grep -e "set(LLVM_VERSION_MAJOR [0-9]" < "$workspace"/sources/llvm-project/cmake/Modules/LLVMVersion.cmake| cut -d ' ' -f 4 | sed "s/)//")
18minor=$(grep -e "set(LLVM_VERSION_MINOR [0-9]" < "$workspace"/sources/llvm-project/cmake/Modules/LLVMVersion.cmake| cut -d ' ' -f 4 | sed "s/)//")
19patch=$(grep -e "set(LLVM_VERSION_PATCH [0-9]" < "$workspace"/sources/llvm-project/cmake/Modules/LLVMVersion.cmake| cut -d ' ' -f 4 | sed "s/)//")
20
21recipes="\
22llvm-project-source-$origver \
23clang \
24clang-cross-$target \
25clang-crosssdk-$sdkhost \
26clang-cross-canadian-$target \
27nativesdk-clang-glue \
28compiler-rt \
29compiler-rt-sanitizers \
30libclc \
31libcxx \
32openmp \
33"
34
35for 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
39done
40
41for f in "$workspace"/appends/*.bbappend; do
42 { echo "MAJOR_VER = \"$major\"" ; echo "MINOR_VER = \"$minor\"" ; echo "PATCH_VER = \"$patch\"" ; } >> "$f"
43done
44
45sed -i -e "s/$origver/$major.$minor.$patch/g" "$workspace"/appends/llvm-project-source.bbappend
46sed -i -e "s/:pn-clang-cross-$target//g" "$workspace"/appends/clang-cross_git.bbappend
47sed -i -e "s/:pn-clang-cross-canadian-$target//g" "$workspace"/appends/clang-cross-canadian_git.bbappend
48sed -i -e "s/:pn-clang-crosssdk-$sdkhost//g" "$workspace"/appends/clang-crosssdk_git.bbappend