summaryrefslogtreecommitdiff
path: root/poky/meta/classes-recipe
diff options
context:
space:
mode:
Diffstat (limited to 'poky/meta/classes-recipe')
-rw-r--r--poky/meta/classes-recipe/baremetal-image.bbclass25
-rw-r--r--poky/meta/classes-recipe/image.bbclass10
-rw-r--r--poky/meta/classes-recipe/kernel-arch.bbclass2
-rw-r--r--poky/meta/classes-recipe/kernel-fitimage.bbclass21
-rw-r--r--poky/meta/classes-recipe/kernel-module-split.bbclass2
-rw-r--r--poky/meta/classes-recipe/kernel.bbclass14
-rw-r--r--poky/meta/classes-recipe/meson.bbclass8
-rw-r--r--poky/meta/classes-recipe/populate_sdk_base.bbclass9
-rw-r--r--poky/meta/classes-recipe/populate_sdk_ext.bbclass3
-rw-r--r--poky/meta/classes-recipe/python3targetconfig.bbclass18
-rw-r--r--poky/meta/classes-recipe/qemuboot.bbclass3
-rw-r--r--poky/meta/classes-recipe/rust-common.bbclass34
-rw-r--r--poky/meta/classes-recipe/rust-target-config.bbclass21
-rw-r--r--poky/meta/classes-recipe/setuptools3_legacy.bbclass2
-rw-r--r--poky/meta/classes-recipe/systemd.bbclass2
-rw-r--r--poky/meta/classes-recipe/toolchain-scripts.bbclass2
-rw-r--r--poky/meta/classes-recipe/uboot-sign.bbclass4
-rw-r--r--poky/meta/classes-recipe/update-alternatives.bbclass2
-rw-r--r--poky/meta/classes-recipe/update-rc.d.bbclass4
19 files changed, 130 insertions, 56 deletions
diff --git a/poky/meta/classes-recipe/baremetal-image.bbclass b/poky/meta/classes-recipe/baremetal-image.bbclass
index d3377a92fa..70791f999a 100644
--- a/poky/meta/classes-recipe/baremetal-image.bbclass
+++ b/poky/meta/classes-recipe/baremetal-image.bbclass
@@ -15,15 +15,6 @@
#
# See meta-skeleton for a working example.
-## Emulate image.bbclass
-# Handle inherits of any of the image classes we need
-IMAGE_CLASSES ??= ""
-IMGCLASSES = " ${IMAGE_CLASSES}"
-inherit ${IMGCLASSES}
-# Set defaults to satisfy IMAGE_FEATURES check
-IMAGE_FEATURES ?= ""
-IMAGE_FEATURES[type] = "list"
-IMAGE_FEATURES[validitems] += ""
# Toolchain should be baremetal or newlib based.
# TCLIBC="baremetal" or TCLIBC="newlib"
@@ -95,6 +86,11 @@ QB_DEFAULT_FSTYPE ?= "bin"
QB_DTB ?= ""
QB_OPT_APPEND:append = " -nographic"
+# QEMU x86 requires an .elf kernel to boot rather than a .bin
+QB_DEFAULT_KERNEL:qemux86 ?= "${IMAGE_LINK_NAME}.elf"
+# QEMU x86-64 refuses to boot from -kernel, needs a multiboot compatible image
+QB_DEFAULT_FSTYPE:qemux86-64 ?= "iso"
+
# RISC-V tunes set the BIOS, unset, and instruct QEMU to
# ignore the BIOS and boot from -kernel
QB_DEFAULT_BIOS:qemuriscv64 = ""
@@ -110,6 +106,17 @@ QB_OPT_APPEND:append:qemuriscv32 = " -bios none"
CFLAGS:append:qemuriscv64 = " -mcmodel=medany"
+## Emulate image.bbclass
+# Handle inherits of any of the image classes we need
+IMAGE_CLASSES ??= ""
+IMGCLASSES = " ${IMAGE_CLASSES}"
+inherit ${IMGCLASSES}
+# Set defaults to satisfy IMAGE_FEATURES check
+IMAGE_FEATURES ?= ""
+IMAGE_FEATURES[type] = "list"
+IMAGE_FEATURES[validitems] += ""
+
+
# This next part is necessary to trick the build system into thinking
# its building an image recipe so it generates the qemuboot.conf
addtask do_rootfs before do_image after do_install
diff --git a/poky/meta/classes-recipe/image.bbclass b/poky/meta/classes-recipe/image.bbclass
index e387645503..d9472a795a 100644
--- a/poky/meta/classes-recipe/image.bbclass
+++ b/poky/meta/classes-recipe/image.bbclass
@@ -182,8 +182,7 @@ python () {
IMAGE_POSTPROCESS_COMMAND ?= ""
-# some default locales
-IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
+IMAGE_LINGUAS ??= ""
LINGUAS_INSTALL ?= "${@" ".join(map(lambda s: "locale-base-%s" % s, d.getVar('IMAGE_LINGUAS').split()))}"
@@ -203,6 +202,7 @@ fakeroot python do_rootfs () {
from oe.rootfs import create_rootfs
from oe.manifest import create_manifest
import logging
+ import oe.packagedata
logger = d.getVar('BB_TASK_LOGGER', False)
if logger:
@@ -247,9 +247,9 @@ fakeroot python do_rootfs () {
# otherwise, the multilib renaming could step in and squash any fixups that
# may have occurred.
pn = d.getVar('PN')
- runtime_mapping_rename("PACKAGE_INSTALL", pn, d)
- runtime_mapping_rename("PACKAGE_INSTALL_ATTEMPTONLY", pn, d)
- runtime_mapping_rename("BAD_RECOMMENDATIONS", pn, d)
+ oe.packagedata.runtime_mapping_rename("PACKAGE_INSTALL", pn, d)
+ oe.packagedata.runtime_mapping_rename("PACKAGE_INSTALL_ATTEMPTONLY", pn, d)
+ oe.packagedata.runtime_mapping_rename("BAD_RECOMMENDATIONS", pn, d)
# Generate the initial manifest
create_manifest(d)
diff --git a/poky/meta/classes-recipe/kernel-arch.bbclass b/poky/meta/classes-recipe/kernel-arch.bbclass
index 6f5d3bde6c..1531ae6cd5 100644
--- a/poky/meta/classes-recipe/kernel-arch.bbclass
+++ b/poky/meta/classes-recipe/kernel-arch.bbclass
@@ -70,5 +70,5 @@ HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}"
KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd ${DEBUG_PREFIX_MAP} -fdebug-prefix-map=${STAGING_KERNEL_DIR}=${KERNEL_SRC_PATH} -fdebug-prefix-map=${STAGING_KERNEL_BUILDDIR}=${KERNEL_SRC_PATH}"
KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}"
KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}"
-TOOLCHAIN = "gcc"
+TOOLCHAIN ?= "gcc"
diff --git a/poky/meta/classes-recipe/kernel-fitimage.bbclass b/poky/meta/classes-recipe/kernel-fitimage.bbclass
index 7980910aa8..b77747404f 100644
--- a/poky/meta/classes-recipe/kernel-fitimage.bbclass
+++ b/poky/meta/classes-recipe/kernel-fitimage.bbclass
@@ -89,6 +89,9 @@ FIT_CONF_PREFIX[doc] = "Prefix to use for FIT configuration node name"
FIT_SUPPORTED_INITRAMFS_FSTYPES ?= "cpio.lz4 cpio.lzo cpio.lzma cpio.xz cpio.zst cpio.gz ext2.gz cpio"
+# Allow user to select the default DTB for FIT image when multiple dtb's exists.
+FIT_CONF_DEFAULT_DTB ?= ""
+
# Keys used to sign individually image nodes.
# The keys to sign image nodes must be different from those used to sign
# configuration nodes, otherwise the "required" property, from
@@ -412,6 +415,7 @@ fitimage_emit_section_config() {
bootscr_line=""
setup_line=""
default_line=""
+ default_dtb_image="${FIT_CONF_DEFAULT_DTB}"
dtb_image_sect=$(symlink_points_below $dtb_image "${EXTERNAL_KERNEL_DEVICETREE}")
if [ -z "$dtb_image_sect" ]; then
@@ -462,7 +466,17 @@ fitimage_emit_section_config() {
# default node is selected based on dtb ID if it is present,
# otherwise its selected based on kernel ID
if [ -n "$dtb_image" ]; then
- default_line="default = \"${FIT_CONF_PREFIX}$dtb_image\";"
+ # Select default node as user specified dtb when
+ # multiple dtb exists.
+ if [ -n "$default_dtb_image" ]; then
+ if [ -s "${EXTERNAL_KERNEL_DEVICETREE}/$default_dtb_image" ]; then
+ default_line="default = \"${FIT_CONF_PREFIX}$default_dtb_image\";"
+ else
+ bbwarn "Couldn't find a valid user specified dtb in ${EXTERNAL_KERNEL_DEVICETREE}/$default_dtb_image"
+ fi
+ else
+ default_line="default = \"${FIT_CONF_PREFIX}$dtb_image\";"
+ fi
else
default_line="default = \"${FIT_CONF_PREFIX}$kernel_id\";"
fi
@@ -590,8 +604,9 @@ fitimage_assemble() {
if [ -n "${EXTERNAL_KERNEL_DEVICETREE}" ]; then
dtbcount=1
- for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" \( -name '*.dtb' -o -name '*.dtbo' \) -printf '%P\n' | sort); do
- # Skip DTB if we've picked it up previously
+ for DTB in $(find "${EXTERNAL_KERNEL_DEVICETREE}" -name '*.dtb' -printf '%P\n' | sort) \
+ $(find "${EXTERNAL_KERNEL_DEVICETREE}" -name '*.dtbo' -printf '%P\n' | sort); do
+ # Skip DTB/DTBO if we've picked it up previously
echo "$DTBS" | tr ' ' '\n' | grep -xq "$DTB" && continue
DTBS="$DTBS $DTB"
diff --git a/poky/meta/classes-recipe/kernel-module-split.bbclass b/poky/meta/classes-recipe/kernel-module-split.bbclass
index 08c2e54e86..50882c31a7 100644
--- a/poky/meta/classes-recipe/kernel-module-split.bbclass
+++ b/poky/meta/classes-recipe/kernel-module-split.bbclass
@@ -35,7 +35,7 @@ do_install:append() {
}
KERNEL_SPLIT_MODULES ?= "1"
-PACKAGESPLITFUNCS:prepend = "split_kernel_module_packages "
+PACKAGESPLITFUNCS =+ "split_kernel_module_packages"
KERNEL_MODULES_META_PACKAGE ?= "${@ d.getVar("KERNEL_PACKAGE_NAME") or "kernel" }-modules"
diff --git a/poky/meta/classes-recipe/kernel.bbclass b/poky/meta/classes-recipe/kernel.bbclass
index 3834a42fb9..bd3b6471c6 100644
--- a/poky/meta/classes-recipe/kernel.bbclass
+++ b/poky/meta/classes-recipe/kernel.bbclass
@@ -367,6 +367,10 @@ kernel_do_compile() {
export KBUILD_BUILD_TIMESTAMP="$ts"
export KCONFIG_NOTIMESTAMP=1
bbnote "KBUILD_BUILD_TIMESTAMP: $ts"
+ else
+ ts=`LC_ALL=C date`
+ export KBUILD_BUILD_TIMESTAMP="$ts"
+ bbnote "KBUILD_BUILD_TIMESTAMP: $ts"
fi
# The $use_alternate_initrd is only set from
# do_bundle_initramfs() This variable is specifically for the
@@ -412,6 +416,10 @@ do_compile_kernelmodules() {
export KBUILD_BUILD_TIMESTAMP="$ts"
export KCONFIG_NOTIMESTAMP=1
bbnote "KBUILD_BUILD_TIMESTAMP: $ts"
+ else
+ ts=`LC_ALL=C date`
+ export KBUILD_BUILD_TIMESTAMP="$ts"
+ bbnote "KBUILD_BUILD_TIMESTAMP: $ts"
fi
if (grep -q -i -e '^CONFIG_MODULES=y$' ${B}/.config); then
oe_runmake -C ${B} ${PARALLEL_MAKE} modules ${KERNEL_EXTRA_ARGS}
@@ -442,8 +450,8 @@ kernel_do_install() {
oe_runmake DEPMOD=echo MODLIB=${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION} INSTALL_FW_PATH=${D}${nonarch_base_libdir}/firmware modules_install
rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/build"
rm "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/source"
- # If the kernel/ directory is empty remove it to prevent QA issues
- rmdir --ignore-fail-on-non-empty "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel"
+ # Remove empty module directories to prevent QA issues
+ find "${D}${nonarch_base_libdir}/modules/${KERNEL_VERSION}/kernel" -type d -empty -delete
else
bbnote "no modules to install"
fi
@@ -697,7 +705,7 @@ pkg_postinst:${KERNEL_PACKAGE_NAME}-base () {
fi
}
-PACKAGESPLITFUNCS:prepend = "split_kernel_packages "
+PACKAGESPLITFUNCS =+ "split_kernel_packages"
python split_kernel_packages () {
do_split_packages(d, root='${nonarch_base_libdir}/firmware', file_regex=r'^(.*)\.(bin|fw|cis|csp|dsp)$', output_pattern='${KERNEL_PACKAGE_NAME}-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
diff --git a/poky/meta/classes-recipe/meson.bbclass b/poky/meta/classes-recipe/meson.bbclass
index 765e81bc4f..48688bed75 100644
--- a/poky/meta/classes-recipe/meson.bbclass
+++ b/poky/meta/classes-recipe/meson.bbclass
@@ -72,7 +72,7 @@ strip = ${@meson_array('STRIP', d)}
readelf = ${@meson_array('READELF', d)}
objcopy = ${@meson_array('OBJCOPY', d)}
pkgconfig = 'pkg-config'
-llvm-config = 'llvm-config${LLVMVERSION}'
+llvm-config = 'llvm-config'
cups-config = 'cups-config'
g-ir-scanner = '${STAGING_BINDIR}/g-ir-scanner-wrapper'
g-ir-compiler = '${STAGING_BINDIR}/g-ir-compiler-wrapper'
@@ -152,7 +152,7 @@ meson_do_configure() {
mkdir -p "${B}/meson-private/tmp"
export TMPDIR="${B}/meson-private/tmp"
bbnote Executing meson ${EXTRA_OEMESON}...
- if ! meson ${MESONOPTS} "${MESON_SOURCEPATH}" "${B}" ${MESON_CROSS_FILE} ${EXTRA_OEMESON}; then
+ if ! meson setup ${MESONOPTS} "${MESON_SOURCEPATH}" "${B}" ${MESON_CROSS_FILE} ${EXTRA_OEMESON}; then
bbfatal_log meson failed
fi
}
@@ -169,11 +169,11 @@ do_configure[postfuncs] += "meson_do_qa_configure"
do_compile[progress] = "outof:^\[(\d+)/(\d+)\]\s+"
meson_do_compile() {
- ninja -v ${PARALLEL_MAKE}
+ meson compile -v ${PARALLEL_MAKE}
}
meson_do_install() {
- DESTDIR='${D}' ninja -v ${PARALLEL_MAKEINST} install
+ meson install --destdir ${D} --no-rebuild
}
EXPORT_FUNCTIONS do_configure do_compile do_install
diff --git a/poky/meta/classes-recipe/populate_sdk_base.bbclass b/poky/meta/classes-recipe/populate_sdk_base.bbclass
index 917619962c..7cc9535356 100644
--- a/poky/meta/classes-recipe/populate_sdk_base.bbclass
+++ b/poky/meta/classes-recipe/populate_sdk_base.bbclass
@@ -162,6 +162,7 @@ SDK_POSTPROCESS_COMMAND = " create_sdk_files; check_sdk_sysroots; archive_sdk; $
def populate_sdk_common(d):
from oe.sdk import populate_sdk
from oe.manifest import create_manifest, Manifest
+ import oe.packagedata
# Handle package exclusions
excl_pkgs = (d.getVar("PACKAGE_EXCLUDE") or "").split()
@@ -184,13 +185,13 @@ def populate_sdk_common(d):
d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", ' '.join(inst_attempt_pkgs))
pn = d.getVar('PN')
- runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", pn, d)
- runtime_mapping_rename("TOOLCHAIN_TARGET_TASK_ATTEMPTONLY", pn, d)
+ oe.packagedata.runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", pn, d)
+ oe.packagedata.runtime_mapping_rename("TOOLCHAIN_TARGET_TASK_ATTEMPTONLY", pn, d)
ld = bb.data.createCopy(d)
ld.setVar("PKGDATA_DIR", "${STAGING_DIR}/${SDK_ARCH}-${SDKPKGSUFFIX}${SDK_VENDOR}-${SDK_OS}/pkgdata")
- runtime_mapping_rename("TOOLCHAIN_HOST_TASK", pn, ld)
- runtime_mapping_rename("TOOLCHAIN_HOST_TASK_ATTEMPTONLY", pn, ld)
+ oe.packagedata.runtime_mapping_rename("TOOLCHAIN_HOST_TASK", pn, ld)
+ oe.packagedata.runtime_mapping_rename("TOOLCHAIN_HOST_TASK_ATTEMPTONLY", pn, ld)
d.setVar("TOOLCHAIN_HOST_TASK", ld.getVar("TOOLCHAIN_HOST_TASK"))
d.setVar("TOOLCHAIN_HOST_TASK_ATTEMPTONLY", ld.getVar("TOOLCHAIN_HOST_TASK_ATTEMPTONLY"))
diff --git a/poky/meta/classes-recipe/populate_sdk_ext.bbclass b/poky/meta/classes-recipe/populate_sdk_ext.bbclass
index 01d8a693a7..f78a9f4e9b 100644
--- a/poky/meta/classes-recipe/populate_sdk_ext.bbclass
+++ b/poky/meta/classes-recipe/populate_sdk_ext.bbclass
@@ -255,7 +255,7 @@ python copy_buildsystem () {
bbpath = d.getVar('BBPATH')
env = os.environ.copy()
env['PYTHONDONTWRITEBYTECODE'] = '1'
- bb.process.run(['devtool', '--bbpath', bbpath, '--basepath', baseoutpath, 'create-workspace', '--create-only', os.path.join(baseoutpath, 'workspace')], env=env)
+ bb.process.run(['devtool', '--bbpath', bbpath, '--basepath', baseoutpath, 'create-workspace', '--layerseries', d.getVar("LAYERSERIES_CORENAMES"), '--create-only', os.path.join(baseoutpath, 'workspace')], env=env)
# Create bblayers.conf
bb.utils.mkdirhier(baseoutpath + '/conf')
@@ -498,7 +498,6 @@ python copy_buildsystem () {
else:
tasklistfn = None
-
cachedir = os.path.join(baseoutpath, 'cache')
bb.utils.mkdirhier(cachedir)
bb.parse.siggen.copy_unitaskhashes(cachedir)
diff --git a/poky/meta/classes-recipe/python3targetconfig.bbclass b/poky/meta/classes-recipe/python3targetconfig.bbclass
index 3f89e5e09e..22305fe176 100644
--- a/poky/meta/classes-recipe/python3targetconfig.bbclass
+++ b/poky/meta/classes-recipe/python3targetconfig.bbclass
@@ -10,26 +10,32 @@ EXTRA_PYTHON_DEPENDS ?= ""
EXTRA_PYTHON_DEPENDS:class-target = "python3"
DEPENDS:append = " ${EXTRA_PYTHON_DEPENDS}"
-do_configure:prepend:class-target() {
+setup_target_config() {
export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata"
+ export PYTHONPATH=${STAGING_LIBDIR}/python-sysconfigdata
+ export PATH=${STAGING_EXECPREFIXDIR}/python-target-config/:$PATH
+}
+
+do_configure:prepend:class-target() {
+ setup_target_config
}
do_compile:prepend:class-target() {
- export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata"
+ setup_target_config
}
do_install:prepend:class-target() {
- export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata"
+ setup_target_config
}
do_configure:prepend:class-nativesdk() {
- export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata"
+ setup_target_config
}
do_compile:prepend:class-nativesdk() {
- export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata"
+ setup_target_config
}
do_install:prepend:class-nativesdk() {
- export _PYTHON_SYSCONFIGDATA_NAME="_sysconfigdata"
+ setup_target_config
}
diff --git a/poky/meta/classes-recipe/qemuboot.bbclass b/poky/meta/classes-recipe/qemuboot.bbclass
index 018c000ca2..5a0e50ccfc 100644
--- a/poky/meta/classes-recipe/qemuboot.bbclass
+++ b/poky/meta/classes-recipe/qemuboot.bbclass
@@ -13,6 +13,7 @@
# QB_OPT_APPEND: options to append to qemu, e.g., "-device usb-mouse"
#
# QB_DEFAULT_KERNEL: default kernel to boot, e.g., "bzImage"
+# e.g., "bzImage-initramfs-qemux86-64.bin" if INITRAMFS_IMAGE_BUNDLE is set to 1.
#
# QB_DEFAULT_FSTYPE: default FSTYPE to boot, e.g., "ext4"
#
@@ -93,7 +94,7 @@
QB_MEM ?= "-m 256"
QB_SMP ?= ""
QB_SERIAL_OPT ?= "-serial mon:stdio -serial null"
-QB_DEFAULT_KERNEL ?= "${KERNEL_IMAGETYPE}"
+QB_DEFAULT_KERNEL ?= "${@bb.utils.contains("INITRAMFS_IMAGE_BUNDLE", "1", "${KERNEL_IMAGETYPE}-${INITRAMFS_LINK_NAME}.bin", "${KERNEL_IMAGETYPE}", d)}"
QB_DEFAULT_FSTYPE ?= "ext4"
QB_RNG ?= "-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0"
QB_OPT_APPEND ?= ""
diff --git a/poky/meta/classes-recipe/rust-common.bbclass b/poky/meta/classes-recipe/rust-common.bbclass
index 3338de7502..e0cedd7aa2 100644
--- a/poky/meta/classes-recipe/rust-common.bbclass
+++ b/poky/meta/classes-recipe/rust-common.bbclass
@@ -66,6 +66,12 @@ def rust_base_triple(d, thing):
elif "musl" in os:
libc = "-musl"
os = "linux"
+ elif "elf" in os:
+ libc = "-elf"
+ os = "none"
+ elif "eabi" in os:
+ libc = "-eabi"
+ os = "none"
return arch + vendor + '-' + os + libc
@@ -91,7 +97,7 @@ RUST_BUILD_ARCH = "${@oe.rust.arch_to_rust_arch(d.getVar('BUILD_ARCH'))}"
# Rust additionally will use two additional cases:
# - undecorated (e.g. CC) - equivalent to TARGET
# - triple suffix (e.g. CC:x86_64_unknown_linux_gnu) - both
-# see: https://github.com/alexcrichton/gcc-rs
+# see: https://github.com/rust-lang/cc-rs
# The way that Rust's internal triples and Yocto triples are mapped together
# its likely best to not use the triple suffix due to potential confusion.
@@ -122,12 +128,22 @@ create_wrapper_rust () {
shift
extras="$1"
shift
+ crate_cc_extras="$1"
+ shift
cat <<- EOF > "${file}"
#!/usr/bin/env python3
import os, sys
orig_binary = "$@"
extras = "${extras}"
+
+ # Apply a required subset of CC crate compiler flags
+ # when we build a target recipe for a non-bare-metal target.
+ # https://github.com/rust-lang/cc-rs/blob/main/src/lib.rs#L1614
+ if "CRATE_CC_NO_DEFAULTS" in os.environ.keys() and \
+ "TARGET" in os.environ.keys() and not "-none-" in os.environ["TARGET"]:
+ orig_binary += "${crate_cc_extras}"
+
binary = orig_binary.split()[0]
args = orig_binary.split() + sys.argv[1:]
if extras:
@@ -151,22 +167,22 @@ do_rust_create_wrappers () {
mkdir -p "${WRAPPER_DIR}"
# Yocto Build / Rust Host C compiler
- create_wrapper_rust "${RUST_BUILD_CC}" "" "${BUILD_CC}"
+ create_wrapper_rust "${RUST_BUILD_CC}" "" "${CRATE_CC_FLAGS}" "${BUILD_CC}"
# Yocto Build / Rust Host C++ compiler
- create_wrapper_rust "${RUST_BUILD_CXX}" "" "${BUILD_CXX}"
+ create_wrapper_rust "${RUST_BUILD_CXX}" "" "${CRATE_CC_FLAGS}" "${BUILD_CXX}"
# Yocto Build / Rust Host linker
- create_wrapper_rust "${RUST_BUILD_CCLD}" "" "${BUILD_CCLD}" "${BUILD_LDFLAGS}"
+ create_wrapper_rust "${RUST_BUILD_CCLD}" "" "" "${BUILD_CCLD}" "${BUILD_LDFLAGS}"
# Yocto Build / Rust Host archiver
- create_wrapper_rust "${RUST_BUILD_AR}" "" "${BUILD_AR}"
+ create_wrapper_rust "${RUST_BUILD_AR}" "" "" "${BUILD_AR}"
# Yocto Target / Rust Target C compiler
- create_wrapper_rust "${RUST_TARGET_CC}" "${WRAPPER_TARGET_EXTRALD}" "${WRAPPER_TARGET_CC}" "${WRAPPER_TARGET_LDFLAGS}"
+ create_wrapper_rust "${RUST_TARGET_CC}" "${WRAPPER_TARGET_EXTRALD}" "${CRATE_CC_FLAGS}" "${WRAPPER_TARGET_CC}" "${WRAPPER_TARGET_LDFLAGS}"
# Yocto Target / Rust Target C++ compiler
- create_wrapper_rust "${RUST_TARGET_CXX}" "${WRAPPER_TARGET_EXTRALD}" "${WRAPPER_TARGET_CXX}" "${CXXFLAGS}"
+ create_wrapper_rust "${RUST_TARGET_CXX}" "${WRAPPER_TARGET_EXTRALD}" "${CRATE_CC_FLAGS}" "${WRAPPER_TARGET_CXX}" "${CXXFLAGS}"
# Yocto Target / Rust Target linker
- create_wrapper_rust "${RUST_TARGET_CCLD}" "${WRAPPER_TARGET_EXTRALD}" "${WRAPPER_TARGET_CCLD}" "${WRAPPER_TARGET_LDFLAGS}"
+ create_wrapper_rust "${RUST_TARGET_CCLD}" "${WRAPPER_TARGET_EXTRALD}" "" "${WRAPPER_TARGET_CCLD}" "${WRAPPER_TARGET_LDFLAGS}"
# Yocto Target / Rust Target archiver
- create_wrapper_rust "${RUST_TARGET_AR}" "" "${WRAPPER_TARGET_AR}"
+ create_wrapper_rust "${RUST_TARGET_AR}" "" "" "${WRAPPER_TARGET_AR}"
}
diff --git a/poky/meta/classes-recipe/rust-target-config.bbclass b/poky/meta/classes-recipe/rust-target-config.bbclass
index 2710b4325d..939dd13d2f 100644
--- a/poky/meta/classes-recipe/rust-target-config.bbclass
+++ b/poky/meta/classes-recipe/rust-target-config.bbclass
@@ -355,7 +355,10 @@ def rust_gen_target(d, thing, wd, arch):
tspec['target-c-int-width'] = d.getVarFlag('TARGET_C_INT_WIDTH', arch_abi)
tspec['target-endian'] = d.getVarFlag('TARGET_ENDIAN', arch_abi)
tspec['arch'] = arch_to_rust_target_arch(rust_arch)
- tspec['os'] = "linux"
+ if "baremetal" in d.getVar('TCLIBC'):
+ tspec['os'] = "none"
+ else:
+ tspec['os'] = "linux"
if "musl" in tspec['llvm-target']:
tspec['env'] = "musl"
else:
@@ -401,3 +404,19 @@ python do_rust_gen_targets () {
addtask rust_gen_targets after do_patch before do_compile
do_rust_gen_targets[dirs] += "${RUST_TARGETS_DIR}"
+# For building target C dependecies use only compiler parameters defined in OE
+# and ignore the CC crate defaults which conflicts with OE ones in some cases.
+# https://github.com/rust-lang/cc-rs#external-configuration-via-environment-variables
+# Some CC crate compiler flags are still required.
+# We apply them conditionally in rust wrappers.
+
+CRATE_CC_FLAGS:class-native = ""
+CRATE_CC_FLAGS:class-nativesdk = ""
+CRATE_CC_FLAGS:class-target = " -ffunction-sections -fdata-sections -fPIC"
+
+do_compile:prepend:class-target() {
+ export CRATE_CC_NO_DEFAULTS=1
+}
+do_install:prepend:class-target() {
+ export CRATE_CC_NO_DEFAULTS=1
+}
diff --git a/poky/meta/classes-recipe/setuptools3_legacy.bbclass b/poky/meta/classes-recipe/setuptools3_legacy.bbclass
index 21748f922a..57de956d0a 100644
--- a/poky/meta/classes-recipe/setuptools3_legacy.bbclass
+++ b/poky/meta/classes-recipe/setuptools3_legacy.bbclass
@@ -49,7 +49,7 @@ setuptools3_legacy_do_install() {
install -d ${D}${PYTHON_SITEPACKAGES_DIR}
STAGING_INCDIR=${STAGING_INCDIR} \
STAGING_LIBDIR=${STAGING_LIBDIR} \
- PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
+ PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR}:$PYTHONPATH \
${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py \
build --build-base=${B} install --skip-build ${SETUPTOOLS_INSTALL_ARGS} || \
bbfatal_log "'${PYTHON_PN} setup.py install ${SETUPTOOLS_INSTALL_ARGS}' execution failed."
diff --git a/poky/meta/classes-recipe/systemd.bbclass b/poky/meta/classes-recipe/systemd.bbclass
index f6564c2b31..f9c92e6c2a 100644
--- a/poky/meta/classes-recipe/systemd.bbclass
+++ b/poky/meta/classes-recipe/systemd.bbclass
@@ -205,7 +205,7 @@ python systemd_populate_packages() {
systemd_check_services()
}
-PACKAGESPLITFUNCS:prepend = "systemd_populate_packages "
+PACKAGESPLITFUNCS =+ "systemd_populate_packages"
python rm_systemd_unitdir (){
import shutil
diff --git a/poky/meta/classes-recipe/toolchain-scripts.bbclass b/poky/meta/classes-recipe/toolchain-scripts.bbclass
index 3cc823fe63..fa658a6596 100644
--- a/poky/meta/classes-recipe/toolchain-scripts.bbclass
+++ b/poky/meta/classes-recipe/toolchain-scripts.bbclass
@@ -37,7 +37,7 @@ toolchain_create_sdk_env_script () {
echo '# http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html#AEN80' >> $script
echo '# http://xahlee.info/UnixResource_dir/_/ldpath.html' >> $script
echo '# Only disable this check if you are absolutely know what you are doing!' >> $script
- echo 'if [ ! -z "$LD_LIBRARY_PATH" ]; then' >> $script
+ echo 'if [ ! -z "${LD_LIBRARY_PATH:-}" ]; then' >> $script
echo " echo \"Your environment is misconfigured, you probably need to 'unset LD_LIBRARY_PATH'\"" >> $script
echo " echo \"but please check why this was set in the first place and that it's safe to unset.\"" >> $script
echo ' echo "The SDK will not operate correctly in most cases when LD_LIBRARY_PATH is set."' >> $script
diff --git a/poky/meta/classes-recipe/uboot-sign.bbclass b/poky/meta/classes-recipe/uboot-sign.bbclass
index 3dc029c429..3065c54577 100644
--- a/poky/meta/classes-recipe/uboot-sign.bbclass
+++ b/poky/meta/classes-recipe/uboot-sign.bbclass
@@ -149,7 +149,7 @@ deploy_dtb() {
fi
if [ -f "${UBOOT_NODTB_BINARY}" ]; then
- install -Dm644 ${UBOOT_DTB_BINARY} ${DEPLOYDIR}/${uboot_nodtb_binary}
+ install -Dm644 ${UBOOT_NODTB_BINARY} ${DEPLOYDIR}/${uboot_nodtb_binary}
if [ -n "${type}" ]; then
ln -sf ${uboot_nodtb_binary} ${DEPLOYDIR}/${UBOOT_NODTB_IMAGE}
fi
@@ -407,7 +407,9 @@ do_deploy:prepend() {
deploy_helper ${type}
fi
done
+ unset j
done
+ unset i
else
cd ${B}
deploy_helper ""
diff --git a/poky/meta/classes-recipe/update-alternatives.bbclass b/poky/meta/classes-recipe/update-alternatives.bbclass
index 970d9bcd45..55e0b954d6 100644
--- a/poky/meta/classes-recipe/update-alternatives.bbclass
+++ b/poky/meta/classes-recipe/update-alternatives.bbclass
@@ -265,7 +265,7 @@ def update_alternatives_alt_targets(d, pkg):
return updates
-PACKAGESPLITFUNCS:prepend = "populate_packages_updatealternatives "
+PACKAGESPLITFUNCS =+ "populate_packages_updatealternatives"
python populate_packages_updatealternatives () {
if not update_alternatives_enabled(d):
diff --git a/poky/meta/classes-recipe/update-rc.d.bbclass b/poky/meta/classes-recipe/update-rc.d.bbclass
index cb2aaba57c..a19e704741 100644
--- a/poky/meta/classes-recipe/update-rc.d.bbclass
+++ b/poky/meta/classes-recipe/update-rc.d.bbclass
@@ -68,8 +68,8 @@ python __anonymous() {
update_rc_after_parse(d)
}
-PACKAGESPLITFUNCS:prepend = "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'populate_packages_updatercd ', '', d)}"
-PACKAGESPLITFUNCS:remove:class-nativesdk = "populate_packages_updatercd "
+PACKAGESPLITFUNCS =+ "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'populate_packages_updatercd', '', d)}"
+PACKAGESPLITFUNCS:remove:class-nativesdk = "populate_packages_updatercd"
populate_packages_updatercd[vardeps] += "updatercd_prerm updatercd_postrm updatercd_postinst"
populate_packages_updatercd[vardepsexclude] += "OVERRIDES"