diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2021-08-16 22:03:13 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2021-08-17 03:53:26 +0300 |
commit | 0ca19ccf045e022d8a24d26afbf346ab7f2f519f (patch) | |
tree | 2732b2bd7700fba730c034a547a2e0751696f2ce /poky/meta | |
parent | 23ca3ffa9de533fecc0fcd48fea85e365c323370 (diff) | |
download | openbmc-0ca19ccf045e022d8a24d26afbf346ab7f2f519f.tar.xz |
subtree updates
poky: 492205ea83..94dfcaff64:
Alejandro Hernandez Samaniego (1):
baremetal-helloworld: Enable RISC-V 32 port
Alexandre Belloni (1):
oeqa/runtime/cases: make date.DateTest.test_date more reliable
Anton Blanchard (3):
libjpeg-turbo: Handle powerpc64le without Altivec
kmod: use nonarch_base_libdir for depmod.d and modprobe.d
pixman: Handle PowerPC without Altivec
Changqing Li (1):
libconvert-asn1-perl: 0.27 -> 0.31
Chen Qi (4):
convert-overrides.py: also convert comments without a leading whitespace
meta: use new override syntax in comments
multilib.bbclass: fix new override syntax for virtclass-multilib
util-linux: add back manpages related settings
Daniel Gomez (1):
docs: fix typo in releases
Dmitry Baryshkov (1):
linux-firmware: add more Qualcomm firmware packages
Dragos-Marian Panait (1):
util-linux: fix CVE-2021-37600
Joe Slater (1):
terminal.bbclass: force bash for devshell
Jon Mason (1):
tune-cortexm*: add support for all Arm Cortex-M processors
Jose Quaresma (1):
sstate.bbclass: fix error handling when sstate mirrors is ro
Joshua Watt (2):
classes/cve-check: Move get_patches_cves to library
lib/packagedata: Fix for new overrides
Khem Raj (4):
glibc: Upgrade to 2.34 release
glibc: Remove obsolete --enable-stackguard-randomization
glibc: Drop DUMMY_LOCALE_T define patch
glibc: Add missing symlinks for libpthread and librt dev files
Michael Halstead (1):
releases: update to include 3.1.10
Michael Opdenacker (12):
manuals: mention license information in footer
manuals: further documentation for cve-check
cve-check: remove deprecated CVE_CHECK_CVE_WHITELIST
bsp-guide: overrides syntax updates
dev-manual: overrides syntax updates
kernel-dev manual: overrides syntax updates
ref-manual: overrides syntax updates
sdk-manual: overrides syntax updates
test-manual: overrides syntax updates
sdk-manual: reference obsolete reference to ADT
Manuals: replace "file name" by "filename"
dev-manual: fix grammar in post-install script explanations
Nisha Parrakat (1):
dbus_%.bbappend: stop using selinux_set_mapping
Olaf Mandel (1):
kickstart: document which options accept units
Patrick Williams (3):
pixman: re-disable iwmmxt
systemd: add zstd PACKAGECONFIG
systemd: set zstd as default PACKAGECONFIG
Paul Barker (2):
u-boot: Package extlinux.conf separately
pypi: Allow override of PyPI archive name
Quentin Schulz (3):
insane.bbclass: fix new override syntax migration
docs: fix new override syntax migration
docs: overview-manual: concepts: remove long-gone BBHASHDEPS variable
Richard Purdie (6):
test-manual: Add extra detail to YP Compatible section
migration-3.4: Add extra notes to override syntax changes
ruby: Fix DEBUG_PREFIX_MAP in LDFLAGS issue
gettext: Fix reproducibility issue with LDFLAGS
curl: Fix reproducibility issue with LDFLAGS
libtool: Fix lto option passing for reproducible builds
Ross Burton (11):
e2fsprogs: ensure small images have 256-byte inodes
wic: don't forcibly pass -T default
parted: drop unneeded ld-is-gold patch
parted: update patch status
buildtools-tarball: add testsdk task
oeqa/sdk: add some buildtools tests
bitbake: utils: add environment updating context manager
bitbake: fetch2: expose environment variable names that need to be exported
bitbake: fetch2/wget: ensure all variables are set when calling urllib
bitbake: fetch2/wget: fetch securely by default
tar: ignore node-tar CVEs
Thomas Perrot (2):
kernel-fitimage: images should not be signed with the same keys as the configurations
oeqa/selftest/fitimage: update tests to use two keys
Tim Orling (3):
python3-scons{-native}: upgrade 4.1.0 -> 4.2.0
perl: do_create_rdepends_inc override syntax
package.bbclass: FILER* override syntax
Tom Rini (2):
common-tasks: Add a summary to the end of the bbappend example
manuals: Rename the "Using .bbappend Files in Your Layer" section
Tony Battersby (2):
bitbake.conf: add DEBUG_PREFIX_MAP to TARGET_LDFLAGS
ruby: Fix reproducibility issue with LDFLAGS
Tony Tascioglu (1):
valgrind: skip broken ptests for glibc 2.34
Vyacheslav Yurkov (7):
lib/oe: add generic functions for overlayfs
overlayfs.bbclass: generate overlayfs mount units
rootfs-postcommands: add QA check for overlayfs
systemd-machine-units: add bbappend for meta-selftest
overlayfs: meta-selftest recipe
oeqa/selftest: overlayfs unit tests
MAINTAINERS: add overlayfs maintainer
Yi Zhao (3):
dbus: add PACKAGECONFIG for audit and selinux
glib-2.0: add PACKAGECONFIG for selinux
shadow: add PACKAGECONFIG for audit and selinux
hongxu (1):
sdk: fix relocate symlink failed
wangmy (1):
ell: upgrade 0.41 -> 0.42
meta-raspberrypi: c7f4c739a3..32921fc9bd:
Omer Akram (1):
linux-firmware-rpidistro: fix wifi driver loading on cm4
Otavio Salvador (1):
rpi-config: Allow setting hdmi_cvt
meta-openembedded: 3cf2475ea0..a13db91f19:
Changqing Li (1):
ndpi: fix CVE-2021-36082
Chen Qi (1):
Convert to new override syntax using latest convert-overrides.py script
Dmitry Baryshkov (1):
image_types_sparse: fix sparse image generation
Geoff Parker (1):
cifs-utils: typo fix fakse --> false
Kai Kang (2):
libdbi-perl: fix CVE-2014-10402
python3-m2crypto: fix for new overrides syntax
Khem Raj (1):
packagegroup-meta-oe: Add ttf-ipa
Leon Anavi (15):
python3-astroid: Upgrade 2.6.5 -> 2.6.6
python3-gast: Upgrade 0.5.1 -> 0.5.2
python3-greenlet: Upgrade 1.1.0 -> 1.1.1
python3-bitarray: Upgrade 2.2.3 -> 2.2.5
python3-send2trash: Upgrade 1.7.1 -> 1.8.0
python3-zeroconf: Upgrade 0.33.2 -> 0.34.3
python3-aiohue: Upgrade 2.5.1 -> 2.6.1
python3-configargparse: Upgrade 1.5.1 -> 1.5.2
python3-pycurl: Upgrade 7.43.0.6 -> 7.44.0
python3-distro: Upgrade 1.5.0 -> 1.6.0
python3-google-api-core: Upgrade 1.30.0 -> 1.31.1
python3-google-auth: Upgrade 1.32.0 -> 1.34.0
python3-google-api-python-client: Upgrade 2.12.0 -> 2.15.0
python3-huey: Upgrade 2.3.2 -> 2.4.0
python3-apply-defaults: Upgrade 0.1.4 -> 0.1.6
Martin Jansa (1):
python3-grpcio: make sure that GRPC_CFLAGS is expanded to empty
Michael Opdenacker (3):
vorbis-tools: update to 1.4.2 (latest in 1.4.x series)
bigbuckbunny-1080p: fix sample video URL
opus-tools: update to 0.2, move to meta-multimedia and fix license
Mingli Yu (3):
jemalloc: fix the race during do_install
jemalloc: add ptest support
jemalloc: improve the ptest output
Naveen Saini (1):
python3-defusedxml: extend recipe to add native support
Philippe Coval (1):
mycroft: Install more tools needed by scripts
Tony Battersby (3):
curlpp: fix QA Issue after LDFLAGS change
ldns: fix QA Issue after LDFLAGS change
tcsh: fix compile error after LDFLAGS change
Yi Zhao (5):
audit: upgrade 3.0.3 -> 3.0.4
augeas: rename PACKAGECONFIG[libselinux] to PACKAGECONFIG[selinux]
network-manager-applet: add selinux to PACKAGECONFIG if enable selinux distro feature
networkmanager: add PACKAGECONFIG for audit and selinux
augeas: add selinux to PACKAGECONFIG if enable selinux distro feature
leimaohui (1):
ttf-ipa: Added a new font.
wangmy (1):
iwd: upgrade 1.15 -> 1.16
zangrc (1):
python3-humanize: upgrade 3.10.0 -> 3.11.0
zhengruoqin (3):
python3-engineio: upgrade 4.2.0 -> 4.2.1
python3-ipython: upgrade 7.25.0 -> 7.26.0
python3-isort: upgrade 5.9.2 -> 5.9.3
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I7a8bd19709f465db51254ed3fcaf2486fe64dcaf
Diffstat (limited to 'poky/meta')
117 files changed, 1320 insertions, 1666 deletions
diff --git a/poky/meta/classes/baremetal-image.bbclass b/poky/meta/classes/baremetal-image.bbclass index 9ec3f1460b..089c445522 100644 --- a/poky/meta/classes/baremetal-image.bbclass +++ b/poky/meta/classes/baremetal-image.bbclass @@ -82,12 +82,15 @@ QB_OPT_APPEND:append = " -nographic" # RISC-V tunes set the BIOS, unset, and instruct QEMU to # ignore the BIOS and boot from -kernel QB_DEFAULT_BIOS:qemuriscv64 = "" +QB_DEFAULT_BIOS:qemuriscv32 = "" QB_OPT_APPEND:append:qemuriscv64 = " -bios none" +QB_OPT_APPEND:append:qemuriscv32 = " -bios none" # Use the medium-any code model for the RISC-V 64 bit implementation, # since medlow can only access addresses below 0x80000000 and RAM # starts at 0x80000000 on RISC-V 64 +# Keep RISC-V 32 using -mcmodel=medlow (symbols lie between -2GB:2GB) CFLAGS:append:qemuriscv64 = " -mcmodel=medany" diff --git a/poky/meta/classes/cve-check.bbclass b/poky/meta/classes/cve-check.bbclass index 6582f97151..70d1988a70 100644 --- a/poky/meta/classes/cve-check.bbclass +++ b/poky/meta/classes/cve-check.bbclass @@ -94,10 +94,11 @@ python do_cve_check () { """ Check recipe for patched and unpatched CVEs """ + from oe.cve_check import get_patched_cves if os.path.exists(d.getVar("CVE_CHECK_DB_FILE")): try: - patched_cves = get_patches_cves(d) + patched_cves = get_patched_cves(d) except FileNotFoundError: bb.fatal("Failure in searching patches") whitelisted, patched, unpatched = check_cves(d, patched_cves) @@ -156,65 +157,6 @@ python cve_check_write_rootfs_manifest () { ROOTFS_POSTPROCESS_COMMAND:prepend = "${@'cve_check_write_rootfs_manifest; ' if d.getVar('CVE_CHECK_CREATE_MANIFEST') == '1' else ''}" do_rootfs[recrdeptask] += "${@'do_cve_check' if d.getVar('CVE_CHECK_CREATE_MANIFEST') == '1' else ''}" -def get_patches_cves(d): - """ - Get patches that solve CVEs using the "CVE: " tag. - """ - - import re - - pn = d.getVar("PN") - cve_match = re.compile("CVE:( CVE\-\d{4}\-\d+)+") - - # Matches the last "CVE-YYYY-ID" in the file name, also if written - # in lowercase. Possible to have multiple CVE IDs in a single - # file name, but only the last one will be detected from the file name. - # However, patch files contents addressing multiple CVE IDs are supported - # (cve_match regular expression) - - cve_file_name_match = re.compile(".*([Cc][Vv][Ee]\-\d{4}\-\d+)") - - patched_cves = set() - bb.debug(2, "Looking for patches that solves CVEs for %s" % pn) - for url in src_patches(d): - patch_file = bb.fetch.decodeurl(url)[2] - - if not os.path.isfile(patch_file): - bb.error("File Not found: %s" % patch_file) - raise FileNotFoundError - - # Check patch file name for CVE ID - fname_match = cve_file_name_match.search(patch_file) - if fname_match: - cve = fname_match.group(1).upper() - patched_cves.add(cve) - bb.debug(2, "Found CVE %s from patch file name %s" % (cve, patch_file)) - - with open(patch_file, "r", encoding="utf-8") as f: - try: - patch_text = f.read() - except UnicodeDecodeError: - bb.debug(1, "Failed to read patch %s using UTF-8 encoding" - " trying with iso8859-1" % patch_file) - f.close() - with open(patch_file, "r", encoding="iso8859-1") as f: - patch_text = f.read() - - # Search for one or more "CVE: " lines - text_match = False - for match in cve_match.finditer(patch_text): - # Get only the CVEs without the "CVE: " tag - cves = patch_text[match.start()+5:match.end()] - for cve in cves.split(): - bb.debug(2, "Patch %s solves %s" % (patch_file, cve)) - patched_cves.add(cve) - text_match = True - - if not fname_match and not text_match: - bb.debug(2, "Patch %s doesn't solve CVEs" % patch_file) - - return patched_cves - def check_cves(d, patched_cves): """ Connect to the NVD database and find unpatched cves. @@ -238,9 +180,6 @@ def check_cves(d, patched_cves): bb.note("Recipe has been whitelisted, skipping check") return ([], [], []) - old_cve_whitelist = d.getVar("CVE_CHECK_CVE_WHITELIST") - if old_cve_whitelist: - bb.warn("CVE_CHECK_CVE_WHITELIST is deprecated, please use CVE_CHECK_WHITELIST.") cve_whitelist = d.getVar("CVE_CHECK_WHITELIST").split() import sqlite3 diff --git a/poky/meta/classes/insane.bbclass b/poky/meta/classes/insane.bbclass index be5ec60146..810459d432 100644 --- a/poky/meta/classes/insane.bbclass +++ b/poky/meta/classes/insane.bbclass @@ -835,11 +835,11 @@ def package_qa_check_deps(pkg, pkgdest, d): try: rvar = bb.utils.explode_dep_versions2(localdata.getVar(var) or "") except ValueError as e: - bb.fatal("%s_%s: %s" % (var, pkg, e)) + bb.fatal("%s:%s: %s" % (var, pkg, e)) for dep in rvar: for v in rvar[dep]: if v and not v.startswith(('< ', '= ', '> ', '<= ', '>=')): - error_msg = "%s_%s is invalid: %s (%s) only comparisons <, =, >, <=, and >= are allowed" % (var, pkg, dep, v) + error_msg = "%s:%s is invalid: %s (%s) only comparisons <, =, >, <=, and >= are allowed" % (var, pkg, dep, v) package_qa_handle_error("dep-cmp", error_msg, d) check_valid_deps('RDEPENDS') @@ -888,7 +888,7 @@ def package_qa_check_expanded_d(package, d, messages): expanded_d = d.getVar('D') for var in 'FILES','pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm': - bbvar = d.getVar(var + "_" + package) or "" + bbvar = d.getVar(var + ":" + package) or "" if expanded_d in bbvar: if var == 'FILES': package_qa_add_message(messages, "expanded-d", "FILES in %s recipe should not contain the ${D} variable as it references the local build directory not the target filesystem, best solution is to remove the ${D} reference" % package) @@ -1325,10 +1325,10 @@ python () { if prog.search(pn): package_qa_handle_error("uppercase-pn", 'PN: %s is upper case, this can result in unexpected behavior.' % pn, d) - # Some people mistakenly use DEPENDS_${PN} instead of DEPENDS and wonder + # Some people mistakenly use DEPENDS:${PN} instead of DEPENDS and wonder # why it doesn't work. - if (d.getVar(d.expand('DEPENDS_${PN}'))): - package_qa_handle_error("pkgvarcheck", "recipe uses DEPENDS_${PN}, should use DEPENDS", d) + if (d.getVar(d.expand('DEPENDS:${PN}'))): + package_qa_handle_error("pkgvarcheck", "recipe uses DEPENDS:${PN}, should use DEPENDS", d) issues = [] if (d.getVar('PACKAGES') or "").split(): diff --git a/poky/meta/classes/kernel-fitimage.bbclass b/poky/meta/classes/kernel-fitimage.bbclass index a9d1002200..2ef8f06b14 100644 --- a/poky/meta/classes/kernel-fitimage.bbclass +++ b/poky/meta/classes/kernel-fitimage.bbclass @@ -60,6 +60,14 @@ FIT_DESC ?= "Kernel fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}" # Sign individual images as well FIT_SIGN_INDIVIDUAL ?= "0" +# 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 +# UBOOT_DTB_BINARY, will be set to "conf", because "conf" prevails on "image". +# Then the images signature checking will not be mandatory and no error will be +# raised in case of failure. +# UBOOT_SIGN_IMG_KEYNAME = "dev2" # keys name in keydir (eg. "dev2.crt", "dev2.key") + # # Emit the fitImage ITS header # @@ -121,7 +129,7 @@ fitimage_emit_section_kernel() { kernel_csum="${FIT_HASH_ALG}" kernel_sign_algo="${FIT_SIGN_ALG}" - kernel_sign_keyname="${UBOOT_SIGN_KEYNAME}" + kernel_sign_keyname="${UBOOT_SIGN_IMG_KEYNAME}" ENTRYPOINT="${UBOOT_ENTRYPOINT}" if [ -n "${UBOOT_ENTRYSYMBOL}" ]; then @@ -167,7 +175,7 @@ fitimage_emit_section_dtb() { dtb_csum="${FIT_HASH_ALG}" dtb_sign_algo="${FIT_SIGN_ALG}" - dtb_sign_keyname="${UBOOT_SIGN_KEYNAME}" + dtb_sign_keyname="${UBOOT_SIGN_IMG_KEYNAME}" dtb_loadline="" dtb_ext=${DTB##*.} @@ -214,7 +222,7 @@ fitimage_emit_section_boot_script() { bootscr_csum="${FIT_HASH_ALG}" bootscr_sign_algo="${FIT_SIGN_ALG}" - bootscr_sign_keyname="${UBOOT_SIGN_KEYNAME}" + bootscr_sign_keyname="${UBOOT_SIGN_IMG_KEYNAME}" cat << EOF >> ${1} bootscr-${2} { @@ -278,7 +286,7 @@ fitimage_emit_section_ramdisk() { ramdisk_csum="${FIT_HASH_ALG}" ramdisk_sign_algo="${FIT_SIGN_ALG}" - ramdisk_sign_keyname="${UBOOT_SIGN_KEYNAME}" + ramdisk_sign_keyname="${UBOOT_SIGN_IMG_KEYNAME}" ramdisk_loadline="" ramdisk_entryline="" @@ -475,6 +483,10 @@ fitimage_assemble() { bootscr_id="" rm -f ${1} arch/${ARCH}/boot/${2} + if [ ! -z "${UBOOT_SIGN_IMG_KEYNAME}" -a "${UBOOT_SIGN_KEYNAME}" = "${UBOOT_SIGN_IMG_KEYNAME}" ]; then + bbfatal "Keys used to sign images and configuration nodes must be different." + fi + fitimage_emit_fit_header ${1} # @@ -674,7 +686,7 @@ do_kernel_generate_rsa_keys() { if [ "${UBOOT_SIGN_ENABLE}" = "1" ] && [ "${FIT_GENERATE_KEYS}" = "1" ]; then - # Generate keys only if they don't already exist + # Generate keys to sign configuration nodes, only if they don't already exist if [ ! -f "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".key ] || \ [ ! -f "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".crt ]; then @@ -691,6 +703,24 @@ do_kernel_generate_rsa_keys() { -key "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".key \ -out "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_KEYNAME}".crt fi + + # Generate keys to sign image nodes, only if they don't already exist + if [ ! -f "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_IMG_KEYNAME}".key ] || \ + [ ! -f "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_IMG_KEYNAME}".crt ]; then + + # make directory if it does not already exist + mkdir -p "${UBOOT_SIGN_KEYDIR}" + + echo "Generating RSA private key for signing fitImage" + openssl genrsa ${FIT_KEY_GENRSA_ARGS} -out \ + "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_IMG_KEYNAME}".key \ + "${FIT_SIGN_NUMBITS}" + + echo "Generating certificate for signing fitImage" + openssl req ${FIT_KEY_REQ_ARGS} "${FIT_KEY_SIGN_PKCS}" \ + -key "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_IMG_KEYNAME}".key \ + -out "${UBOOT_SIGN_KEYDIR}/${UBOOT_SIGN_IMG_KEYNAME}".crt + fi fi } diff --git a/poky/meta/classes/multilib.bbclass b/poky/meta/classes/multilib.bbclass index c3be89767a..3cbda5d806 100644 --- a/poky/meta/classes/multilib.bbclass +++ b/poky/meta/classes/multilib.bbclass @@ -35,7 +35,7 @@ python multilib_virtclass_handler () { e.data.setVar('SDKTARGETSYSROOT', e.data.getVar('SDKTARGETSYSROOT')) override = ":virtclass-multilib-" + variant e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override) - target_vendor = e.data.getVar("TARGET_VENDOR_" + "virtclass-multilib-" + variant, False) + target_vendor = e.data.getVar("TARGET_VENDOR:" + "virtclass-multilib-" + variant, False) if target_vendor: e.data.setVar("TARGET_VENDOR", target_vendor) return @@ -82,7 +82,7 @@ python multilib_virtclass_handler () { e.data.setVar("WHITELIST_GPL-3.0", pkgs) # DEFAULTTUNE can change TARGET_ARCH override so expand this now before update_data - newtune = e.data.getVar("DEFAULTTUNE_" + "virtclass-multilib-" + variant, False) + newtune = e.data.getVar("DEFAULTTUNE:" + "virtclass-multilib-" + variant, False) if newtune: e.data.setVar("DEFAULTTUNE", newtune) } diff --git a/poky/meta/classes/overlayfs.bbclass b/poky/meta/classes/overlayfs.bbclass new file mode 100644 index 0000000000..8d9b59c9bf --- /dev/null +++ b/poky/meta/classes/overlayfs.bbclass @@ -0,0 +1,111 @@ +# Class for generation of overlayfs mount units +# +# It's often desired in Embedded System design to have a read-only rootfs. +# But a lot of different applications might want to have a read-write access to +# some parts of a filesystem. It can be especially useful when your update mechanism +# overwrites the whole rootfs, but you want your application data to be preserved +# between updates. This class provides a way to achieve that by means +# of overlayfs and at the same time keeping the base rootfs read-only. +# +# Usage example. +# +# Set a mount point for a partition overlayfs is going to use as upper layer +# in your machine configuration. Underlying file system can be anything that +# is supported by overlayfs. This has to be done in your machine configuration. +# QA check fails to catch file existence if you redefine this variable in your recipe! +# +# OVERLAYFS_MOUNT_POINT[data] ?= "/data" +# +# The class assumes you have a data.mount systemd unit defined in your +# systemd-machine-units recipe and installed to the image. +# +# Then you can specify writable directories on a recipe base +# +# OVERLAYFS_WRITABLE_PATHS[data] = "/usr/share/my-custom-application" +# +# To support several mount points you can use a different variable flag. Assume we +# want to have a writable location on the file system, but not interested where the data +# survive a reboot. Then we could have a mnt-overlay.mount unit for a tmpfs file system: +# +# OVERLAYFS_MOUNT_POINT[mnt-overlay] = "/mnt/overlay" +# OVERLAYFS_WRITABLE_PATHS[mnt-overlay] = "/usr/share/another-application" +# +# Note: the class does not support /etc directory itself, because systemd depends on it + +REQUIRED_DISTRO_FEATURES += "systemd overlayfs" + +inherit systemd features_check + +python do_create_overlayfs_units() { + CreateDirsUnitTemplate = """[Unit] +Description=Overlayfs directories setup +Requires={DATA_MOUNT_UNIT} +After={DATA_MOUNT_UNIT} +DefaultDependencies=no + +[Service] +Type=oneshot +ExecStart=mkdir -p {DATA_MOUNT_POINT}/workdir{LOWERDIR} && mkdir -p {DATA_MOUNT_POINT}/upper{LOWERDIR} +RemainAfterExit=true +StandardOutput=journal + +[Install] +WantedBy=multi-user.target +""" + MountUnitTemplate = """[Unit] +Description=Overlayfs mount unit +Requires={CREATE_DIRS_SERVICE} +After={CREATE_DIRS_SERVICE} + +[Mount] +What=overlay +Where={LOWERDIR} +Type=overlay +Options=lowerdir={LOWERDIR},upperdir={DATA_MOUNT_POINT}/upper{LOWERDIR},workdir={DATA_MOUNT_POINT}/workdir{LOWERDIR} + +[Install] +WantedBy=multi-user.target +""" + + def prepareUnits(data, lower): + from oe.overlayfs import mountUnitName, helperUnitName + + args = { + 'DATA_MOUNT_POINT': data, + 'DATA_MOUNT_UNIT': mountUnitName(data), + 'CREATE_DIRS_SERVICE': helperUnitName(lower), + 'LOWERDIR': lower, + } + + with open(os.path.join(d.getVar('WORKDIR'), mountUnitName(lower)), 'w') as f: + f.write(MountUnitTemplate.format(**args)) + + with open(os.path.join(d.getVar('WORKDIR'), helperUnitName(lower)), 'w') as f: + f.write(CreateDirsUnitTemplate.format(**args)) + + overlayMountPoints = d.getVarFlags("OVERLAYFS_MOUNT_POINT") + for mountPoint in overlayMountPoints: + for lower in d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint).split(): + prepareUnits(d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint), lower) +} + +# we need to generate file names early during parsing stage +python () { + from oe.overlayfs import strForBash, unitFileList + + unitList = unitFileList(d) + for unit in unitList: + d.appendVar('SYSTEMD_SERVICE:' + d.getVar('PN'), ' ' + unit); + d.appendVar('FILES:' + d.getVar('PN'), ' ' + strForBash(unit)) + + d.setVar('OVERLAYFS_UNIT_LIST', ' '.join([strForBash(s) for s in unitList])) +} + +do_install:append() { + install -d ${D}${systemd_system_unitdir} + for unit in ${OVERLAYFS_UNIT_LIST}; do + install -m 0444 ${WORKDIR}/${unit} ${D}${systemd_system_unitdir} + done +} + +addtask create_overlayfs_units before do_install diff --git a/poky/meta/classes/package.bbclass b/poky/meta/classes/package.bbclass index a659a1ef5c..a9138ff6be 100644 --- a/poky/meta/classes/package.bbclass +++ b/poky/meta/classes/package.bbclass @@ -1663,12 +1663,12 @@ fi val = write_if_exists(sf, pkg, var) write_if_exists(sf, pkg, 'FILERPROVIDESFLIST') - for dfile in (d.getVar('FILERPROVIDESFLIST_' + pkg) or "").split(): - write_if_exists(sf, pkg, 'FILERPROVIDES_' + dfile) + for dfile in (d.getVar('FILERPROVIDESFLIST:' + pkg) or "").split(): + write_if_exists(sf, pkg, 'FILERPROVIDES:' + dfile) write_if_exists(sf, pkg, 'FILERDEPENDSFLIST') - for dfile in (d.getVar('FILERDEPENDSFLIST_' + pkg) or "").split(): - write_if_exists(sf, pkg, 'FILERDEPENDS_' + dfile) + for dfile in (d.getVar('FILERDEPENDSFLIST:' + pkg) or "").split(): + write_if_exists(sf, pkg, 'FILERDEPENDS:' + dfile) sf.write('%s_%s: %d\n' % ('PKGSIZE', pkg, total_size)) @@ -1714,11 +1714,11 @@ RPMDEPS = "${STAGING_LIBDIR_NATIVE}/rpm/rpmdeps --alldeps --define '__font_provi # Collect perfile run-time dependency metadata # Output: -# FILERPROVIDESFLIST_pkg - list of all files w/ deps -# FILERPROVIDES_filepath_pkg - per file dep +# FILERPROVIDESFLIST:pkg - list of all files w/ deps +# FILERPROVIDES:filepath:pkg - per file dep # -# FILERDEPENDSFLIST_pkg - list of all files w/ deps -# FILERDEPENDS_filepath_pkg - per file dep +# FILERDEPENDSFLIST:pkg - list of all files w/ deps +# FILERDEPENDS:filepath:pkg - per file dep python package_do_filedeps() { if d.getVar('SKIP_FILEDEPS') == '1': @@ -1755,18 +1755,18 @@ python package_do_filedeps() { for file in sorted(provides): provides_files[pkg].append(file) - key = "FILERPROVIDES_" + file + "_" + pkg + key = "FILERPROVIDES:" + file + ":" + pkg d.appendVar(key, " " + " ".join(provides[file])) for file in sorted(requires): requires_files[pkg].append(file) - key = "FILERDEPENDS_" + file + "_" + pkg + key = "FILERDEPENDS:" + file + ":" + pkg d.appendVar(key, " " + " ".join(requires[file])) for pkg in requires_files: - d.setVar("FILERDEPENDSFLIST_" + pkg, " ".join(requires_files[pkg])) + d.setVar("FILERDEPENDSFLIST:" + pkg, " ".join(requires_files[pkg])) for pkg in provides_files: - d.setVar("FILERPROVIDESFLIST_" + pkg, " ".join(provides_files[pkg])) + d.setVar("FILERPROVIDESFLIST:" + pkg, " ".join(provides_files[pkg])) } SHLIBSDIRS = "${WORKDIR_PKGDATA}/${MLPREFIX}shlibs2" diff --git a/poky/meta/classes/pypi.bbclass b/poky/meta/classes/pypi.bbclass index 272c220bca..9405d58601 100644 --- a/poky/meta/classes/pypi.bbclass +++ b/poky/meta/classes/pypi.bbclass @@ -8,12 +8,12 @@ def pypi_package(d): PYPI_PACKAGE ?= "${@pypi_package(d)}" PYPI_PACKAGE_EXT ?= "tar.gz" +PYPI_ARCHIVE_NAME ?= "${PYPI_PACKAGE}-${PV}.${PYPI_PACKAGE_EXT}" def pypi_src_uri(d): package = d.getVar('PYPI_PACKAGE') - package_ext = d.getVar('PYPI_PACKAGE_EXT') - pv = d.getVar('PV') - return 'https://files.pythonhosted.org/packages/source/%s/%s/%s-%s.%s' % (package[0], package, package, pv, package_ext) + archive_name = d.getVar('PYPI_ARCHIVE_NAME') + return 'https://files.pythonhosted.org/packages/source/%s/%s/%s' % (package[0], package, archive_name) PYPI_SRC_URI ?= "${@pypi_src_uri(d)}" diff --git a/poky/meta/classes/rootfs-postcommands.bbclass b/poky/meta/classes/rootfs-postcommands.bbclass index fbfa63fcb3..c5746eba13 100644 --- a/poky/meta/classes/rootfs-postcommands.bbclass +++ b/poky/meta/classes/rootfs-postcommands.bbclass @@ -39,6 +39,8 @@ ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "systemd" ROOTFS_POSTPROCESS_COMMAND += 'empty_var_volatile;' +ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "overlayfs", "overlayfs_qa_check;", "", d)}' + inherit image-artifact-names # Sort the user and group entries in /etc by ID in order to make the content @@ -373,3 +375,26 @@ rootfs_reproducible () { fi fi } + +python overlayfs_qa_check() { + from oe.overlayfs import mountUnitName + + # this is a dumb check for unit existence, not its validity + overlayMountPoints = d.getVarFlags("OVERLAYFS_MOUNT_POINT") + imagepath = d.getVar("IMAGE_ROOTFS") + searchpaths = [oe.path.join(imagepath, d.getVar("sysconfdir"), "systemd", "system"), + oe.path.join(imagepath, d.getVar("systemd_system_unitdir"))] + + allUnitExist = True; + for mountPoint in overlayMountPoints: + path = d.getVarFlag('OVERLAYFS_MOUNT_POINT', mountPoint) + unit = mountUnitName(path) + + if not any(os.path.isfile(oe.path.join(dirpath, unit)) + for dirpath in searchpaths): + bb.warn('Unit name %s not found in systemd unit directories' % unit) + allUnitExist = False; + + if not allUnitExist: + bb.fatal('Not all mount units are installed by the BSP') +} diff --git a/poky/meta/classes/sstate.bbclass b/poky/meta/classes/sstate.bbclass index 554e401ee2..2175ace4c4 100644 --- a/poky/meta/classes/sstate.bbclass +++ b/poky/meta/classes/sstate.bbclass @@ -705,6 +705,7 @@ def sstate_package(ss, d): pass except OSError as e: # Handle read-only file systems gracefully + import errno if e.errno != errno.EROFS: raise e @@ -1152,6 +1153,7 @@ python sstate_eventhandler() { pass except OSError as e: # Handle read-only file systems gracefully + import errno if e.errno != errno.EROFS: raise e diff --git a/poky/meta/classes/terminal.bbclass b/poky/meta/classes/terminal.bbclass index 6059ae95e0..a564ee7494 100644 --- a/poky/meta/classes/terminal.bbclass +++ b/poky/meta/classes/terminal.bbclass @@ -26,6 +26,9 @@ def emit_terminal_func(command, envdata, d): bb.utils.mkdirhier(os.path.dirname(runfile)) with open(runfile, 'w') as script: + # Override the shell shell_trap_code specifies. + # If our shell is bash, we might well face silent death. + script.write("#!/bin/bash\n") script.write(bb.build.shell_trap_code()) bb.data.emit_func(cmd_func, script, envdata) script.write(cmd_func) @@ -37,7 +40,7 @@ def emit_terminal_func(command, envdata, d): def oe_terminal(command, title, d): import oe.data import oe.terminal - + envdata = bb.data.init() for v in os.environ: diff --git a/poky/meta/conf/bitbake.conf b/poky/meta/conf/bitbake.conf index 1d5f5b7fcd..f6fb2aa698 100644 --- a/poky/meta/conf/bitbake.conf +++ b/poky/meta/conf/bitbake.conf @@ -236,8 +236,8 @@ DESCRIPTION ?= "${SUMMARY}." # The following two are commented out because they result in a recursive # definition of the variable in some corner cases. These are left in # to illustrate the intended behavior. -#SUMMARY_${PN} ?= "${SUMMARY}" -#DESCRIPTION_${PN} ?= "${DESCRIPTION}" +#SUMMARY:${PN} ?= "${SUMMARY}" +#DESCRIPTION:${PN} ?= "${DESCRIPTION}" SUMMARY:${PN}-src ?= "${SUMMARY} - Source files" DESCRIPTION:${PN}-src ?= "${DESCRIPTION} \ @@ -597,7 +597,7 @@ TARGET_LINK_HASH_STYLE ?= "${@['-Wl,--hash-style=gnu',''][d.getVar('LINKER_HASH_ ASNEEDED ?= "-Wl,--as-needed" export LDFLAGS = "${TARGET_LDFLAGS}" -TARGET_LDFLAGS = "-Wl,-O1 ${TARGET_LINK_HASH_STYLE} ${ASNEEDED}" +TARGET_LDFLAGS = "-Wl,-O1 ${TARGET_LINK_HASH_STYLE} ${ASNEEDED} ${DEBUG_PREFIX_MAP}" # mips does not support GNU hash style therefore we override LINKER_HASH_STYLE:mipsarch:libc-musl = "sysv" diff --git a/poky/meta/conf/distro/include/tcmode-default.inc b/poky/meta/conf/distro/include/tcmode-default.inc index 7afe28a160..47f23f5c39 100644 --- a/poky/meta/conf/distro/include/tcmode-default.inc +++ b/poky/meta/conf/distro/include/tcmode-default.inc @@ -20,7 +20,7 @@ GCCVERSION ?= "11.%" SDKGCCVERSION ?= "${GCCVERSION}" BINUVERSION ?= "2.37%" GDBVERSION ?= "10.%" -GLIBCVERSION ?= "2.33" +GLIBCVERSION ?= "2.34" LINUXLIBCVERSION ?= "5.13%" QEMUVERSION ?= "6.0%" GOVERSION ?= "1.16%" diff --git a/poky/meta/conf/machine/include/arm/arch-armv7em.inc b/poky/meta/conf/machine/include/arm/arch-armv7em.inc new file mode 100644 index 0000000000..adcab272ed --- /dev/null +++ b/poky/meta/conf/machine/include/arm/arch-armv7em.inc @@ -0,0 +1,17 @@ +# +# Defaults for ARMv7e-m +# +DEFAULTTUNE ?= "armv7em" + +TUNEVALID[armv7em] = "Enable instructions for ARMv7e-m" +TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7em', ' -march=armv7e-m', '', d)}" +MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv7em', 'armv7em:', '', d)}" + +TUNECONFLICTS[armv7em] = "armv4 armv5 armv6 armv7a" + +require conf/machine/include/arm/arch-armv7m.inc + +AVAILTUNES += "armv7em" +ARMPKGARCH:tune-armv7em = "armv7em" +TUNE_FEATURES:tune-armv7em = "armv7em" +PACKAGE_EXTRA_ARCHS:tune-armv7em = "armv7em" diff --git a/poky/meta/conf/machine/include/arm/arch-armv7m.inc b/poky/meta/conf/machine/include/arm/arch-armv7m.inc new file mode 100644 index 0000000000..a36c265bc1 --- /dev/null +++ b/poky/meta/conf/machine/include/arm/arch-armv7m.inc @@ -0,0 +1,17 @@ +# +# Defaults for ARMv7-m +# +DEFAULTTUNE ?= "armv7m" + +TUNEVALID[armv7m] = "Enable instructions for ARMv7-m" +TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7m', ' -march=armv7-m', '', d)}" +MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv7m', 'armv7m:', '', d)}" + +TUNECONFLICTS[armv7m] = "armv4 armv5 armv6 armv7a" + +require conf/machine/include/arm/arch-armv6m.inc + +AVAILTUNES += "armv7m" +ARMPKGARCH:tune-armv7m = "armv7m" +TUNE_FEATURES:tune-armv7m = "armv7m" +PACKAGE_EXTRA_ARCHS:tune-armv7m = "armv7m" diff --git a/poky/meta/conf/machine/include/arm/arch-armv8-1m-main.inc b/poky/meta/conf/machine/include/arm/arch-armv8-1m-main.inc new file mode 100644 index 0000000000..9171b31c90 --- /dev/null +++ b/poky/meta/conf/machine/include/arm/arch-armv8-1m-main.inc @@ -0,0 +1,18 @@ +# +# +# Defaults for ARMv8.1-M.main +# +DEFAULTTUNE ?= "armv8-1m-main" + +TUNEVALID[armv8-1m-main] = "Enable instructions for ARMv8.1-m.main" +TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'armv8-1m-main', ' -march=armv8.1-m.main', '', d)}" +MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv8-1m-main', 'armv8-1m-main:', '', d)}" + +TUNECONFLICTS[armv8-1m-main] = "armv4 armv5 armv6 armv7a" + +require conf/machine/include/arm/arch-armv8m-main.inc + +AVAILTUNES += "armv8-1m-main" +ARMPKGARCH:tune-armv8-1m-main = "armv8-1m-main" +TUNE_FEATURES:tune-armv8-1m-main = "armv8-1m-main" +PACKAGE_EXTRA_ARCHS:tune-armv8-1m-main = "armv8-1m-main" diff --git a/poky/meta/conf/machine/include/arm/arch-armv8m-base.inc b/poky/meta/conf/machine/include/arm/arch-armv8m-base.inc new file mode 100644 index 0000000000..d9a341c66e --- /dev/null +++ b/poky/meta/conf/machine/include/arm/arch-armv8m-base.inc @@ -0,0 +1,17 @@ +# +# Defaults for ARMv8-m.base +# +DEFAULTTUNE ?= "armv8m-base" + +TUNEVALID[armv8m-base] = "Enable instructions for ARMv8-m.base" +TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'armv8m-base', ' -march=armv8-m.base', '', d)}" +MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv8m-base', 'armv8m-base:', '', d)}" + +TUNECONFLICTS[armv8m-base] = "armv4 armv5 armv6 armv7a" + +require conf/machine/include/arm/arch-armv7m.inc + +AVAILTUNES += "armv8m-base" +ARMPKGARCH:tune-armv8m-base = "armv8m-base" +TUNE_FEATURES:tune-armv8m-base = "armv8m-base" +PACKAGE_EXTRA_ARCHS:tune-armv8m-base = "armv8m-base" diff --git a/poky/meta/conf/machine/include/arm/arch-armv8m-main.inc b/poky/meta/conf/machine/include/arm/arch-armv8m-main.inc new file mode 100644 index 0000000000..27f552b2d7 --- /dev/null +++ b/poky/meta/conf/machine/include/arm/arch-armv8m-main.inc @@ -0,0 +1,36 @@ +# +# Defaults for ARMv8-m.main +# +DEFAULTTUNE ?= "armv8m-main" + +require conf/machine/include/arm/arch-armv8m-base.inc + +TUNEVALID[armv8m-main] = "Enable instructions for ARMv8-m.main" +TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'armv8m-main', ' -march=armv8-m.main${MARCH_DSP}${MARCH_FPU}', '', d)}" +MACHINEOVERRIDES =. "${@bb.utils.contains('TUNE_FEATURES', 'armv8m-main', 'armv8m-main:', '', d)}" + +TUNECONFLICTS[armv8m-main] = "armv4 armv5 armv6 armv7a" + +# FIXME - below taken from meta/conf/machine/include/arm/arch-armv5-dsp.inc and should be put into something more generic +TUNEVALID[dsp] = "ARM DSP functionality" +ARMPKGSFX_DSP = "${@bb.utils.contains('TUNE_FEATURES', [ 'dsp' ], 'e', '', d)}" +MARCH_DSP = "${@bb.utils.contains('TUNE_FEATURES', [ 'dsp' ], '+dsp', '+nodsp', d)}" + +# FIXME - Below belongs in meta/conf/machine/include/arm/feature-arm-neon.inc +TUNEVALID[vfpv5spd16] = "Enable Vector Floating Point Version 5, Single Precision. with 16 registers (fpv5-sp-d16) unit." +TUNE_CCARGS_MFPU .= "${@bb.utils.contains('TUNE_FEATURES', 'vfpv5spd16', 'fpv5-sp-d16', '', d)}" +MARCH_FPU = "${@bb.utils.contains('TUNE_FEATURES', [ 'vfpv5spd16' ], '+fp', '+nofp', d)}" + +AVAILTUNES += "armv8m-main armv8m-mainearmv8m-main-vfpv5spd16 armv8m-maine-vfpv5spd16" +ARMPKGARCH:tune-armv8m-main = "armv8m-main" +ARMPKGARCH:tune-armv8m-maine = "armv8m-main" +ARMPKGARCH:tune-armv8m-main-vfpv5spd16 = "armv8m-main" +ARMPKGARCH:tune-armv8m-maine-vfpv5spd16 = "armv8m-main" +TUNE_FEATURES:tune-armv8m-main = "armv8m-main" +TUNE_FEATURES:tune-armv8m-maine = "${TUNE_FEATURES:tune-armv8m-main} dsp" +TUNE_FEATURES:tune-armv8m-main-vfpv5spd16 = "${TUNE_FEATURES:tune-armv8m-main} vfpv5spd16" +TUNE_FEATURES:tune-armv8m-maine-vfpv5spd16 = "${TUNE_FEATURES:tune-armv8m-main-vfpv5spd16} dsp" +PACKAGE_EXTRA_ARCHS:tune-armv8m-main = "armv8m-main" +PACKAGE_EXTRA_ARCHS:tune-armv8m-maine = "${PACKAGE_EXTRA_ARCHS:tune-armv8m-main} armv8m-maine" +PACKAGE_EXTRA_ARCHS:tune-armv8m-main-vfpv5spd16 = "${PACKAGE_EXTRA_ARCHS:tune-armv8m-main} armv8m-main-fpv5-spd16" +PACKAGE_EXTRA_ARCHS:tune-armv8m-maine-vfpv5spd16 = "${PACKAGE_EXTRA_ARCHS:tune-armv8m-main} armv8m-maine-fpv5-spd16" diff --git a/poky/meta/conf/machine/include/arm/armv8-1m/tune-cortexm55.inc b/poky/meta/conf/machine/include/arm/armv8-1m/tune-cortexm55.inc new file mode 100644 index 0000000000..493ad67b21 --- /dev/null +++ b/poky/meta/conf/machine/include/arm/armv8-1m/tune-cortexm55.inc @@ -0,0 +1,14 @@ +# +# Tune Settings for Cortex-M55 +# +DEFAULTTUNE ?= "cortexm55" + +TUNEVALID[cortexm55] = "Enable Cortex-M55 specific processor optimizations" +TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm55', ' -mcpu=cortex-m55', '', d)}" + +require conf/machine/include/arm/arch-armv8-1m-main.inc + +AVAILTUNES += "cortexm55" +ARMPKGARCH:tune-cortexm55 = "cortexm55" +TUNE_FEATURES:tune-cortexm55 = "${TUNE_FEATURES:tune-armv8-1m-main} cortexm55" +PACKAGE_EXTRA_ARCHS:tune-cortexm55 = "${PACKAGE_EXTRA_ARCHS:tune-armv8-1m-main} cortexm55" diff --git a/poky/meta/conf/machine/include/arm/armv8-m/tune-cortexm23.inc b/poky/meta/conf/machine/include/arm/armv8-m/tune-cortexm23.inc new file mode 100644 index 0000000000..25780bc080 --- /dev/null +++ b/poky/meta/conf/machine/include/arm/armv8-m/tune-cortexm23.inc @@ -0,0 +1,14 @@ +# +# Tune Settings for Cortex-M23 +# +DEFAULTTUNE ?= "cortexm23" + +TUNEVALID[cortexm23] = "Enable Cortex-M23 specific processor optimizations" +TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm23', ' -mcpu=cortex-m23', '', d)}" + +require conf/machine/include/arm/arch-armv8m-base.inc + +AVAILTUNES += "cortexm23" +ARMPKGARCH:tune-cortexm23 = "cortexm23" +TUNE_FEATURES:tune-cortexm23 = "${TUNE_FEATURES:tune-armv8m-base} cortexm23" +PACKAGE_EXTRA_ARCHS:tune-cortexm23 = "${PACKAGE_EXTRA_ARCHS:tune-armv8m-base} cortexm23" diff --git a/poky/meta/conf/machine/include/arm/armv8-m/tune-cortexm33.inc b/poky/meta/conf/machine/include/arm/armv8-m/tune-cortexm33.inc new file mode 100644 index 0000000000..04d1fe2bde --- /dev/null +++ b/poky/meta/conf/machine/include/arm/armv8-m/tune-cortexm33.inc @@ -0,0 +1,17 @@ +# +# Tune Settings for Cortex-M33 +# +DEFAULTTUNE ?= "cortexm33" + +TUNEVALID[cortexm33] = "Enable Cortex-M33 specific processor optimizations" +TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm33', ' -mcpu=cortex-m33', '', d)}" + +require conf/machine/include/arm/arch-armv8m-main.inc + +# GCC thnks that DSP and VFP are required, but Arm docs say it is +# optional. So forcing below so that compiling works, but this should +# be fixed in GCC +AVAILTUNES += "cortexm33" +ARMPKGARCH:tune-cortexm33 = "cortexm33" +TUNE_FEATURES:tune-cortexm33 = "${TUNE_FEATURES:tune-armv8m-maine-vfpv5spd16} cortexm33" +PACKAGE_EXTRA_ARCHS:tune-cortexm33 = "${PACKAGE_EXTRA_ARCHS:tune-armv8m-maine-vfpv5spd16} cortexm33e-fpv5-spd16" diff --git a/poky/meta/conf/machine/include/arm/armv8-m/tune-cortexm35p.inc b/poky/meta/conf/machine/include/arm/armv8-m/tune-cortexm35p.inc new file mode 100644 index 0000000000..60e978facd --- /dev/null +++ b/poky/meta/conf/machine/include/arm/armv8-m/tune-cortexm35p.inc @@ -0,0 +1,17 @@ +# +# Tune Settings for Cortex-M35P +# +DEFAULTTUNE ?= "cortexm35p" + +TUNEVALID[cortexm35p] = "Enable Cortex-M35p specific processor optimizations" +TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm35p', ' -mcpu=cortex-m35p', '', d)}" + +require conf/machine/include/arm/arch-armv8m-main.inc + +# GCC thnks that DSP and VFP are required, but Arm docs say it is +# optional. So forcing below so that compiling works, but this should +# be fixed in GCC +AVAILTUNES += "cortexm35p" +ARMPKGARCH:tune-cortexm35p = "cortexm35p" +TUNE_FEATURES:tune-cortexm35p = "${TUNE_FEATURES:tune-armv8m-maine-vfpv5spd16} cortexm35p" +PACKAGE_EXTRA_ARCHS:tune-cortexm35p = "${PACKAGE_EXTRA_ARCHS:tune-armv8m-maine-vfpv5spd16} cortexm35pe-fpv5-spd16" diff --git a/poky/meta/conf/machine/include/tune-cortexm1.inc b/poky/meta/conf/machine/include/tune-cortexm1.inc new file mode 100644 index 0000000000..16661f3a26 --- /dev/null +++ b/poky/meta/conf/machine/include/tune-cortexm1.inc @@ -0,0 +1,14 @@ +# +# Tune Settings for Cortex-M1 +# +DEFAULTTUNE ?= "cortexm1" + +TUNEVALID[cortexm1] = "Enable Cortex-M1 specific processor optimizations" +TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm1', ' -mcpu=cortex-m1', '', d)}" + +require conf/machine/include/arm/arch-armv6m.inc + +AVAILTUNES += "cortexm1" +ARMPKGARCH:tune-cortexm1 = "cortexm1" +TUNE_FEATURES:tune-cortexm1 = "${TUNE_FEATURES:tune-armv6m} cortexm1" +PACKAGE_EXTRA_ARCHS:tune-cortexm1 = "${PACKAGE_EXTRA_ARCHS:tune-armv6m} cortexm1" diff --git a/poky/meta/conf/machine/include/tune-cortexm3.inc b/poky/meta/conf/machine/include/tune-cortexm3.inc new file mode 100644 index 0000000000..a6cb566387 --- /dev/null +++ b/poky/meta/conf/machine/include/tune-cortexm3.inc @@ -0,0 +1,14 @@ +# +# Tune Settings for Cortex-M3 +# +DEFAULTTUNE ?= "cortexm3" + +TUNEVALID[cortexm3] = "Enable Cortex-M3 specific processor optimizations" +TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm3', ' -mcpu=cortex-m3', '', d)}" + +require conf/machine/include/arm/arch-armv7m.inc + +AVAILTUNES += "cortexm3" +ARMPKGARCH:tune-cortexm3 = "cortexm3" +TUNE_FEATURES:tune-cortexm3 = "${TUNE_FEATURES:tune-armv7m} cortexm3" +PACKAGE_EXTRA_ARCHS:tune-cortexm3 = "${PACKAGE_EXTRA_ARCHS:tune-armv7m} cortexm3" diff --git a/poky/meta/conf/machine/include/tune-cortexm4.inc b/poky/meta/conf/machine/include/tune-cortexm4.inc new file mode 100644 index 0000000000..e86622ff3d --- /dev/null +++ b/poky/meta/conf/machine/include/tune-cortexm4.inc @@ -0,0 +1,14 @@ +# +# Tune Settings for Cortex-M4 +# +DEFAULTTUNE ?= "cortexm4" + +TUNEVALID[cortexm4] = "Enable Cortex-M4 specific processor optimizations" +TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm4', ' -mcpu=cortex-m4', '', d)}" + +require conf/machine/include/arm/arch-armv7em.inc + +AVAILTUNES += "cortexm4" +ARMPKGARCH:tune-cortexm4 = "cortexm4" +TUNE_FEATURES:tune-cortexm4 = "${TUNE_FEATURES:tune-armv7em} cortexm4" +PACKAGE_EXTRA_ARCHS:tune-cortexm4 = "${PACKAGE_EXTRA_ARCHS:tune-armv7em} cortexm4" diff --git a/poky/meta/conf/machine/include/tune-cortexm7.inc b/poky/meta/conf/machine/include/tune-cortexm7.inc new file mode 100644 index 0000000000..6434ec6398 --- /dev/null +++ b/poky/meta/conf/machine/include/tune-cortexm7.inc @@ -0,0 +1,14 @@ +# +# Tune Settings for Cortex-M7 +# +DEFAULTTUNE ?= "cortexm7" + +TUNEVALID[cortexm7] = "Enable Cortex-M7 specific processor optimizations" +TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'cortexm7', ' -mcpu=cortex-m7', '', d)}" + +require conf/machine/include/arm/arch-armv7em.inc + +AVAILTUNES += "cortexm7" +ARMPKGARCH:tune-cortexm7 = "cortexm7" +TUNE_FEATURES:tune-cortexm7 = "${TUNE_FEATURES:tune-armv7em} cortexm7" +PACKAGE_EXTRA_ARCHS:tune-cortexm7 = "${PACKAGE_EXTRA_ARCHS:tune-armv7em} cortexm7" diff --git a/poky/meta/conf/machine/qemuppc64.conf b/poky/meta/conf/machine/qemuppc64.conf index 0682e752be..a5270e98ed 100644 --- a/poky/meta/conf/machine/qemuppc64.conf +++ b/poky/meta/conf/machine/qemuppc64.conf @@ -18,7 +18,7 @@ QB_KERNEL_CMDLINE_APPEND = "console=hvc0" QB_OPT_APPEND = "-usb -device usb-tablet" #prelink broken on ppc64 -#USER_CLASSES_remove = "image-prelink" -#IMAGE_PREPROCESS_COMMAND_remove = "prelink_image;" +#USER_CLASSES:remove = "image-prelink" +#IMAGE_PREPROCESS_COMMAND:remove = "prelink_image;" MACHINE_EXTRA_RRECOMMENDS += " kernel-modules" diff --git a/poky/meta/files/toolchain-shar-relocate.sh b/poky/meta/files/toolchain-shar-relocate.sh index 8ea6194eca..3ece04db0a 100644 --- a/poky/meta/files/toolchain-shar-relocate.sh +++ b/poky/meta/files/toolchain-shar-relocate.sh @@ -72,7 +72,7 @@ fi # change all symlinks pointing to @SDKPATH@ for l in $($SUDO_EXEC find $native_sysroot -type l); do - $SUDO_EXEC ln -sfn $(readlink $l|$SUDO_EXEC sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:") $l + $SUDO_EXEC ln -sfn $(readlink $l|$SUDO_EXEC sed -e "s:$SDK_BUILD_PATH:$target_sdk_dir:") $l if [ $? -ne 0 ]; then echo "Failed to setup symlinks. Relocate script failed. Abort!" exit 1 diff --git a/poky/meta/lib/oe/cve_check.py b/poky/meta/lib/oe/cve_check.py index a1d7c292af..0302beeb4a 100644 --- a/poky/meta/lib/oe/cve_check.py +++ b/poky/meta/lib/oe/cve_check.py @@ -63,3 +63,86 @@ def _cmpkey(release, patch_l, pre_l, pre_v): else: _pre = float(pre_v) if pre_v else float('-inf') return _release, _patch, _pre + + +def get_patched_cves(d): + """ + Get patches that solve CVEs using the "CVE: " tag. + """ + + import re + import oe.patch + + pn = d.getVar("PN") + cve_match = re.compile("CVE:( CVE\-\d{4}\-\d+)+") + + # Matches the last "CVE-YYYY-ID" in the file name, also if written + # in lowercase. Possible to have multiple CVE IDs in a single + # file name, but only the last one will be detected from the file name. + # However, patch files contents addressing multiple CVE IDs are supported + # (cve_match regular expression) + + cve_file_name_match = re.compile(".*([Cc][Vv][Ee]\-\d{4}\-\d+)") + + patched_cves = set() + bb.debug(2, "Looking for patches that solves CVEs for %s" % pn) + for url in oe.patch.src_patches(d): + patch_file = bb.fetch.decodeurl(url)[2] + + if not os.path.isfile(patch_file): + bb.error("File Not found: %s" % patch_file) + raise FileNotFoundError + + # Check patch file name for CVE ID + fname_match = cve_file_name_match.search(patch_file) + if fname_match: + cve = fname_match.group(1).upper() + patched_cves.add(cve) + bb.debug(2, "Found CVE %s from patch file name %s" % (cve, patch_file)) + + with open(patch_file, "r", encoding="utf-8") as f: + try: + patch_text = f.read() + except UnicodeDecodeError: + bb.debug(1, "Failed to read patch %s using UTF-8 encoding" + " trying with iso8859-1" % patch_file) + f.close() + with open(patch_file, "r", encoding="iso8859-1") as f: + patch_text = f.read() + + # Search for one or more "CVE: " lines + text_match = False + for match in cve_match.finditer(patch_text): + # Get only the CVEs without the "CVE: " tag + cves = patch_text[match.start()+5:match.end()] + for cve in cves.split(): + bb.debug(2, "Patch %s solves %s" % (patch_file, cve)) + patched_cves.add(cve) + text_match = True + + if not fname_match and not text_match: + bb.debug(2, "Patch %s doesn't solve CVEs" % patch_file) + + return patched_cves + + +def get_cpe_ids(cve_product, version): + """ + Get list of CPE identifiers for the given product and version + """ + + version = version.split("+git")[0] + + cpe_ids = [] + for product in cve_product.split(): + # CVE_PRODUCT in recipes may include vendor information for CPE identifiers. If not, + # use wildcard for vendor. + if ":" in product: + vendor, product = product.split(":", 1) + else: + vendor = "*" + + cpe_id = f'cpe:2.3:a:{vendor}:{product}:{version}:*:*:*:*:*:*:*' + cpe_ids.append(cpe_id) + + return cpe_ids diff --git a/poky/meta/lib/oe/overlayfs.py b/poky/meta/lib/oe/overlayfs.py new file mode 100644 index 0000000000..21ef710509 --- /dev/null +++ b/poky/meta/lib/oe/overlayfs.py @@ -0,0 +1,43 @@ +# +# SPDX-License-Identifier: GPL-2.0-only +# +# This file contains common functions for overlayfs and its QA check + +# this function is based on https://github.com/systemd/systemd/blob/main/src/basic/unit-name.c +def escapeSystemdUnitName(path): + escapeMap = { + '/': '-', + '-': "\\x2d", + '\\': "\\x5d" + } + return "".join([escapeMap.get(c, c) for c in path.strip('/')]) + +def strForBash(s): + return s.replace('\\', '\\\\') + +def mountUnitName(unit): + return escapeSystemdUnitName(unit) + '.mount' + +def helperUnitName(unit): + return escapeSystemdUnitName(unit) + '-create-upper-dir.service' + +def unitFileList(d): + fileList = [] + overlayMountPoints = d.getVarFlags("OVERLAYFS_MOUNT_POINT") + + if not overlayMountPoints: + bb.fatal("A recipe uses overlayfs class but there is no OVERLAYFS_MOUNT_POINT set in your MACHINE configuration") + + # check that we have required mount points set first + requiredMountPoints = d.getVarFlags('OVERLAYFS_WRITABLE_PATHS') + for mountPoint in requiredMountPoints: + if mountPoint not in overlayMountPoints: + bb.fatal("Missing required mount point for OVERLAYFS_MOUNT_POINT[%s] in your MACHINE configuration" % mountPoint) + + for mountPoint in overlayMountPoints: + for path in d.getVarFlag('OVERLAYFS_WRITABLE_PATHS', mountPoint).split(): + fileList.append(mountUnitName(path)) + fileList.append(helperUnitName(path)) + + return fileList + diff --git a/poky/meta/lib/oe/packagedata.py b/poky/meta/lib/oe/packagedata.py index 22261d271e..0b17897e40 100644 --- a/poky/meta/lib/oe/packagedata.py +++ b/poky/meta/lib/oe/packagedata.py @@ -45,14 +45,14 @@ def read_pkgdata(pn, d): return read_pkgdatafile(fn) # -# Collapse FOO_pkg variables into FOO +# Collapse FOO:pkg variables into FOO # def read_subpkgdata_dict(pkg, d): ret = {} subd = read_pkgdatafile(get_subpkgedata_fn(pkg, d)) for var in subd: - newvar = var.replace("_" + pkg, "") - if newvar == var and var + "_" + pkg in subd: + newvar = var.replace(":" + pkg, "") + if newvar == var and var + ":" + pkg in subd: continue ret[newvar] = subd[var] return ret diff --git a/poky/meta/lib/oeqa/runtime/cases/date.py b/poky/meta/lib/oeqa/runtime/cases/date.py index e14322911d..bd6537400e 100644 --- a/poky/meta/lib/oeqa/runtime/cases/date.py +++ b/poky/meta/lib/oeqa/runtime/cases/date.py @@ -28,14 +28,13 @@ class DateTest(OERuntimeTestCase): self.assertEqual(status, 0, msg=msg) oldDate = output - sampleDate = '"2016-08-09 10:00:00"' - (status, output) = self.target.run("date -s %s" % sampleDate) + sampleTimestamp = 1488800000 + (status, output) = self.target.run("date -s @%d" % sampleTimestamp) self.assertEqual(status, 0, msg='Date set failed, output: %s' % output) - (status, output) = self.target.run("date -R") - p = re.match('Tue, 09 Aug 2016 10:00:.. \+0000', output) + (status, output) = self.target.run('date +"%s"') msg = 'The date was not set correctly, output: %s' % output - self.assertTrue(p, msg=msg) + self.assertTrue(int(output) - sampleTimestamp < 300, msg=msg) (status, output) = self.target.run('date -s "%s"' % oldDate) msg = 'Failed to reset date, output: %s' % output diff --git a/poky/meta/lib/oeqa/sdk/buildtools-cases/README b/poky/meta/lib/oeqa/sdk/buildtools-cases/README new file mode 100644 index 0000000000..d4f20faa9f --- /dev/null +++ b/poky/meta/lib/oeqa/sdk/buildtools-cases/README @@ -0,0 +1,2 @@ +These test cases are used by buildtools-tarball, and are not used by the testsdk +class. diff --git a/poky/meta/lib/oeqa/sdk/buildtools-cases/build.py b/poky/meta/lib/oeqa/sdk/buildtools-cases/build.py new file mode 100644 index 0000000000..5a17ab98c6 --- /dev/null +++ b/poky/meta/lib/oeqa/sdk/buildtools-cases/build.py @@ -0,0 +1,23 @@ +# +# SPDX-License-Identifier: MIT +# + +import os, tempfile +from oeqa.sdk.case import OESDKTestCase +from oeqa.utils.subprocesstweak import errors_have_output +errors_have_output() + +class BuildTests(OESDKTestCase): + """ + Verify that bitbake can build virtual/libc inside the buildtools. + """ + def test_libc(self): + with tempfile.TemporaryDirectory(prefix='bitbake-build-', dir=self.tc.sdk_dir) as testdir: + corebase = self.td['COREBASE'] + + self._run('. %s/oe-init-build-env %s' % (corebase, testdir)) + with open(os.path.join(testdir, 'conf', 'local.conf'), 'ta') as conf: + conf.write('\n') + conf.write('DL_DIR = "%s"\n' % self.td['DL_DIR']) + + self._run('. %s/oe-init-build-env %s && bitbake virtual/libc' % (corebase, testdir)) diff --git a/poky/meta/lib/oeqa/sdk/buildtools-cases/sanity.py b/poky/meta/lib/oeqa/sdk/buildtools-cases/sanity.py new file mode 100644 index 0000000000..64baaa8f84 --- /dev/null +++ b/poky/meta/lib/oeqa/sdk/buildtools-cases/sanity.py @@ -0,0 +1,22 @@ +# +# SPDX-License-Identifier: MIT +# + +import shutil +import os.path +from oeqa.sdk.case import OESDKTestCase + +class SanityTests(OESDKTestCase): + def test_tools(self): + """ + Test that wget and tar come from the buildtools, not the host. This + verifies that the buildtools have installed correctly. We can't check + for gcc as that is only installed by buildtools-extended. + """ + for command in ("tar", "wget"): + # Canonicalise the SDK root + sdk_base = os.path.realpath(self.tc.sdk_dir) + # Canonicalise the location of this command + tool_path = os.path.realpath(self._run("command -v %s" % command).strip()) + # Assert that the tool was found inside the SDK root + self.assertEquals(os.path.commonprefix((sdk_base, tool_path)), sdk_base) diff --git a/poky/meta/lib/oeqa/selftest/cases/fitimage.py b/poky/meta/lib/oeqa/selftest/cases/fitimage.py index 815ee48c05..184c8778d2 100644 --- a/poky/meta/lib/oeqa/selftest/cases/fitimage.py +++ b/poky/meta/lib/oeqa/selftest/cases/fitimage.py @@ -114,7 +114,8 @@ KERNEL_CLASSES = " kernel-fitimage test-mkimage-wrapper " UBOOT_SIGN_ENABLE = "1" FIT_GENERATE_KEYS = "1" UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" -UBOOT_SIGN_KEYNAME = "oe-selftest" +UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest" +UBOOT_SIGN_KEYNAME = "cfg-oe-selftest" FIT_SIGN_INDIVIDUAL = "1" UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'" """ @@ -173,11 +174,11 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'" reqsigvalues_image = { 'algo': '"sha256,rsa2048"', - 'key-name-hint': '"oe-selftest"', + 'key-name-hint': '"img-oe-selftest"', } reqsigvalues_config = { 'algo': '"sha256,rsa2048"', - 'key-name-hint': '"oe-selftest"', + 'key-name-hint': '"cfg-oe-selftest"', 'sign-images': '"kernel", "fdt"', } @@ -215,7 +216,10 @@ UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart comment'" self.assertIn('conf-am335x-boneblack.dtb', signed_sections) for signed_section, values in signed_sections.items(): value = values.get('Sign algo', None) - self.assertEqual(value, 'sha256,rsa2048:oe-selftest', 'Signature algorithm for %s not expected value' % signed_section) + if signed_section.startswith("conf"): + self.assertEqual(value, 'sha256,rsa2048:cfg-oe-selftest', 'Signature algorithm for %s not expected value' % signed_section) + else: + self.assertEqual(value, 'sha256,rsa2048:img-oe-selftest', 'Signature algorithm for %s not expected value' % signed_section) value = values.get('Sign value', None) self.assertEqual(len(value), 512, 'Signature value for section %s not expected length' % signed_section) @@ -266,7 +270,8 @@ KERNEL_CLASSES = " kernel-fitimage" UBOOT_SIGN_ENABLE = "1" FIT_GENERATE_KEYS = "1" UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" -UBOOT_SIGN_KEYNAME = "oe-selftest" +UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest" +UBOOT_SIGN_KEYNAME = "cfg-oe-selftest" FIT_SIGN_INDIVIDUAL = "1" """ self.write_config(config) @@ -348,7 +353,8 @@ KERNEL_CLASSES = " kernel-fitimage test-mkimage-wrapper " UBOOT_SIGN_ENABLE = "1" FIT_GENERATE_KEYS = "1" UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" -UBOOT_SIGN_KEYNAME = "oe-selftest" +UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest" +UBOOT_SIGN_KEYNAME = "cfg-oe-selftest" FIT_SIGN_INDIVIDUAL = "1" UBOOT_MKIMAGE_SIGN_ARGS = "-c 'a smart U-Boot comment'" """ @@ -592,7 +598,8 @@ KERNEL_CLASSES = " kernel-fitimage test-mkimage-wrapper " UBOOT_SIGN_ENABLE = "1" FIT_GENERATE_KEYS = "1" UBOOT_SIGN_KEYDIR = "${TOPDIR}/signing-keys" -UBOOT_SIGN_KEYNAME = "kernel-oe-selftest" +UBOOT_SIGN_IMG_KEYNAME = "img-oe-selftest" +UBOOT_SIGN_KEYNAME = "cfg-oe-selftest" FIT_SIGN_INDIVIDUAL = "1" """ self.write_config(config) diff --git a/poky/meta/lib/oeqa/selftest/cases/overlayfs.py b/poky/meta/lib/oeqa/selftest/cases/overlayfs.py new file mode 100644 index 0000000000..0184d52494 --- /dev/null +++ b/poky/meta/lib/oeqa/selftest/cases/overlayfs.py @@ -0,0 +1,171 @@ +# +# SPDX-License-Identifier: MIT +# + +from oeqa.selftest.case import OESelftestTestCase +from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu + +class OverlayFSTests(OESelftestTestCase): + """Overlayfs class usage tests""" + + def getline(self, res, line): + for l in res.output.split('\n'): + if line in l: + return l + + def add_overlay_conf_to_machine(self): + machine_inc = """ +OVERLAYFS_MOUNT_POINT[mnt-overlay] = "/mnt/overlay" +""" + self.set_machine_config(machine_inc) + + def test_distro_features_missing(self): + """ + Summary: Check that required DISTRO_FEATURES are set + Expected: Fail when either systemd or overlayfs are not in DISTRO_FEATURES + Author: Vyacheslav Yurkov <uvv.mail@gmail.com> + """ + + config = """ +IMAGE_INSTALL:append = " overlayfs-user" +""" + overlayfs_recipe_append = """ +inherit overlayfs +""" + self.write_config(config) + self.add_overlay_conf_to_machine() + self.write_recipeinc('overlayfs-user', overlayfs_recipe_append) + + res = bitbake('core-image-minimal', ignore_status=True) + line = self.getline(res, "overlayfs-user was skipped: missing required distro features") + self.assertTrue("overlayfs" in res.output, msg=res.output) + self.assertTrue("systemd" in res.output, msg=res.output) + self.assertTrue("ERROR: Required build target 'core-image-minimal' has no buildable providers." in res.output, msg=res.output) + + def test_not_all_units_installed(self): + """ + Summary: Test QA check that we have required mount units in the image + Expected: Fail because mount unit for overlay partition is not installed + Author: Vyacheslav Yurkov <uvv.mail@gmail.com> + """ + + config = """ +IMAGE_INSTALL:append = " overlayfs-user" +DISTRO_FEATURES += "systemd overlayfs" +""" + + self.write_config(config) + self.add_overlay_conf_to_machine() + + res = bitbake('core-image-minimal', ignore_status=True) + line = self.getline(res, "Unit name mnt-overlay.mount not found in systemd unit directories") + self.assertTrue(line and line.startswith("WARNING:"), msg=res.output) + line = self.getline(res, "Not all mount units are installed by the BSP") + self.assertTrue(line and line.startswith("ERROR:"), msg=res.output) + + def test_mount_unit_not_set(self): + """ + Summary: Test whether mount unit was set properly + Expected: Fail because mount unit was not set + Author: Vyacheslav Yurkov <uvv.mail@gmail.com> + """ + + config = """ +IMAGE_INSTALL:append = " overlayfs-user" +DISTRO_FEATURES += "systemd overlayfs" +""" + + self.write_config(config) + + res = bitbake('core-image-minimal', ignore_status=True) + line = self.getline(res, "A recipe uses overlayfs class but there is no OVERLAYFS_MOUNT_POINT set in your MACHINE configuration") + self.assertTrue(line and line.startswith("Parsing recipes...ERROR:"), msg=res.output) + + def test_wrong_mount_unit_set(self): + """ + Summary: Test whether mount unit was set properly + Expected: Fail because not the correct flag used for mount unit + Author: Vyacheslav Yurkov <uvv.mail@gmail.com> + """ + + config = """ +IMAGE_INSTALL:append = " overlayfs-user" +DISTRO_FEATURES += "systemd overlayfs" +""" + + wrong_machine_config = """ +OVERLAYFS_MOUNT_POINT[usr-share-overlay] = "/usr/share/overlay" +""" + + self.write_config(config) + self.set_machine_config(wrong_machine_config) + + res = bitbake('core-image-minimal', ignore_status=True) + line = self.getline(res, "Missing required mount point for OVERLAYFS_MOUNT_POINT[mnt-overlay] in your MACHINE configuration") + self.assertTrue(line and line.startswith("Parsing recipes...ERROR:"), msg=res.output) + + def test_correct_image(self): + """ + Summary: Check that we can create an image when all parameters are + set correctly + Expected: Image is created successfully + Author: Vyacheslav Yurkov <uvv.mail@gmail.com> + """ + + config = """ +IMAGE_INSTALL:append = " overlayfs-user systemd-machine-units" +DISTRO_FEATURES += "systemd overlayfs" + +# Use systemd as init manager +VIRTUAL-RUNTIME_init_manager = "systemd" + +# enable overlayfs in the kernel +KERNEL_EXTRA_FEATURES:append = " features/overlayfs/overlayfs.scc" +""" + + systemd_machine_unit_append = """ +SYSTEMD_SERVICE:${PN} += " \ + mnt-overlay.mount \ +" + +do_install:append() { + install -d ${D}${systemd_system_unitdir} + cat <<EOT > ${D}${systemd_system_unitdir}/mnt-overlay.mount +[Unit] +Description=Tmpfs directory +DefaultDependencies=no + +[Mount] +What=tmpfs +Where=/mnt/overlay +Type=tmpfs +Options=mode=1777,strictatime,nosuid,nodev + +[Install] +WantedBy=multi-user.target +EOT +} + +""" + + self.write_config(config) + self.add_overlay_conf_to_machine() + self.write_recipeinc('systemd-machine-units', systemd_machine_unit_append) + + bitbake('core-image-minimal') + + def getline_qemu(out, line): + for l in out.split('\n'): + if line in l: + return l + + with runqemu('core-image-minimal') as qemu: + # Check that we have /mnt/overlay fs mounted as tmpfs and + # /usr/share/my-application as an overlay (see overlayfs-user recipe) + status, output = qemu.run_serial("/bin/mount -t tmpfs,overlay") + + line = getline_qemu(output, "on /mnt/overlay") + self.assertTrue(line and line.startswith("tmpfs"), msg=output) + + line = getline_qemu(output, "upperdir=/mnt/overlay/upper/usr/share/my-application") + self.assertTrue(line and line.startswith("overlay"), msg=output) diff --git a/poky/meta/recipes-bsp/u-boot/u-boot.inc b/poky/meta/recipes-bsp/u-boot/u-boot.inc index 4340b17cb6..971fdbb102 100644 --- a/poky/meta/recipes-bsp/u-boot/u-boot.inc +++ b/poky/meta/recipes-bsp/u-boot/u-boot.inc @@ -210,7 +210,7 @@ do_install () { fi } -PACKAGE_BEFORE_PN += "${PN}-env" +PACKAGE_BEFORE_PN += "${PN}-env ${PN}-extlinux" RPROVIDES:${PN}-env += "u-boot-default-env" ALLOW_EMPTY:${PN}-env = "1" @@ -219,6 +219,9 @@ FILES:${PN}-env = " \ ${sysconfdir}/fw_env.config \ " +FILES:${PN}-extlinux = "${UBOOT_EXTLINUX_INSTALL_DIR}/${UBOOT_EXTLINUX_CONF_NAME}" +RDEPENDS:${PN} += "${@bb.utils.contains('UBOOT_EXTLINUX', '1', '${PN}-extlinux', '', d)}" + FILES:${PN} = "/boot ${datadir}" RDEPENDS:${PN} += "${PN}-env" diff --git a/poky/meta/recipes-core/dbus/dbus-glib_0.112.bb b/poky/meta/recipes-core/dbus/dbus-glib_0.112.bb index a03b2addfd..99b0a20004 100644 --- a/poky/meta/recipes-core/dbus/dbus-glib_0.112.bb +++ b/poky/meta/recipes-core/dbus/dbus-glib_0.112.bb @@ -20,7 +20,7 @@ SRC_URI[sha256sum] = "7d550dccdfcd286e33895501829ed971eeb65c614e73aadb4a08aeef71 inherit autotools pkgconfig gettext bash-completion gtk-doc #default disable regression tests, some unit test code in non testing code -#PACKAGECONFIG_pn-${PN} = "tests" enable regression tests local.conf +#PACKAGECONFIG:pn-${PN} = "tests" enable regression tests local.conf PACKAGECONFIG ??= "" PACKAGECONFIG[tests] = "--enable-tests,,," diff --git a/poky/meta/recipes-core/dbus/dbus.inc b/poky/meta/recipes-core/dbus/dbus.inc index b237476493..adc138bf10 100644 --- a/poky/meta/recipes-core/dbus/dbus.inc +++ b/poky/meta/recipes-core/dbus/dbus.inc @@ -8,6 +8,7 @@ SRC_URI = "https://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \ file://tmpdir.patch \ file://dbus-1.init \ file://clear-guid_from_server-if-send_negotiate_unix_f.patch \ + file://stop_using_selinux_set_mapping.patch \ " SRC_URI[md5sum] = "dfe8a71f412e0b53be26ed4fbfdc91c4" @@ -15,12 +16,10 @@ SRC_URI[sha256sum] = "f77620140ecb4cdc67f37fb444f8a6bea70b5b6461f12f1cbe2cec60fa EXTRA_OECONF = "--disable-xml-docs \ --disable-doxygen-docs \ - --disable-libaudit \ --enable-largefile \ --with-system-socket=/run/dbus/system_bus_socket \ " EXTRA_OECONF:append:class-target = " SYSTEMCTL=${base_bindir}/systemctl" -EXTRA_OECONF:append:class-native = " --disable-selinux" PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \ user-session \ @@ -32,3 +31,5 @@ PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm" PACKAGECONFIG[user-session] = "--enable-user-session --with-systemduserunitdir=${systemd_user_unitdir},--disable-user-session" PACKAGECONFIG[verbose-mode] = "--enable-verbose-mode,,," +PACKAGECONFIG[audit] = "--enable-libaudit,--disable-libaudit,audit" +PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux" diff --git a/poky/meta/recipes-core/dbus/dbus/stop_using_selinux_set_mapping.patch b/poky/meta/recipes-core/dbus/dbus/stop_using_selinux_set_mapping.patch new file mode 100644 index 0000000000..7035098e41 --- /dev/null +++ b/poky/meta/recipes-core/dbus/dbus/stop_using_selinux_set_mapping.patch @@ -0,0 +1,148 @@ +From 6072f8b24153d844a3033108a17bcd0c1a967816 Mon Sep 17 00:00:00 2001 +From: Laurent Bigonville <bigon@bigon.be> +Date: Sat, 3 Mar 2018 11:15:23 +0100 +Subject: [PATCH] Stop using selinux_set_mapping() function + +Currently, if the "dbus" security class or the associated AV doesn't +exist, dbus-daemon fails to initialize and exits immediately. Also the +security classes or access vector cannot be reordered in the policy. +This can be a problem for people developing their own policy or trying +to access a machine where, for some reasons, there is not policy defined +at all. + +The code here copy the behaviour of the selinux_check_access() function. +We cannot use this function here as it doesn't allow us to define the +AVC entry reference. + +See the discussion at https://marc.info/?l=selinux&m=152163374332372&w=2 + +Resolves: https://gitlab.freedesktop.org/dbus/dbus/issues/198 +--- + bus/selinux.c | 75 ++++++++++++++++++++++++++++----------------------- + 1 file changed, 42 insertions(+), 33 deletions(-) + + +Upstream-Status: Backport +Signed-off-by: Nisha.Parrakat <Nisha.Parrakat@kpit.com> +diff --git a/bus/selinux.c b/bus/selinux.c + +--- a/bus/selinux.c 2021-08-11 14:45:59.048513026 +0000 ++++ b/bus/selinux.c 2021-08-11 14:57:47.144846966 +0000 +@@ -311,24 +311,6 @@ + #endif + } + +-/* +- * Private Flask definitions; the order of these constants must +- * exactly match that of the structure array below! +- */ +-/* security dbus class constants */ +-#define SECCLASS_DBUS 1 +- +-/* dbus's per access vector constants */ +-#define DBUS__ACQUIRE_SVC 1 +-#define DBUS__SEND_MSG 2 +- +-#ifdef HAVE_SELINUX +-static struct security_class_mapping dbus_map[] = { +- { "dbus", { "acquire_svc", "send_msg", NULL } }, +- { NULL } +-}; +-#endif /* HAVE_SELINUX */ +- + /** + * Establish dynamic object class and permission mapping and + * initialize the user space access vector cache (AVC) for D-Bus and set up +@@ -350,13 +332,6 @@ + + _dbus_verbose ("SELinux is enabled in this kernel.\n"); + +- if (selinux_set_mapping (dbus_map) < 0) +- { +- _dbus_warn ("Failed to set up security class mapping (selinux_set_mapping():%s).", +- strerror (errno)); +- return FALSE; +- } +- + avc_entry_ref_init (&aeref); + if (avc_init ("avc", &mem_cb, &log_cb, &thread_cb, &lock_cb) < 0) + { +@@ -421,19 +396,53 @@ + static dbus_bool_t + bus_selinux_check (BusSELinuxID *sender_sid, + BusSELinuxID *override_sid, +- security_class_t target_class, +- access_vector_t requested, ++ const char *target_class, ++ const char *requested, + DBusString *auxdata) + { ++ int saved_errno; ++ security_class_t security_class; ++ access_vector_t requested_access; ++ + if (!selinux_enabled) + return TRUE; + ++ security_class = string_to_security_class (target_class); ++ if (security_class == 0) ++ { ++ saved_errno = errno; ++ log_callback (SELINUX_ERROR, "Unknown class %s", target_class); ++ if (security_deny_unknown () == 0) ++ { ++ return TRUE; ++ } ++ ++ _dbus_verbose ("Unknown class %s\n", target_class); ++ errno = saved_errno; ++ return FALSE; ++ } ++ ++ requested_access = string_to_av_perm (security_class, requested); ++ if (requested_access == 0) ++ { ++ saved_errno = errno; ++ log_callback (SELINUX_ERROR, "Unknown permission %s for class %s", requested, target_class); ++ if (security_deny_unknown () == 0) ++ { ++ return TRUE; ++ } ++ ++ _dbus_verbose ("Unknown permission %s for class %s\n", requested, target_class); ++ errno = saved_errno; ++ return FALSE; ++ } ++ + /* Make the security check. AVC checks enforcing mode here as well. */ + if (avc_has_perm (SELINUX_SID_FROM_BUS (sender_sid), + override_sid ? + SELINUX_SID_FROM_BUS (override_sid) : + bus_sid, +- target_class, requested, &aeref, auxdata) < 0) ++ security_class, requested_access, &aeref, auxdata) < 0) + { + switch (errno) + { +@@ -500,8 +509,8 @@ + + ret = bus_selinux_check (connection_sid, + service_sid, +- SECCLASS_DBUS, +- DBUS__ACQUIRE_SVC, ++ "dbus", ++ "acquire_svc", + &auxdata); + + _dbus_string_free (&auxdata); +@@ -629,8 +638,8 @@ + + ret = bus_selinux_check (sender_sid, + recipient_sid, +- SECCLASS_DBUS, +- DBUS__SEND_MSG, ++ "dbus", ++ "send_msg", + &auxdata); + + _dbus_string_free (&auxdata); diff --git a/poky/meta/recipes-core/ell/ell_0.41.bb b/poky/meta/recipes-core/ell/ell_0.42.bb index f6da957b51..7d021c5e3c 100644 --- a/poky/meta/recipes-core/ell/ell_0.41.bb +++ b/poky/meta/recipes-core/ell/ell_0.42.bb @@ -17,7 +17,7 @@ inherit autotools pkgconfig SRC_URI = "https://mirrors.edge.kernel.org/pub/linux/libs/${BPN}/${BPN}-${PV}.tar.xz \ file://0001-pem.c-do-not-use-rawmemchr.patch \ " -SRC_URI[sha256sum] = "4e8dba6c53cf152dbd0fd1dc3d4c7b04abf79e20a948895f85943e586870505c" +SRC_URI[sha256sum] = "8b926eebb053f545a03349c0e3d02be586f5aa041f5660b6ced85b55fc531bb7" do_configure:prepend () { mkdir -p ${S}/build-aux diff --git a/poky/meta/recipes-core/gettext/gettext_0.21.bb b/poky/meta/recipes-core/gettext/gettext_0.21.bb index 4247b487ab..5ada709937 100644 --- a/poky/meta/recipes-core/gettext/gettext_0.21.bb +++ b/poky/meta/recipes-core/gettext/gettext_0.21.bb @@ -171,6 +171,7 @@ do_install_ptest() { find ${D}${PTEST_PATH}/ -name "*.o" -exec rm {} \; chmod 0755 ${D}${PTEST_PATH}/tests/lang-vala ${D}${PTEST_PATH}/tests/plural-1 ${D}${PTEST_PATH}/tests/xgettext-tcl-4 \ ${D}${PTEST_PATH}/tests/xgettext-vala-1 ${D}${PTEST_PATH}/tests/xgettext-po-2 + sed -i -e 's|${DEBUG_PREFIX_MAP}||g' ${D}${PTEST_PATH}/tests/init-env fi } diff --git a/poky/meta/recipes-core/glib-2.0/glib.inc b/poky/meta/recipes-core/glib-2.0/glib.inc index 4859d28097..7528337456 100644 --- a/poky/meta/recipes-core/glib-2.0/glib.inc +++ b/poky/meta/recipes-core/glib-2.0/glib.inc @@ -45,8 +45,9 @@ PACKAGECONFIG[manpages] = "-Dman=true, -Dman=false, libxslt-native xmlto-native" # libelf is auto-detected without a configuration option PACKAGECONFIG[libelf] = ",,elfutils" PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false,dbus" +PACKAGECONFIG[selinux] = "-Dselinux=enabled,-Dselinux=disabled,libselinux" -EXTRA_OEMESON = "-Ddtrace=false -Dfam=false -Dsystemtap=false -Dselinux=disabled" +EXTRA_OEMESON = "-Ddtrace=false -Dfam=false -Dsystemtap=false" do_configure:prepend() { sed -i -e '1s,#!.*,#!${USRBINPATH}/env python3,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in diff --git a/poky/meta/recipes-core/glibc/cross-localedef-native_2.33.bb b/poky/meta/recipes-core/glibc/cross-localedef-native_2.34.bb index ec59c6ba10..6100f3d4c4 100644 --- a/poky/meta/recipes-core/glibc/cross-localedef-native_2.33.bb +++ b/poky/meta/recipes-core/glibc/cross-localedef-native_2.34.bb @@ -25,14 +25,13 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://0001-localedef-Add-hardlink-resolver-from-util-linux.patch \ file://0002-localedef-fix-ups-hardlink-to-make-it-compile.patch \ \ - file://0016-timezone-re-written-tzselect-as-posix-sh.patch \ - file://0017-Remove-bash-dependency-for-nscd-init-script.patch \ - file://0018-eglibc-Cross-building-and-testing-instructions.patch \ - file://0019-eglibc-Help-bootstrap-cross-toolchain.patch \ - file://0020-eglibc-Resolve-__fpscr_values-on-SH4.patch \ - file://0021-eglibc-Forward-port-cross-locale-generation-support.patch \ - file://0022-Define-DUMMY_LOCALE_T-if-not-defined.patch \ - file://0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \ + file://0017-timezone-re-written-tzselect-as-posix-sh.patch \ + file://0018-Remove-bash-dependency-for-nscd-init-script.patch \ + file://0019-eglibc-Cross-building-and-testing-instructions.patch \ + file://0020-eglibc-Help-bootstrap-cross-toolchain.patch \ + file://0021-eglibc-Resolve-__fpscr_values-on-SH4.patch \ + file://0022-eglibc-Forward-port-cross-locale-generation-support.patch \ + file://0024-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \ " # Makes for a rather long rev (22 characters), but... # diff --git a/poky/meta/recipes-core/glibc/glibc-common.inc b/poky/meta/recipes-core/glibc/glibc-common.inc index 782b2605cc..f695cd6a4a 100644 --- a/poky/meta/recipes-core/glibc/glibc-common.inc +++ b/poky/meta/recipes-core/glibc/glibc-common.inc @@ -22,4 +22,4 @@ ARM_INSTRUCTION_SET:armv6 = "arm" # COMPATIBLE_HOST:libc-musl:class-target = "null" -PV = "2.33" +PV = "2.34" diff --git a/poky/meta/recipes-core/glibc/glibc-locale_2.33.bb b/poky/meta/recipes-core/glibc/glibc-locale_2.34.bb index f7702e0358..f7702e0358 100644 --- a/poky/meta/recipes-core/glibc/glibc-locale_2.33.bb +++ b/poky/meta/recipes-core/glibc/glibc-locale_2.34.bb diff --git a/poky/meta/recipes-core/glibc/glibc-mtrace_2.33.bb b/poky/meta/recipes-core/glibc/glibc-mtrace_2.34.bb index 0b69bad46a..0b69bad46a 100644 --- a/poky/meta/recipes-core/glibc/glibc-mtrace_2.33.bb +++ b/poky/meta/recipes-core/glibc/glibc-mtrace_2.34.bb diff --git a/poky/meta/recipes-core/glibc/glibc-package.inc b/poky/meta/recipes-core/glibc/glibc-package.inc index 4bf5038fc0..3026aec9b6 100644 --- a/poky/meta/recipes-core/glibc/glibc-package.inc +++ b/poky/meta/recipes-core/glibc/glibc-package.inc @@ -1,6 +1,6 @@ INHIBIT_SYSROOT_STRIP = "1" -PACKAGES = "${PN}-dbg catchsegv sln nscd ldconfig ldd tzcode glibc-thread-db ${PN}-pic libcidn libmemusage libnss-db libsegfault ${PN}-pcprofile libsotruss ${PN} ${PN}-utils glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}-src" +PACKAGES = "${PN}-dbg catchsegv sln nscd ldconfig ldd tzcode glibc-thread-db ${PN}-pic libcidn libmemusage malloc-debug libnss-db libsegfault ${PN}-pcprofile libsotruss ${PN} ${PN}-utils glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}-src" # The ld.so in this glibc supports the GNU_HASH RPROVIDES:${PN} = "eglibc rtld(GNU_HASH)" @@ -30,6 +30,7 @@ FILES:ldd = "${bindir}/ldd" FILES:libsegfault = "${base_libdir}/libSegFault*" FILES:libcidn = "${base_libdir}/libcidn-*.so ${base_libdir}/libcidn.so.*" FILES:libmemusage = "${base_libdir}/libmemusage.so" +FILES:malloc-debug = "${base_libdir}/libc_malloc_debug.so.0" FILES:libnss-db = "${base_libdir}/libnss_db.so.* ${base_libdir}/libnss_db-*.so ${localstatedir}/db/Makefile ${localstatedir}/db/makedbs.sh" RDEPENDS:libnss-db = "${PN}-utils" FILES:glibc-extra-nss = "${base_libdir}/libnss_*-*.so ${base_libdir}/libnss_*.so.*" @@ -118,6 +119,8 @@ do_install() { ln -s ${@oe.path.relative('${root_prefix}/lib', '${base_libdir}')}/${ARCH_DYNAMIC_LOADER} \ ${D}${root_prefix}/lib/${ARCH_DYNAMIC_LOADER} fi + lnr ${D}${base_libdir}/libpthread.so.0 ${D}${libdir}/libpthread.so + lnr ${D}${base_libdir}/librt.so.1 ${D}${libdir}/librt.so } def get_libc_fpu_setting(bb, d): diff --git a/poky/meta/recipes-core/glibc/glibc-scripts_2.33.bb b/poky/meta/recipes-core/glibc/glibc-scripts_2.34.bb index 5a89bd8022..5a89bd8022 100644 --- a/poky/meta/recipes-core/glibc/glibc-scripts_2.33.bb +++ b/poky/meta/recipes-core/glibc/glibc-scripts_2.34.bb diff --git a/poky/meta/recipes-core/glibc/glibc-testsuite_2.33.bb b/poky/meta/recipes-core/glibc/glibc-testsuite_2.34.bb index 72aa332171..72aa332171 100644 --- a/poky/meta/recipes-core/glibc/glibc-testsuite_2.33.bb +++ b/poky/meta/recipes-core/glibc/glibc-testsuite_2.34.bb diff --git a/poky/meta/recipes-core/glibc/glibc-version.inc b/poky/meta/recipes-core/glibc/glibc-version.inc index 376ead66ac..281df7ecda 100644 --- a/poky/meta/recipes-core/glibc/glibc-version.inc +++ b/poky/meta/recipes-core/glibc/glibc-version.inc @@ -1,7 +1,7 @@ -SRCBRANCH ?= "release/2.33/master" -PV = "2.33" -SRCREV_glibc ?= "3f5080aedd164c1f92a53552dd3e0b82ac6d2bd3" -SRCREV_localedef ?= "bd644c9e6f3e20c5504da1488448173c69c56c28" +SRCBRANCH ?= "release/2.34/master" +PV = "2.34" +SRCREV_glibc ?= "ae37d06c7d127817ba43850f0f898b793d42aea7" +SRCREV_localedef ?= "95c0221703ad970a52445e9eaf91c4aff35eebef" GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git" diff --git a/poky/meta/recipes-core/glibc/glibc.inc b/poky/meta/recipes-core/glibc/glibc.inc index 04e6db99b9..80a3e0b493 100644 --- a/poky/meta/recipes-core/glibc/glibc.inc +++ b/poky/meta/recipes-core/glibc/glibc.inc @@ -42,7 +42,7 @@ PARALLEL_MAKE = "" EXTRA_OEMAKE += "SHELL=/bin/bash" do_configure:prepend() { - sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in + sed -e "s#/bin/bash#/bin/sh#" -i ${S}/elf/ldd.bash.in } # Enable backtrace from abort() diff --git a/poky/meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-from-util-linux.patch b/poky/meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-from-util-linux.patch index f96da83a9b..3ff485b1e3 100644 --- a/poky/meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-from-util-linux.patch +++ b/poky/meta/recipes-core/glibc/glibc/0001-localedef-Add-hardlink-resolver-from-util-linux.patch @@ -1,4 +1,4 @@ -From d1f1671034a222417f9a829dcaa4f0c3d4f8954d Mon Sep 17 00:00:00 2001 +From d34ba0833cd811f8869a6262044af55f9e7b59d8 Mon Sep 17 00:00:00 2001 From: Jason Wessel <jason.wessel@windriver.com> Date: Sat, 7 Dec 2019 09:59:22 -0800 Subject: [PATCH] localedef: Add hardlink resolver from util-linux diff --git a/poky/meta/recipes-core/glibc/glibc/0002-localedef-fix-ups-hardlink-to-make-it-compile.patch b/poky/meta/recipes-core/glibc/glibc/0002-localedef-fix-ups-hardlink-to-make-it-compile.patch index 3dc4582f47..2445aa56b3 100644 --- a/poky/meta/recipes-core/glibc/glibc/0002-localedef-fix-ups-hardlink-to-make-it-compile.patch +++ b/poky/meta/recipes-core/glibc/glibc/0002-localedef-fix-ups-hardlink-to-make-it-compile.patch @@ -1,4 +1,4 @@ -From 14d256e2db009f8bac9a265e8393d7ed25050df9 Mon Sep 17 00:00:00 2001 +From d7bb36a9a27e5e4c3be6378493b41286513750e9 Mon Sep 17 00:00:00 2001 From: Jason Wessel <jason.wessel@windriver.com> Date: Sat, 7 Dec 2019 10:01:37 -0800 Subject: [PATCH] localedef: fix-ups hardlink to make it compile diff --git a/poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch b/poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch index c4718a106f..210cc1076c 100644 --- a/poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch +++ b/poky/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch @@ -1,4 +1,4 @@ -From 32a4b8ae046fe4bb1b19f61378d079d44deaede7 Mon Sep 17 00:00:00 2001 +From 776a53db6afba8a7ff4412aba88b0679227877f9 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 01:48:24 +0000 Subject: [PATCH] nativesdk-glibc: Look for host system ld.so.cache as well @@ -30,10 +30,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/elf/dl-load.c b/elf/dl-load.c -index 9e2089cfaa..ad01674027 100644 +index a08df001af..d09daf9e41 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c -@@ -2175,6 +2175,14 @@ _dl_map_object (struct link_map *loader, const char *name, +@@ -2196,6 +2196,14 @@ _dl_map_object (struct link_map *loader, const char *name, } } @@ -48,7 +48,7 @@ index 9e2089cfaa..ad01674027 100644 #ifdef USE_LDCONFIG if (fd == -1 && (__glibc_likely ((mode & __RTLD_SECURE) == 0) -@@ -2233,14 +2241,6 @@ _dl_map_object (struct link_map *loader, const char *name, +@@ -2254,14 +2262,6 @@ _dl_map_object (struct link_map *loader, const char *name, } #endif diff --git a/poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch b/poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch index a8e625d24c..010b816e11 100644 --- a/poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch +++ b/poky/meta/recipes-core/glibc/glibc/0004-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch @@ -1,4 +1,4 @@ -From aa8393bff257e4badfd208b88473ead175c69362 Mon Sep 17 00:00:00 2001 +From df18bae1eeee55ecb9db36d13fe67c58355682eb Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 01:50:00 +0000 Subject: [PATCH] nativesdk-glibc: Fix buffer overrun with a relocated SDK @@ -21,10 +21,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> 1 file changed, 12 insertions(+) diff --git a/elf/dl-load.c b/elf/dl-load.c -index ad01674027..f455207e79 100644 +index d09daf9e41..2c6270e2a7 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c -@@ -1871,7 +1871,19 @@ open_path (const char *name, size_t namelen, int mode, +@@ -1892,7 +1892,19 @@ open_path (const char *name, size_t namelen, int mode, given on the command line when rtld is run directly. */ return -1; diff --git a/poky/meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch b/poky/meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch index 197caae921..bf9f3e36ca 100644 --- a/poky/meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch +++ b/poky/meta/recipes-core/glibc/glibc/0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch @@ -1,4 +1,4 @@ -From 3ea08e491a8494ff03e598b5e0fc2d8131e75da9 Mon Sep 17 00:00:00 2001 +From 6af8ce8eceed86addbc188f773a2d36d83ee4042 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 01:51:38 +0000 Subject: [PATCH] nativesdk-glibc: Raise the size of arrays containing dl paths @@ -26,10 +26,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> 8 files changed, 16 insertions(+), 10 deletions(-) diff --git a/elf/dl-cache.c b/elf/dl-cache.c -index 32f3bef5ea..71f3a82dc0 100644 +index 2b8da8650d..3d9787bda4 100644 --- a/elf/dl-cache.c +++ b/elf/dl-cache.c -@@ -359,6 +359,10 @@ search_cache (const char *string_table, uint32_t string_table_size, +@@ -355,6 +355,10 @@ search_cache (const char *string_table, uint32_t string_table_size, return best; } @@ -41,7 +41,7 @@ index 32f3bef5ea..71f3a82dc0 100644 _dl_cache_libcmp (const char *p1, const char *p2) { diff --git a/elf/dl-load.c b/elf/dl-load.c -index f455207e79..a144e24fcf 100644 +index 2c6270e2a7..23018d2f7e 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -115,8 +115,8 @@ enum { ncapstr = 1, max_capstrlen = 0 }; @@ -56,7 +56,7 @@ index f455207e79..a144e24fcf 100644 SYSTEM_DIRS_LEN }; diff --git a/elf/dl-usage.c b/elf/dl-usage.c -index 6e26818bd7..f09e8b93e5 100644 +index 5ad3a72559..88f26d3692 100644 --- a/elf/dl-usage.c +++ b/elf/dl-usage.c @@ -25,6 +25,8 @@ @@ -77,7 +77,7 @@ index 6e26818bd7..f09e8b93e5 100644 --library-path PATH use given PATH instead of content of the environment\n\ variable LD_LIBRARY_PATH\n\ --glibc-hwcaps-prepend LIST\n\ -@@ -266,7 +268,7 @@ setting environment variables (which would be inherited by subprocesses).\n\ +@@ -267,7 +269,7 @@ setting environment variables (which would be inherited by subprocesses).\n\ \n\ This program interpreter self-identifies as: " RTLD "\n\ ", @@ -98,10 +98,10 @@ index 91966702ca..dc86c20e83 100644 +const char __invoke_dynamic_linker__[4096] __attribute__ ((section (".interp"))) = RUNTIME_LINKER; diff --git a/elf/ldconfig.c b/elf/ldconfig.c -index 28ed637a29..5d38a60c5d 100644 +index 1037e8d0cf..ffdac84952 100644 --- a/elf/ldconfig.c +++ b/elf/ldconfig.c -@@ -176,6 +176,9 @@ static struct argp argp = +@@ -177,6 +177,9 @@ static struct argp argp = options, parse_opt, NULL, doc, NULL, more_help, NULL }; @@ -112,7 +112,7 @@ index 28ed637a29..5d38a60c5d 100644 a platform. */ static int diff --git a/elf/rtld.c b/elf/rtld.c -index 596b6ac3d9..1ccd33f668 100644 +index fbbd60b446..fce9940f80 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -185,6 +185,7 @@ dso_name_valid_for_suid (const char *p) @@ -124,11 +124,11 @@ index 596b6ac3d9..1ccd33f668 100644 static void audit_list_init (struct audit_list *list) diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c -index 682f949834..7eed87bc9d 100644 +index 62bee28769..67b60dc88c 100644 --- a/iconv/gconv_conf.c +++ b/iconv/gconv_conf.c @@ -36,7 +36,7 @@ - + #include <gconv_parseconfdir.h> /* This is the default path where we look for module lists. */ -static const char default_gconv_path[] = GCONV_PATH; diff --git a/poky/meta/recipes-core/glibc/glibc/0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch b/poky/meta/recipes-core/glibc/glibc/0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch index 172ade8d97..3a37f7af72 100644 --- a/poky/meta/recipes-core/glibc/glibc/0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch +++ b/poky/meta/recipes-core/glibc/glibc/0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch @@ -1,4 +1,4 @@ -From 19e3e45eb1838ee80af13c3d27fcff446773211e Mon Sep 17 00:00:00 2001 +From b30f380cd88ae181a4a6a3a4784206ffe3ccd19b Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Thu, 31 Dec 2015 14:35:35 -0800 Subject: [PATCH] nativesdk-glibc: Allow 64 bit atomics for x86 diff --git a/poky/meta/recipes-core/glibc/glibc/0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch b/poky/meta/recipes-core/glibc/glibc/0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch index 14697567c2..d763178f21 100644 --- a/poky/meta/recipes-core/glibc/glibc/0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch +++ b/poky/meta/recipes-core/glibc/glibc/0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch @@ -1,4 +1,4 @@ -From 732d4f4954fe60718870048d0583a20a7a8a8540 Mon Sep 17 00:00:00 2001 +From 24bffe9c2645cd6542e29cb57786dc703cced07b Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Fri, 3 Aug 2018 09:55:12 -0700 Subject: [PATCH] nativesdk-glibc: Make relocatable install for locales @@ -41,7 +41,7 @@ index ab09122b0c..f42cc75780 100644 else /* We really have to load some data. First see whether the name is diff --git a/locale/loadarchive.c b/locale/loadarchive.c -index 4177fc8972..40247b1e68 100644 +index 512769eaec..436619091b 100644 --- a/locale/loadarchive.c +++ b/locale/loadarchive.c @@ -42,7 +42,7 @@ @@ -67,7 +67,7 @@ index b3d4da0185..22f9dc1140 100644 /* Load the locale data for CATEGORY from the file specified by *NAME. If *NAME is "", use environment variables as specified by POSIX, and diff --git a/locale/programs/locale.c b/locale/programs/locale.c -index 575b208e82..5ec630c3a4 100644 +index ca0a95be99..6b98895203 100644 --- a/locale/programs/locale.c +++ b/locale/programs/locale.c @@ -632,6 +632,7 @@ nameentcmp (const void *a, const void *b) diff --git a/poky/meta/recipes-core/glibc/glibc/0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch b/poky/meta/recipes-core/glibc/glibc/0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch new file mode 100644 index 0000000000..f4fc1d68c4 --- /dev/null +++ b/poky/meta/recipes-core/glibc/glibc/0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch @@ -0,0 +1,32 @@ +From 2761400989bcbf11e10bc85f90c3a2ba1305c4ae Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 6 Mar 2021 14:48:56 -0800 +Subject: [PATCH] nativesdk-glibc: Fall back to faccessat on faccess2 returns + EPERM + +Fedora-specific workaround for systemd-nspawn + +Upstream-Status: Inappropriate [Distro Specific] + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + sysdeps/unix/sysv/linux/faccessat.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/sysdeps/unix/sysv/linux/faccessat.c b/sysdeps/unix/sysv/linux/faccessat.c +index 13160d3249..ee3ddc9b79 100644 +--- a/sysdeps/unix/sysv/linux/faccessat.c ++++ b/sysdeps/unix/sysv/linux/faccessat.c +@@ -30,7 +30,11 @@ __faccessat (int fd, const char *file, int mode, int flag) + #if __ASSUME_FACCESSAT2 + return ret; + #else +- if (ret == 0 || errno != ENOSYS) ++ /* Fedora-specific workaround: ++ As a workround for a broken systemd-nspawn that returns ++ EPERM when a syscall is not allowed instead of ENOSYS ++ we must check for EPERM here and fall back to faccessat. */ ++ if (ret == 0 || !(errno == ENOSYS || errno == EPERM)) + return ret; + + if (flag & ~(AT_SYMLINK_NOFOLLOW | AT_EACCESS)) diff --git a/poky/meta/recipes-core/glibc/glibc/0008-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch b/poky/meta/recipes-core/glibc/glibc/0009-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch index 2162bf38c2..01de227a02 100644 --- a/poky/meta/recipes-core/glibc/glibc/0008-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch +++ b/poky/meta/recipes-core/glibc/glibc/0009-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch @@ -1,4 +1,4 @@ -From 3d58330390a7d4f4ed32f4a9c25628af3e0dd5c1 Mon Sep 17 00:00:00 2001 +From 74923ca4b1ae0ed5a2478e7d265b37534f6815d7 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 00:01:50 +0000 Subject: [PATCH] fsl e500/e5500/e6500/603e fsqrt implementation diff --git a/poky/meta/recipes-core/glibc/glibc/0009-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch b/poky/meta/recipes-core/glibc/glibc/0010-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch index 0c8bf94a75..5c1130cf10 100644 --- a/poky/meta/recipes-core/glibc/glibc/0009-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch +++ b/poky/meta/recipes-core/glibc/glibc/0010-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch @@ -1,4 +1,4 @@ -From 3b5fe5b1a7390cde0f07351415e3891f62d1f7e0 Mon Sep 17 00:00:00 2001 +From 5da3da7f2d276c2a6ae1b04419b28e96953803ec Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 00:15:07 +0000 Subject: [PATCH] ppc/sqrt: Fix undefined reference to `__sqrt_finite' diff --git a/poky/meta/recipes-core/glibc/glibc/0010-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/poky/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch index cadaa0b2e2..b72e79057b 100644 --- a/poky/meta/recipes-core/glibc/glibc/0010-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch +++ b/poky/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch @@ -1,4 +1,4 @@ -From 6b6e1dcd707017598ea3bdc2d91a761943b62218 Mon Sep 17 00:00:00 2001 +From 77f1c90d67a2f8852184fb8fd95cb0ed63065dc7 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 00:16:38 +0000 Subject: [PATCH] __ieee754_sqrt{,f} are now inline functions and call out diff --git a/poky/meta/recipes-core/glibc/glibc/0011-Quote-from-bug-1443-which-explains-what-the-patch-do.patch b/poky/meta/recipes-core/glibc/glibc/0012-Quote-from-bug-1443-which-explains-what-the-patch-do.patch index e4c78b5c79..07d4411c61 100644 --- a/poky/meta/recipes-core/glibc/glibc/0011-Quote-from-bug-1443-which-explains-what-the-patch-do.patch +++ b/poky/meta/recipes-core/glibc/glibc/0012-Quote-from-bug-1443-which-explains-what-the-patch-do.patch @@ -1,4 +1,4 @@ -From 297bac9429260f8df495b81d3fae8ae4c6913f5f Mon Sep 17 00:00:00 2001 +From add514edf4299d1bf540d85d0aa0bd5fe0d46b78 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 00:20:09 +0000 Subject: [PATCH] Quote from bug 1443 which explains what the patch does : diff --git a/poky/meta/recipes-core/glibc/glibc/0012-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch b/poky/meta/recipes-core/glibc/glibc/0013-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch index c5e8e6473a..c2766ef4c3 100644 --- a/poky/meta/recipes-core/glibc/glibc/0012-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch +++ b/poky/meta/recipes-core/glibc/glibc/0013-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch @@ -1,4 +1,4 @@ -From f389babf3c920e68b7d7391556a78ebf62a21ebe Mon Sep 17 00:00:00 2001 +From c5047b8f7d1a17324cfa02b99f07a70ebcec2cf2 Mon Sep 17 00:00:00 2001 From: Ting Liu <b28495@freescale.com> Date: Wed, 19 Dec 2012 04:39:57 -0600 Subject: [PATCH] eglibc: run libm-err-tab.pl with specific dirs in ${S} diff --git a/poky/meta/recipes-core/glibc/glibc/0013-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/poky/meta/recipes-core/glibc/glibc/0014-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch index 7f362cace0..088b810530 100644 --- a/poky/meta/recipes-core/glibc/glibc/0013-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch +++ b/poky/meta/recipes-core/glibc/glibc/0014-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch @@ -1,4 +1,4 @@ -From 4b0d41a315e66f688fef7b0c2e2b6ce9fa16ec93 Mon Sep 17 00:00:00 2001 +From 133870f12ba36686dd8df1311fac32a4c5b28579 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 00:24:46 +0000 Subject: [PATCH] __ieee754_sqrt{,f} are now inline functions and call out diff --git a/poky/meta/recipes-core/glibc/glibc/0014-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch b/poky/meta/recipes-core/glibc/glibc/0015-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch index 4da0e003c0..e8332a53c2 100644 --- a/poky/meta/recipes-core/glibc/glibc/0014-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch +++ b/poky/meta/recipes-core/glibc/glibc/0015-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch @@ -1,4 +1,4 @@ -From c062a462fee53a30a85d693c8288b5bd8fe4ec6e Mon Sep 17 00:00:00 2001 +From b4613f814ba7ba5db95d18116172f81a83ac8f5b Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 00:27:10 +0000 Subject: [PATCH] sysdeps/gnu/configure.ac: handle correctly diff --git a/poky/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch b/poky/meta/recipes-core/glibc/glibc/0016-yes-within-the-path-sets-wrong-config-variables.patch index 15e83f8917..f7e7f1cd10 100644 --- a/poky/meta/recipes-core/glibc/glibc/0015-yes-within-the-path-sets-wrong-config-variables.patch +++ b/poky/meta/recipes-core/glibc/glibc/0016-yes-within-the-path-sets-wrong-config-variables.patch @@ -1,4 +1,4 @@ -From 0bd39d8907953f18e01742f42b24647ac7689d0a Mon Sep 17 00:00:00 2001 +From 7be3e82b66394a7b242e56c6fc609e858b8e2436 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 00:31:06 +0000 Subject: [PATCH] 'yes' within the path sets wrong config variables @@ -29,7 +29,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> 12 files changed, 28 insertions(+), 28 deletions(-) diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure -index 83c3a23e44..a68c946277 100644 +index 4c1fac49f3..597314f476 100644 --- a/sysdeps/aarch64/configure +++ b/sysdeps/aarch64/configure @@ -157,12 +157,12 @@ else @@ -48,7 +48,7 @@ index 83c3a23e44..a68c946277 100644 else libc_cv_aarch64_be=no diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac -index 66f755078a..a32b265bbe 100644 +index 3347c13fa1..4af163c0b6 100644 --- a/sysdeps/aarch64/configure.ac +++ b/sysdeps/aarch64/configure.ac @@ -17,8 +17,8 @@ AC_DEFINE(SUPPORT_STATIC_PIE) diff --git a/poky/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch b/poky/meta/recipes-core/glibc/glibc/0017-timezone-re-written-tzselect-as-posix-sh.patch index 79bd704153..100d08599c 100644 --- a/poky/meta/recipes-core/glibc/glibc/0016-timezone-re-written-tzselect-as-posix-sh.patch +++ b/poky/meta/recipes-core/glibc/glibc/0017-timezone-re-written-tzselect-as-posix-sh.patch @@ -1,4 +1,4 @@ -From 3feb4213628f1485000ffe1d3fd26e37a7b14336 Mon Sep 17 00:00:00 2001 +From 2731fa0c7463cd160361a8ac92f3bd7f984d953d Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 00:33:03 +0000 Subject: [PATCH] timezone: re-written tzselect as posix sh @@ -10,27 +10,19 @@ Upstream-Status: Pending Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> --- - timezone/Makefile | 2 +- - timezone/tzselect.ksh | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) + timezone/tzselect.ksh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/timezone/Makefile b/timezone/Makefile -index 395abfeebd..2d939edf75 100644 ---- a/timezone/Makefile -+++ b/timezone/Makefile -@@ -123,7 +123,7 @@ $(testdata)/XT%: testdata/XT% - cp $< $@ - - $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make -- sed -e 's|/bin/bash|$(BASH)|' \ -+ sed -e 's|/bin/bash|/bin/sh|' \ - -e 's|TZDIR=[^}]*|TZDIR=$(zonedir)|' \ - -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \ - -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \ diff --git a/timezone/tzselect.ksh b/timezone/tzselect.ksh -index 18fce27e24..70745f9d36 100755 +index 18fce27e24..7705df83d7 100755 --- a/timezone/tzselect.ksh +++ b/timezone/tzselect.ksh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + # Ask the user about the time zone, and output the resulting TZ value to stdout. + # Interact with the user via stderr and stdin. + @@ -34,7 +34,7 @@ REPORT_BUGS_TO=tz@iana.org # Specify default values for environment variables if they are unset. diff --git a/poky/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch b/poky/meta/recipes-core/glibc/glibc/0018-Remove-bash-dependency-for-nscd-init-script.patch index c32d70b593..23296da61d 100644 --- a/poky/meta/recipes-core/glibc/glibc/0017-Remove-bash-dependency-for-nscd-init-script.patch +++ b/poky/meta/recipes-core/glibc/glibc/0018-Remove-bash-dependency-for-nscd-init-script.patch @@ -1,4 +1,4 @@ -From f6119b98a9caa80642d69a97edc98f57ecef5c3c Mon Sep 17 00:00:00 2001 +From 412d33bbfe42a10a9b1f62afcc73fe121a0363b0 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Thu, 31 Dec 2015 14:33:02 -0800 Subject: [PATCH] Remove bash dependency for nscd init script diff --git a/poky/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch b/poky/meta/recipes-core/glibc/glibc/0019-eglibc-Cross-building-and-testing-instructions.patch index 826e5af465..8fb9182d98 100644 --- a/poky/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch +++ b/poky/meta/recipes-core/glibc/glibc/0019-eglibc-Cross-building-and-testing-instructions.patch @@ -1,4 +1,4 @@ -From 060ba13b5ac5e90517d540f009ebdcdcf62f9685 Mon Sep 17 00:00:00 2001 +From db9674ffc6583a508da1a3cb044c3ccf3febaea1 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 00:42:58 +0000 Subject: [PATCH] eglibc: Cross building and testing instructions diff --git a/poky/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch b/poky/meta/recipes-core/glibc/glibc/0020-eglibc-Help-bootstrap-cross-toolchain.patch index afac2e04f6..9b76cfd3b8 100644 --- a/poky/meta/recipes-core/glibc/glibc/0019-eglibc-Help-bootstrap-cross-toolchain.patch +++ b/poky/meta/recipes-core/glibc/glibc/0020-eglibc-Help-bootstrap-cross-toolchain.patch @@ -1,4 +1,4 @@ -From f13c2f525e9bc82ce13e4cf486f7fe0831fc3fac Mon Sep 17 00:00:00 2001 +From 7856684f76c100155cad11b5b236fb31234b6e28 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 00:49:28 +0000 Subject: [PATCH] eglibc: Help bootstrap cross toolchain @@ -29,7 +29,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> create mode 100644 include/stubs-bootstrap.h diff --git a/Makefile b/Makefile -index 50f99ca611..31eed15f02 100644 +index f98d5a9e67..c36d04da0f 100644 --- a/Makefile +++ b/Makefile @@ -79,9 +79,18 @@ subdir-dirs = include @@ -52,7 +52,7 @@ index 50f99ca611..31eed15f02 100644 ifeq (yes,$(build-shared)) headers += gnu/lib-names.h endif -@@ -416,6 +425,16 @@ others: $(common-objpfx)testrun.sh $(common-objpfx)debugglibc.sh +@@ -415,6 +424,16 @@ others: $(common-objpfx)testrun.sh $(common-objpfx)debugglibc.sh subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs) @@ -69,7 +69,7 @@ index 50f99ca611..31eed15f02 100644 ifndef abi-variants installed-stubs = $(inst_includedir)/gnu/stubs.h else -@@ -442,6 +461,7 @@ $(inst_includedir)/gnu/stubs.h: $(+force) +@@ -441,6 +460,7 @@ $(inst_includedir)/gnu/stubs.h: $(+force) install-others-nosubdir: $(installed-stubs) endif diff --git a/poky/meta/recipes-core/glibc/glibc/0020-eglibc-Resolve-__fpscr_values-on-SH4.patch b/poky/meta/recipes-core/glibc/glibc/0021-eglibc-Resolve-__fpscr_values-on-SH4.patch index 9a610c6703..74c8c10661 100644 --- a/poky/meta/recipes-core/glibc/glibc/0020-eglibc-Resolve-__fpscr_values-on-SH4.patch +++ b/poky/meta/recipes-core/glibc/glibc/0021-eglibc-Resolve-__fpscr_values-on-SH4.patch @@ -1,4 +1,4 @@ -From 330c4e50e28e29c31fb8d6ab39cdbb2af4d3def7 Mon Sep 17 00:00:00 2001 +From 111ab95a85314d1e70fb159a14250354cc69d899 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 00:55:53 +0000 Subject: [PATCH] eglibc: Resolve __fpscr_values on SH4 @@ -21,10 +21,10 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> 2 files changed, 12 insertions(+) diff --git a/sysdeps/unix/sysv/linux/sh/Versions b/sysdeps/unix/sysv/linux/sh/Versions -index e0938c4165..ca1d7da339 100644 +index 9c734ff755..974e33b4b1 100644 --- a/sysdeps/unix/sysv/linux/sh/Versions +++ b/sysdeps/unix/sysv/linux/sh/Versions -@@ -2,6 +2,7 @@ libc { +@@ -3,6 +3,7 @@ libc { GLIBC_2.2 { # functions used in other libraries __xstat64; __fxstat64; __lxstat64; diff --git a/poky/meta/recipes-core/glibc/glibc/0022-Define-DUMMY_LOCALE_T-if-not-defined.patch b/poky/meta/recipes-core/glibc/glibc/0022-Define-DUMMY_LOCALE_T-if-not-defined.patch deleted file mode 100644 index 33d912d356..0000000000 --- a/poky/meta/recipes-core/glibc/glibc/0022-Define-DUMMY_LOCALE_T-if-not-defined.patch +++ /dev/null @@ -1,29 +0,0 @@ -From c8df3cf4556d8d78a98675865395ce42f3b67109 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Wed, 20 Apr 2016 21:11:00 -0700 -Subject: [PATCH] Define DUMMY_LOCALE_T if not defined - -This is a hack to fix building the locale bits on an older -CentOs 5.X machine - -Upstream-Status: Inappropriate [other] - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - locale/programs/config.h | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/locale/programs/config.h b/locale/programs/config.h -index 2edcf3696c..5350101e38 100644 ---- a/locale/programs/config.h -+++ b/locale/programs/config.h -@@ -19,6 +19,9 @@ - #ifndef _LD_CONFIG_H - #define _LD_CONFIG_H 1 - -+#ifndef DUMMY_LOCALE_T -+#define DUMMY_LOCALE_T -+#endif - /* Use the internal textdomain used for libc messages. */ - #define PACKAGE _libc_intl_domainname - #ifndef VERSION diff --git a/poky/meta/recipes-core/glibc/glibc/0021-eglibc-Forward-port-cross-locale-generation-support.patch b/poky/meta/recipes-core/glibc/glibc/0022-eglibc-Forward-port-cross-locale-generation-support.patch index 0b2f020fdd..a9ff8e92ea 100644 --- a/poky/meta/recipes-core/glibc/glibc/0021-eglibc-Forward-port-cross-locale-generation-support.patch +++ b/poky/meta/recipes-core/glibc/glibc/0022-eglibc-Forward-port-cross-locale-generation-support.patch @@ -1,4 +1,4 @@ -From 557ed640b26bd208ce8d4a6fd725b124893668d7 Mon Sep 17 00:00:00 2001 +From 4e5de801a39d66b8bd93d09f5912dcbe5db4ef04 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 01:33:49 +0000 Subject: [PATCH] eglibc: Forward port cross locale generation support @@ -148,7 +148,7 @@ index 4841bfd05d..ffcba1fd79 100644 return NULL; } diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c -index 0af21e05e2..4980b0c52f 100644 +index b6406b775d..bfa4adba9c 100644 --- a/locale/programs/ld-collate.c +++ b/locale/programs/ld-collate.c @@ -349,7 +349,7 @@ new_element (struct locale_collate_t *collate, const char *mbs, size_t mbslen, @@ -160,7 +160,7 @@ index 0af21e05e2..4980b0c52f 100644 uint32_t zero = 0; /* Handle <U0000> as a single character. */ if (nwcs == 0) -@@ -1772,8 +1772,7 @@ symbol `%s' has the same encoding as"), (*eptr)->name); +@@ -1775,8 +1775,7 @@ symbol `%s' has the same encoding as"), (*eptr)->name); if ((*eptr)->nwcs == runp->nwcs) { @@ -170,7 +170,7 @@ index 0af21e05e2..4980b0c52f 100644 if (c == 0) { -@@ -2000,9 +1999,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp) +@@ -2003,9 +2002,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp) one consecutive entry. */ if (runp->wcnext != NULL && runp->nwcs == runp->wcnext->nwcs @@ -183,7 +183,7 @@ index 0af21e05e2..4980b0c52f 100644 && (runp->wcs[runp->nwcs - 1] == runp->wcnext->wcs[runp->nwcs - 1] + 1)) { -@@ -2026,9 +2025,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp) +@@ -2029,9 +2028,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp) runp = runp->wcnext; while (runp->wcnext != NULL && runp->nwcs == runp->wcnext->nwcs diff --git a/poky/meta/recipes-core/glibc/glibc/0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch b/poky/meta/recipes-core/glibc/glibc/0024-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch index a5a7a0cad7..50c2e14735 100644 --- a/poky/meta/recipes-core/glibc/glibc/0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch +++ b/poky/meta/recipes-core/glibc/glibc/0024-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch @@ -1,4 +1,4 @@ -From 2ec233ce078b74030de9195096058cd502fdc395 Mon Sep 17 00:00:00 2001 +From 13bc0e53cc91e102472d532f28b3d44c30d291fc Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Fri, 3 Aug 2018 09:42:06 -0700 Subject: [PATCH] localedef --add-to-archive uses a hard-coded locale path @@ -18,7 +18,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c -index 6bb189ae37..0711c5c44e 100644 +index f38e835c52..8d8f8699b2 100644 --- a/locale/programs/locarchive.c +++ b/locale/programs/locarchive.c @@ -340,12 +340,24 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head) diff --git a/poky/meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch b/poky/meta/recipes-core/glibc/glibc/0025-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch index d2691e1ee7..fb0a609dbb 100644 --- a/poky/meta/recipes-core/glibc/glibc/0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch +++ b/poky/meta/recipes-core/glibc/glibc/0025-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch @@ -1,4 +1,4 @@ -From f8289aa320b00f6db43213979cceab2325a7a611 Mon Sep 17 00:00:00 2001 +From 50b605dece16606dd9d1c737e579c13725eab11d Mon Sep 17 00:00:00 2001 From: Mark Hatle <mark.hatle@windriver.com> Date: Thu, 18 Aug 2016 14:07:58 -0500 Subject: [PATCH] elf/dl-deps.c: Make _dl_build_local_scope breadth first diff --git a/poky/meta/recipes-core/glibc/glibc/0025-intl-Emit-no-lines-in-bison-generated-files.patch b/poky/meta/recipes-core/glibc/glibc/0026-intl-Emit-no-lines-in-bison-generated-files.patch index 32f8fd22b8..998db39b47 100644 --- a/poky/meta/recipes-core/glibc/glibc/0025-intl-Emit-no-lines-in-bison-generated-files.patch +++ b/poky/meta/recipes-core/glibc/glibc/0026-intl-Emit-no-lines-in-bison-generated-files.patch @@ -1,4 +1,4 @@ -From 3156464f9a95bf1dafd2e22d19d7bf89c520acc1 Mon Sep 17 00:00:00 2001 +From 99ab34278a6ebec134267412b4f619f43e278dea Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Fri, 3 Aug 2018 09:44:00 -0700 Subject: [PATCH] intl: Emit no lines in bison generated files diff --git a/poky/meta/recipes-core/glibc/glibc/0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch b/poky/meta/recipes-core/glibc/glibc/0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch index 782d931f22..2bfa2aaa06 100644 --- a/poky/meta/recipes-core/glibc/glibc/0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch +++ b/poky/meta/recipes-core/glibc/glibc/0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch @@ -1,4 +1,4 @@ -From 881f5b8134afd9a30049b93fc79dda7a44947a5f Mon Sep 17 00:00:00 2001 +From 3190ada9ecaec915794886a608221655c120f90c Mon Sep 17 00:00:00 2001 From: Martin Jansa <martin.jansa@gmail.com> Date: Mon, 17 Dec 2018 21:36:18 +0000 Subject: [PATCH] locale: prevent maybe-uninitialized errors with -Os [BZ diff --git a/poky/meta/recipes-core/glibc/glibc/0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch b/poky/meta/recipes-core/glibc/glibc/0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch index d273cab4a3..8042caaeae 100644 --- a/poky/meta/recipes-core/glibc/glibc/0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch +++ b/poky/meta/recipes-core/glibc/glibc/0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch @@ -1,4 +1,4 @@ -From b4e0a034b12b313dcb82d22341bef6a66b3e9ef9 Mon Sep 17 00:00:00 2001 +From 5d201a75918a0e181ee6206f701901fdb91baf81 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Wed, 18 Mar 2015 00:11:22 +0000 Subject: [PATCH] readlib: Add OECORE_KNOWN_INTERPRETER_NAMES to known names diff --git a/poky/meta/recipes-core/glibc/glibc/0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch b/poky/meta/recipes-core/glibc/glibc/0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch index 11a77cdf93..8e011699ef 100644 --- a/poky/meta/recipes-core/glibc/glibc/0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch +++ b/poky/meta/recipes-core/glibc/glibc/0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch @@ -1,4 +1,4 @@ -From 2ae3ff3ae28abb1d0d100b4722da7ff188de9a30 Mon Sep 17 00:00:00 2001 +From baba3c6021340a9070b734f931a15cea4cfe6c31 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Fri, 15 May 2020 17:05:45 -0700 Subject: [PATCH] wordsize.h: Unify the header between arm and aarch64 @@ -50,7 +50,7 @@ index 91da566b74..34fcdef1f1 100644 /* Determine the wordsize from the preprocessor defines. - Copyright (C) 2016-2021 Free Software Foundation, Inc. -+ Copyright (C) 2016-2021 Free Software Foundation, Inc. ++ Copyright (C) 2016-2020 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/poky/meta/recipes-core/glibc/glibc/0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch b/poky/meta/recipes-core/glibc/glibc/0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch index 5ef1ac2ed7..22df820aed 100644 --- a/poky/meta/recipes-core/glibc/glibc/0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch +++ b/poky/meta/recipes-core/glibc/glibc/0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch @@ -1,4 +1,4 @@ -From 5cc14938f05ae1354c8062f017a21f39d5fc9729 Mon Sep 17 00:00:00 2001 +From 60aa53f547911163b42a1c436d695a15c87f34ee Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Fri, 7 Aug 2020 14:31:16 -0700 Subject: [PATCH] powerpc: Do not ask compiler for finding arch diff --git a/poky/meta/recipes-core/glibc/glibc/CVE-2021-33574.patch b/poky/meta/recipes-core/glibc/glibc/CVE-2021-33574.patch deleted file mode 100644 index fd73b23c88..0000000000 --- a/poky/meta/recipes-core/glibc/glibc/CVE-2021-33574.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 42d359350510506b87101cf77202fefcbfc790cb Mon Sep 17 00:00:00 2001 -From: Andreas Schwab <schwab@linux-m68k.org> -Date: Thu, 27 May 2021 12:49:47 +0200 -Subject: [PATCH] Use __pthread_attr_copy in mq_notify (bug 27896) - -Make a deep copy of the pthread attribute object to remove a potential -use-after-free issue. - -Upstream-Status: Backport [https://sourceware.org/git/?p=glibc.git;a=commit;h=42d359350510506b87101cf77202fefcbfc790cb] -CVE: CVE-2021-33574 -Signed-off-by: Vinay Kumar <vinay.m.engg@gmail.com> ---- -diff --git a/sysdeps/unix/sysv/linux/mq_notify.c b/sysdeps/unix/sysv/linux/mq_notify.c -index cc575a0cdd8..6f46d29d1dc 100644 ---- a/sysdeps/unix/sysv/linux/mq_notify.c -+++ b/sysdeps/unix/sysv/linux/mq_notify.c -@@ -133,8 +133,11 @@ helper_thread (void *arg) - (void) __pthread_barrier_wait (¬ify_barrier); - } - else if (data.raw[NOTIFY_COOKIE_LEN - 1] == NOTIFY_REMOVED) -- /* The only state we keep is the copy of the thread attributes. */ -- free (data.attr); -+ { -+ /* The only state we keep is the copy of the thread attributes. */ -+ pthread_attr_destroy (data.attr); -+ free (data.attr); -+ } - } - return NULL; - } -@@ -255,8 +258,14 @@ mq_notify (mqd_t mqdes, const struct sigevent *notification) - if (data.attr == NULL) - return -1; - -- memcpy (data.attr, notification->sigev_notify_attributes, -- sizeof (pthread_attr_t)); -+ int ret = __pthread_attr_copy (data.attr, -+ notification->sigev_notify_attributes); -+ if (ret != 0) -+ { -+ free (data.attr); -+ __set_errno (ret); -+ return -1; -+ } - } - - /* Construct the new request. */ -@@ -269,8 +278,11 @@ mq_notify (mqd_t mqdes, const struct sigevent *notification) - int retval = INLINE_SYSCALL (mq_notify, 2, mqdes, &se); - - /* If it failed, free the allocated memory. */ -- if (__glibc_unlikely (retval != 0)) -- free (data.attr); -+ if (retval != 0 && data.attr != NULL) -+ { -+ pthread_attr_destroy (data.attr); -+ free (data.attr); -+ } - - return retval; - } diff --git a/poky/meta/recipes-core/glibc/glibc/faccessat2-perm.patch b/poky/meta/recipes-core/glibc/glibc/faccessat2-perm.patch deleted file mode 100644 index 2ee7110ca1..0000000000 --- a/poky/meta/recipes-core/glibc/glibc/faccessat2-perm.patch +++ /dev/null @@ -1,31 +0,0 @@ -Older seccomp-based filters used in container frameworks will block faccessat2 -calls as it's a relatively new syscall. This isn't a big problem with -glibc <2.33 but 2.33 will call faccessat2 itself, get EPERM, and thenn be confused -about what to do as EPERM isn't an expected error code. - -This manifests itself as mysterious errors, for example a kernel failing to link. - -The root cause of bad seccomp filters is mostly fixed (systemd 247, Docker 20.10.0) -but we can't expect everyone to upgrade, so add a workaound (originally from -Red Hat) to handle EPERM like ENOSYS and fallback to faccessat(). - -Upstream-Status: Inappropriate -Signed-off-by: Ross Burton <ross.burton@arm.com> - -diff --git a/sysdeps/unix/sysv/linux/faccessat.c b/sysdeps/unix/sysv/linux/faccessat.c -index 56cb6dcc8b4d58d3..5de75032bbc93a2c 100644 ---- a/sysdeps/unix/sysv/linux/faccessat.c -+++ b/sysdeps/unix/sysv/linux/faccessat.c -@@ -34,7 +34,11 @@ faccessat (int fd, const char *file, int mode, int flag) - #if __ASSUME_FACCESSAT2 - return ret; - #else -- if (ret == 0 || errno != ENOSYS) -+ /* Fedora-specific workaround: -+ As a workround for a broken systemd-nspawn that returns -+ EPERM when a syscall is not allowed instead of ENOSYS -+ we must check for EPERM here and fall back to faccessat. */ -+ if (ret == 0 || !(errno == ENOSYS || errno == EPERM)) - return ret; - - if (flag & ~(AT_SYMLINK_NOFOLLOW | AT_EACCESS)) diff --git a/poky/meta/recipes-core/glibc/glibc/mte-backports.patch b/poky/meta/recipes-core/glibc/glibc/mte-backports.patch deleted file mode 100644 index d9604fdf45..0000000000 --- a/poky/meta/recipes-core/glibc/glibc/mte-backports.patch +++ /dev/null @@ -1,1238 +0,0 @@ -Backport a number of patches from master to improve Arm MTE support. - -Upstream-Status: Backport [will be in 2.34] -Signed-off-by: Ross Burton <ross.burton@arm.com> - -From 2643466c2928a93de7b80a61f6a8f61a653862e1 Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy <szabolcs.nagy@arm.com> -Date: Thu, 11 Mar 2021 14:09:56 +0000 -Subject: [PATCH 01/11] malloc: Fix a potential realloc issue with memory - tagging - -At an _int_free call site in realloc the wrong size was used for tag -clearing: the chunk header of the next chunk was also cleared which -in practice may work, but logically wrong. - -The tag clearing is moved before the memcpy to save a tag computation, -this avoids a chunk2mem. Another chunk2mem is removed because newmem -does not have to be recomputed. Whitespaces got fixed too. - -Reviewed-by: DJ Delorie <dj@redhat.com> ---- - malloc/malloc.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/malloc/malloc.c b/malloc/malloc.c -index 8f8f12c276..51cec67e55 100644 ---- a/malloc/malloc.c -+++ b/malloc/malloc.c -@@ -4851,14 +4851,14 @@ _int_realloc(mstate av, mchunkptr oldp, INTERNAL_SIZE_T oldsize, - } - else - { -- void *oldmem = chunk2mem (oldp); -+ void *oldmem = chunk2rawmem (oldp); -+ size_t sz = CHUNK_AVAILABLE_SIZE (oldp) - CHUNK_HDR_SZ; -+ (void) TAG_REGION (oldmem, sz); - newmem = TAG_NEW_USABLE (newmem); -- memcpy (newmem, oldmem, -- CHUNK_AVAILABLE_SIZE (oldp) - CHUNK_HDR_SZ); -- (void) TAG_REGION (chunk2rawmem (oldp), oldsize); -- _int_free (av, oldp, 1); -- check_inuse_chunk (av, newp); -- return chunk2mem (newp); -+ memcpy (newmem, oldmem, sz); -+ _int_free (av, oldp, 1); -+ check_inuse_chunk (av, newp); -+ return newmem; - } - } - } --- -2.25.1 - - -From 32f3132be063e4b16a5cdb058980af354126e2f4 Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy <szabolcs.nagy@arm.com> -Date: Thu, 28 Jan 2021 17:34:36 +0000 -Subject: [PATCH 02/11] malloc: Move MTAG_MMAP_FLAGS definition - -This is only used internally in malloc.c, the extern declaration -was wrong, __mtag_mmap_flags has internal linkage. - -Reviewed-by: DJ Delorie <dj@redhat.com> ---- - include/malloc.h | 7 ------- - malloc/malloc.c | 2 ++ - 2 files changed, 2 insertions(+), 7 deletions(-) - -diff --git a/include/malloc.h b/include/malloc.h -index 7ae08d53d3..b77761f74d 100644 ---- a/include/malloc.h -+++ b/include/malloc.h -@@ -16,11 +16,4 @@ typedef struct malloc_state *mstate; - - # endif /* !_ISOMAC */ - --#ifdef USE_MTAG --extern int __mtag_mmap_flags; --#define MTAG_MMAP_FLAGS __mtag_mmap_flags --#else --#define MTAG_MMAP_FLAGS 0 --#endif -- - #endif -diff --git a/malloc/malloc.c b/malloc/malloc.c -index 51cec67e55..61c25d0f93 100644 ---- a/malloc/malloc.c -+++ b/malloc/malloc.c -@@ -463,11 +463,13 @@ static void *(*__tag_region)(void *, size_t) = __default_tag_region; - static void *(*__tag_new_usable)(void *) = __default_tag_nop; - static void *(*__tag_at)(void *) = __default_tag_nop; - -+# define MTAG_MMAP_FLAGS __mtag_mmap_flags - # define TAG_NEW_MEMSET(ptr, val, size) __tag_new_memset (ptr, val, size) - # define TAG_REGION(ptr, size) __tag_region (ptr, size) - # define TAG_NEW_USABLE(ptr) __tag_new_usable (ptr) - # define TAG_AT(ptr) __tag_at (ptr) - #else -+# define MTAG_MMAP_FLAGS 0 - # define TAG_NEW_MEMSET(ptr, val, size) memset (ptr, val, size) - # define TAG_REGION(ptr, size) (ptr) - # define TAG_NEW_USABLE(ptr) (ptr) --- -2.25.1 - - -From 4b13f77fb97f9618a7868ab767d05e0c2d7c6f6f Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy <szabolcs.nagy@arm.com> -Date: Thu, 4 Feb 2021 11:38:23 +0000 -Subject: [PATCH 03/11] malloc: Simplify __mtag_tag_new_usable - -The chunk cannot be a dumped one here. The only non-obvious cases -are free and realloc which may be called on a dumped area chunk, -but in both cases it can be verified that tagging is already -avoided for dumped area chunks. - -Reviewed-by: DJ Delorie <dj@redhat.com> ---- - malloc/arena.c | 5 ----- - 1 file changed, 5 deletions(-) - -diff --git a/malloc/arena.c b/malloc/arena.c -index bf17be27d4..0777dc70c6 100644 ---- a/malloc/arena.c -+++ b/malloc/arena.c -@@ -298,11 +298,6 @@ __mtag_tag_new_usable (void *ptr) - if (ptr) - { - mchunkptr cp = mem2chunk(ptr); -- /* This likely will never happen, but we can't handle retagging -- chunks from the dumped main arena. So just return the -- existing pointer. */ -- if (DUMPED_MAIN_ARENA_CHUNK (cp)) -- return ptr; - ptr = __libc_mtag_tag_region (__libc_mtag_new_tag (ptr), - CHUNK_AVAILABLE_SIZE (cp) - CHUNK_HDR_SZ); - } --- -2.25.1 - - -From 4f05837ba6934c5b8bbc6738f8883890493f50b6 Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy <szabolcs.nagy@arm.com> -Date: Thu, 4 Feb 2021 11:52:14 +0000 -Subject: [PATCH 04/11] malloc: Avoid taggig mmaped memory on free - -Either the memory belongs to the dumped area, in which case we don't -want to tag (the dumped area has the same tag as malloc internal data -so tagging is unnecessary, but chunks there may not have the right -alignment for the tag granule), or the memory will be unmapped -immediately (and thus tagging is not useful). - -Reviewed-by: DJ Delorie <dj@redhat.com> ---- - malloc/malloc.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/malloc/malloc.c b/malloc/malloc.c -index 61c25d0f93..ecb87350b0 100644 ---- a/malloc/malloc.c -+++ b/malloc/malloc.c -@@ -3284,9 +3284,6 @@ __libc_free (void *mem) - - p = mem2chunk (mem); - -- /* Mark the chunk as belonging to the library again. */ -- (void)TAG_REGION (chunk2rawmem (p), CHUNK_AVAILABLE_SIZE (p) - CHUNK_HDR_SZ); -- - if (chunk_is_mmapped (p)) /* release mmapped memory. */ - { - /* See if the dynamic brk/mmap threshold needs adjusting. -@@ -3307,6 +3304,10 @@ __libc_free (void *mem) - { - MAYBE_INIT_TCACHE (); - -+ /* Mark the chunk as belonging to the library again. */ -+ (void)TAG_REGION (chunk2rawmem (p), -+ CHUNK_AVAILABLE_SIZE (p) - CHUNK_HDR_SZ); -+ - ar_ptr = arena_for_chunk (p); - _int_free (ar_ptr, p, 0); - } --- -2.25.1 - - -From 673fad3798846101b77a89595cfa17f334a1c898 Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy <szabolcs.nagy@arm.com> -Date: Tue, 16 Feb 2021 14:12:25 +0000 -Subject: [PATCH 05/11] malloc: Refactor TAG_ macros to avoid indirection - -This does not change behaviour, just removes one layer of indirection -in the internal memory tagging logic. - -Use tag_ and mtag_ prefixes instead of __tag_ and __mtag_ since these -are all symbols with internal linkage, private to malloc.c, so there -is no user namespace pollution issue. - -Reviewed-by: DJ Delorie <dj@redhat.com> ---- - malloc/arena.c | 16 +++++----- - malloc/hooks.c | 10 +++--- - malloc/malloc.c | 81 +++++++++++++++++++++++-------------------------- - 3 files changed, 51 insertions(+), 56 deletions(-) - -diff --git a/malloc/arena.c b/malloc/arena.c -index 0777dc70c6..d0778fea92 100644 ---- a/malloc/arena.c -+++ b/malloc/arena.c -@@ -332,12 +332,12 @@ ptmalloc_init (void) - if (__MTAG_SBRK_UNTAGGED) - __morecore = __failing_morecore; - -- __mtag_mmap_flags = __MTAG_MMAP_FLAGS; -- __tag_new_memset = __mtag_tag_new_memset; -- __tag_region = __libc_mtag_tag_region; -- __tag_new_usable = __mtag_tag_new_usable; -- __tag_at = __libc_mtag_address_get_tag; -- __mtag_granule_mask = ~(size_t)(__MTAG_GRANULE_SIZE - 1); -+ mtag_mmap_flags = __MTAG_MMAP_FLAGS; -+ tag_new_memset = __mtag_tag_new_memset; -+ tag_region = __libc_mtag_tag_region; -+ tag_new_usable = __mtag_tag_new_usable; -+ tag_at = __libc_mtag_address_get_tag; -+ mtag_granule_mask = ~(size_t)(__MTAG_GRANULE_SIZE - 1); - } - #endif - -@@ -557,7 +557,7 @@ new_heap (size_t size, size_t top_pad) - } - } - } -- if (__mprotect (p2, size, MTAG_MMAP_FLAGS | PROT_READ | PROT_WRITE) != 0) -+ if (__mprotect (p2, size, mtag_mmap_flags | PROT_READ | PROT_WRITE) != 0) - { - __munmap (p2, HEAP_MAX_SIZE); - return 0; -@@ -587,7 +587,7 @@ grow_heap (heap_info *h, long diff) - { - if (__mprotect ((char *) h + h->mprotect_size, - (unsigned long) new_size - h->mprotect_size, -- MTAG_MMAP_FLAGS | PROT_READ | PROT_WRITE) != 0) -+ mtag_mmap_flags | PROT_READ | PROT_WRITE) != 0) - return -2; - - h->mprotect_size = new_size; -diff --git a/malloc/hooks.c b/malloc/hooks.c -index efec05f0a8..d8e304c31c 100644 ---- a/malloc/hooks.c -+++ b/malloc/hooks.c -@@ -68,7 +68,7 @@ __malloc_check_init (void) - tags, so fetch the tag at each location before dereferencing - it. */ - #define SAFE_CHAR_OFFSET(p,offset) \ -- ((unsigned char *) TAG_AT (((unsigned char *) p) + offset)) -+ ((unsigned char *) tag_at (((unsigned char *) p) + offset)) - - /* A simple, standard set of debugging hooks. Overhead is `only' one - byte per chunk; still this will catch most cases of double frees or -@@ -249,7 +249,7 @@ malloc_check (size_t sz, const void *caller) - top_check (); - victim = _int_malloc (&main_arena, nb); - __libc_lock_unlock (main_arena.mutex); -- return mem2mem_check (TAG_NEW_USABLE (victim), sz); -+ return mem2mem_check (tag_new_usable (victim), sz); - } - - static void -@@ -280,7 +280,7 @@ free_check (void *mem, const void *caller) - else - { - /* Mark the chunk as belonging to the library again. */ -- (void)TAG_REGION (chunk2rawmem (p), CHUNK_AVAILABLE_SIZE (p) -+ (void)tag_region (chunk2rawmem (p), CHUNK_AVAILABLE_SIZE (p) - - CHUNK_HDR_SZ); - _int_free (&main_arena, p, 1); - __libc_lock_unlock (main_arena.mutex); -@@ -375,7 +375,7 @@ invert: - - __libc_lock_unlock (main_arena.mutex); - -- return mem2mem_check (TAG_NEW_USABLE (newmem), bytes); -+ return mem2mem_check (tag_new_usable (newmem), bytes); - } - - static void * -@@ -417,7 +417,7 @@ memalign_check (size_t alignment, size_t bytes, const void *caller) - top_check (); - mem = _int_memalign (&main_arena, alignment, bytes + 1); - __libc_lock_unlock (main_arena.mutex); -- return mem2mem_check (TAG_NEW_USABLE (mem), bytes); -+ return mem2mem_check (tag_new_usable (mem), bytes); - } - - #if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_25) -diff --git a/malloc/malloc.c b/malloc/malloc.c -index ecb87350b0..62d00f54cc 100644 ---- a/malloc/malloc.c -+++ b/malloc/malloc.c -@@ -413,26 +413,26 @@ void *(*__morecore)(ptrdiff_t) = __default_morecore; - operations can continue to be used. Support macros are used to do - this: - -- void *TAG_NEW_MEMSET (void *ptr, int, val, size_t size) -+ void *tag_new_memset (void *ptr, int, val, size_t size) - - Has the same interface as memset(), but additionally allocates a - new tag, colors the memory with that tag and returns a pointer that - is correctly colored for that location. The non-tagging version - will simply call memset. - -- void *TAG_REGION (void *ptr, size_t size) -+ void *tag_region (void *ptr, size_t size) - - Color the region of memory pointed to by PTR and size SIZE with - the color of PTR. Returns the original pointer. - -- void *TAG_NEW_USABLE (void *ptr) -+ void *tag_new_usable (void *ptr) - - Allocate a new random color and use it to color the user region of - a chunk; this may include data from the subsequent chunk's header - if tagging is sufficiently fine grained. Returns PTR suitably - recolored for accessing the memory there. - -- void *TAG_AT (void *ptr) -+ void *tag_at (void *ptr) - - Read the current color of the memory at the address pointed to by - PTR (ignoring it's current color) and return PTR recolored to that -@@ -455,25 +455,20 @@ __default_tag_nop (void *ptr) - return ptr; - } - --static int __mtag_mmap_flags = 0; --static size_t __mtag_granule_mask = ~(size_t)0; -+static int mtag_mmap_flags = 0; -+static size_t mtag_granule_mask = ~(size_t)0; - --static void *(*__tag_new_memset)(void *, int, size_t) = memset; --static void *(*__tag_region)(void *, size_t) = __default_tag_region; --static void *(*__tag_new_usable)(void *) = __default_tag_nop; --static void *(*__tag_at)(void *) = __default_tag_nop; -+static void *(*tag_new_memset)(void *, int, size_t) = memset; -+static void *(*tag_region)(void *, size_t) = __default_tag_region; -+static void *(*tag_new_usable)(void *) = __default_tag_nop; -+static void *(*tag_at)(void *) = __default_tag_nop; - --# define MTAG_MMAP_FLAGS __mtag_mmap_flags --# define TAG_NEW_MEMSET(ptr, val, size) __tag_new_memset (ptr, val, size) --# define TAG_REGION(ptr, size) __tag_region (ptr, size) --# define TAG_NEW_USABLE(ptr) __tag_new_usable (ptr) --# define TAG_AT(ptr) __tag_at (ptr) - #else --# define MTAG_MMAP_FLAGS 0 --# define TAG_NEW_MEMSET(ptr, val, size) memset (ptr, val, size) --# define TAG_REGION(ptr, size) (ptr) --# define TAG_NEW_USABLE(ptr) (ptr) --# define TAG_AT(ptr) (ptr) -+# define mtag_mmap_flags 0 -+# define tag_new_memset(ptr, val, size) memset (ptr, val, size) -+# define tag_region(ptr, size) (ptr) -+# define tag_new_usable(ptr) (ptr) -+# define tag_at(ptr) (ptr) - #endif - - #include <string.h> -@@ -1305,8 +1300,8 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - /* Convert between user mem pointers and chunk pointers, updating any - memory tags on the pointer to respect the tag value at that - location. */ --#define chunk2mem(p) ((void*)TAG_AT (((char*)(p) + CHUNK_HDR_SZ))) --#define mem2chunk(mem) ((mchunkptr)TAG_AT (((char*)(mem) - CHUNK_HDR_SZ))) -+#define chunk2mem(p) ((void *)tag_at (((char*)(p) + CHUNK_HDR_SZ))) -+#define mem2chunk(mem) ((mchunkptr)tag_at (((char*)(mem) - CHUNK_HDR_SZ))) - - /* The smallest possible chunk */ - #define MIN_CHUNK_SIZE (offsetof(struct malloc_chunk, fd_nextsize)) -@@ -1337,7 +1332,7 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - #ifdef USE_MTAG - #define CHUNK_AVAILABLE_SIZE(p) \ - ((chunksize (p) + (chunk_is_mmapped (p) ? 0 : SIZE_SZ)) \ -- & __mtag_granule_mask) -+ & mtag_granule_mask) - #else - #define CHUNK_AVAILABLE_SIZE(p) \ - (chunksize (p) + (chunk_is_mmapped (p) ? 0 : SIZE_SZ)) -@@ -1361,7 +1356,7 @@ checked_request2size (size_t req, size_t *sz) __nonnull (1) - number. Ideally, this would be part of request2size(), but that - must be a macro that produces a compile time constant if passed - a constant literal. */ -- req = (req + ~__mtag_granule_mask) & __mtag_granule_mask; -+ req = (req + ~mtag_granule_mask) & mtag_granule_mask; - #endif - - *sz = request2size (req); -@@ -2467,7 +2462,7 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av) - if ((unsigned long) (size) > (unsigned long) (nb)) - { - mm = (char *) (MMAP (0, size, -- MTAG_MMAP_FLAGS | PROT_READ | PROT_WRITE, 0)); -+ mtag_mmap_flags | PROT_READ | PROT_WRITE, 0)); - - if (mm != MAP_FAILED) - { -@@ -2665,7 +2660,7 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av) - if ((unsigned long) (size) > (unsigned long) (nb)) - { - char *mbrk = (char *) (MMAP (0, size, -- MTAG_MMAP_FLAGS | PROT_READ | PROT_WRITE, -+ mtag_mmap_flags | PROT_READ | PROT_WRITE, - 0)); - - if (mbrk != MAP_FAILED) -@@ -3221,14 +3216,14 @@ __libc_malloc (size_t bytes) - && tcache->counts[tc_idx] > 0) - { - victim = tcache_get (tc_idx); -- return TAG_NEW_USABLE (victim); -+ return tag_new_usable (victim); - } - DIAG_POP_NEEDS_COMMENT; - #endif - - if (SINGLE_THREAD_P) - { -- victim = TAG_NEW_USABLE (_int_malloc (&main_arena, bytes)); -+ victim = tag_new_usable (_int_malloc (&main_arena, bytes)); - assert (!victim || chunk_is_mmapped (mem2chunk (victim)) || - &main_arena == arena_for_chunk (mem2chunk (victim))); - return victim; -@@ -3249,7 +3244,7 @@ __libc_malloc (size_t bytes) - if (ar_ptr != NULL) - __libc_lock_unlock (ar_ptr->mutex); - -- victim = TAG_NEW_USABLE (victim); -+ victim = tag_new_usable (victim); - - assert (!victim || chunk_is_mmapped (mem2chunk (victim)) || - ar_ptr == arena_for_chunk (mem2chunk (victim))); -@@ -3305,7 +3300,7 @@ __libc_free (void *mem) - MAYBE_INIT_TCACHE (); - - /* Mark the chunk as belonging to the library again. */ -- (void)TAG_REGION (chunk2rawmem (p), -+ (void)tag_region (chunk2rawmem (p), - CHUNK_AVAILABLE_SIZE (p) - CHUNK_HDR_SZ); - - ar_ptr = arena_for_chunk (p); -@@ -3408,7 +3403,7 @@ __libc_realloc (void *oldmem, size_t bytes) - reused. There's a performance hit for both us and the - caller for doing this, so we might want to - reconsider. */ -- return TAG_NEW_USABLE (newmem); -+ return tag_new_usable (newmem); - } - #endif - /* Note the extra SIZE_SZ overhead. */ -@@ -3451,7 +3446,7 @@ __libc_realloc (void *oldmem, size_t bytes) - { - size_t sz = CHUNK_AVAILABLE_SIZE (oldp) - CHUNK_HDR_SZ; - memcpy (newp, oldmem, sz); -- (void) TAG_REGION (chunk2rawmem (oldp), sz); -+ (void) tag_region (chunk2rawmem (oldp), sz); - _int_free (ar_ptr, oldp, 0); - } - } -@@ -3509,7 +3504,7 @@ _mid_memalign (size_t alignment, size_t bytes, void *address) - p = _int_memalign (&main_arena, alignment, bytes); - assert (!p || chunk_is_mmapped (mem2chunk (p)) || - &main_arena == arena_for_chunk (mem2chunk (p))); -- return TAG_NEW_USABLE (p); -+ return tag_new_usable (p); - } - - arena_get (ar_ptr, bytes + alignment + MINSIZE); -@@ -3527,7 +3522,7 @@ _mid_memalign (size_t alignment, size_t bytes, void *address) - - assert (!p || chunk_is_mmapped (mem2chunk (p)) || - ar_ptr == arena_for_chunk (mem2chunk (p))); -- return TAG_NEW_USABLE (p); -+ return tag_new_usable (p); - } - /* For ISO C11. */ - weak_alias (__libc_memalign, aligned_alloc) -@@ -3544,7 +3539,7 @@ __libc_valloc (size_t bytes) - void *address = RETURN_ADDRESS (0); - size_t pagesize = GLRO (dl_pagesize); - p = _mid_memalign (pagesize, bytes, address); -- return TAG_NEW_USABLE (p); -+ return tag_new_usable (p); - } - - void * -@@ -3569,7 +3564,7 @@ __libc_pvalloc (size_t bytes) - rounded_bytes = rounded_bytes & -(pagesize - 1); - - p = _mid_memalign (pagesize, rounded_bytes, address); -- return TAG_NEW_USABLE (p); -+ return tag_new_usable (p); - } - - void * -@@ -3666,7 +3661,7 @@ __libc_calloc (size_t n, size_t elem_size) - regardless of MORECORE_CLEARS, so we zero the whole block while - doing so. */ - #ifdef USE_MTAG -- return TAG_NEW_MEMSET (mem, 0, CHUNK_AVAILABLE_SIZE (p) - CHUNK_HDR_SZ); -+ return tag_new_memset (mem, 0, CHUNK_AVAILABLE_SIZE (p) - CHUNK_HDR_SZ); - #else - INTERNAL_SIZE_T csz = chunksize (p); - -@@ -4821,7 +4816,7 @@ _int_realloc(mstate av, mchunkptr oldp, INTERNAL_SIZE_T oldsize, - av->top = chunk_at_offset (oldp, nb); - set_head (av->top, (newsize - nb) | PREV_INUSE); - check_inuse_chunk (av, oldp); -- return TAG_NEW_USABLE (chunk2rawmem (oldp)); -+ return tag_new_usable (chunk2rawmem (oldp)); - } - - /* Try to expand forward into next chunk; split off remainder below */ -@@ -4856,8 +4851,8 @@ _int_realloc(mstate av, mchunkptr oldp, INTERNAL_SIZE_T oldsize, - { - void *oldmem = chunk2rawmem (oldp); - size_t sz = CHUNK_AVAILABLE_SIZE (oldp) - CHUNK_HDR_SZ; -- (void) TAG_REGION (oldmem, sz); -- newmem = TAG_NEW_USABLE (newmem); -+ (void) tag_region (oldmem, sz); -+ newmem = tag_new_usable (newmem); - memcpy (newmem, oldmem, sz); - _int_free (av, oldp, 1); - check_inuse_chunk (av, newp); -@@ -4881,7 +4876,7 @@ _int_realloc(mstate av, mchunkptr oldp, INTERNAL_SIZE_T oldsize, - { - remainder = chunk_at_offset (newp, nb); - /* Clear any user-space tags before writing the header. */ -- remainder = TAG_REGION (remainder, remainder_size); -+ remainder = tag_region (remainder, remainder_size); - set_head_size (newp, nb | (av != &main_arena ? NON_MAIN_ARENA : 0)); - set_head (remainder, remainder_size | PREV_INUSE | - (av != &main_arena ? NON_MAIN_ARENA : 0)); -@@ -4891,7 +4886,7 @@ _int_realloc(mstate av, mchunkptr oldp, INTERNAL_SIZE_T oldsize, - } - - check_inuse_chunk (av, newp); -- return TAG_NEW_USABLE (chunk2rawmem (newp)); -+ return tag_new_usable (chunk2rawmem (newp)); - } - - /* -@@ -5108,7 +5103,7 @@ musable (void *mem) - /* The usable space may be reduced if memory tagging is needed, - since we cannot share the user-space data with malloc's internal - data structure. */ -- result &= __mtag_granule_mask; -+ result &= mtag_granule_mask; - #endif - return result; - } --- -2.25.1 - - -From f0ea41e819f40aacedf25431bedd95da9c5db534 Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy <szabolcs.nagy@arm.com> -Date: Wed, 27 Jan 2021 15:45:43 +0000 -Subject: [PATCH 06/11] malloc: Use global flag instead of function pointer - dispatch for mtag - -A flag check can be faster than function pointers because of how -branch prediction and speculation works and it can also remove a layer -of indirection when there is a mismatch between the malloc internal -tag_* api and __libc_mtag_* target hooks. - -Memory tagging wrapper functions are moved to malloc.c from arena.c and -the logic now checks mmap_enabled. The definition of tag_new_usable is -moved after chunk related definitions. - -This refactoring also allows using mtag_enabled checks instead of -USE_MTAG ifdefs when memory tagging support only changes code logic -when memory tagging is enabled at runtime. Note: an "if (false)" code -block is optimized away even at -O0 by gcc. - -Reviewed-by: DJ Delorie <dj@redhat.com> ---- - malloc/arena.c | 33 +--------------------------- - malloc/malloc.c | 58 ++++++++++++++++++++++++++++++++----------------- - 2 files changed, 39 insertions(+), 52 deletions(-) - -diff --git a/malloc/arena.c b/malloc/arena.c -index d0778fea92..1e83bb66bd 100644 ---- a/malloc/arena.c -+++ b/malloc/arena.c -@@ -287,34 +287,6 @@ extern struct dl_open_hook *_dl_open_hook; - libc_hidden_proto (_dl_open_hook); - #endif - --#ifdef USE_MTAG -- --/* Generate a new (random) tag value for PTR and tag the memory it -- points to upto the end of the usable size for the chunk containing -- it. Return the newly tagged pointer. */ --static void * --__mtag_tag_new_usable (void *ptr) --{ -- if (ptr) -- { -- mchunkptr cp = mem2chunk(ptr); -- ptr = __libc_mtag_tag_region (__libc_mtag_new_tag (ptr), -- CHUNK_AVAILABLE_SIZE (cp) - CHUNK_HDR_SZ); -- } -- return ptr; --} -- --/* Generate a new (random) tag value for PTR, set the tags for the -- memory to the new tag and initialize the memory contents to VAL. -- In practice this function will only be called with VAL=0, but we -- keep this parameter to maintain the same prototype as memset. */ --static void * --__mtag_tag_new_memset (void *ptr, int val, size_t size) --{ -- return __libc_mtag_memset_with_tag (__libc_mtag_new_tag (ptr), val, size); --} --#endif -- - static void - ptmalloc_init (void) - { -@@ -332,11 +304,8 @@ ptmalloc_init (void) - if (__MTAG_SBRK_UNTAGGED) - __morecore = __failing_morecore; - -+ mtag_enabled = true; - mtag_mmap_flags = __MTAG_MMAP_FLAGS; -- tag_new_memset = __mtag_tag_new_memset; -- tag_region = __libc_mtag_tag_region; -- tag_new_usable = __mtag_tag_new_usable; -- tag_at = __libc_mtag_address_get_tag; - mtag_granule_mask = ~(size_t)(__MTAG_GRANULE_SIZE - 1); - } - #endif -diff --git a/malloc/malloc.c b/malloc/malloc.c -index 62d00f54cc..253a919ec5 100644 ---- a/malloc/malloc.c -+++ b/malloc/malloc.c -@@ -441,35 +441,41 @@ void *(*__morecore)(ptrdiff_t) = __default_morecore; - */ - - #ifdef USE_MTAG -+static bool mtag_enabled = false; -+static int mtag_mmap_flags = 0; -+static size_t mtag_granule_mask = ~(size_t)0; -+#else -+# define mtag_enabled false -+# define mtag_mmap_flags 0 -+#endif - --/* Default implementaions when memory tagging is supported, but disabled. */ --static void * --__default_tag_region (void *ptr, size_t size) -+static __always_inline void * -+tag_region (void *ptr, size_t size) - { -+ if (__glibc_unlikely (mtag_enabled)) -+ return __libc_mtag_tag_region (ptr, size); - return ptr; - } - --static void * --__default_tag_nop (void *ptr) -+static __always_inline void * -+tag_new_memset (void *ptr, int val, size_t size) - { -- return ptr; -+ if (__glibc_unlikely (mtag_enabled)) -+ return __libc_mtag_memset_with_tag (__libc_mtag_new_tag (ptr), val, size); -+ return memset (ptr, val, size); - } - --static int mtag_mmap_flags = 0; --static size_t mtag_granule_mask = ~(size_t)0; -- --static void *(*tag_new_memset)(void *, int, size_t) = memset; --static void *(*tag_region)(void *, size_t) = __default_tag_region; --static void *(*tag_new_usable)(void *) = __default_tag_nop; --static void *(*tag_at)(void *) = __default_tag_nop; -+/* Defined later. */ -+static void * -+tag_new_usable (void *ptr); - --#else --# define mtag_mmap_flags 0 --# define tag_new_memset(ptr, val, size) memset (ptr, val, size) --# define tag_region(ptr, size) (ptr) --# define tag_new_usable(ptr) (ptr) --# define tag_at(ptr) (ptr) --#endif -+static __always_inline void * -+tag_at (void *ptr) -+{ -+ if (__glibc_unlikely (mtag_enabled)) -+ return __libc_mtag_address_get_tag (ptr); -+ return ptr; -+} - - #include <string.h> - -@@ -1460,6 +1466,18 @@ checked_request2size (size_t req, size_t *sz) __nonnull (1) - #pragma GCC poison mchunk_size - #pragma GCC poison mchunk_prev_size - -+static __always_inline void * -+tag_new_usable (void *ptr) -+{ -+ if (__glibc_unlikely (mtag_enabled) && ptr) -+ { -+ mchunkptr cp = mem2chunk(ptr); -+ ptr = __libc_mtag_tag_region (__libc_mtag_new_tag (ptr), -+ CHUNK_AVAILABLE_SIZE (cp) - CHUNK_HDR_SZ); -+ } -+ return ptr; -+} -+ - /* - -------------------- Internal data structures -------------------- - --- -2.25.1 - - -From 8597244d5c3edbd672b285eea5f6dea833256f9d Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy <szabolcs.nagy@arm.com> -Date: Wed, 17 Feb 2021 10:39:37 +0000 -Subject: [PATCH 07/11] malloc: Ensure the generic mtag hooks are not used - -Use inline functions instead of macros, because macros can cause unused -variable warnings and type conversion issues. We assume these functions -may appear in the code but only in dead code paths (hidden by a runtime -check), so it's important that they can compile with correct types, but -if they are actually used that should be an error. - -Currently the hooks are only used when USE_MTAG is true which only -happens on aarch64 and then the aarch64 specific code is used not this -generic header. However followup refactoring will allow the hooks to -be used with !USE_MTAG. - -Note: the const qualifier in the comment was wrong: changing tags is a -write operation. - -Reviewed-by: DJ Delorie <dj@redhat.com> ---- - sysdeps/generic/libc-mtag.h | 41 ++++++++++++++++++++++++++++--------- - 1 file changed, 31 insertions(+), 10 deletions(-) - -diff --git a/sysdeps/generic/libc-mtag.h b/sysdeps/generic/libc-mtag.h -index 1a866cdc0c..e8fc236b6c 100644 ---- a/sysdeps/generic/libc-mtag.h -+++ b/sysdeps/generic/libc-mtag.h -@@ -31,22 +31,43 @@ - /* Extra flags to pass to mmap() to request a tagged region of memory. */ - #define __MTAG_MMAP_FLAGS 0 - -+/* Memory tagging target hooks are only called when memory tagging is -+ enabled at runtime. The generic definitions here must not be used. */ -+void __libc_mtag_link_error (void); -+ - /* Set the tags for a region of memory, which must have size and alignment -- that are multiples of __MTAG_GRANULE_SIZE. Size cannot be zero. -- void *__libc_mtag_tag_region (const void *, size_t) */ --#define __libc_mtag_tag_region(p, s) (p) -+ that are multiples of __MTAG_GRANULE_SIZE. Size cannot be zero. */ -+static inline void * -+__libc_mtag_tag_region (void *p, size_t n) -+{ -+ __libc_mtag_link_error (); -+ return p; -+} - - /* Optimized equivalent to __libc_mtag_tag_region followed by memset. */ --#define __libc_mtag_memset_with_tag memset -+static inline void * -+__libc_mtag_memset_with_tag (void *p, int c, size_t n) -+{ -+ __libc_mtag_link_error (); -+ return memset (p, c, n); -+} - - /* Convert address P to a pointer that is tagged correctly for that -- location. -- void *__libc_mtag_address_get_tag (void*) */ --#define __libc_mtag_address_get_tag(p) (p) -+ location. */ -+static inline void * -+__libc_mtag_address_get_tag (void *p) -+{ -+ __libc_mtag_link_error (); -+ return p; -+} - - /* Assign a new (random) tag to a pointer P (does not adjust the tag on -- the memory addressed). -- void *__libc_mtag_new_tag (void*) */ --#define __libc_mtag_new_tag(p) (p) -+ the memory addressed). */ -+static inline void * -+__libc_mtag_new_tag (void *p) -+{ -+ __libc_mtag_link_error (); -+ return p; -+} - - #endif /* _GENERIC_LIBC_MTAG_H */ --- -2.25.1 - - -From 3d9e16280ad881d038aedba0b6fcbd9e78b29072 Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy <szabolcs.nagy@arm.com> -Date: Fri, 29 Jan 2021 17:07:28 +0000 -Subject: [PATCH 08/11] malloc: Only support zeroing and not arbitrary memset - with mtag - -The memset api is suboptimal and does not provide much benefit. Memory -tagging only needs a zeroing memset (and only for memory that's sized -and aligned to multiples of the tag granule), so change the internal -api and the target hooks accordingly. This is to simplify the -implementation of the target hook. - -Reviewed-by: DJ Delorie <dj@redhat.com> ---- - malloc/malloc.c | 17 ++++++++--------- - sysdeps/aarch64/Makefile | 2 +- - ...g_memset_tag.S => __mtag_tag_zero_region.S} | 18 +++++++----------- - sysdeps/aarch64/libc-mtag.h | 4 ++-- - sysdeps/generic/libc-mtag.h | 6 +++--- - 5 files changed, 21 insertions(+), 26 deletions(-) - rename sysdeps/aarch64/{__mtag_memset_tag.S => __mtag_tag_zero_region.S} (82%) - -diff --git a/malloc/malloc.c b/malloc/malloc.c -index 253a919ec5..01cf6e9325 100644 ---- a/malloc/malloc.c -+++ b/malloc/malloc.c -@@ -413,12 +413,11 @@ void *(*__morecore)(ptrdiff_t) = __default_morecore; - operations can continue to be used. Support macros are used to do - this: - -- void *tag_new_memset (void *ptr, int, val, size_t size) -+ void *tag_new_zero_region (void *ptr, size_t size) - -- Has the same interface as memset(), but additionally allocates a -- new tag, colors the memory with that tag and returns a pointer that -- is correctly colored for that location. The non-tagging version -- will simply call memset. -+ Allocates a new tag, colors the memory with that tag, zeros the -+ memory and returns a pointer that is correctly colored for that -+ location. The non-tagging version will simply call memset with 0. - - void *tag_region (void *ptr, size_t size) - -@@ -458,11 +457,11 @@ tag_region (void *ptr, size_t size) - } - - static __always_inline void * --tag_new_memset (void *ptr, int val, size_t size) -+tag_new_zero_region (void *ptr, size_t size) - { - if (__glibc_unlikely (mtag_enabled)) -- return __libc_mtag_memset_with_tag (__libc_mtag_new_tag (ptr), val, size); -- return memset (ptr, val, size); -+ return __libc_mtag_tag_zero_region (__libc_mtag_new_tag (ptr), size); -+ return memset (ptr, 0, size); - } - - /* Defined later. */ -@@ -3679,7 +3678,7 @@ __libc_calloc (size_t n, size_t elem_size) - regardless of MORECORE_CLEARS, so we zero the whole block while - doing so. */ - #ifdef USE_MTAG -- return tag_new_memset (mem, 0, CHUNK_AVAILABLE_SIZE (p) - CHUNK_HDR_SZ); -+ return tag_new_zero_region (mem, CHUNK_AVAILABLE_SIZE (p) - CHUNK_HDR_SZ); - #else - INTERNAL_SIZE_T csz = chunksize (p); - -diff --git a/sysdeps/aarch64/Makefile b/sysdeps/aarch64/Makefile -index d3ab37a40a..259070cfad 100644 ---- a/sysdeps/aarch64/Makefile -+++ b/sysdeps/aarch64/Makefile -@@ -41,7 +41,7 @@ endif - ifeq ($(subdir),misc) - sysdep_headers += sys/ifunc.h - sysdep_routines += __mtag_address_get_tag \ -- __mtag_memset_tag \ -+ __mtag_tag_zero_region \ - __mtag_new_tag \ - __mtag_tag_region - -diff --git a/sysdeps/aarch64/__mtag_memset_tag.S b/sysdeps/aarch64/__mtag_tag_zero_region.S -similarity index 82% -rename from sysdeps/aarch64/__mtag_memset_tag.S -rename to sysdeps/aarch64/__mtag_tag_zero_region.S -index 3c202888a4..74d398bba5 100644 ---- a/sysdeps/aarch64/__mtag_memset_tag.S -+++ b/sysdeps/aarch64/__mtag_tag_zero_region.S -@@ -20,9 +20,6 @@ - - #ifdef USE_MTAG - --/* Use the same register names and assignments as memset. */ --#include "memset-reg.h" -- - .arch armv8.5-a - .arch_extension memtag - -@@ -31,16 +28,15 @@ - /* FIXME: This is a minimal implementation. We could do much better than - this for large values of COUNT. */ - --ENTRY(__libc_mtag_memset_with_tag) -+#define dstin x0 -+#define count x1 -+#define dst x2 - -- and valw, valw, 255 -- orr valw, valw, valw, lsl 8 -- orr valw, valw, valw, lsl 16 -- orr val, val, val, lsl 32 -- mov dst, dstin -+ENTRY(__libc_mtag_tag_zero_region) - -+ mov dst, dstin - L(loop): -- stgp val, val, [dst], #16 -+ stzg dst, [dst], #16 - subs count, count, 16 - bne L(loop) - #if 0 -@@ -49,5 +45,5 @@ L(loop): - ldg dstin, [dstin] // Recover the tag created (might be untagged). - #endif - ret --END (__libc_mtag_memset_with_tag) -+END (__libc_mtag_tag_zero_region) - #endif /* USE_MTAG */ -diff --git a/sysdeps/aarch64/libc-mtag.h b/sysdeps/aarch64/libc-mtag.h -index 979cbb743e..f58402ccf9 100644 ---- a/sysdeps/aarch64/libc-mtag.h -+++ b/sysdeps/aarch64/libc-mtag.h -@@ -39,8 +39,8 @@ - void *__libc_mtag_tag_region (const void *, size_t) */ - void *__libc_mtag_tag_region (void *, size_t); - --/* Optimized equivalent to __libc_mtag_tag_region followed by memset. */ --void *__libc_mtag_memset_with_tag (void *, int, size_t); -+/* Optimized equivalent to __libc_mtag_tag_region followed by memset to 0. */ -+void *__libc_mtag_tag_zero_region (void *, size_t); - - /* Convert address P to a pointer that is tagged correctly for that - location. -diff --git a/sysdeps/generic/libc-mtag.h b/sysdeps/generic/libc-mtag.h -index e8fc236b6c..4743e873f1 100644 ---- a/sysdeps/generic/libc-mtag.h -+++ b/sysdeps/generic/libc-mtag.h -@@ -44,12 +44,12 @@ __libc_mtag_tag_region (void *p, size_t n) - return p; - } - --/* Optimized equivalent to __libc_mtag_tag_region followed by memset. */ -+/* Optimized equivalent to __libc_mtag_tag_region followed by memset to 0. */ - static inline void * --__libc_mtag_memset_with_tag (void *p, int c, size_t n) -+__libc_mtag_tag_zero_region (void *p, size_t n) - { - __libc_mtag_link_error (); -- return memset (p, c, n); -+ return memset (p, 0, n); - } - - /* Convert address P to a pointer that is tagged correctly for that --- -2.25.1 - - -From 4d596cb72342ba0734dc847653431e078a70edfc Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy <szabolcs.nagy@arm.com> -Date: Tue, 16 Feb 2021 17:02:44 +0000 -Subject: [PATCH 09/11] malloc: Change calloc when tagging is disabled - -When glibc is built with memory tagging support (USE_MTAG) but it is not -enabled at runtime (mtag_enabled) then unconditional memset was used -even though that can be often avoided. - -This is for performance when tagging is supported but not enabled. -The extra check should have no overhead: tag_new_zero_region already -had a runtime check which the compiler can now optimize away. - -Reviewed-by: DJ Delorie <dj@redhat.com> ---- - malloc/malloc.c | 10 ++++------ - 1 file changed, 4 insertions(+), 6 deletions(-) - -diff --git a/malloc/malloc.c b/malloc/malloc.c -index 01cf6e9325..0b2aff3768 100644 ---- a/malloc/malloc.c -+++ b/malloc/malloc.c -@@ -3591,11 +3591,9 @@ __libc_calloc (size_t n, size_t elem_size) - mchunkptr oldtop; - INTERNAL_SIZE_T sz, oldtopsize; - void *mem; --#ifndef USE_MTAG - unsigned long clearsize; - unsigned long nclears; - INTERNAL_SIZE_T *d; --#endif - ptrdiff_t bytes; - - if (__glibc_unlikely (__builtin_mul_overflow (n, elem_size, &bytes))) -@@ -3674,12 +3672,13 @@ __libc_calloc (size_t n, size_t elem_size) - return 0; - - mchunkptr p = mem2chunk (mem); -+ - /* If we are using memory tagging, then we need to set the tags - regardless of MORECORE_CLEARS, so we zero the whole block while - doing so. */ --#ifdef USE_MTAG -- return tag_new_zero_region (mem, CHUNK_AVAILABLE_SIZE (p) - CHUNK_HDR_SZ); --#else -+ if (__glibc_unlikely (mtag_enabled)) -+ return tag_new_zero_region (mem, CHUNK_AVAILABLE_SIZE (p) - CHUNK_HDR_SZ); -+ - INTERNAL_SIZE_T csz = chunksize (p); - - /* Two optional cases in which clearing not necessary */ -@@ -3733,7 +3732,6 @@ __libc_calloc (size_t n, size_t elem_size) - } - - return mem; --#endif - } - - /* --- -2.25.1 - - -From 287a35fba55a0a817db7af71ee966a37b7642bf0 Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy <szabolcs.nagy@arm.com> -Date: Mon, 8 Feb 2021 12:39:01 +0000 -Subject: [PATCH 10/11] malloc: Use branches instead of mtag_granule_mask - -The branches may be better optimized since mtag_enabled is widely used. - -Granule size larger than a chunk header is not supported since then we -cannot have both the chunk header and user area granule aligned. To -fix that for targets with large granule, the chunk layout has to change. - -So code that attempted to handle the granule mask generally was changed. -This simplified CHUNK_AVAILABLE_SIZE and the logic in malloc_usable_size. - -Reviewed-by: DJ Delorie <dj@redhat.com> ---- - malloc/arena.c | 1 - - malloc/malloc.c | 34 ++++++++++++++-------------------- - 2 files changed, 14 insertions(+), 21 deletions(-) - -diff --git a/malloc/arena.c b/malloc/arena.c -index 1e83bb66bd..9fbbb38a15 100644 ---- a/malloc/arena.c -+++ b/malloc/arena.c -@@ -306,7 +306,6 @@ ptmalloc_init (void) - - mtag_enabled = true; - mtag_mmap_flags = __MTAG_MMAP_FLAGS; -- mtag_granule_mask = ~(size_t)(__MTAG_GRANULE_SIZE - 1); - } - #endif - -diff --git a/malloc/malloc.c b/malloc/malloc.c -index 0b2aff3768..849bd8e2c9 100644 ---- a/malloc/malloc.c -+++ b/malloc/malloc.c -@@ -442,7 +442,6 @@ void *(*__morecore)(ptrdiff_t) = __default_morecore; - #ifdef USE_MTAG - static bool mtag_enabled = false; - static int mtag_mmap_flags = 0; --static size_t mtag_granule_mask = ~(size_t)0; - #else - # define mtag_enabled false - # define mtag_mmap_flags 0 -@@ -1333,15 +1332,16 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ - ((req) + SIZE_SZ + MALLOC_ALIGN_MASK) & ~MALLOC_ALIGN_MASK) - - /* Available size of chunk. This is the size of the real usable data -- in the chunk, plus the chunk header. */ --#ifdef USE_MTAG --#define CHUNK_AVAILABLE_SIZE(p) \ -- ((chunksize (p) + (chunk_is_mmapped (p) ? 0 : SIZE_SZ)) \ -- & mtag_granule_mask) --#else --#define CHUNK_AVAILABLE_SIZE(p) \ -- (chunksize (p) + (chunk_is_mmapped (p) ? 0 : SIZE_SZ)) --#endif -+ in the chunk, plus the chunk header. Note: If memory tagging is -+ enabled the layout changes to accomodate the granule size, this is -+ wasteful for small allocations so not done by default. The logic -+ does not work if chunk headers are not granule aligned. */ -+_Static_assert (__MTAG_GRANULE_SIZE <= CHUNK_HDR_SZ, -+ "memory tagging is not supported with large granule."); -+#define CHUNK_AVAILABLE_SIZE(p) \ -+ (__MTAG_GRANULE_SIZE > SIZE_SZ && __glibc_unlikely (mtag_enabled) ? \ -+ chunksize (p) : \ -+ chunksize (p) + (chunk_is_mmapped (p) ? 0 : SIZE_SZ)) - - /* Check if REQ overflows when padded and aligned and if the resulting value - is less than PTRDIFF_T. Returns TRUE and the requested size or MINSIZE in -@@ -1353,7 +1353,6 @@ checked_request2size (size_t req, size_t *sz) __nonnull (1) - if (__glibc_unlikely (req > PTRDIFF_MAX)) - return false; - --#ifdef USE_MTAG - /* When using tagged memory, we cannot share the end of the user - block with the header for the next chunk, so ensure that we - allocate blocks that are rounded up to the granule size. Take -@@ -1361,8 +1360,9 @@ checked_request2size (size_t req, size_t *sz) __nonnull (1) - number. Ideally, this would be part of request2size(), but that - must be a macro that produces a compile time constant if passed - a constant literal. */ -- req = (req + ~mtag_granule_mask) & mtag_granule_mask; --#endif -+ if (__glibc_unlikely (mtag_enabled)) -+ req = (req + (__MTAG_GRANULE_SIZE - 1)) & -+ ~(size_t)(__MTAG_GRANULE_SIZE - 1); - - *sz = request2size (req); - return true; -@@ -5112,14 +5112,8 @@ musable (void *mem) - result = chunksize (p) - CHUNK_HDR_SZ; - } - else if (inuse (p)) -- result = chunksize (p) - SIZE_SZ; -+ result = CHUNK_AVAILABLE_SIZE (p) - CHUNK_HDR_SZ; - --#ifdef USE_MTAG -- /* The usable space may be reduced if memory tagging is needed, -- since we cannot share the user-space data with malloc's internal -- data structure. */ -- result &= mtag_granule_mask; --#endif - return result; - } - return 0; --- -2.25.1 - - -From 66de173bf919e601e408dc78772c6841ad6388ab Mon Sep 17 00:00:00 2001 -From: Szabolcs Nagy <szabolcs.nagy@arm.com> -Date: Wed, 17 Feb 2021 10:15:18 +0000 -Subject: [PATCH 11/11] malloc: Use mtag_enabled instead of USE_MTAG - -Use the runtime check where possible: it should not cause slow down in -the !USE_MTAG case since then mtag_enabled is constant false, but it -allows compiling the tagging logic so it's less likely to break or -diverge when developers only test the !USE_MTAG case. - -Reviewed-by: DJ Delorie <dj@redhat.com> ---- - malloc/hooks.c | 10 ++++------ - malloc/malloc.c | 10 ++++------ - 2 files changed, 8 insertions(+), 12 deletions(-) - -diff --git a/malloc/hooks.c b/malloc/hooks.c -index d8e304c31c..9474e199c3 100644 ---- a/malloc/hooks.c -+++ b/malloc/hooks.c -@@ -262,11 +262,10 @@ free_check (void *mem, const void *caller) - - int err = errno; - --#ifdef USE_MTAG - /* Quickly check that the freed pointer matches the tag for the memory. - This gives a useful double-free detection. */ -- *(volatile char *)mem; --#endif -+ if (__glibc_unlikely (mtag_enabled)) -+ *(volatile char *)mem; - - __libc_lock_lock (main_arena.mutex); - p = mem2chunk_check (mem, NULL); -@@ -310,11 +309,10 @@ realloc_check (void *oldmem, size_t bytes, const void *caller) - return NULL; - } - --#ifdef USE_MTAG - /* Quickly check that the freed pointer matches the tag for the memory. - This gives a useful double-free detection. */ -- *(volatile char *)oldmem; --#endif -+ if (__glibc_unlikely (mtag_enabled)) -+ *(volatile char *)oldmem; - - __libc_lock_lock (main_arena.mutex); - const mchunkptr oldp = mem2chunk_check (oldmem, &magic_p); -diff --git a/malloc/malloc.c b/malloc/malloc.c -index 849bd8e2c9..36583120ce 100644 ---- a/malloc/malloc.c -+++ b/malloc/malloc.c -@@ -3286,11 +3286,10 @@ __libc_free (void *mem) - if (mem == 0) /* free(0) has no effect */ - return; - --#ifdef USE_MTAG - /* Quickly check that the freed pointer matches the tag for the memory. - This gives a useful double-free detection. */ -- *(volatile char *)mem; --#endif -+ if (__glibc_unlikely (mtag_enabled)) -+ *(volatile char *)mem; - - int err = errno; - -@@ -3352,11 +3351,10 @@ __libc_realloc (void *oldmem, size_t bytes) - if (oldmem == 0) - return __libc_malloc (bytes); - --#ifdef USE_MTAG - /* Perform a quick check to ensure that the pointer's tag matches the - memory's tag. */ -- *(volatile char*) oldmem; --#endif -+ if (__glibc_unlikely (mtag_enabled)) -+ *(volatile char*) oldmem; - - /* chunk corresponding to oldmem */ - const mchunkptr oldp = mem2chunk (oldmem); --- -2.25.1 - diff --git a/poky/meta/recipes-core/glibc/glibc_2.33.bb b/poky/meta/recipes-core/glibc/glibc_2.34.bb index 67eb3f04bb..66494c5c23 100644 --- a/poky/meta/recipes-core/glibc/glibc_2.33.bb +++ b/poky/meta/recipes-core/glibc/glibc_2.34.bb @@ -25,7 +25,7 @@ NATIVESDKFIXES:class-nativesdk = "\ file://0005-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch \ file://0006-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch \ file://0007-nativesdk-glibc-Make-relocatable-install-for-locales.patch \ - file://faccessat2-perm.patch \ + file://0008-nativesdk-glibc-Fall-back-to-faccessat-on-faccess2-r.patch \ " SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ @@ -34,30 +34,27 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \ file://makedbs.sh \ \ ${NATIVESDKFIXES} \ - file://0008-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch \ - file://0009-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch \ - file://0010-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \ - file://0011-Quote-from-bug-1443-which-explains-what-the-patch-do.patch \ - file://0012-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \ - file://0013-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \ - file://0014-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \ - file://0015-yes-within-the-path-sets-wrong-config-variables.patch \ - file://0016-timezone-re-written-tzselect-as-posix-sh.patch \ - file://0017-Remove-bash-dependency-for-nscd-init-script.patch \ - file://0018-eglibc-Cross-building-and-testing-instructions.patch \ - file://0019-eglibc-Help-bootstrap-cross-toolchain.patch \ - file://0020-eglibc-Resolve-__fpscr_values-on-SH4.patch \ - file://0021-eglibc-Forward-port-cross-locale-generation-support.patch \ - file://0022-Define-DUMMY_LOCALE_T-if-not-defined.patch \ - file://0023-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \ - file://0024-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch \ - file://0025-intl-Emit-no-lines-in-bison-generated-files.patch \ + file://0009-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch \ + file://0010-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch \ + file://0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \ + file://0012-Quote-from-bug-1443-which-explains-what-the-patch-do.patch \ + file://0013-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \ + file://0014-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \ + file://0015-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \ + file://0016-yes-within-the-path-sets-wrong-config-variables.patch \ + file://0017-timezone-re-written-tzselect-as-posix-sh.patch \ + file://0018-Remove-bash-dependency-for-nscd-init-script.patch \ + file://0019-eglibc-Cross-building-and-testing-instructions.patch \ + file://0020-eglibc-Help-bootstrap-cross-toolchain.patch \ + file://0021-eglibc-Resolve-__fpscr_values-on-SH4.patch \ + file://0022-eglibc-Forward-port-cross-locale-generation-support.patch \ + file://0024-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \ + file://0025-elf-dl-deps.c-Make-_dl_build_local_scope-breadth-fir.patch \ + file://0026-intl-Emit-no-lines-in-bison-generated-files.patch \ file://0027-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch \ file://0028-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch \ file://0029-wordsize.h-Unify-the-header-between-arm-and-aarch64.patch \ file://0030-powerpc-Do-not-ask-compiler-for-finding-arch.patch \ - file://mte-backports.patch \ - file://CVE-2021-33574.patch \ " S = "${WORKDIR}/git" B = "${WORKDIR}/build-${TARGET_SYS}" @@ -81,7 +78,6 @@ EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \ --enable-tunables \ --enable-bind-now \ --enable-stack-protector=strong \ - --enable-stackguard-randomization \ --disable-crypt \ --with-default-link \ ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \ diff --git a/poky/meta/recipes-core/meta/buildtools-tarball.bb b/poky/meta/recipes-core/meta/buildtools-tarball.bb index 9775430d4b..6e96cf6c32 100644 --- a/poky/meta/recipes-core/meta/buildtools-tarball.bb +++ b/poky/meta/recipes-core/meta/buildtools-tarball.bb @@ -99,3 +99,16 @@ TOOLCHAIN_NEED_CONFIGSITE_CACHE = "" # The recipe doesn't need any default deps INHIBIT_DEFAULT_DEPS = "1" + +python do_testsdk() { + import oeqa.sdk.testsdk + testsdk = oeqa.sdk.testsdk.TestSDK() + + cases_path = os.path.join(os.path.abspath(os.path.dirname(oeqa.sdk.testsdk.__file__)), "buildtools-cases") + testsdk.context_executor_class.default_cases = cases_path + + testsdk.run(d) +} +addtask testsdk +do_testsdk[nostamp] = "1" +do_testsdk[depends] += "xz-native:do_populate_sysroot" diff --git a/poky/meta/recipes-core/systemd/systemd_249.1.bb b/poky/meta/recipes-core/systemd/systemd_249.1.bb index 5d472027c9..a6759c7a35 100644 --- a/poky/meta/recipes-core/systemd/systemd_249.1.bb +++ b/poky/meta/recipes-core/systemd/systemd_249.1.bb @@ -93,7 +93,7 @@ PACKAGECONFIG ??= " \ userdb \ utmp \ vconsole \ - xz \ + zstd \ " PACKAGECONFIG:remove:libc-musl = " \ @@ -199,6 +199,7 @@ PACKAGECONFIG[xdg-autostart] = "-Dxdg-autostart=true,-Dxdg-autostart=false" PACKAGECONFIG[xkbcommon] = "-Dxkbcommon=true,-Dxkbcommon=false,libxkbcommon" PACKAGECONFIG[xz] = "-Dxz=true,-Dxz=false,xz" PACKAGECONFIG[zlib] = "-Dzlib=true,-Dzlib=false,zlib" +PACKAGECONFIG[zstd] = "-Dzstd=true,-Dzstd=false,zstd" # Helper variables to clarify locations. This mirrors the logic in systemd's # build system. diff --git a/poky/meta/recipes-core/util-linux/util-linux.inc b/poky/meta/recipes-core/util-linux/util-linux.inc index a76fb9e500..0f17c73e86 100644 --- a/poky/meta/recipes-core/util-linux/util-linux.inc +++ b/poky/meta/recipes-core/util-linux/util-linux.inc @@ -35,6 +35,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin file://run-ptest \ file://display_testname_for_subtest.patch \ file://avoid_parallel_tests.patch \ + file://CVE-2021-37600.patch \ " SRC_URI[sha256sum] = "8e4bd42053b726cf86eb4d13a73bc1d9225a2c2e1a2e0d2a891f1020f83e6b76" diff --git a/poky/meta/recipes-core/util-linux/util-linux/CVE-2021-37600.patch b/poky/meta/recipes-core/util-linux/util-linux/CVE-2021-37600.patch new file mode 100644 index 0000000000..2b306c435b --- /dev/null +++ b/poky/meta/recipes-core/util-linux/util-linux/CVE-2021-37600.patch @@ -0,0 +1,33 @@ +From 1c9143d0c1f979c3daf10e1c37b5b1e916c22a1c Mon Sep 17 00:00:00 2001 +From: Karel Zak <kzak@redhat.com> +Date: Tue, 27 Jul 2021 11:58:31 +0200 +Subject: [PATCH] sys-utils/ipcutils: be careful when call calloc() for uint64 + nmembs + +Fix: https://github.com/karelzak/util-linux/issues/1395 +Signed-off-by: Karel Zak <kzak@redhat.com> + +CVE: CVE-2021-37600 +Upstream-Status: Backport [1c9143d0c1f979c3daf10e1c37b5b1e916c22a1c] + +Signed-off-by: Dragos-Marian Panait <dragos.panait@windriver.com> +--- + sys-utils/ipcutils.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sys-utils/ipcutils.c b/sys-utils/ipcutils.c +index e784c4dcb..18868cfd3 100644 +--- a/sys-utils/ipcutils.c ++++ b/sys-utils/ipcutils.c +@@ -218,7 +218,7 @@ static void get_sem_elements(struct sem_data *p) + { + size_t i; + +- if (!p || !p->sem_nsems || p->sem_perm.id < 0) ++ if (!p || !p->sem_nsems || p->sem_nsems > SIZE_MAX || p->sem_perm.id < 0) + return; + + p->elements = xcalloc(p->sem_nsems, sizeof(struct sem_elem)); +-- +2.25.1 + diff --git a/poky/meta/recipes-core/util-linux/util-linux_2.37.1.bb b/poky/meta/recipes-core/util-linux/util-linux_2.37.1.bb index b67c3dcb53..9351595144 100644 --- a/poky/meta/recipes-core/util-linux/util-linux_2.37.1.bb +++ b/poky/meta/recipes-core/util-linux/util-linux_2.37.1.bb @@ -1,7 +1,7 @@ require util-linux.inc #gtk-doc is not enabled as it requires xmlto which requires util-linux -inherit autotools gettext pkgconfig systemd update-alternatives python3-dir bash-completion ptest +inherit autotools gettext manpages pkgconfig systemd update-alternatives python3-dir bash-completion ptest DEPENDS = "libcap-ng ncurses virtual/crypt zlib util-linux-libuuid" PACKAGES =+ "${PN}-swaponoff" @@ -92,6 +92,9 @@ EXTRA_OECONF:append = " --disable-hwclock-gplv3" # PACKAGECONFIG ?= "pcre2" PACKAGECONFIG:class-target ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'chfn-chsh pam', '', d)}" +# inherit manpages requires this to be present, however util-linux does not have +# configuration options, and installs manpages always +PACKAGECONFIG[manpages] = "" PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, libpam," # Respect the systemd feature for uuidd PACKAGECONFIG[systemd] = "--with-systemd --with-systemdsystemunitdir=${systemd_system_unitdir}, --without-systemd --without-systemdsystemunitdir,systemd" @@ -263,6 +266,32 @@ ALTERNATIVE_LINK_NAME[utmpdump] = "${bindir}/utmpdump" ALTERNATIVE_LINK_NAME[uuidgen] = "${bindir}/uuidgen" ALTERNATIVE_LINK_NAME[wall] = "${bindir}/wall" +ALTERNATIVE:${PN}-doc = "\ +blkid.8 eject.1 findfs.8 fsck.8 kill.1 last.1 lastb.1 libblkid.3 logger.1 mesg.1 \ +mountpoint.1 nologin.8 rfkill.8 sulogin.8 utmpdump.1 uuid.3 wall.1\ +" +ALTERNATIVE:${PN}-doc += "${@bb.utils.contains('PACKAGECONFIG', 'pam', 'su.1', '', d)}" + +ALTERNATIVE_LINK_NAME[blkid.8] = "${mandir}/man8/blkid.8" +ALTERNATIVE_LINK_NAME[eject.1] = "${mandir}/man1/eject.1" +ALTERNATIVE_LINK_NAME[findfs.8] = "${mandir}/man8/findfs.8" +ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8" +ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1" +ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1" +ALTERNATIVE_LINK_NAME[lastb.1] = "${mandir}/man1/lastb.1" +ALTERNATIVE_LINK_NAME[libblkid.3] = "${mandir}/man3/libblkid.3" +ALTERNATIVE_LINK_NAME[logger.1] = "${mandir}/man1/logger.1" +ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1" +ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1" +ALTERNATIVE_LINK_NAME[nologin.8] = "${mandir}/man8/nologin.8" +ALTERNATIVE_LINK_NAME[rfkill.8] = "${mandir}/man8/rfkill.8" +ALTERNATIVE_LINK_NAME[setpriv.1] = "${mandir}/man1/setpriv.1" +ALTERNATIVE_LINK_NAME[su.1] = "${mandir}/man1/su.1" +ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8" +ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1" +ALTERNATIVE_LINK_NAME[uuid.3] = "${mandir}/man3/uuid.3" +ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1" + BBCLASSEXTEND = "native nativesdk" PTEST_BINDIR = "1" diff --git a/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/big-inodes-for-small-fs.patch b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/big-inodes-for-small-fs.patch new file mode 100644 index 0000000000..caeb560d32 --- /dev/null +++ b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs/big-inodes-for-small-fs.patch @@ -0,0 +1,22 @@ +Ensure "small" file systems also have the default inode size (256 bytes) so that +can store 64-bit timestamps and work past 2038. + +The "small" type is any size >3MB and <512MB, which covers a lot of relatively +small filesystems built by OE, especially when they're sized to fit the contents +and expand to the storage on boot. + +Upstream-Status: Inappropriate +Signed-off-by: Ross Burton <ross.burton@arm.com> + +diff --git a/misc/mke2fs.conf.in b/misc/mke2fs.conf.in +index 01e35cf8..29f41dc0 100644 +--- a/misc/mke2fs.conf.in ++++ b/misc/mke2fs.conf.in +@@ -16,7 +16,6 @@ + } + small = { + blocksize = 1024 +- inode_size = 128 + inode_ratio = 4096 + } + floppy = { diff --git a/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.46.2.bb b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.46.2.bb index d68d131e0a..8cc046c794 100644 --- a/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.46.2.bb +++ b/poky/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.46.2.bb @@ -10,6 +10,7 @@ SRC_URI += "file://remove.ldconfig.call.patch \ SRC_URI:append:class-native = " file://e2fsprogs-fix-missing-check-for-permission-denied.patch \ file://quiet-debugfs.patch \ + file://big-inodes-for-small-fs.patch \ " diff --git a/poky/meta/recipes-devtools/elfutils/elfutils_0.185.bb b/poky/meta/recipes-devtools/elfutils/elfutils_0.185.bb index 5031ab97e7..7a88c5259f 100644 --- a/poky/meta/recipes-devtools/elfutils/elfutils_0.185.bb +++ b/poky/meta/recipes-devtools/elfutils/elfutils_0.185.bb @@ -127,7 +127,7 @@ FILES:libdw = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils FILES:libdebuginfod = "${libdir}/libdebuginfod-${PV}.so ${libdir}/libdebuginfod.so.*" # Some packages have the version preceeding the .so instead properly # versioned .so.<version>, so we need to reorder and repackage. -#FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so" +#FILES:${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so" #FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so" # The package contains symlinks that trip up insane diff --git a/poky/meta/recipes-devtools/libtool/libtool-2.4.6.inc b/poky/meta/recipes-devtools/libtool/libtool-2.4.6.inc index c1cbceb51f..6748d7468e 100644 --- a/poky/meta/recipes-devtools/libtool/libtool-2.4.6.inc +++ b/poky/meta/recipes-devtools/libtool/libtool-2.4.6.inc @@ -23,6 +23,7 @@ SRC_URI = "${GNU_MIRROR}/libtool/libtool-${PV}.tar.gz \ file://0001-libtool-Check-for-static-libs-for-internal-compiler-.patch \ file://0001-Makefile.am-make-sure-autoheader-run-before-autoconf.patch \ file://0001-Makefile.am-make-sure-autoheader-run-before-automake.patch \ + file://lto-prefix.patch \ " SRC_URI[md5sum] = "addf44b646ddb4e3919805aa88fa7c5e" diff --git a/poky/meta/recipes-devtools/libtool/libtool/lto-prefix.patch b/poky/meta/recipes-devtools/libtool/libtool/lto-prefix.patch new file mode 100644 index 0000000000..2bd010b8e4 --- /dev/null +++ b/poky/meta/recipes-devtools/libtool/libtool/lto-prefix.patch @@ -0,0 +1,22 @@ +If lto is enabled, we need the prefix-map variables to be passed to the linker. +Add these to the list of options libtool passes through. + +Upstream-Status: Pending +Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> + +Index: libtool-2.4.6/build-aux/ltmain.in +=================================================================== +--- libtool-2.4.6.orig/build-aux/ltmain.in ++++ libtool-2.4.6/build-aux/ltmain.in +@@ -5424,9 +5424,10 @@ func_mode_link () + # --sysroot=* for sysroot support + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -stdlib=* select c++ std lib with clang ++ # -f*-prefix-map* needed for lto linking + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ +- -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) ++ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*|-f*-prefix-map*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + func_append compile_command " $arg" diff --git a/poky/meta/recipes-devtools/perl/perl_5.34.0.bb b/poky/meta/recipes-devtools/perl/perl_5.34.0.bb index cc01321f7a..ab19a8d0be 100644 --- a/poky/meta/recipes-devtools/perl/perl_5.34.0.bb +++ b/poky/meta/recipes-devtools/perl/perl_5.34.0.bb @@ -361,7 +361,7 @@ EOPREAMBLE awk '{if ($3 != "\x22"$1"\x22"){ print $0}}'| \ grep -v -e "\-vms\-" -e module-5 -e "^$" -e "\\$" -e your -e tk -e autoperl -e html -e http -e parse-cpan -e perl-ostype -e ndbm-file -e module-mac -e fcgi -e lwp -e dbd -e dbix | \ sort -u | \ - sed 's/^/RDEPENDS_/;s/perl-module-/${PN}-module-/g;s/module-\(module-\)/\1/g;s/\(module-load\)-conditional/\1/g;s/encode-configlocal/&-pm/;' | \ + sed 's/^/RDEPENDS:/;s/perl-module-/${PN}-module-/g;s/module-\(module-\)/\1/g;s/\(module-load\)-conditional/\1/g;s/encode-configlocal/&-pm/;' | \ egrep -wv '=>|module-a|module-apache.?|module-apr|module-authen-sasl|module-b-asmdata|module-convert-ebcdic|module-devel-size|module-digest-perl-md5|module-dumpvalue|module-extutils-constant-aaargh56hash|module-extutils-xssymset|module-file-bsdglob|module-for|module-it|module-io-socket-inet6|module-io-socket-ssl|module-io-string|module-ipc-system-simple|module-lexical|module-local-lib|metadata|module-modperl-util|module-pluggable-object|module-test-builder-io-scalar|module-test2|module-text-unidecode|module-unicore|module-win32|objects\sload|syscall.ph|systeminfo.ph|%s' | \ egrep -wv '=>|module-algorithm-diff|module-carp|module-c<extutils-mm-unix>|module-l<extutils-mm-unix>|module-encode-hanextra|module-extutils-makemaker-version-regex|module-file-spec|module-io-compress-lzma|module-io-uncompress-unxz|module-locale-maketext-lexicon|module-log-agent|module-meta-notation|module-net-localcfg|module-net-ping-external|module-b-deparse|module-scalar-util|module-some-module|module-symbol|module-uri|module-win32api-file' > ${WORKDIR}/perl-rdepends.generated cat ${WORKDIR}/perl-rdepends.inc ${WORKDIR}/perl-rdepends.generated > ${THISDIR}/files/perl-rdepends.txt diff --git a/poky/meta/recipes-devtools/python/python3-scons-native_4.1.0.bb b/poky/meta/recipes-devtools/python/python3-scons-native_4.2.0.bb index 73076b8732..73076b8732 100644 --- a/poky/meta/recipes-devtools/python/python3-scons-native_4.1.0.bb +++ b/poky/meta/recipes-devtools/python/python3-scons-native_4.2.0.bb diff --git a/poky/meta/recipes-devtools/python/python3-scons/0001-Fix-man-page-installation.patch b/poky/meta/recipes-devtools/python/python3-scons/0001-Fix-man-page-installation.patch index ff212b85ee..6dffe64809 100644 --- a/poky/meta/recipes-devtools/python/python3-scons/0001-Fix-man-page-installation.patch +++ b/poky/meta/recipes-devtools/python/python3-scons/0001-Fix-man-page-installation.patch @@ -1,4 +1,4 @@ -From 82be2b7b9758a2f62ee11931da674cd541076041 Mon Sep 17 00:00:00 2001 +From 8b482e618047e94833545dce3a26924ef4f075db Mon Sep 17 00:00:00 2001 From: Tim Orling <ticotimo@gmail.com> Date: Sat, 22 May 2021 11:20:46 -0700 Subject: [PATCH] Fix man page installation @@ -9,10 +9,10 @@ Fixes: Upstream-Status: Inappropriate [oe specific] Signed-off-by: Tim Orling <ticotimo@gmail.com> + --- MANIFEST.in | 2 +- - setup.cfg | 6 +++--- - 2 files changed, 4 insertions(+), 4 deletions(-) + 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 04ec000..937f6f3 100644 @@ -27,20 +27,3 @@ index 04ec000..937f6f3 100644 -diff --git a/setup.cfg b/setup.cfg -index 37e5204..677c00a 100644 ---- a/setup.cfg -+++ b/setup.cfg -@@ -56,9 +56,9 @@ console_scripts = - scons.tool.docbook = *.* - - [options.data_files] --. = build/doc/man/scons.1 -- build/doc/man/scons-time.1 -- build/doc/man/sconsign.1 -+. = scons.1 -+ scons-time.1 -+ sconsign.1 - - [sdist] - dist-dir = build/dist diff --git a/poky/meta/recipes-devtools/python/python3-scons_4.1.0.bb b/poky/meta/recipes-devtools/python/python3-scons_4.2.0.bb index 5a5b550be0..23527a2cce 100644 --- a/poky/meta/recipes-devtools/python/python3-scons_4.1.0.bb +++ b/poky/meta/recipes-devtools/python/python3-scons_4.2.0.bb @@ -2,10 +2,10 @@ SUMMARY = "Software Construction tool (make/autotools replacement)" HOMEPAGE = "https://github.com/SCons/scons" SECTION = "devel/python" LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://LICENSE;md5=b94c6e2be9670c62b38f7118c12866d2" +LIC_FILES_CHKSUM = "file://LICENSE;md5=d903b0b8027f461402bac9b5169b36f7" SRC_URI += " file://0001-Fix-man-page-installation.patch" -SRC_URI[sha256sum] = "accb8035be2c9cfbab06471286eaeff86a10037a8064cf4ef4c3df04ea5a7387" +SRC_URI[sha256sum] = "691893b63f38ad14295f5104661d55cb738ec6514421c6261323351c25432b0a" PYPI_PACKAGE = "SCons" diff --git a/poky/meta/recipes-devtools/qemu/qemu.inc b/poky/meta/recipes-devtools/qemu/qemu.inc index 4de8a9098b..0bbc4b1187 100644 --- a/poky/meta/recipes-devtools/qemu/qemu.inc +++ b/poky/meta/recipes-devtools/qemu/qemu.inc @@ -110,7 +110,7 @@ export LIBTOOL="${HOST_SYS}-libtool" B = "${WORKDIR}/build" -#EXTRA_OECONF_append = " --python=${HOSTTOOLS_DIR}/python3" +#EXTRA_OECONF:append = " --python=${HOSTTOOLS_DIR}/python3" do_configure:prepend:class-native() { # Append build host pkg-config paths for native target since the host may provide sdl diff --git a/poky/meta/recipes-devtools/ruby/ruby/0002-template-Makefile.in-filter-out-f-prefix-map.patch b/poky/meta/recipes-devtools/ruby/ruby/0002-template-Makefile.in-filter-out-f-prefix-map.patch new file mode 100644 index 0000000000..9387506c26 --- /dev/null +++ b/poky/meta/recipes-devtools/ruby/ruby/0002-template-Makefile.in-filter-out-f-prefix-map.patch @@ -0,0 +1,42 @@ +Subject: [PATCH] template/Makefile.in: filter out -f*prefix-map + +If we add DEBUG_PREFIX_MAP into LDFLAGS, ruby and ruby-dbg are no longer +reproducible. Fix this. + +Upstream-Status: Inapproppriate [oe-core specific] +Signed-off-by: Tony Battersby <tonyb@cybernetics.com> +--- +--- a/tool/mjit_archflag.sh ++++ b/tool/mjit_archflag.sh +@@ -7,6 +7,20 @@ quote() { + echo + } + ++quote_filtered() { ++ printf "#${indent}define $1" ++ while shift && [ "$#" -gt 0 ]; do ++ case "$1" in ++ -ffile-prefix-map=*|-fdebug-prefix-map=*|-fmacro-prefix-map=*) ++ ;; ++ *) ++ printf ' "%s"'$sep "$1" ++ ;; ++ esac ++ done ++ echo ++} ++ + archs="" + arch_flag="" + +--- a/template/Makefile.in ++++ b/template/Makefile.in +@@ -666,7 +666,7 @@ mjit_config.h: + quote "MJIT_OPTFLAGS " $(MJIT_OPTFLAGS); \ + quote "MJIT_DEBUGFLAGS " $(MJIT_DEBUGFLAGS); \ + quote "MJIT_LDSHARED " ; \ +- quote "MJIT_DLDFLAGS MJIT_ARCHFLAG" $(MJIT_DLDFLAGS); \ ++ quote_filtered "MJIT_DLDFLAGS MJIT_ARCHFLAG" $(MJIT_DLDFLAGS); \ + quote "MJIT_LIBS " $(LIBRUBYARG_SHARED); \ + quote 'PRELOADENV "@PRELOADENV@"'; \ + indent=$${archs:+' '}; \ diff --git a/poky/meta/recipes-devtools/ruby/ruby_3.0.2.bb b/poky/meta/recipes-devtools/ruby/ruby_3.0.2.bb index a082735574..38e594a59e 100644 --- a/poky/meta/recipes-devtools/ruby/ruby_3.0.2.bb +++ b/poky/meta/recipes-devtools/ruby/ruby_3.0.2.bb @@ -6,6 +6,7 @@ SRC_URI += " \ file://remove_has_include_macros.patch \ file://run-ptest \ file://0001-template-Makefile.in-do-not-write-host-cross-cc-item.patch \ + file://0002-template-Makefile.in-filter-out-f-prefix-map.patch \ " SRC_URI[sha256sum] = "5085dee0ad9f06996a8acec7ebea4a8735e6fac22f22e2d98c3f2bc3bef7e6f1" @@ -55,6 +56,10 @@ do_install:append:class-target () { -e 's:${RECIPE_SYSROOT}::g' \ -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \ ${D}$rbconfig_rb + + sed -i -e 's|${DEBUG_PREFIX_MAP}||g' \ + ${D}${libdir}/pkgconfig/*.pc + } do_install_ptest () { diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/remove-for-aarch64 b/poky/meta/recipes-devtools/valgrind/valgrind/remove-for-aarch64 index b4fc8af333..440e8bec31 100644 --- a/poky/meta/recipes-devtools/valgrind/valgrind/remove-for-aarch64 +++ b/poky/meta/recipes-devtools/valgrind/valgrind/remove-for-aarch64 @@ -236,3 +236,5 @@ memcheck/tests/wrapmallocstatic memcheck/tests/writev1 memcheck/tests/xml1 memcheck/tests/linux/stack_changes +gdbserver_tests/hginfo +memcheck/tests/linux/timerfd-syscall diff --git a/poky/meta/recipes-devtools/valgrind/valgrind/remove-for-all b/poky/meta/recipes-devtools/valgrind/valgrind/remove-for-all index c3fc639066..cb8d10b18f 100644 --- a/poky/meta/recipes-devtools/valgrind/valgrind/remove-for-all +++ b/poky/meta/recipes-devtools/valgrind/valgrind/remove-for-all @@ -1 +1,8 @@ none/tests/amd64/fb_test_amd64 +gdbserver_tests/hginfo +memcheck/tests/supp_unknown +helgrind/tests/tls_threads +drd/tests/bar_bad_xml +drd/tests/pth_barrier_thr_cr +drd/tests/thread_name_xml +massif/tests/deep-D diff --git a/poky/meta/recipes-extended/parted/files/0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch b/poky/meta/recipes-extended/parted/files/0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch deleted file mode 100644 index bd2b5c55b1..0000000000 --- a/poky/meta/recipes-extended/parted/files/0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 5c99d7e4c2b5e7a957dc922aff03debfebbd6154 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com> -Date: Fri, 3 Mar 2017 21:49:15 +0100 -Subject: [PATCH] libparted_fs_resize: link against libuuid explicitly to - unbreak gold linking on test -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -| ../libparted/fs/.libs/libparted-fs-resize.so: error: undefined reference to 'uuid_generate' - -Upstream-Status: Pending - -Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> ---- - libparted/fs/Makefile.am | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/libparted/fs/Makefile.am b/libparted/fs/Makefile.am -index d3cc8bc..c301b0b 100644 ---- a/libparted/fs/Makefile.am -+++ b/libparted/fs/Makefile.am -@@ -113,6 +113,8 @@ libparted_fs_resize_la_SOURCES = \ - r/hfs/reloc_plus.c \ - r/hfs/reloc_plus.h - -+libparted_fs_resize_la_LIBADD = $(UUID_LIBS) -+ - AM_CPPFLAGS = \ - -I$(top_srcdir)/libparted/labels \ - $(partedincludedir) \ --- -2.9.3 - diff --git a/poky/meta/recipes-extended/parted/files/check-vfat.patch b/poky/meta/recipes-extended/parted/files/check-vfat.patch index c64130a4e2..fad50292d9 100644 --- a/poky/meta/recipes-extended/parted/files/check-vfat.patch +++ b/poky/meta/recipes-extended/parted/files/check-vfat.patch @@ -1,7 +1,7 @@ Add checks for both mkfs.vfat and the vfat file system in the kernel before running tests. -Upstream-Status: Pending +Upstream-Status: Submitted [https://alioth-lists.debian.net/pipermail/parted-devel/2021-August/005653.html] Signed-off-by: Ross Burton <ross.burton@arm.com> diff --git a/tests/t-lib-helpers.sh b/tests/t-lib-helpers.sh diff --git a/poky/meta/recipes-extended/parted/parted_3.4.bb b/poky/meta/recipes-extended/parted/parted_3.4.bb index 8924bdb478..ffab627110 100644 --- a/poky/meta/recipes-extended/parted/parted_3.4.bb +++ b/poky/meta/recipes-extended/parted/parted_3.4.bb @@ -8,7 +8,6 @@ DEPENDS = "ncurses util-linux virtual/libiconv" SRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.xz \ file://fix-doc-mandir.patch \ - file://0002-libparted_fs_resize-link-against-libuuid-explicitly-.patch \ file://run-ptest \ file://check-vfat.patch \ " diff --git a/poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb b/poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.31.bb index cdc43b5fb9..1848ef67e1 100644 --- a/poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb +++ b/poky/meta/recipes-extended/perl/libconvert-asn1-perl_0.31.bb @@ -1,14 +1,14 @@ SUMMARY = "Convert::ASN1 - Perl ASN.1 Encode/Decode library" SECTION = "libs" -HOMEPAGE = "https://metacpan.org/source/GBARR/Convert-ASN1-0.27" +HOMEPAGE = "http://search.cpan.org/dist/Convert-ASN1/" DESCRIPTION = "Convert::ASN1 is a perl library for encoding/decoding data using ASN.1 definitions." LICENSE = "Artistic-1.0 | GPL-1.0+" LIC_FILES_CHKSUM = "file://README.md;beginline=91;endline=97;md5=ceff7fd286eb6d8e8e0d3d23e096a63f" -SRC_URI = "http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/Convert-ASN1-${PV}.tar.gz" +SRC_URI = "https://cpan.metacpan.org/authors/id/T/TI/TIMLEGGE/Convert-ASN1-${PV}.tar.gz" -SRC_URI[md5sum] = "68723e96be0b258a9e20480276e8a62c" -SRC_URI[sha256sum] = "74a4a78ae0c5e973100ac0a8f203a110f76fb047b79dae4fc1fd7d6814d3d58a" +SRC_URI[md5sum] = "1e12b263a5042804bb1c59ddce899876" +SRC_URI[sha256sum] = "6fe4c1ba744c3a8212bf2c9b2703d93530acc153435cf2f93633540b439fbbeb" S = "${WORKDIR}/Convert-ASN1-${PV}" diff --git a/poky/meta/recipes-extended/shadow/shadow.inc b/poky/meta/recipes-extended/shadow/shadow.inc index 2834509649..97ffae978a 100644 --- a/poky/meta/recipes-extended/shadow/shadow.inc +++ b/poky/meta/recipes-extended/shadow/shadow.inc @@ -46,9 +46,7 @@ inherit autotools gettext export CONFIG_SHELL="/bin/sh" -EXTRA_OECONF += "--without-audit \ - --without-libcrack \ - --without-selinux \ +EXTRA_OECONF += "--without-libcrack \ --with-group-name-max-length=24 \ --enable-subordinate-ids=yes \ --without-sssd \ @@ -81,6 +79,8 @@ PACKAGECONFIG:class-nativesdk = "" PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam,${PAM_PLUGINS}" PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr" PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl" +PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit" +PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux libsemanage" RDEPENDS:${PN} = "shadow-securetty \ base-passwd \ diff --git a/poky/meta/recipes-extended/tar/tar_1.34.bb b/poky/meta/recipes-extended/tar/tar_1.34.bb index c096a8c9a8..98755a11cc 100644 --- a/poky/meta/recipes-extended/tar/tar_1.34.bb +++ b/poky/meta/recipes-extended/tar/tar_1.34.bb @@ -61,3 +61,6 @@ PROVIDES:append:class-native = " tar-replacement-native" NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}" BBCLASSEXTEND = "native nativesdk" + +# These are both specific to the NPM package node-tar +CVE_CHECK_WHITELIST += "CVE-2021-32803 CVE-2021-32804" diff --git a/poky/meta/recipes-graphics/jpeg/libjpeg-turbo_2.1.0.bb b/poky/meta/recipes-graphics/jpeg/libjpeg-turbo_2.1.0.bb index 3b8130af6d..9d0a338532 100644 --- a/poky/meta/recipes-graphics/jpeg/libjpeg-turbo_2.1.0.bb +++ b/poky/meta/recipes-graphics/jpeg/libjpeg-turbo_2.1.0.bb @@ -46,6 +46,7 @@ EXTRA_OECMAKE:append:class-target:armeb = " ${@bb.utils.contains("TUNE_FEATURES" # Provide a workaround if Altivec unit is not present in PPC EXTRA_OECMAKE:append:class-target:powerpc = " ${@bb.utils.contains("TUNE_FEATURES", "altivec", "", "-DWITH_SIMD=False", d)}" EXTRA_OECMAKE:append:class-target:powerpc64 = " ${@bb.utils.contains("TUNE_FEATURES", "altivec", "", "-DWITH_SIMD=False", d)}" +EXTRA_OECMAKE:append:class-target:powerpc64le = " ${@bb.utils.contains("TUNE_FEATURES", "altivec", "", "-DWITH_SIMD=False", d)}" DEBUG_OPTIMIZATION:append:armv4 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}" DEBUG_OPTIMIZATION:append:armv5 = " ${@bb.utils.contains('TUNE_CCARGS', '-mthumb', '-fomit-frame-pointer', '', d)}" diff --git a/poky/meta/recipes-graphics/xorg-lib/pixman_0.40.0.bb b/poky/meta/recipes-graphics/xorg-lib/pixman_0.40.0.bb index 00dd68006f..ab9595cc75 100644 --- a/poky/meta/recipes-graphics/xorg-lib/pixman_0.40.0.bb +++ b/poky/meta/recipes-graphics/xorg-lib/pixman_0.40.0.bb @@ -34,4 +34,8 @@ EXTRA_OEMESON += "-Dloongson-mmi=disabled" # disable iwmmxt due to compile fails on most arm platforms. EXTRA_OEMESON += "-Diwmmxt=disabled" +EXTRA_OEMESON:append:class-target:powerpc = " ${@bb.utils.contains("TUNE_FEATURES", "altivec", "-Dvmx=enabled", "-Dvmx=disabled", d)}" +EXTRA_OEMESON:append:class-target:powerpc64 = " ${@bb.utils.contains("TUNE_FEATURES", "altivec", "-Dvmx=enabled", "-Dvmx=disabled", d)}" +EXTRA_OEMESON:append:class-target:powerpc64le = " ${@bb.utils.contains("TUNE_FEATURES", "altivec", "-Dvmx=enabled", "-Dvmx=disabled", d)}" + BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-kernel/kmod/kmod_git.bb b/poky/meta/recipes-kernel/kmod/kmod_git.bb index 853561a61e..eb5d176ded 100644 --- a/poky/meta/recipes-kernel/kmod/kmod_git.bb +++ b/poky/meta/recipes-kernel/kmod/kmod_git.bb @@ -24,13 +24,13 @@ do_install:append () { lnr ${D}${base_bindir}/kmod ${D}${base_sbindir}/${tool} done # configuration directories - install -dm755 ${D}${base_libdir}/depmod.d - install -dm755 ${D}${base_libdir}/modprobe.d + install -dm755 ${D}${nonarch_base_libdir}/depmod.d + install -dm755 ${D}${nonarch_base_libdir}/modprobe.d install -dm755 ${D}${sysconfdir}/depmod.d install -dm755 ${D}${sysconfdir}/modprobe.d # install depmod.d file for search/ dir - install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${base_libdir}/depmod.d/search.conf" + install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${nonarch_base_libdir}/depmod.d/search.conf" } do_compile:prepend() { @@ -57,6 +57,6 @@ ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod" PACKAGES =+ "libkmod" FILES:libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}" -FILES:${PN} += "${base_libdir}/depmod.d ${base_libdir}/modprobe.d" +FILES:${PN} += "${nonarch_base_libdir}/depmod.d ${nonarch_base_libdir}/modprobe.d" BBCLASSEXTEND = "nativesdk" diff --git a/poky/meta/recipes-kernel/linux-firmware/linux-firmware_20210511.bb b/poky/meta/recipes-kernel/linux-firmware/linux-firmware_20210511.bb index fe46cb5192..d91a5562ac 100644 --- a/poky/meta/recipes-kernel/linux-firmware/linux-firmware_20210511.bb +++ b/poky/meta/recipes-kernel/linux-firmware/linux-firmware_20210511.bb @@ -303,8 +303,11 @@ PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \ ${PN}-qat ${PN}-qat-license \ ${PN}-qcom-license \ ${PN}-qcom-venus-1.8 ${PN}-qcom-venus-4.2 ${PN}-qcom-venus-5.2 ${PN}-qcom-venus-5.4 \ - ${PN}-qcom-adreno-a3xx ${PN}-qcom-adreno-a530 ${PN}-qcom-adreno-a630 \ + ${PN}-qcom-vpu-1.0 ${PN}-qcom-vpu-2.0 \ + ${PN}-qcom-adreno-a3xx ${PN}-qcom-adreno-a530 \ + ${PN}-qcom-adreno-a630 ${PN}-qcom-adreno-a650 ${PN}-qcom-adreno-a660 \ ${PN}-qcom-sdm845-audio ${PN}-qcom-sdm845-compute ${PN}-qcom-sdm845-modem \ + ${PN}-qcom-sm8250-audio ${PN}-qcom-sm8250-compute \ ${PN}-amlogic-vdec-license ${PN}-amlogic-vdec \ ${PN}-lt9611uxc ${PN}-lontium-license \ ${PN}-whence-license \ @@ -952,22 +955,34 @@ FILES:${PN}-qcom-venus-1.8 = "${nonarch_base_libdir}/firmware/qcom/venus-1.8/*" FILES:${PN}-qcom-venus-4.2 = "${nonarch_base_libdir}/firmware/qcom/venus-4.2/*" FILES:${PN}-qcom-venus-5.2 = "${nonarch_base_libdir}/firmware/qcom/venus-5.2/*" FILES:${PN}-qcom-venus-5.4 = "${nonarch_base_libdir}/firmware/qcom/venus-5.4/*" +FILES:${PN}-qcom-vpu-1.0 = "${nonarch_base_libdir}/firmware/qcom/vpu-1.0/*" +FILES:${PN}-qcom-vpu-2.0 = "${nonarch_base_libdir}/firmware/qcom/vpu-2.0/*" FILES:${PN}-qcom-adreno-a3xx = "${nonarch_base_libdir}/firmware/qcom/a300_*.fw ${nonarch_base_libdir}/firmware/a300_*.fw" FILES:${PN}-qcom-adreno-a530 = "${nonarch_base_libdir}/firmware/qcom/a530*.*" FILES:${PN}-qcom-adreno-a630 = "${nonarch_base_libdir}/firmware/qcom/a630*.* ${nonarch_base_libdir}/firmware/qcom/sdm845/a630*.*" +FILES:${PN}-qcom-adreno-a650 = "${nonarch_base_libdir}/firmware/qcom/a650*.* ${nonarch_base_libdir}/firmware/qcom/sm8250/a650*.*" +FILES:${PN}-qcom-adreno-a660 = "${nonarch_base_libdir}/firmware/qcom/a660*.*" FILES:${PN}-qcom-sdm845-audio = "${nonarch_base_libdir}/firmware/qcom/sdm845/adsp*.*" FILES:${PN}-qcom-sdm845-compute = "${nonarch_base_libdir}/firmware/qcom/sdm845/cdsp*.*" FILES:${PN}-qcom-sdm845-modem = "${nonarch_base_libdir}/firmware/qcom/sdm845/mba.mbn ${nonarch_base_libdir}/firmware/qcom/sdm845/modem*.* ${nonarch_base_libdir}/firmware/qcom/sdm845/wlanmdsp.mbn" +FILES:${PN}-qcom-sm8250-audio = "${nonarch_base_libdir}/firmware/qcom/sm8250/adsp*.*" +FILES:${PN}-qcom-sm8250-compute = "${nonarch_base_libdir}/firmware/qcom/sm8250/cdsp*.*" RDEPENDS:${PN}-qcom-venus-1.8 = "${PN}-qcom-license" RDEPENDS:${PN}-qcom-venus-4.2 = "${PN}-qcom-license" RDEPENDS:${PN}-qcom-venus-5.2 = "${PN}-qcom-license" RDEPENDS:${PN}-qcom-venus-5.4 = "${PN}-qcom-license" +RDEPENDS:${PN}-qcom-vpu-1.0 = "${PN}-qcom-license" +RDEPENDS:${PN}-qcom-vpu-2.0 = "${PN}-qcom-license" RDEPENDS:${PN}-qcom-adreno-a3xx = "${PN}-qcom-license" RDEPENDS:${PN}-qcom-adreno-a530 = "${PN}-qcom-license" RDEPENDS:${PN}-qcom-adreno-a630 = "${PN}-qcom-license" +RDEPENDS:${PN}-qcom-adreno-a650 = "${PN}-qcom-license" +RDEPENDS:${PN}-qcom-adreno-a660 = "${PN}-qcom-license" RDEPENDS:${PN}-qcom-sdm845-audio = "${PN}-qcom-license" RDEPENDS:${PN}-qcom-sdm845-compute = "${PN}-qcom-license" RDEPENDS:${PN}-qcom-sdm845-modem = "${PN}-qcom-license" +RDEPENDS:${PN}-qcom-sm8250-audio = "${PN}-qcom-license" +RDEPENDS:${PN}-qcom-sm8250-compute = "${PN}-qcom-license" FILES:${PN}-liquidio = "${nonarch_base_libdir}/firmware/liquidio" diff --git a/poky/meta/recipes-support/curl/curl_7.78.0.bb b/poky/meta/recipes-support/curl/curl_7.78.0.bb index 2e2be66102..dece0babb2 100644 --- a/poky/meta/recipes-support/curl/curl_7.78.0.bb +++ b/poky/meta/recipes-support/curl/curl_7.78.0.bb @@ -73,6 +73,7 @@ do_install:append:class-target() { -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \ -e 's,--with-libtool-sysroot=${STAGING_DIR_TARGET},,g' \ -e 's|${DEBUG_PREFIX_MAP}||g' \ + -e 's|${@" ".join(d.getVar("DEBUG_PREFIX_MAP").split())}||g' \ ${D}${bindir}/curl-config } |