diff options
Diffstat (limited to 'common/recipes-core')
4 files changed, 137 insertions, 0 deletions
diff --git a/common/recipes-core/llvm/files/0002-llvm-allow-env-override-of-exe-path.patch b/common/recipes-core/llvm/files/0002-llvm-allow-env-override-of-exe-path.patch new file mode 100644 index 00000000..7b490a81 --- /dev/null +++ b/common/recipes-core/llvm/files/0002-llvm-allow-env-override-of-exe-path.patch @@ -0,0 +1,35 @@ +From ac39269933a9011567722e69c02734beaa1191b3 Mon Sep 17 00:00:00 2001 +From: Martin Kelly <mkelly@xevo.com> +Date: Fri, 19 May 2017 00:22:57 -0700 +Subject: [PATCH] llvm: allow env override of exe path + +When using a native llvm-config from inside a sysroot, we need llvm-config to +return the libraries, include directories, etc. from inside the sysroot rather +than from the native sysroot. Thus provide an env override for calling +llvm-config from a target sysroot. + +Signed-off-by: Martin Kelly <mkelly@xevo.com> +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +--- + tools/llvm-config/llvm-config.cpp | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp +index 892adc3b9dd..73b6989fa9e 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -226,6 +226,13 @@ Typical components:\n\ + + /// Compute the path to the main executable. + std::string GetExecutablePath(const char *Argv0) { ++ // Hack for Yocto: we need to override the root path when we are using ++ // llvm-config from within a target sysroot. ++ const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH"); ++ if (Sysroot != nullptr) { ++ return Sysroot; ++ } ++ + // This just needs to be some symbol in the binary; C++ doesn't + // allow taking the address of ::main however. + void *P = (void *)(intptr_t)GetExecutablePath; diff --git a/common/recipes-core/llvm/llvm_git.bbappend b/common/recipes-core/llvm/llvm_git.bbappend index 373df6cb..bd77ed77 100644 --- a/common/recipes-core/llvm/llvm_git.bbappend +++ b/common/recipes-core/llvm/llvm_git.bbappend @@ -1,2 +1,16 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=c520ed40e11887bb1d24d86f7f5b1f05" + +SRCREV = "4a059213dd6f034147e9083c21133dc1b57b3a8a" +PV = "7" +BRANCH = "release_70" +PATCH_VERSION = "0" + SRC_URI += "file://0001-llvm-config-allow-overriding-libdir-through-cmdline.patch" +SRC_URI_remove = "file://0001-Disable-generating-a-native-llvm-config.patch" + +INSANE_SKIP_${MLPREFIX}libllvm${LLVM_RELEASE}-llvm-${LLVM_RELEASE}.${PATCH_VERSION}.0 += "dev-so" + +PACKAGES =+ "${PN}-testplugin" +FILES_${PN}-testplugin = "${libdir}/${LLVM_DIR}/TestPlugin.so" +FILES_${PN}-dbg += "${libdir}/${LLVM_DIR}/.debug/TestPlugin.so" diff --git a/common/recipes-core/systemd/files/0001-dissect-Don-t-count-RPMB-and-boot-partitions-8609.patch b/common/recipes-core/systemd/files/0001-dissect-Don-t-count-RPMB-and-boot-partitions-8609.patch new file mode 100644 index 00000000..ed50663e --- /dev/null +++ b/common/recipes-core/systemd/files/0001-dissect-Don-t-count-RPMB-and-boot-partitions-8609.patch @@ -0,0 +1,85 @@ +From d6586055923f0b04df64b197f213804681c8200b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Rechi=20Vita?= <jprvita@gmail.com> +Date: Tue, 3 Apr 2018 05:51:18 -0700 +Subject: [PATCH] dissect: Don't count RPMB and boot partitions (#8609) + +Filter-out RPMB partitions and boot partitions from MMC devices when +counting partitions enumerated by the kernel. Also factor out the now +duplicated code into a separate function. + +This complement the previous fixes to the problem reported in +https://github.com/systemd/systemd/issues/5806 +--- + src/shared/dissect-image.c | 34 ++++++++++++++++++++++++++-------- + 1 file changed, 26 insertions(+), 8 deletions(-) + +diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c +index 86114e3dd1..c74fcb4db0 100644 +--- a/src/shared/dissect-image.c ++++ b/src/shared/dissect-image.c +@@ -108,7 +108,20 @@ not_found: + #endif + } + +-int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectImageFlags flags, DissectedImage **ret) { ++/* Detect RPMB and Boot partitions, which are not listed by blkid. ++ * See https://github.com/systemd/systemd/issues/5806. */ ++static bool device_is_mmc_special_partition(struct udev_device *d) { ++ const char *sysname = udev_device_get_sysname(d); ++ return (sysname && startswith(sysname, "mmcblk") && ++ (endswith(sysname, "rpmb") || endswith(sysname, "boot0") || endswith(sysname, "boot1"))); ++} ++ ++int dissect_image( ++ int fd, ++ const void *root_hash, ++ size_t root_hash_size, ++ DissectImageFlags flags, ++ DissectedImage **ret) { + + #if HAVE_BLKID + sd_id128_t root_uuid = SD_ID128_NULL, verity_uuid = SD_ID128_NULL; +@@ -277,8 +290,17 @@ int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectI + /* Count the partitions enumerated by the kernel */ + n = 0; + first = udev_enumerate_get_list_entry(e); +- udev_list_entry_foreach(item, first) ++ udev_list_entry_foreach(item, first) { ++ _cleanup_udev_device_unref_ struct udev_device *q; ++ ++ q = udev_device_new_from_syspath(udev, udev_list_entry_get_name(item)); ++ if (!q) ++ return -errno; ++ ++ if (device_is_mmc_special_partition(q)) ++ continue; + n++; ++ } + + /* Count the partitions enumerated by blkid */ + z = blkid_partlist_numof_partitions(pl); +@@ -337,7 +359,7 @@ int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectI + _cleanup_udev_device_unref_ struct udev_device *q; + unsigned long long pflags; + blkid_partition pp; +- const char *node, *sysname; ++ const char *node; + dev_t qn; + int nr; + +@@ -352,11 +374,7 @@ int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectI + if (st.st_rdev == qn) + continue; + +- /* Filter out weird MMC RPMB partitions, which cannot reasonably be read, see +- * https://github.com/systemd/systemd/issues/5806 */ +- sysname = udev_device_get_sysname(q); +- if (sysname && startswith(sysname, "mmcblk") && +- (endswith(sysname, "rpmb") || endswith(sysname, "boot0" ) || endswith(sysname, "boot1"))) ++ if (device_is_mmc_special_partition(q)) + continue; + + node = udev_device_get_devnode(q); +-- +2.11.1 + diff --git a/common/recipes-core/systemd/systemd_%.bbappend b/common/recipes-core/systemd/systemd_%.bbappend index 2198b747..182d7b56 100644 --- a/common/recipes-core/systemd/systemd_%.bbappend +++ b/common/recipes-core/systemd/systemd_%.bbappend @@ -1,3 +1,6 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +SRC_URI_append_amd = " file://0001-dissect-Don-t-count-RPMB-and-boot-partitions-8609.patch" + pkg_postinst_udev-hwdb_amd () { } pkg_postinst_ontarget_udev-hwdb_amd () { |