From 0903674e2d7bafcf89cf75adbcf34cac5ce4b938 Mon Sep 17 00:00:00 2001 From: Andrew Geissler Date: Fri, 25 Jun 2021 14:25:14 -0500 Subject: poky: subtree update:9d1b332292..2834c2f853 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alex Stewart (3): opkg-utils: upgrade to version 0.4.5 opkg: upgrade to version 0.4.5 opkg: add QA check for openssl feed verification Alexander Kanavin (37): virglrenderer: explicitly depend on libgbm elfutils: update 0.183 -> 0.185 libcap: update 2.49 -> 2.50 perl: split perl-cross into its own recipe perl-cross: 1.3.5 -> 1.3.6 perl: update 5.32.1 -> 5.34.0 libgcrypt: upgrade 1.9.2 -> 1.9.3 erofs-utils: correct upstream version check m4: correct ptest failures ovmf: update 2021.02 -> 2021.05 apt: update 2.2.3 -> 2.2.4 util-linux: update 2.36.2 -> 2.37 cross-canadian: correct the location of pkg-config files nettle: update 3.7.2 -> 3.7.3 glib-2.0: update 2.68.2 -> 2.68.3 meson: upgrade 0.58.0 -> 0.58.1 ell: upgrade 0.40 -> 0.41 erofs-utils: upgrade 1.2.1 -> 1.3 grub: upgrade 2.04+2.06~rc1 -> 2.06 gptfdisk: upgrade 1.0.7 -> 1.0.8 connman: update 1.39 -> 1.40 libksba: upgrade 1.5.1 -> 1.6.0 libnss-mdns: upgrade 0.15 -> 0.15.1 libwpe: upgrade 1.10.0 -> 1.10.1 puzzles: upgrade to latest revision rng-tools: upgrade 6.12 -> 6.13 stress-ng: upgrade 0.12.09 -> 0.12.10 python3-magic: upgrade 0.4.23 -> 0.4.24 sudo: upgrade 1.9.7 -> 1.9.7p1 wpebackend-fdo: upgrade 1.8.4 -> 1.10.0 xkeyboard-config: upgrade 2.32 -> 2.33 bitbake.conf: enable debuginfod in native/nativesdk gdb-cross: enable debuginfod util-linux: backport a patch to address mkswap hangs selftest: do not hardcode /tmp/sdk glibc: do not enable memory tagging on aarch64 just yet mesa: enable gallium intel drivers when building for x86 Alexandre Belloni (1): runqemu: time the copy to tmpfs Alexey Brodkin (3): gcc: Fixes for ARC gdb: Add native GDB support for ARC gcc: Apply multilib fix to ARC as well Alistair Francis (3): recipes-bsp/opensbi: Disable FW_PIC recipes-bsp/u-boot: Allow deploying the u-boot DTB recipes-bsp/opensbi: Add support for specifying a device tree Anders Wallin (1): coreutils: remove NOSTAT_LEAF_OPTIMIZATION Andrea Adami (1): kernel.bbclass: fix do_sizecheck() comparison Andreas Müller (19): mesa: upgrade 21.1.1 -> 21.1.2 systemd: Add more ugly casts to fix build with musl alsa-lib: upgrade 1.2.4 -> 1.2.5 alsa-plugins: upgrade 1.2.2 -> 1.2.5 alsa-tools: upgrade 1.2.2 -> 1.2.5 alsa-topology-conf: upgrade 1.2.4 -> 1.2.5 alsa-ucm-conf: upgrade 1.2.4 -> 1.2.5 alsa-utils(-scripts): upgrade 1.2.4 -> 1.2.5 libinput: upgrade 1.17.3 -> 1.18.0 xf86-input-libinput: upgrade 0.30.0 -> 1.0.1 epiphany: upgrade 40.1 -> 40.2 vala: upgrade 0.52.3 -> 0.52.4 p11-kit: upgrade 0.23.22 -> 0.23.24 xorgproto: upgrade 2021.4.99.1 -> 2021.4.99.2 mpg123: 1.27.2 -> 1.28.0 libx11: upgrade 1.7.1 -> 1.7.2 libx11: remove CPPFLAGS_FOR_BUILD += "-D_GNU_SOURCE" libpcap: upgrade 1.10.0 -> 1.10.1 mesa: upgrade 21.1.2 -> 21.1.3 Bruce Ashfield (10): linux-yocto/5.10: update to v5.10.42 linux-yocto/5.10: temporarily revert aufs linux-yocto-dev: base AUTOREV on specified version linux-yocto/5.4: update to v5.4.124 linux-yocto/5.10: restore aufs linux-yocto/5.10: update to v5.10.43 linux-yocto/5.4: update to v5.4.125 linux-yocto/5.10: cgroup1: fix leaked context root causing sporadic NULL deref in LTP btrfs-tools: include linux/const.h to fix build with 5.12+ headers bsps/5.10: update to v5.10.43 Changqing Li (1): libjpeg-turbo: fix do_compile error on arm Chris Laplante (1): bitbake: build: warn on setting noexec/nostamp/fakeroot flag to any value besides '1' Daniel Wagenknecht (5): ref-manual: variables: update examples refering to DEPLOY_DIR_IMAGE ref-manual: variables: document IMGDEPLOYDIR ref-manual: migration-2.2: add note about IMGDEPLOYDIR ref-manual: variables: fixup example in IMAGE_CMD ref-manual: variables: fixup class reference in IMAGE_MANIFEST Joe Slater (1): tcf-agent: change license to EPL/EDL Joshua Watt (2): classes/buildhistory: Add option to strip path prefix classes/reproducible_build: Use atomic rename for SDE file Justin Bronder (1): populate_sdk_ext: copy BBMULTICONFIG files Kai Kang (1): valgrind: fix a typo Khem Raj (14): harfbuzz: Fix unused-variable warning arch-armv4: Allow -march=armv4 ffmpeg: Link in libatomic on riscv32 libssp-nonshared: Use a different implementation for __stack_chk_fail qemuriscv: Enable 4 core emulation gcompat: Add recipe musl: Do not package glibc loader musl: Set UPSTREAM_CHECK_COMMITS Revert "libgcc-initial: Do not build fp128 to decimal ppc functions" qemu: Provide float128 via hwcaps2 on ppc64le linuxloader: Be aware of riscv32 ldso linuxloader.bbclass: Add entry for ppc64 LE glibc loader gcompat: Create symlinks to glibc ldso locations sdk: Enable do_populate_sdk with multilibs Luca Boccassi (1): systemd: install new sysext tool via systemd-extra-utils Marcus Comstedt (1): conf/machine-sdk: Add ppc64 SDK machine Matt Spencer (1): systemd-conf: Prevent systemd-network from managing veth interfaces Michael Halstead (1): releases: update to include 3.1.8 Michael Opdenacker (12): bitbake: docs: Add BB_HASHSERVE definition to glossary bitbake: doc: bitbake-user-manual: fix erroneous statement in glossary intro manuals: fix epub export warnings ref-manual: move migration guides to separate document releases: clarify supported and outdated releases releases: put release number after "Release Series" sdk-manual: fix broken references migration guides: remove index reference to BB_SETSCENE_VERIFY_FUNCTION2 manuals: fix issues related to trailing dots sdk-manual: add missing quoting around "devtool upgrade" sdk-manual: fix wrong word sdk-manual: add missing index references Ming Liu (2): u-boot-tools: fix a mkimage signature issue uboot-sign.bbclass: fix some install commands Mingli Yu (2): sysstat: make the service start automatically boost: fix wrong type for mutex in regex v5 Nicolas Dechesne (3): index: remove the link/section to 'mega manual' from main page index: remove links to releases manual and index index: split releases manuals and indexes into two sections in the tree Paul Barker (2): bitbake: asyncrpc: Add ping method bitbake: asyncrpc: Reduce verbosity Quentin Schulz (6): docs: ref-manual: migration-3.0: remove reference to non-existing BB_SETSCENE_VERIFY_FUNCTION2 docs: ref-manual: variables: add missing links to terms glossary bitbake: doc: user-manual: remove mentions to BBVERSIONS bitbake: doc: user-manual: ref-manual: remove mentions to BB_SETSCENE_VERIFY_FUNCTION2 documentation: Makefile: turn warnings into errors by default docs: replace ``FOO`` by :term:`FOO` where possible Richard Purdie (11): lttng-tools: upgrade 2.12.3 -> 2.12.4 qemurunner: Try to ensure mmap'd libs are paged in qemurunner: Increase startup timeout 120 -> 300 build-appliance-image: Update to master head revision test-manual: add initial reproducible builds documentation test-manual: Add initial YP Compatible documentation README: Tweak as the website isn't really new now README: Move to using markdown as the format perf: Use python3targetconfig to ensure we use target libraries ltp: Reinstate 'hanging' tests for evaluation README.poky: Formatting and content cleanup Richard Weinberger (1): Document erofs filesystem targets Robert P. J. Day (2): ref-manual: add SRCTREECOVEREDTASKS to variable glossary ref-manual: add glossary entry for NON_MULTILIB_RECIPES Ross Burton (11): mx: remove from Openembedded Core core-image-weston: remove Clutter examples Remove Clutter and Cogl oeqa: remove Clutter usage meta-poky: remove clutter references Remove Clutter references gcc: enable branch protection by standard image_types: add zsync conversions avahi: apply fix for CVE-2021-3468 qemu: fix virtio vhost-user-gpu CVEs gcc: replace gdb helper install revert with the upstream fix Sakib Sajal (3): oeqa/core/target/qemu.py: display contents of dumped files oe-time-dd-test.sh: improve output formatting oe-time-dd-test.sh: add iostat command Saul Wold (1): qemurunner: add second qmp port Scott Weaver (1): bitbake: fetch2: add check for empty SRC_URI hash string Tim Orling (8): maintainers.inc: update email address python3-scons: upgrade 3.1.2 -> 4.1.0; simplify python3-hypothesis: upgrade 6.13.7 -> 6.13.14 at-spi2-core: upgrade 2.40.1 -> 2.40.2 python3-importlib-metadata: upgrade 4.4.0 -> 4.5.0 python3-manifest: add statistics subpackage python3-hypothesis: upgrade 6.13.14 -> 6.14.0 python3: skip tests requiring tools-sdk Tony Battersby (1): glibc: fix path to place zdump in the tzcode package Tony Tascioglu (3): valgrind: Improve non-deterministic ptest reliability valgrind: remove buggy ptest from arm64 valgrind: Actually install list of non-deterministic ptests hongxu (1): nativesdk-libdnf: fix installed and not shipped files wangmy (21): cmake: upgrade 3.20.2 -> 3.20.3 mtools: upgrade 4.0.27 -> 4.0.29 python3-magic: upgrade 0.4.22 -> 0.4.23 less: upgrade 586 -> 589 python3-libarchive-c: upgrade 3.0 -> 3.1 diffoscope: upgrade 175 -> 177 dtc: upgrade 1.6.0 -> 1.6.1 git: upgrade 2.31.1 -> 2.32.0 gnutls: upgrade 3.7.1 -> 3.7.2 go: upgrade 1.16.4 -> 1.16.5 less: upgrade 589 -> 590 ethtool: upgrade 5.10 -> 5.12 m4: upgrade 1.4.18 -> 1.4.19 alsa-lib: upgrade 1.2.5 -> 1.2.5.1 alsa-utils: upgrade 1.2.5 -> 1.2.5.1 alsa-topology-conf: upgrade 1.2.5 -> 1.2.5.1 alsa-ucm-conf: upgrade 1.2.5 -> 1.2.5.1 blktrace: upgrade 1.2.0 -> 1.3.0 enchant2: upgrade 2.2.15 -> 2.3.0 librepo: upgrade 1.14.0 -> 1.14.1 createrepo-c: upgrade 0.17.2 -> 0.17.3 zangrc (1): python3-pycairo: upgrade 1.20.0 -> 1.20.1 zhengruoqin (6): python3-importlib-metadata: upgrade 4.3.0 -> 4.4.0 libogg: upgrade 1.3.4 -> 1.3.5 liburcu: upgrade 0.12.2 -> 0.13.0 libcomps: upgrade 0.1.16 -> 0.1.17 python3-dbusmock: upgrade 0.23.0 -> 0.23.1 nfs-utils: upgrade 2.5.3 -> 2.5.4 Signed-off-by: Andrew Geissler Change-Id: Iac124e214336beb9cab7fb3b67a6968d4e34d06f --- .../0001-fts-remove-NOSTAT_LEAF_OPTIMIZATION.patch | 167 +++++++++++ poky/meta/recipes-core/coreutils/coreutils_8.32.bb | 1 + poky/meta/recipes-core/ell/ell_0.40.bb | 24 -- poky/meta/recipes-core/ell/ell_0.41.bb | 24 ++ .../glib-2.0/glib-2.0/relocate-modules.patch | 2 +- poky/meta/recipes-core/glib-2.0/glib-2.0_2.68.2.bb | 54 ---- poky/meta/recipes-core/glib-2.0/glib-2.0_2.68.3.bb | 54 ++++ poky/meta/recipes-core/glibc/glibc-package.inc | 2 +- poky/meta/recipes-core/glibc/glibc_2.33.bb | 2 +- .../images/build-appliance-image_15.0.0.bb | 2 +- poky/meta/recipes-core/musl/gcompat_git.bb | 54 ++++ poky/meta/recipes-core/musl/libssp-nonshared.bb | 11 +- .../recipes-core/musl/libssp-nonshared/ssp-local.c | 45 --- .../recipes-core/musl/libssp-nonshared/stack_chk.c | 40 +++ poky/meta/recipes-core/musl/musl_git.bb | 6 +- ...0001-ovmf-update-path-to-native-BaseTools.patch | 7 +- ...makefile-adjust-to-build-in-under-bitbake.patch | 11 +- .../ovmf/ovmf/0003-ovmf-Update-to-latest.patch | 45 +++ .../ovmf/ovmf/0004-Strip-build-paths.patch | 32 ++ .../ovmf/ovmf/0004-ovmf-Update-to-latest.patch | 46 --- .../ovmf/ovmf/0005-debug-prefix-map.patch | 104 +++++++ .../recipes-core/ovmf/ovmf/0006-reproducible.patch | 180 +++++++++++ .../recipes-core/ovmf/ovmf/debug_prefix_map.patch | 93 ------ .../meta/recipes-core/ovmf/ovmf/reproducible.patch | 165 ---------- poky/meta/recipes-core/ovmf/ovmf/zero.patch | 84 ------ poky/meta/recipes-core/ovmf/ovmf_git.bb | 12 +- .../systemd/systemd-conf/wired.network | 1 + .../0010-Use-uintmax_t-for-handling-rlim_t.patch | 11 +- poky/meta/recipes-core/systemd/systemd_248.3.bb | 1 + .../util-linux/util-linux-libuuid_2.36.2.bb | 16 - .../util-linux/util-linux-libuuid_2.37.bb | 16 + poky/meta/recipes-core/util-linux/util-linux.inc | 4 +- .../8a3a74160b96498d672e3652827aa7e6d7f3a120.patch | 29 ++ ...e-EXTRA_LTLIBRARIES-instead-of-noinst_LTL.patch | 49 --- .../util-linux/avoid_parallel_tests.patch | 27 +- .../recipes-core/util-linux/util-linux/ptest.patch | 15 +- .../recipes-core/util-linux/util-linux_2.36.2.bb | 332 --------------------- .../recipes-core/util-linux/util-linux_2.37.bb | 302 +++++++++++++++++++ 38 files changed, 1114 insertions(+), 956 deletions(-) create mode 100644 poky/meta/recipes-core/coreutils/coreutils/0001-fts-remove-NOSTAT_LEAF_OPTIMIZATION.patch delete mode 100644 poky/meta/recipes-core/ell/ell_0.40.bb create mode 100644 poky/meta/recipes-core/ell/ell_0.41.bb delete mode 100644 poky/meta/recipes-core/glib-2.0/glib-2.0_2.68.2.bb create mode 100644 poky/meta/recipes-core/glib-2.0/glib-2.0_2.68.3.bb create mode 100644 poky/meta/recipes-core/musl/gcompat_git.bb delete mode 100644 poky/meta/recipes-core/musl/libssp-nonshared/ssp-local.c create mode 100644 poky/meta/recipes-core/musl/libssp-nonshared/stack_chk.c create mode 100644 poky/meta/recipes-core/ovmf/ovmf/0003-ovmf-Update-to-latest.patch create mode 100644 poky/meta/recipes-core/ovmf/ovmf/0004-Strip-build-paths.patch delete mode 100644 poky/meta/recipes-core/ovmf/ovmf/0004-ovmf-Update-to-latest.patch create mode 100644 poky/meta/recipes-core/ovmf/ovmf/0005-debug-prefix-map.patch create mode 100644 poky/meta/recipes-core/ovmf/ovmf/0006-reproducible.patch delete mode 100644 poky/meta/recipes-core/ovmf/ovmf/debug_prefix_map.patch delete mode 100644 poky/meta/recipes-core/ovmf/ovmf/reproducible.patch delete mode 100644 poky/meta/recipes-core/ovmf/ovmf/zero.patch delete mode 100644 poky/meta/recipes-core/util-linux/util-linux-libuuid_2.36.2.bb create mode 100644 poky/meta/recipes-core/util-linux/util-linux-libuuid_2.37.bb create mode 100644 poky/meta/recipes-core/util-linux/util-linux/8a3a74160b96498d672e3652827aa7e6d7f3a120.patch delete mode 100644 poky/meta/recipes-core/util-linux/util-linux/Automake-use-EXTRA_LTLIBRARIES-instead-of-noinst_LTL.patch delete mode 100644 poky/meta/recipes-core/util-linux/util-linux_2.36.2.bb create mode 100644 poky/meta/recipes-core/util-linux/util-linux_2.37.bb (limited to 'poky/meta/recipes-core') diff --git a/poky/meta/recipes-core/coreutils/coreutils/0001-fts-remove-NOSTAT_LEAF_OPTIMIZATION.patch b/poky/meta/recipes-core/coreutils/coreutils/0001-fts-remove-NOSTAT_LEAF_OPTIMIZATION.patch new file mode 100644 index 000000000..06b6307da --- /dev/null +++ b/poky/meta/recipes-core/coreutils/coreutils/0001-fts-remove-NOSTAT_LEAF_OPTIMIZATION.patch @@ -0,0 +1,167 @@ +From 3a48610860a9a75692d2cbedde69ac15269d540a Mon Sep 17 00:00:00 2001 +Message-Id: <3a48610860a9a75692d2cbedde69ac15269d540a.1624302273.git.wallinux@gmail.com> +From: Paul Eggert +Date: Wed, 15 Apr 2020 20:50:32 -0700 +Subject: [PATCH] fts: remove NOSTAT_LEAF_OPTIMIZATION +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +It caused ‘find’ and ‘du’ to dump core, and it was useful +only for obsolescent Linux filesystems anyway. Problem reported in: +https://lists.gnu.org/r/bug-gnulib/2020-04/msg00068.html +Quite possibly there is still a serious underlying fts bug with +tight-loop-check and mutating file systems, but if so this patch +should cause the bug to be triggered less often. +* lib/fts.c (enum leaf_optimization): Remove +NOSTAT_LEAF_OPTIMIZATION, as it’s problematic. +(S_MAGIC_REISERFS, S_MAGIC_XFS): Remove; no longer needed. +(leaf_optimization): Remove special cases for ReiserFS and XFS. +(fts_read): Remove NOSTAT_LEAF_OPTIMIZATION code. +* lib/fts_.h (struct _ftsent.fts_n_dirs_remaining): +Remove. All uses removed. + +Upstream-Status: Backport [upstream gnulib commit: +47bf2cf3184027c1eb9c1dfeea5c5b8b2d69710d] + +Signed-off-by: Anders Wallin +--- + lib/fts.c | 56 ++++++++---------------------------------------------- + lib/fts_.h | 5 ----- + 2 files changed, 8 insertions(+), 53 deletions(-) + +diff --git a/lib/fts.c b/lib/fts.c +index d3a0472..ade8c33 100644 +--- a/lib/fts.c ++++ b/lib/fts.c +@@ -445,7 +445,6 @@ fts_open (char * const *argv, + if ((parent = fts_alloc(sp, "", 0)) == NULL) + goto mem2; + parent->fts_level = FTS_ROOTPARENTLEVEL; +- parent->fts_n_dirs_remaining = -1; + } + + /* The classic fts implementation would call fts_stat with +@@ -634,9 +633,8 @@ fts_close (FTS *sp) + } + + /* Minimum link count of a traditional Unix directory. When leaf +- optimization is OK and MIN_DIR_NLINK <= st_nlink, then st_nlink is +- an upper bound on the number of subdirectories (counting "." and +- ".."). */ ++ optimization is OK and a directory's st_nlink == MIN_DIR_NLINK, ++ then the directory has no subdirectories. */ + enum { MIN_DIR_NLINK = 2 }; + + /* Whether leaf optimization is OK for a directory. */ +@@ -645,12 +643,8 @@ enum leaf_optimization + /* st_nlink is not reliable for this directory's subdirectories. */ + NO_LEAF_OPTIMIZATION, + +- /* Leaf optimization is OK, but is not useful for avoiding stat calls. */ +- OK_LEAF_OPTIMIZATION, +- +- /* Leaf optimization is not only OK: it is useful for avoiding +- stat calls, because dirent.d_type does not work. */ +- NOSTAT_LEAF_OPTIMIZATION ++ /* st_nlink == 2 means the directory lacks subdirectories. */ ++ OK_LEAF_OPTIMIZATION + }; + + #if (defined __linux__ || defined __ANDROID__) \ +@@ -663,9 +657,7 @@ enum leaf_optimization + # define S_MAGIC_CIFS 0xFF534D42 + # define S_MAGIC_NFS 0x6969 + # define S_MAGIC_PROC 0x9FA0 +-# define S_MAGIC_REISERFS 0x52654973 + # define S_MAGIC_TMPFS 0x1021994 +-# define S_MAGIC_XFS 0x58465342 + + # ifdef HAVE___FSWORD_T + typedef __fsword_t fsword; +@@ -782,23 +774,15 @@ dirent_inode_sort_may_be_useful (FTSENT const *p, int dir_fd) + } + + /* Given an FTS entry P for a directory with descriptor DIR_FD, +- return true if it is both useful and valid to apply leaf optimization. +- The optimization is useful only for file systems that lack usable +- dirent.d_type info. The optimization is valid if an st_nlink value +- of at least MIN_DIR_NLINK is an upper bound on the number of +- subdirectories of D, counting "." and ".." as subdirectories. ++ return whether it is valid to apply leaf optimization. ++ The optimization is valid if a directory's st_nlink value equal ++ to MIN_DIR_NLINK means the directory has no subdirectories. + DIR_FD is negative if unavailable. */ + static enum leaf_optimization + leaf_optimization (FTSENT const *p, int dir_fd) + { + switch (filesystem_type (p, dir_fd)) + { +- /* List here the file system types that may lack usable dirent.d_type +- info, yet for which the optimization does apply. */ +- case S_MAGIC_REISERFS: +- case S_MAGIC_XFS: /* XFS lacked it until 2013-08-22 commit. */ +- return NOSTAT_LEAF_OPTIMIZATION; +- + case 0: + /* Leaf optimization is unsafe if the file system type is unknown. */ + FALLTHROUGH; +@@ -1023,26 +1007,7 @@ check_for_dir: + if (p->fts_info == FTS_NSOK) + { + if (p->fts_statp->st_size == FTS_STAT_REQUIRED) +- { +- FTSENT *parent = p->fts_parent; +- if (parent->fts_n_dirs_remaining == 0 +- && ISSET(FTS_NOSTAT) +- && ISSET(FTS_PHYSICAL) +- && (leaf_optimization (parent, sp->fts_cwd_fd) +- == NOSTAT_LEAF_OPTIMIZATION)) +- { +- /* nothing more needed */ +- } +- else +- { +- p->fts_info = fts_stat(sp, p, false); +- if (S_ISDIR(p->fts_statp->st_mode) +- && p->fts_level != FTS_ROOTLEVEL +- && 0 < parent->fts_n_dirs_remaining +- && parent->fts_n_dirs_remaining != (nlink_t) -1) +- parent->fts_n_dirs_remaining--; +- } +- } ++ p->fts_info = fts_stat(sp, p, false); + else + fts_assert (p->fts_statp->st_size == FTS_NO_STAT_REQUIRED); + } +@@ -1826,11 +1791,6 @@ err: memset(sbp, 0, sizeof(struct stat)); + } + + if (S_ISDIR(sbp->st_mode)) { +- p->fts_n_dirs_remaining +- = ((sbp->st_nlink < MIN_DIR_NLINK +- || p->fts_level <= FTS_ROOTLEVEL) +- ? -1 +- : sbp->st_nlink - (ISSET (FTS_SEEDOT) ? 0 : MIN_DIR_NLINK)); + if (ISDOT(p->fts_name)) { + /* Command-line "." and ".." are real directories. */ + return (p->fts_level == FTS_ROOTLEVEL ? FTS_D : FTS_DOT); +diff --git a/lib/fts_.h b/lib/fts_.h +index 6c7d0ce..15c248c 100644 +--- a/lib/fts_.h ++++ b/lib/fts_.h +@@ -219,11 +219,6 @@ typedef struct _ftsent { + + size_t fts_namelen; /* strlen(fts_name) */ + +- /* If not (nlink_t) -1, an upper bound on the number of +- remaining subdirectories of interest. If this becomes +- zero, some work can be avoided. */ +- nlink_t fts_n_dirs_remaining; +- + # define FTS_D 1 /* preorder directory */ + # define FTS_DC 2 /* directory that causes cycles */ + # define FTS_DEFAULT 3 /* none of the above */ +-- +2.32.0 + diff --git a/poky/meta/recipes-core/coreutils/coreutils_8.32.bb b/poky/meta/recipes-core/coreutils/coreutils_8.32.bb index f3fe31fd3..dd271d496 100644 --- a/poky/meta/recipes-core/coreutils/coreutils_8.32.bb +++ b/poky/meta/recipes-core/coreutils/coreutils_8.32.bb @@ -21,6 +21,7 @@ SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz \ file://0001-local.mk-fix-cross-compiling-problem.patch \ file://run-ptest \ file://0001-ls-restore-8.31-behavior-on-removed-directories.patch \ + file://0001-fts-remove-NOSTAT_LEAF_OPTIMIZATION.patch \ " SRC_URI[md5sum] = "022042695b7d5bcf1a93559a9735e668" diff --git a/poky/meta/recipes-core/ell/ell_0.40.bb b/poky/meta/recipes-core/ell/ell_0.40.bb deleted file mode 100644 index d08867622..000000000 --- a/poky/meta/recipes-core/ell/ell_0.40.bb +++ /dev/null @@ -1,24 +0,0 @@ -SUMMARY = "Embedded Linux Library" -HOMEPAGE = "https://01.org/ell" -DESCRIPTION = "The Embedded Linux Library (ELL) provides core, \ -low-level functionality for system daemons. It typically has no \ -dependencies other than the Linux kernel, C standard library, and \ -libdl (for dynamic linking). While ELL is designed to be efficient \ -and compact enough for use on embedded Linux platforms, it is not \ -limited to resource-constrained systems." -SECTION = "libs" -LICENSE = "LGPLv2.1" -LIC_FILES_CHKSUM = "file://COPYING;md5=fb504b67c50331fc78734fed90fb0e09" - -DEPENDS = "dbus" - -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] = "b9bf5c14f2963591ea1372049c05646919a9ed46fcee5cd11ede1022c99ffbbd" - -do_configure_prepend () { - mkdir -p ${S}/build-aux -} diff --git a/poky/meta/recipes-core/ell/ell_0.41.bb b/poky/meta/recipes-core/ell/ell_0.41.bb new file mode 100644 index 000000000..5fd3077bc --- /dev/null +++ b/poky/meta/recipes-core/ell/ell_0.41.bb @@ -0,0 +1,24 @@ +SUMMARY = "Embedded Linux Library" +HOMEPAGE = "https://01.org/ell" +DESCRIPTION = "The Embedded Linux Library (ELL) provides core, \ +low-level functionality for system daemons. It typically has no \ +dependencies other than the Linux kernel, C standard library, and \ +libdl (for dynamic linking). While ELL is designed to be efficient \ +and compact enough for use on embedded Linux platforms, it is not \ +limited to resource-constrained systems." +SECTION = "libs" +LICENSE = "LGPLv2.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=fb504b67c50331fc78734fed90fb0e09" + +DEPENDS = "dbus" + +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" + +do_configure_prepend () { + mkdir -p ${S}/build-aux +} diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch b/poky/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch index 7fbc07af5..f34f30bb3 100644 --- a/poky/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch +++ b/poky/meta/recipes-core/glib-2.0/glib-2.0/relocate-modules.patch @@ -1,4 +1,4 @@ -From b7abbba886d3743616f8cc0e8b441c879128bbda Mon Sep 17 00:00:00 2001 +From e56cdb8c343dd6a6ed3b10bd54e353d633ad6158 Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Fri, 11 Mar 2016 15:35:55 +0000 Subject: [PATCH] glib-2.0: relocate the GIO module directory for native builds diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0_2.68.2.bb b/poky/meta/recipes-core/glib-2.0/glib-2.0_2.68.2.bb deleted file mode 100644 index 0cf16884e..000000000 --- a/poky/meta/recipes-core/glib-2.0/glib-2.0_2.68.2.bb +++ /dev/null @@ -1,54 +0,0 @@ -require glib.inc - -PE = "1" - -SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}" - -SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \ - file://run-ptest \ - file://0001-Fix-DATADIRNAME-on-uclibc-Linux.patch \ - file://Enable-more-tests-while-cross-compiling.patch \ - file://0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch \ - file://0001-Install-gio-querymodules-as-libexec_PROGRAM.patch \ - file://0001-Do-not-ignore-return-value-of-write.patch \ - file://0010-Do-not-hardcode-python-path-into-various-tools.patch \ - file://0001-Set-host_machine-correctly-when-building-with-mingw3.patch \ - file://0001-Do-not-write-bindir-into-pkg-config-files.patch \ - file://0001-meson-Run-atomics-test-on-clang-as-well.patch \ - file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \ - file://0001-gio-tests-codegen.py-bump-timeout-to-100-seconds.patch \ - " -SRC_URI_append_class-native = " file://relocate-modules.patch" - -SRC_URI[sha256sum] = "ecc7798a9cc034eabdfd7f246e6dd461cdbf1175fcc2e9867cc7da7b7309e0fb" - -# Find any meson cross files in FILESPATH that are relevant for the current -# build (using siteinfo) and add them to EXTRA_OEMESON. -inherit siteinfo -def find_meson_cross_files(d): - if bb.data.inherits_class('native', d): - return "" - - thisdir = os.path.normpath(d.getVar("THISDIR")) - import collections - sitedata = siteinfo_data(d) - # filename -> found - files = collections.OrderedDict() - for path in d.getVar("FILESPATH").split(":"): - for element in sitedata: - filename = os.path.normpath(os.path.join(path, "meson.cross.d", element)) - sanitized_path = filename.replace(thisdir, "${THISDIR}") - if sanitized_path == filename: - if os.path.exists(filename): - bb.error("Cannot add '%s' to --cross-file, because it's not relative to THISDIR '%s' and sstate signature would contain this full path" % (filename, thisdir)) - continue - files[filename.replace(thisdir, "${THISDIR}")] = os.path.exists(filename) - - items = ["--cross-file=" + k for k,v in files.items() if v] - d.appendVar("EXTRA_OEMESON", " " + " ".join(items)) - items = ["%s:%s" % (k, "True" if v else "False") for k,v in files.items()] - d.appendVarFlag("do_configure", "file-checksums", " " + " ".join(items)) - -python () { - find_meson_cross_files(d) -} diff --git a/poky/meta/recipes-core/glib-2.0/glib-2.0_2.68.3.bb b/poky/meta/recipes-core/glib-2.0/glib-2.0_2.68.3.bb new file mode 100644 index 000000000..2a3a00fad --- /dev/null +++ b/poky/meta/recipes-core/glib-2.0/glib-2.0_2.68.3.bb @@ -0,0 +1,54 @@ +require glib.inc + +PE = "1" + +SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}" + +SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \ + file://run-ptest \ + file://0001-Fix-DATADIRNAME-on-uclibc-Linux.patch \ + file://Enable-more-tests-while-cross-compiling.patch \ + file://0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch \ + file://0001-Install-gio-querymodules-as-libexec_PROGRAM.patch \ + file://0001-Do-not-ignore-return-value-of-write.patch \ + file://0010-Do-not-hardcode-python-path-into-various-tools.patch \ + file://0001-Set-host_machine-correctly-when-building-with-mingw3.patch \ + file://0001-Do-not-write-bindir-into-pkg-config-files.patch \ + file://0001-meson-Run-atomics-test-on-clang-as-well.patch \ + file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \ + file://0001-gio-tests-codegen.py-bump-timeout-to-100-seconds.patch \ + " +SRC_URI_append_class-native = " file://relocate-modules.patch" + +SRC_URI[sha256sum] = "e7e1a3c20c026109c45c9ec4a31d8dcebc22e86c69486993e565817d64be3138" + +# Find any meson cross files in FILESPATH that are relevant for the current +# build (using siteinfo) and add them to EXTRA_OEMESON. +inherit siteinfo +def find_meson_cross_files(d): + if bb.data.inherits_class('native', d): + return "" + + thisdir = os.path.normpath(d.getVar("THISDIR")) + import collections + sitedata = siteinfo_data(d) + # filename -> found + files = collections.OrderedDict() + for path in d.getVar("FILESPATH").split(":"): + for element in sitedata: + filename = os.path.normpath(os.path.join(path, "meson.cross.d", element)) + sanitized_path = filename.replace(thisdir, "${THISDIR}") + if sanitized_path == filename: + if os.path.exists(filename): + bb.error("Cannot add '%s' to --cross-file, because it's not relative to THISDIR '%s' and sstate signature would contain this full path" % (filename, thisdir)) + continue + files[filename.replace(thisdir, "${THISDIR}")] = os.path.exists(filename) + + items = ["--cross-file=" + k for k,v in files.items() if v] + d.appendVar("EXTRA_OEMESON", " " + " ".join(items)) + items = ["%s:%s" % (k, "True" if v else "False") for k,v in files.items()] + d.appendVarFlag("do_configure", "file-checksums", " " + " ".join(items)) + +python () { + find_meson_cross_files(d) +} diff --git a/poky/meta/recipes-core/glibc/glibc-package.inc b/poky/meta/recipes-core/glibc/glibc-package.inc index c3d0d9152..92e5dbac6 100644 --- a/poky/meta/recipes-core/glibc/glibc-package.inc +++ b/poky/meta/recipes-core/glibc/glibc-package.inc @@ -43,7 +43,7 @@ FILES_${PN}-staticdev += "${libdir}/*.a ${base_libdir}/*.a" FILES_nscd = "${sbindir}/nscd* ${sysconfdir}/init.d/nscd ${systemd_unitdir}/system/nscd* ${sysconfdir}/tmpfiles.d/nscd.conf \ ${sysconfdir}/nscd.conf ${sysconfdir}/default/volatiles/98_nscd ${localstatedir}/db/nscd" FILES_${PN}-mtrace = "${bindir}/mtrace" -FILES_tzcode = "${bindir}/tzselect ${sbindir}/zic ${sbindir}/zdump" +FILES_tzcode = "${bindir}/tzselect ${sbindir}/zic ${bindir}/zdump" FILES_${PN}-utils = "${bindir}/* ${sbindir}/*" FILES_catchsegv = "${bindir}/catchsegv" RDEPENDS_catchsegv = "libsegfault" diff --git a/poky/meta/recipes-core/glibc/glibc_2.33.bb b/poky/meta/recipes-core/glibc/glibc_2.33.bb index b70cd0978..caa2e2ae1 100644 --- a/poky/meta/recipes-core/glibc/glibc_2.33.bb +++ b/poky/meta/recipes-core/glibc/glibc_2.33.bb @@ -90,10 +90,10 @@ EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}" EXTRA_OECONF_append_x86 = " --enable-cet" EXTRA_OECONF_append_x86-64 = " --enable-cet" -EXTRA_OECONF_append_aarch64 = " --enable-memory-tagging" PACKAGECONFIG ??= "nscd" PACKAGECONFIG[nscd] = "--enable-nscd,--disable-nscd" +PACKAGECONFIG[memory-tagging] = "--enable-memory-tagging,--disable-memory-tagging" do_patch_append() { bb.build.exec_func('do_fix_readlib_c', d) diff --git a/poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb b/poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb index 1aeb952db..32f8d16a4 100644 --- a/poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb +++ b/poky/meta/recipes-core/images/build-appliance-image_15.0.0.bb @@ -24,7 +24,7 @@ IMAGE_FSTYPES = "wic.vmdk wic.vhd wic.vhdx" inherit core-image setuptools3 -SRCREV ?= "42514ade8bdb9502f49a56752561f6c2e9f23348" +SRCREV ?= "b44849c32c87fbb8c5a465ecc29a6182e6781d78" SRC_URI = "git://git.yoctoproject.org/poky \ file://Yocto_Build_Appliance.vmx \ file://Yocto_Build_Appliance.vmxf \ diff --git a/poky/meta/recipes-core/musl/gcompat_git.bb b/poky/meta/recipes-core/musl/gcompat_git.bb new file mode 100644 index 000000000..863ba8dbf --- /dev/null +++ b/poky/meta/recipes-core/musl/gcompat_git.bb @@ -0,0 +1,54 @@ +# Copyright (C) 2021 Khem Raj +# Released under the MIT license (see COPYING.MIT for the terms) + +SUMMARY = "A library which provides glibc-compatible APIs for use on musl libc systems" +HOMEPAGE = "https://git.adelielinux.org/adelie/gcompat" + +LICENSE = "NCSA" +LIC_FILES_CHKSUM = "file://LICENSE;md5=eb33ef4af05a9c7602843afb7adfe792" + +SRC_URI = "git://git.adelielinux.org/adelie/gcompat.git;protocol=https;branch=current" + +PV = "1.0.0+1.1+git${SRCPV}" +SRCREV = "af5a49e489fdc04b9cf02547650d7aeaccd43793" + +S = "${WORKDIR}/git" + +inherit pkgconfig linuxloader siteinfo + +DEPENDS += "musl-obstack" + +GLIBC_LDSO = "${@get_glibc_loader(d)}" +MUSL_LDSO = "${@get_musl_loader(d)}" + +EXTRA_OEMAKE = "LINKER_PATH=${MUSL_LDSO} \ + LOADER_NAME=`basename ${GLIBC_LDSO}` \ + " + +do_configure () { + : +} + +do_compile () { + oe_runmake +} + +do_install () { + oe_runmake install 'DESTDIR=${D}' + if [ "${SITEINFO_BITS}" = "64" ]; then + install -d ${D}/lib64 + lnr ${D}${GLIBC_LDSO} ${D}/lib64/`basename ${GLIBC_LDSO}` + fi +} + +FILES_${PN} += "/lib64" + +INSANE_SKIP_${PN} = "libdir" + +RPROVIDES_${PN} += "musl-glibc-compat" +# +# We will skip parsing for non-musl systems +# +COMPATIBLE_HOST = ".*-musl.*" + +UPSTREAM_CHECK_COMMITS = "1" diff --git a/poky/meta/recipes-core/musl/libssp-nonshared.bb b/poky/meta/recipes-core/musl/libssp-nonshared.bb index bae8c81cc..81c87e8e8 100644 --- a/poky/meta/recipes-core/musl/libssp-nonshared.bb +++ b/poky/meta/recipes-core/musl/libssp-nonshared.bb @@ -2,11 +2,12 @@ # Released under the MIT license (see COPYING.MIT for the terms) SUMMARY = "Minimal libssp_nonshared.a must needed for ssp to work with gcc on musl" -LICENSE = "GPL-3.0-with-GCC-exception" -LIC_FILES_CHKSUM = "file://ssp-local.c;beginline=1;endline=32;md5=c06d391208c0cfcbc541a6728ed65cc4" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://stack_chk.c;beginline=1;endline=30;md5=97e59d9deee678a9332c9ddb2ab6360d" SECTION = "libs" -SRC_URI = "file://ssp-local.c" +# Sourced from https://github.com/intel/linux-sgx/blob/master/sdk/compiler-rt/stack_chk.c +SRC_URI = "file://stack_chk.c" INHIBIT_DEFAULT_DEPS = "1" @@ -19,8 +20,8 @@ do_configure[noexec] = "1" S = "${WORKDIR}" do_compile() { - ${CC} ${CPPFLAGS} ${CFLAGS} -fPIE -c ssp-local.c -o ssp-local.o - ${AR} r libssp_nonshared.a ssp-local.o + ${CC} ${CPPFLAGS} ${CFLAGS} -fPIE -c stack_chk.c -o stack_chk.o + ${AR} r libssp_nonshared.a stack_chk.o } do_install() { install -Dm 0644 ${B}/libssp_nonshared.a ${D}${base_libdir}/libssp_nonshared.a diff --git a/poky/meta/recipes-core/musl/libssp-nonshared/ssp-local.c b/poky/meta/recipes-core/musl/libssp-nonshared/ssp-local.c deleted file mode 100644 index 8f51afa2c..000000000 --- a/poky/meta/recipes-core/musl/libssp-nonshared/ssp-local.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Stack protector support. - Copyright (C) 2005-2018 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free -Software Foundation; either version 3, or (at your option) any later -version. - -In addition to the permissions in the GNU General Public License, the -Free Software Foundation gives you unlimited permission to link the -compiled version of this file into combinations with other programs, -and to distribute those combinations without any restriction coming -from the use of this file. (The General Public License restrictions -do apply in other respects; for example, they cover modification of -the file, and distribution when not linked into a combine -executable.) - -GCC is distributed in the hope that it will be useful, but WITHOUT ANY -WARRANTY; without even the implied warranty of MERCHANTABILITY or -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -for more details. - -Under Section 7 of GPL version 3, you are granted additional -permissions described in the GCC Runtime Library Exception, version -3.1, as published by the Free Software Foundation. - -You should have received a copy of the GNU General Public License and -a copy of the GCC Runtime Library Exception along with this program; -see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -. */ - -extern void __stack_chk_fail (void); - -/* Some targets can avoid loading a GP for calls to hidden functions. - Using this entry point may avoid the load of a GP entirely for the - function, making the overall code smaller. */ - -void -__attribute__((visibility ("hidden"))) -__stack_chk_fail_local (void) -{ - __stack_chk_fail (); -} diff --git a/poky/meta/recipes-core/musl/libssp-nonshared/stack_chk.c b/poky/meta/recipes-core/musl/libssp-nonshared/stack_chk.c new file mode 100644 index 000000000..097aae24b --- /dev/null +++ b/poky/meta/recipes-core/musl/libssp-nonshared/stack_chk.c @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2011-2021 Intel Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +extern void __attribute__((noreturn)) __stack_chk_fail(void); + +void +__attribute__((noreturn)) +__attribute__((visibility ("hidden"))) +__stack_chk_fail_local (void) +{ + __stack_chk_fail (); +} diff --git a/poky/meta/recipes-core/musl/musl_git.bb b/poky/meta/recipes-core/musl/musl_git.bb index 795b888bb..bd9d5f1d4 100644 --- a/poky/meta/recipes-core/musl/musl_git.bb +++ b/poky/meta/recipes-core/musl/musl_git.bb @@ -68,13 +68,9 @@ do_install() { echo "${libdir}" >> ${D}${sysconfdir}/ld-musl-${MUSL_LDSO_ARCH}.path rm -f ${D}${bindir}/ldd ${D}${GLIBC_LDSO} lnr ${D}${libdir}/libc.so ${D}${bindir}/ldd - lnr ${D}${libdir}/libc.so ${D}${GLIBC_LDSO} } -PACKAGES =+ "${PN}-glibc-compat" - FILES_${PN} += "/lib/ld-musl-${MUSL_LDSO_ARCH}.so.1 ${sysconfdir}/ld-musl-${MUSL_LDSO_ARCH}.path" -FILES_${PN}-glibc-compat += "${GLIBC_LDSO}" FILES_${PN}-staticdev = "${libdir}/libc.a" FILES_${PN}-dev =+ "${libdir}/libcrypt.a ${libdir}/libdl.a ${libdir}/libm.a \ ${libdir}/libpthread.a ${libdir}/libresolv.a \ @@ -88,3 +84,5 @@ RPROVIDES_${PN} += "ldd libsegfault rtld(GNU_HASH)" LEAD_SONAME = "libc.so" INSANE_SKIP_${PN}-dev = "staticdev" INSANE_SKIP_${PN} = "libdir" + +UPSTREAM_CHECK_COMMITS = "1" diff --git a/poky/meta/recipes-core/ovmf/ovmf/0001-ovmf-update-path-to-native-BaseTools.patch b/poky/meta/recipes-core/ovmf/ovmf/0001-ovmf-update-path-to-native-BaseTools.patch index c32963a80..89d9ffab5 100644 --- a/poky/meta/recipes-core/ovmf/ovmf/0001-ovmf-update-path-to-native-BaseTools.patch +++ b/poky/meta/recipes-core/ovmf/ovmf/0001-ovmf-update-path-to-native-BaseTools.patch @@ -1,7 +1,7 @@ -From 200ff35c6545b4ab85f5ea7a6096fbaec3d82f6d Mon Sep 17 00:00:00 2001 +From 1125f5a02c2f327aeffe2d6b66a9d816ad2eeec0 Mon Sep 17 00:00:00 2001 From: Ricardo Neri Date: Thu, 9 Jun 2016 02:23:01 -0700 -Subject: [PATCH 1/4] ovmf: update path to native BaseTools +Subject: [PATCH 1/6] ovmf: update path to native BaseTools BaseTools is a set of utilities to build EDK-based firmware. These utilities are used during the build process. Thus, they need to be built natively. @@ -11,7 +11,6 @@ with the appropriate location before building. Signed-off-by: Ricardo Neri Upstream-Status: Pending - --- OvmfPkg/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) @@ -30,5 +29,5 @@ index 91b1442ade..1858dae31a 100755 source edksetup.sh BaseTools else -- -2.28.0 +2.32.0 diff --git a/poky/meta/recipes-core/ovmf/ovmf/0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch b/poky/meta/recipes-core/ovmf/ovmf/0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch index c61a08f02..f6141c8af 100644 --- a/poky/meta/recipes-core/ovmf/ovmf/0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch +++ b/poky/meta/recipes-core/ovmf/ovmf/0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch @@ -1,23 +1,22 @@ -From 667c0cf97dadc4f5994d26ec3984f559a05ec406 Mon Sep 17 00:00:00 2001 +From 19d4c7f9812062a683b3ba60b35aac0461190456 Mon Sep 17 00:00:00 2001 From: Ricardo Neri Date: Fri, 26 Jul 2019 17:34:26 -0400 -Subject: [PATCH 2/4] BaseTools: makefile: adjust to build in under bitbake +Subject: [PATCH 2/6] BaseTools: makefile: adjust to build in under bitbake Prepend the build flags with those of bitbake. This is to build using the bitbake native sysroot include and library directories. Signed-off-by: Ricardo Neri Upstream-Status: Pending - --- BaseTools/Source/C/Makefiles/header.makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile -index 1c105ee7d4..d5eea3864e 100644 +index 0df728f327..1299d47c87 100644 --- a/BaseTools/Source/C/Makefiles/header.makefile +++ b/BaseTools/Source/C/Makefiles/header.makefile -@@ -69,35 +69,36 @@ $(error Bad HOST_ARCH) +@@ -75,35 +75,36 @@ $(error Bad HOST_ARCH) endif INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKEROOT)/Include/ -I $(MAKEROOT)/Include/IndustryStandard -I $(MAKEROOT)/Common/ -I .. -I . $(ARCH_INCLUDE) @@ -63,5 +62,5 @@ index 1c105ee7d4..d5eea3864e 100644 # # Snow Leopard is a 32-bit and 64-bit environment. uname -m returns i386, but gcc defaults -- -2.28.0 +2.32.0 diff --git a/poky/meta/recipes-core/ovmf/ovmf/0003-ovmf-Update-to-latest.patch b/poky/meta/recipes-core/ovmf/ovmf/0003-ovmf-Update-to-latest.patch new file mode 100644 index 000000000..d71042989 --- /dev/null +++ b/poky/meta/recipes-core/ovmf/ovmf/0003-ovmf-Update-to-latest.patch @@ -0,0 +1,45 @@ +From 67267d8cc31df16a3608cad1a17c5f1470ef8bbd Mon Sep 17 00:00:00 2001 +From: Steve Langasek +Date: Sat, 10 Jun 2017 01:39:36 -0700 +Subject: [PATCH 3/6] ovmf: Update to latest + +Description: pass -fno-stack-protector to all GCC toolchains + The upstream build rules inexplicably pass -fno-stack-protector only + when building for i386 and amd64. Add this essential argument to the + generic rules for gcc 4.4 and later. +Last-Updated: 2016-04-12 +Upstream-Status: Pending +--- + BaseTools/Conf/tools_def.template | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template +index 498696e583..36241b6ede 100755 +--- a/BaseTools/Conf/tools_def.template ++++ b/BaseTools/Conf/tools_def.template +@@ -1897,10 +1897,10 @@ DEFINE GCC_RISCV64_RC_FLAGS = -I binary -O elf64-littleriscv -B riscv + # GCC Build Flag for included header file list generation + DEFINE GCC_DEPS_FLAGS = -MMD -MF $@.deps + +-DEFINE GCC48_ALL_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -ffunction-sections -fdata-sections -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings ++DEFINE GCC48_ALL_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -ffunction-sections -fdata-sections -fno-stack-protector -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings + DEFINE GCC48_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20 +-DEFINE GCC48_IA32_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -Wno-address +-DEFINE GCC48_X64_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address ++DEFINE GCC48_IA32_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -D EFI32 -fno-asynchronous-unwind-tables -Wno-address ++DEFINE GCC48_X64_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address + DEFINE GCC48_IA32_X64_ASLDLINK_FLAGS = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable + DEFINE GCC48_IA32_X64_DLINK_FLAGS = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive + DEFINE GCC48_IA32_DLINK2_FLAGS = -Wl,--defsym=PECOFF_HEADER_SIZE=0x220 DEF(GCC_DLINK2_FLAGS_COMMON) +@@ -1909,7 +1909,7 @@ DEFINE GCC48_X64_DLINK2_FLAGS = -Wl,--defsym=PECOFF_HEADER_SIZE=0x228 DEF + DEFINE GCC48_ASM_FLAGS = DEF(GCC_ASM_FLAGS) + DEFINE GCC48_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ASM_FLAGS) -mlittle-endian + DEFINE GCC48_AARCH64_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ASM_FLAGS) -mlittle-endian +-DEFINE GCC48_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -fstack-protector -mword-relocations ++DEFINE GCC48_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -mword-relocations + DEFINE GCC48_ARM_CC_XIPFLAGS = DEF(GCC_ARM_CC_XIPFLAGS) + DEFINE GCC48_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mcmodel=large DEF(GCC_AARCH64_CC_FLAGS) + DEFINE GCC48_AARCH64_CC_XIPFLAGS = DEF(GCC_AARCH64_CC_XIPFLAGS) +-- +2.32.0 + diff --git a/poky/meta/recipes-core/ovmf/ovmf/0004-Strip-build-paths.patch b/poky/meta/recipes-core/ovmf/ovmf/0004-Strip-build-paths.patch new file mode 100644 index 000000000..dfb8a7339 --- /dev/null +++ b/poky/meta/recipes-core/ovmf/ovmf/0004-Strip-build-paths.patch @@ -0,0 +1,32 @@ +From b7cfe97895e0586d14403ba98e62a0cd9373da96 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Mon, 14 Jun 2021 19:55:08 +0200 +Subject: [PATCH 4/6] Strip build paths + +Pass --zero to GenFw in release builds so that the sections that link back to +the intermediate binaries (containing build paths) are removed. + +Upstream-Status: Pending (discussion at https://bugzilla.tianocore.org/show_bug.cgi?id=3256) +Signed-off-by: Ross Burton + +Signed-off-by: Alexander Kanavin +--- + OvmfPkg/OvmfPkgIa32.dsc | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc +index 33fbd76790..06c6d5ce60 100644 +--- a/OvmfPkg/OvmfPkgIa32.dsc ++++ b/OvmfPkg/OvmfPkgIa32.dsc +@@ -91,6 +91,8 @@ + + !include NetworkPkg/NetworkBuildOptions.dsc.inc + ++ RELEASE_*_*_GENFW_FLAGS = --zero ++ + [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] + GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 + XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000 +-- +2.32.0 + diff --git a/poky/meta/recipes-core/ovmf/ovmf/0004-ovmf-Update-to-latest.patch b/poky/meta/recipes-core/ovmf/ovmf/0004-ovmf-Update-to-latest.patch deleted file mode 100644 index 128438b20..000000000 --- a/poky/meta/recipes-core/ovmf/ovmf/0004-ovmf-Update-to-latest.patch +++ /dev/null @@ -1,46 +0,0 @@ -From ad06fcf1e08736e79221cd6863ff2e3c9254f261 Mon Sep 17 00:00:00 2001 -From: Steve Langasek -Date: Sat, 10 Jun 2017 01:39:36 -0700 -Subject: [PATCH 4/4] ovmf: Update to latest - -Description: pass -fno-stack-protector to all GCC toolchains - The upstream build rules inexplicably pass -fno-stack-protector only - when building for i386 and amd64. Add this essential argument to the - generic rules for gcc 4.4 and later. -Last-Updated: 2016-04-12 -Upstream-Status: Pending - ---- - BaseTools/Conf/tools_def.template | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template -index 933b3160fd..c2fbbf0c38 100755 ---- a/BaseTools/Conf/tools_def.template -+++ b/BaseTools/Conf/tools_def.template -@@ -1952,10 +1952,10 @@ DEFINE GCC_RISCV64_RC_FLAGS = -I binary -O elf64-littleriscv -B riscv - # GCC Build Flag for included header file list generation - DEFINE GCC_DEPS_FLAGS = -MMD -MF $@.deps - --DEFINE GCC48_ALL_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -ffunction-sections -fdata-sections -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings -+DEFINE GCC48_ALL_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -ffunction-sections -fdata-sections -fno-stack-protector -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings - DEFINE GCC48_IA32_X64_DLINK_COMMON = -nostdlib -Wl,-n,-q,--gc-sections -z common-page-size=0x20 --DEFINE GCC48_IA32_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables -Wno-address --DEFINE GCC48_X64_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address -+DEFINE GCC48_IA32_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m32 -march=i586 -malign-double -D EFI32 -fno-asynchronous-unwind-tables -Wno-address -+DEFINE GCC48_X64_CC_FLAGS = DEF(GCC48_ALL_CC_FLAGS) -m64 "-DEFIAPI=__attribute__((ms_abi))" -maccumulate-outgoing-args -mno-red-zone -Wno-address -mcmodel=small -fpie -fno-asynchronous-unwind-tables -Wno-address - DEFINE GCC48_IA32_X64_ASLDLINK_FLAGS = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,ReferenceAcpiTable -u ReferenceAcpiTable - DEFINE GCC48_IA32_X64_DLINK_FLAGS = DEF(GCC48_IA32_X64_DLINK_COMMON) -Wl,--entry,$(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Wl,-Map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map,--whole-archive - DEFINE GCC48_IA32_DLINK2_FLAGS = -Wl,--defsym=PECOFF_HEADER_SIZE=0x220 DEF(GCC_DLINK2_FLAGS_COMMON) -@@ -1964,7 +1964,7 @@ DEFINE GCC48_X64_DLINK2_FLAGS = -Wl,--defsym=PECOFF_HEADER_SIZE=0x228 DEF - DEFINE GCC48_ASM_FLAGS = DEF(GCC_ASM_FLAGS) - DEFINE GCC48_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ASM_FLAGS) -mlittle-endian - DEFINE GCC48_AARCH64_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ASM_FLAGS) -mlittle-endian --DEFINE GCC48_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -fstack-protector -mword-relocations -+DEFINE GCC48_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ARM_CC_FLAGS) -mword-relocations - DEFINE GCC48_ARM_CC_XIPFLAGS = DEF(GCC_ARM_CC_XIPFLAGS) - DEFINE GCC48_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mcmodel=large DEF(GCC_AARCH64_CC_FLAGS) - DEFINE GCC48_AARCH64_CC_XIPFLAGS = DEF(GCC_AARCH64_CC_XIPFLAGS) --- -2.28.0 - diff --git a/poky/meta/recipes-core/ovmf/ovmf/0005-debug-prefix-map.patch b/poky/meta/recipes-core/ovmf/ovmf/0005-debug-prefix-map.patch new file mode 100644 index 000000000..e467d6f15 --- /dev/null +++ b/poky/meta/recipes-core/ovmf/ovmf/0005-debug-prefix-map.patch @@ -0,0 +1,104 @@ +From 860bb1979f3578bb83257076fe0f3bd33f9d68bf Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Mon, 14 Jun 2021 19:56:28 +0200 +Subject: [PATCH 5/6] debug prefix map + +We want to pass ${DEBUG_PREFIX_MAP} to gcc commands and also pass in + --debug-prefix-map to nasm (we carry a patch to nasm for this). The +tools definitions file is built by ovmf-native so we need to pass this in +at target build time when we know the right values so we use the environment. + +By using determininistc file paths during the ovmf build, it removes the +opportunitity for gcc/ld to change the output binaries due to path lengths +overflowing section sizes and causing small changes in the binary output. +Previously we relied on the stripped output being the same which isn't always +the case if the size of the debug symbols varies. + +Upstream-Status: Pending [gcc parts may be upstreamable, nasm patch isn't upstream yet] +Signed-off-by: Richard Purdie +Signed-off-by: Alexander Kanavin +--- + BaseTools/Conf/tools_def.template | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template +index 36241b6ede..947fbf2e8d 100755 +--- a/BaseTools/Conf/tools_def.template ++++ b/BaseTools/Conf/tools_def.template +@@ -1863,7 +1863,7 @@ NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_N + *_*_*_DTCPP_PATH = DEF(DTCPP_BIN) + *_*_*_DTC_PATH = DEF(DTC_BIN) + +-DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common ++DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common ENV(GCC_PREFIX_MAP) + DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe + DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe + DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft -fno-pic -fno-pie +@@ -1881,8 +1881,8 @@ DEFINE GCC_IA32_X64_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _Ref + DEFINE GCC_ARM_ASLDLINK_FLAGS = DEF(GCC_ARM_DLINK_FLAGS) -Wl,--entry,ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS) + DEFINE GCC_AARCH64_ASLDLINK_FLAGS = DEF(GCC_AARCH64_DLINK_FLAGS) -Wl,--entry,ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS) + DEFINE GCC_IA32_X64_DLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _$(IMAGE_ENTRY_POINT) --file-alignment 0x20 --section-alignment 0x20 -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map +-DEFINE GCC_ASM_FLAGS = -c -x assembler -imacros AutoGen.h +-DEFINE GCC_PP_FLAGS = -E -x assembler-with-cpp -include AutoGen.h ++DEFINE GCC_ASM_FLAGS = -c -x assembler -imacros AutoGen.h ENV(GCC_PREFIX_MAP) ++DEFINE GCC_PP_FLAGS = -E -x assembler-with-cpp -include AutoGen.h ENV(GCC_PREFIX_MAP) + DEFINE GCC_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(MODULE_NAME)StrDefs.h + DEFINE GCC_ASLPP_FLAGS = -x c -E -include AutoGen.h + DEFINE GCC_ASLCC_FLAGS = -x c +@@ -2027,7 +2027,7 @@ DEFINE GCC_PP_FLAGS = -E -x assembler-with-cpp -include A + *_GCC48_IA32_DLINK2_FLAGS = DEF(GCC48_IA32_DLINK2_FLAGS) + *_GCC48_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS) + *_GCC48_IA32_OBJCOPY_FLAGS = +-*_GCC48_IA32_NASM_FLAGS = -f elf32 ++*_GCC48_IA32_NASM_FLAGS = -f elf32 ENV(NASM_PREFIX_MAP) + + DEBUG_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os + RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable +@@ -2055,7 +2055,7 @@ RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but + *_GCC48_X64_DLINK2_FLAGS = DEF(GCC48_X64_DLINK2_FLAGS) + *_GCC48_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS) + *_GCC48_X64_OBJCOPY_FLAGS = +-*_GCC48_X64_NASM_FLAGS = -f elf64 ++*_GCC48_X64_NASM_FLAGS = -f elf64 ENV(NASM_PREFIX_MAP) + + DEBUG_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Os + RELEASE_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Os -Wno-unused-but-set-variable +@@ -2167,7 +2167,7 @@ RELEASE_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -Wno-unused-but-s + *_GCC49_IA32_DLINK2_FLAGS = DEF(GCC49_IA32_DLINK2_FLAGS) + *_GCC49_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS) + *_GCC49_IA32_OBJCOPY_FLAGS = +-*_GCC49_IA32_NASM_FLAGS = -f elf32 ++*_GCC49_IA32_NASM_FLAGS = -f elf32 ENV(NASM_PREFIX_MAP) + + DEBUG_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os + RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable -Wno-unused-const-variable +@@ -2195,7 +2195,7 @@ RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but + *_GCC49_X64_DLINK2_FLAGS = DEF(GCC49_X64_DLINK2_FLAGS) + *_GCC49_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS) + *_GCC49_X64_OBJCOPY_FLAGS = +-*_GCC49_X64_NASM_FLAGS = -f elf64 ++*_GCC49_X64_NASM_FLAGS = -f elf64 ENV(NASM_PREFIX_MAP) + + DEBUG_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Os + RELEASE_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Os -Wno-unused-but-set-variable -Wno-unused-const-variable +@@ -2313,7 +2313,7 @@ RELEASE_GCC49_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 + *_GCC5_IA32_DLINK2_FLAGS = DEF(GCC5_IA32_DLINK2_FLAGS) -no-pie + *_GCC5_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS) + *_GCC5_IA32_OBJCOPY_FLAGS = +-*_GCC5_IA32_NASM_FLAGS = -f elf32 ++*_GCC5_IA32_NASM_FLAGS = -f elf32 ENV(NASM_PREFIX_MAP) + + DEBUG_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -flto -Os + DEBUG_GCC5_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,-m,elf_i386,--oformat=elf32-i386 +@@ -2345,7 +2345,7 @@ RELEASE_GCC5_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl, + *_GCC5_X64_DLINK2_FLAGS = DEF(GCC5_X64_DLINK2_FLAGS) + *_GCC5_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS) + *_GCC5_X64_OBJCOPY_FLAGS = +-*_GCC5_X64_NASM_FLAGS = -f elf64 ++*_GCC5_X64_NASM_FLAGS = -f elf64 ENV(NASM_PREFIX_MAP) + + DEBUG_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO -Os + DEBUG_GCC5_X64_DLINK_FLAGS = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os +-- +2.32.0 + diff --git a/poky/meta/recipes-core/ovmf/ovmf/0006-reproducible.patch b/poky/meta/recipes-core/ovmf/ovmf/0006-reproducible.patch new file mode 100644 index 000000000..343c21b54 --- /dev/null +++ b/poky/meta/recipes-core/ovmf/ovmf/0006-reproducible.patch @@ -0,0 +1,180 @@ +From 27ed9962f5cb3afcc44d6c96c53277132a999712 Mon Sep 17 00:00:00 2001 +From: Alexander Kanavin +Date: Mon, 14 Jun 2021 19:57:30 +0200 +Subject: [PATCH 6/6] reproducible + +This patch fixes various things which make the build more reproducible. Some changes +here only change intermediate artefacts but that means when you have two build trees +giving differing results, the differences can be isolated more easily. The issues here +usually become apparent with longer paths. + +This was all debugged with: +TMPDIR = "${TOPDIR}/tmp" +vs. +TMPDIR = "${TOPDIR}/tmp-inital-mylongpath-mylongpath-mylongpath-mylongpath-mylongpath-mylongpath-mylongpath-mylongpath-mylongpath" + +The patch specifically: + + * Sorts output in GNUmakefile + * Always generates indirect flags files used to avoid pathlength issues else the + compile commands suddenly change when using longer paths + * Sorts the AutoGenTimeStamp file contents + * Makes the TargetDescBlock objects from BuildEngine sortable to allow the makefile fix + * Fix ElfConvert within GenFw so that only the basename of the binary being converted + is used, else the output from "GenFw XXX.bin" differs from "GenFw /long/path/XXX.bin" + with sufficiently long paths + +Upstream-Status: Pending [At least some of this might be interesting to upstream] +Signed-off-by: Richard Purdie +Signed-off-by: Alexander Kanavin +--- + BaseTools/Source/C/GenFw/Elf64Convert.c | 8 ++++--- + .../Source/Python/AutoGen/BuildEngine.py | 3 +++ + BaseTools/Source/Python/AutoGen/GenMake.py | 24 +++++++++---------- + .../Source/Python/AutoGen/ModuleAutoGen.py | 5 +++- + 4 files changed, 24 insertions(+), 16 deletions(-) + +diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c +index d097db8632..a87ae6f3d0 100644 +--- a/BaseTools/Source/C/GenFw/Elf64Convert.c ++++ b/BaseTools/Source/C/GenFw/Elf64Convert.c +@@ -14,6 +14,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent + #ifndef __GNUC__ + #include + #include ++#else ++#define _GNU_SOURCE + #endif + #include + #include +@@ -769,7 +771,7 @@ ScanSections64 ( + } + mCoffOffset = mDebugOffset + sizeof(EFI_IMAGE_DEBUG_DIRECTORY_ENTRY) + + sizeof(EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY) + +- strlen(mInImageName) + 1; ++ strlen(basename(mInImageName)) + 1; + + mCoffOffset = CoffAlign(mCoffOffset); + if (SectionCount == 0) { +@@ -1608,7 +1610,7 @@ WriteDebug64 ( + EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *Dir; + EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY *Nb10; + +- Len = strlen(mInImageName) + 1; ++ Len = strlen(basename(mInImageName)) + 1; + + Dir = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY*)(mCoffFile + mDebugOffset); + Dir->Type = EFI_IMAGE_DEBUG_TYPE_CODEVIEW; +@@ -1618,7 +1620,7 @@ WriteDebug64 ( + + Nb10 = (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY*)(Dir + 1); + Nb10->Signature = CODEVIEW_SIGNATURE_NB10; +- strcpy ((char *)(Nb10 + 1), mInImageName); ++ strcpy ((char *)(Nb10 + 1), basename(mInImageName)); + + + NtHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(mCoffFile + mNtHdrOffset); +diff --git a/BaseTools/Source/Python/AutoGen/BuildEngine.py b/BaseTools/Source/Python/AutoGen/BuildEngine.py +index 722fead75a..8f1c236970 100644 +--- a/BaseTools/Source/Python/AutoGen/BuildEngine.py ++++ b/BaseTools/Source/Python/AutoGen/BuildEngine.py +@@ -70,6 +70,9 @@ class TargetDescBlock(object): + else: + return str(Other) == self.Target.Path + ++ def __lt__(self, other): ++ return str(self) < str(other) ++ + def AddInput(self, Input): + if Input not in self.Inputs: + self.Inputs.append(Input) +diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py +index 961b2ab1c3..23c1592025 100755 +--- a/BaseTools/Source/Python/AutoGen/GenMake.py ++++ b/BaseTools/Source/Python/AutoGen/GenMake.py +@@ -575,7 +575,7 @@ cleanlib: + os.remove(RespFileList) + + # convert source files and binary files to build targets +- self.ResultFileList = [str(T.Target) for T in MyAgo.CodaTargetList] ++ self.ResultFileList = sorted([str(T.Target) for T in MyAgo.CodaTargetList]) + if len(self.ResultFileList) == 0 and len(MyAgo.SourceFileList) != 0: + EdkLogger.error("build", AUTOGEN_ERROR, "Nothing to build", + ExtraData="[%s]" % str(MyAgo)) +@@ -726,7 +726,7 @@ cleanlib: + OutputFile = '' + DepsFileList = [] + +- for Cmd in self.GenFfsList: ++ for Cmd in sorted(self.GenFfsList): + if Cmd[2]: + for CopyCmd in Cmd[2]: + Src, Dst = CopyCmd +@@ -759,7 +759,7 @@ cleanlib: + self.BuildTargetList.append('\t%s' % CmdString) + + self.ParseSecCmd(DepsFileList, Cmd[1]) +- for SecOutputFile, SecDepsFile, SecCmd in self.FfsOutputFileList : ++ for SecOutputFile, SecDepsFile, SecCmd in sorted(self.FfsOutputFileList): + self.BuildTargetList.append('%s : %s' % (self.ReplaceMacro(SecOutputFile), self.ReplaceMacro(SecDepsFile))) + self.BuildTargetList.append('\t%s' % self.ReplaceMacro(SecCmd)) + self.FfsOutputFileList = [] +@@ -798,13 +798,13 @@ cleanlib: + + def CommandExceedLimit(self): + FlagDict = { +- 'CC' : { 'Macro' : '$(CC_FLAGS)', 'Value' : False}, +- 'PP' : { 'Macro' : '$(PP_FLAGS)', 'Value' : False}, +- 'APP' : { 'Macro' : '$(APP_FLAGS)', 'Value' : False}, +- 'ASLPP' : { 'Macro' : '$(ASLPP_FLAGS)', 'Value' : False}, +- 'VFRPP' : { 'Macro' : '$(VFRPP_FLAGS)', 'Value' : False}, +- 'ASM' : { 'Macro' : '$(ASM_FLAGS)', 'Value' : False}, +- 'ASLCC' : { 'Macro' : '$(ASLCC_FLAGS)', 'Value' : False}, ++ 'CC' : { 'Macro' : '$(CC_FLAGS)', 'Value' : True}, ++ 'PP' : { 'Macro' : '$(PP_FLAGS)', 'Value' : True}, ++ 'APP' : { 'Macro' : '$(APP_FLAGS)', 'Value' : True}, ++ 'ASLPP' : { 'Macro' : '$(ASLPP_FLAGS)', 'Value' : True}, ++ 'VFRPP' : { 'Macro' : '$(VFRPP_FLAGS)', 'Value' : True}, ++ 'ASM' : { 'Macro' : '$(ASM_FLAGS)', 'Value' : True}, ++ 'ASLCC' : { 'Macro' : '$(ASLCC_FLAGS)', 'Value' : True}, + } + + RespDict = {} +@@ -1007,9 +1007,9 @@ cleanlib: + if not self.ObjTargetDict.get(T.Target.SubDir): + self.ObjTargetDict[T.Target.SubDir] = set() + self.ObjTargetDict[T.Target.SubDir].add(NewFile) +- for Type in self._AutoGenObject.Targets: ++ for Type in sorted(self._AutoGenObject.Targets): + resp_file_number = 0 +- for T in self._AutoGenObject.Targets[Type]: ++ for T in sorted(self._AutoGenObject.Targets[Type]): + # Generate related macros if needed + if T.GenFileListMacro and T.FileListMacro not in self.FileListMacros: + self.FileListMacros[T.FileListMacro] = [] +diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py +index d70b0d7ae8..25dca9a6df 100755 +--- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py ++++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py +@@ -1484,6 +1484,9 @@ class ModuleAutoGen(AutoGen): + for File in Files: + if File.lower().endswith('.pdb'): + AsBuiltInfDict['binary_item'].append('DISPOSABLE|' + File) ++ ++ AsBuiltInfDict['binary_item'] = sorted(AsBuiltInfDict['binary_item']) ++ + HeaderComments = self.Module.HeaderComments + StartPos = 0 + for Index in range(len(HeaderComments)): +@@ -1759,7 +1762,7 @@ class ModuleAutoGen(AutoGen): + if os.path.exists (self.TimeStampPath): + os.remove (self.TimeStampPath) + +- SaveFileOnChange(self.TimeStampPath, "\n".join(FileSet), False) ++ SaveFileOnChange(self.TimeStampPath, "\n".join(sorted(FileSet)), False) + + # Ignore generating makefile when it is a binary module + if self.IsBinaryModule: +-- +2.32.0 + diff --git a/poky/meta/recipes-core/ovmf/ovmf/debug_prefix_map.patch b/poky/meta/recipes-core/ovmf/ovmf/debug_prefix_map.patch deleted file mode 100644 index 0165fae7c..000000000 --- a/poky/meta/recipes-core/ovmf/ovmf/debug_prefix_map.patch +++ /dev/null @@ -1,93 +0,0 @@ -We want to pass ${DEBUG_PREFIX_MAP} to gcc commands and also pass in - --debug-prefix-map to nasm (we carry a patch to nasm for this). The -tools definitions file is built by ovmf-native so we need to pass this in -at target build time when we know the right values so we use the environment. - -By using determininistc file paths during the ovmf build, it removes the -opportunitity for gcc/ld to change the output binaries due to path lengths -overflowing section sizes and causing small changes in the binary output. -Previously we relied on the stripped output being the same which isn't always -the case if the size of the debug symbols varies. - -Upstream-Status: Pending [gcc parts may be upstreamable, nasm patch isn't upstream yet] -Signed-off-by: Richard Purdie - - -Index: git/BaseTools/Conf/tools_def.template -=================================================================== ---- git.orig/BaseTools/Conf/tools_def.template -+++ git/BaseTools/Conf/tools_def.template -@@ -1918,7 +1918,7 @@ NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG = --a - *_*_*_DTCPP_PATH = DEF(DTCPP_BIN) - *_*_*_DTC_PATH = DEF(DTC_BIN) - --DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common -+DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common ENV(GCC_PREFIX_MAP) - DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe - DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe - DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft -fno-pic -fno-pie -@@ -1936,8 +1936,8 @@ DEFINE GCC_IA32_X64_ASLDLINK_FLAGS = -fu - DEFINE GCC_ARM_ASLDLINK_FLAGS = DEF(GCC_ARM_DLINK_FLAGS) -Wl,--entry,ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS) - DEFINE GCC_AARCH64_ASLDLINK_FLAGS = DEF(GCC_AARCH64_DLINK_FLAGS) -Wl,--entry,ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT) DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS) - DEFINE GCC_IA32_X64_DLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _$(IMAGE_ENTRY_POINT) --file-alignment 0x20 --section-alignment 0x20 -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map --DEFINE GCC_ASM_FLAGS = -c -x assembler -imacros AutoGen.h --DEFINE GCC_PP_FLAGS = -E -x assembler-with-cpp -include AutoGen.h -+DEFINE GCC_ASM_FLAGS = -c -x assembler -imacros AutoGen.h ENV(GCC_PREFIX_MAP) -+DEFINE GCC_PP_FLAGS = -E -x assembler-with-cpp -include AutoGen.h ENV(GCC_PREFIX_MAP) - DEFINE GCC_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(MODULE_NAME)StrDefs.h - DEFINE GCC_ASLPP_FLAGS = -x c -E -include AutoGen.h - DEFINE GCC_ASLCC_FLAGS = -x c -@@ -2082,7 +2082,7 @@ DEFINE GCC_PP_FLAGS - *_GCC48_IA32_DLINK2_FLAGS = DEF(GCC48_IA32_DLINK2_FLAGS) - *_GCC48_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS) - *_GCC48_IA32_OBJCOPY_FLAGS = --*_GCC48_IA32_NASM_FLAGS = -f elf32 -+*_GCC48_IA32_NASM_FLAGS = -f elf32 ENV(NASM_PREFIX_MAP) - - DEBUG_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os - RELEASE_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable -@@ -2110,7 +2110,7 @@ RELEASE_GCC48_IA32_CC_FLAGS = DEF( - *_GCC48_X64_DLINK2_FLAGS = DEF(GCC48_X64_DLINK2_FLAGS) - *_GCC48_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS) - *_GCC48_X64_OBJCOPY_FLAGS = --*_GCC48_X64_NASM_FLAGS = -f elf64 -+*_GCC48_X64_NASM_FLAGS = -f elf64 ENV(NASM_PREFIX_MAP) - - DEBUG_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Os - RELEASE_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS) -Os -Wno-unused-but-set-variable -@@ -2222,7 +2222,7 @@ RELEASE_GCC48_AARCH64_CC_FLAGS = DEF(G - *_GCC49_IA32_DLINK2_FLAGS = DEF(GCC49_IA32_DLINK2_FLAGS) - *_GCC49_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS) - *_GCC49_IA32_OBJCOPY_FLAGS = --*_GCC49_IA32_NASM_FLAGS = -f elf32 -+*_GCC49_IA32_NASM_FLAGS = -f elf32 ENV(NASM_PREFIX_MAP) - - DEBUG_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os - RELEASE_GCC49_IA32_CC_FLAGS = DEF(GCC49_IA32_CC_FLAGS) -Os -Wno-unused-but-set-variable -Wno-unused-const-variable -@@ -2250,7 +2250,7 @@ RELEASE_GCC49_IA32_CC_FLAGS = DEF( - *_GCC49_X64_DLINK2_FLAGS = DEF(GCC49_X64_DLINK2_FLAGS) - *_GCC49_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS) - *_GCC49_X64_OBJCOPY_FLAGS = --*_GCC49_X64_NASM_FLAGS = -f elf64 -+*_GCC49_X64_NASM_FLAGS = -f elf64 ENV(NASM_PREFIX_MAP) - - DEBUG_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Os - RELEASE_GCC49_X64_CC_FLAGS = DEF(GCC49_X64_CC_FLAGS) -Os -Wno-unused-but-set-variable -Wno-unused-const-variable -@@ -2368,7 +2368,7 @@ RELEASE_GCC49_AARCH64_DLINK_XIPFLAGS = - - *_GCC5_IA32_DLINK2_FLAGS = DEF(GCC5_IA32_DLINK2_FLAGS) -no-pie - *_GCC5_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS) - *_GCC5_IA32_OBJCOPY_FLAGS = --*_GCC5_IA32_NASM_FLAGS = -f elf32 -+*_GCC5_IA32_NASM_FLAGS = -f elf32 ENV(NASM_PREFIX_MAP) - - DEBUG_GCC5_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -flto -Os - DEBUG_GCC5_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,-m,elf_i386,--oformat=elf32-i386 -@@ -2400,7 +2400,7 @@ RELEASE_GCC5_IA32_DLINK_FLAGS = DEF(G - *_GCC5_X64_DLINK2_FLAGS = DEF(GCC5_X64_DLINK2_FLAGS) - *_GCC5_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS) - *_GCC5_X64_OBJCOPY_FLAGS = --*_GCC5_X64_NASM_FLAGS = -f elf64 -+*_GCC5_X64_NASM_FLAGS = -f elf64 ENV(NASM_PREFIX_MAP) - - DEBUG_GCC5_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO -Os - DEBUG_GCC5_X64_DLINK_FLAGS = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os diff --git a/poky/meta/recipes-core/ovmf/ovmf/reproducible.patch b/poky/meta/recipes-core/ovmf/ovmf/reproducible.patch deleted file mode 100644 index 5d2aeaacf..000000000 --- a/poky/meta/recipes-core/ovmf/ovmf/reproducible.patch +++ /dev/null @@ -1,165 +0,0 @@ -This patch fixes various things which make the build more reproducible. Some changes -here only change intermediate artefacts but that means when you have two build trees -giving differing results, the differences can be isolated more easily. The issues here -usually become apparent with longer paths. - -This was all debugged with: -TMPDIR = "${TOPDIR}/tmp" -vs. -TMPDIR = "${TOPDIR}/tmp-inital-mylongpath-mylongpath-mylongpath-mylongpath-mylongpath-mylongpath-mylongpath-mylongpath-mylongpath" - -The patch specifically: - - * Sorts output in GNUmakefile - * Always generates indirect flags files used to avoid pathlength issues else the - compile commands suddenly change when using longer paths - * Sorts the AutoGenTimeStamp file contents - * Makes the TargetDescBlock objects from BuildEngine sortable to allow the makefile fix - * Fix ElfConvert within GenFw so that only the basename of the binary being converted - is used, else the output from "GenFw XXX.bin" differs from "GenFw /long/path/XXX.bin" - with sufficiently long paths - -Upstream-Status: Pending [At least some of this might be interesting to upstream] -Signed-off-by: Richard Purdie - -Index: git/BaseTools/Source/Python/AutoGen/GenMake.py -=================================================================== ---- git.orig/BaseTools/Source/Python/AutoGen/GenMake.py -+++ git/BaseTools/Source/Python/AutoGen/GenMake.py -@@ -571,7 +571,7 @@ cleanlib: - os.remove(RespFileList) - - # convert source files and binary files to build targets -- self.ResultFileList = [str(T.Target) for T in MyAgo.CodaTargetList] -+ self.ResultFileList = sorted([str(T.Target) for T in MyAgo.CodaTargetList]) - if len(self.ResultFileList) == 0 and len(MyAgo.SourceFileList) != 0: - EdkLogger.error("build", AUTOGEN_ERROR, "Nothing to build", - ExtraData="[%s]" % str(MyAgo)) -@@ -722,7 +722,7 @@ cleanlib: - OutputFile = '' - DepsFileList = [] - -- for Cmd in self.GenFfsList: -+ for Cmd in sorted(self.GenFfsList): - if Cmd[2]: - for CopyCmd in Cmd[2]: - Src, Dst = CopyCmd -@@ -755,7 +755,7 @@ cleanlib: - self.BuildTargetList.append('\t%s' % CmdString) - - self.ParseSecCmd(DepsFileList, Cmd[1]) -- for SecOutputFile, SecDepsFile, SecCmd in self.FfsOutputFileList : -+ for SecOutputFile, SecDepsFile, SecCmd in sorted(self.FfsOutputFileList): - self.BuildTargetList.append('%s : %s' % (self.ReplaceMacro(SecOutputFile), self.ReplaceMacro(SecDepsFile))) - self.BuildTargetList.append('\t%s' % self.ReplaceMacro(SecCmd)) - self.FfsOutputFileList = [] -@@ -794,13 +794,13 @@ cleanlib: - - def CommandExceedLimit(self): - FlagDict = { -- 'CC' : { 'Macro' : '$(CC_FLAGS)', 'Value' : False}, -- 'PP' : { 'Macro' : '$(PP_FLAGS)', 'Value' : False}, -- 'APP' : { 'Macro' : '$(APP_FLAGS)', 'Value' : False}, -- 'ASLPP' : { 'Macro' : '$(ASLPP_FLAGS)', 'Value' : False}, -- 'VFRPP' : { 'Macro' : '$(VFRPP_FLAGS)', 'Value' : False}, -- 'ASM' : { 'Macro' : '$(ASM_FLAGS)', 'Value' : False}, -- 'ASLCC' : { 'Macro' : '$(ASLCC_FLAGS)', 'Value' : False}, -+ 'CC' : { 'Macro' : '$(CC_FLAGS)', 'Value' : True}, -+ 'PP' : { 'Macro' : '$(PP_FLAGS)', 'Value' : True}, -+ 'APP' : { 'Macro' : '$(APP_FLAGS)', 'Value' : True}, -+ 'ASLPP' : { 'Macro' : '$(ASLPP_FLAGS)', 'Value' : True}, -+ 'VFRPP' : { 'Macro' : '$(VFRPP_FLAGS)', 'Value' : True}, -+ 'ASM' : { 'Macro' : '$(ASM_FLAGS)', 'Value' : True}, -+ 'ASLCC' : { 'Macro' : '$(ASLCC_FLAGS)', 'Value' : True}, - } - - RespDict = {} -@@ -1003,9 +1003,9 @@ cleanlib: - if not self.ObjTargetDict.get(T.Target.SubDir): - self.ObjTargetDict[T.Target.SubDir] = set() - self.ObjTargetDict[T.Target.SubDir].add(NewFile) -- for Type in self._AutoGenObject.Targets: -+ for Type in sorted(self._AutoGenObject.Targets): - resp_file_number = 0 -- for T in self._AutoGenObject.Targets[Type]: -+ for T in sorted(self._AutoGenObject.Targets[Type]): - # Generate related macros if needed - if T.GenFileListMacro and T.FileListMacro not in self.FileListMacros: - self.FileListMacros[T.FileListMacro] = [] -Index: git/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py -=================================================================== ---- git.orig/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py -+++ git/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py -@@ -1484,6 +1484,9 @@ class ModuleAutoGen(AutoGen): - for File in Files: - if File.lower().endswith('.pdb'): - AsBuiltInfDict['binary_item'].append('DISPOSABLE|' + File) -+ -+ AsBuiltInfDict['binary_item'] = sorted(AsBuiltInfDict['binary_item']) -+ - HeaderComments = self.Module.HeaderComments - StartPos = 0 - for Index in range(len(HeaderComments)): -@@ -1759,7 +1762,7 @@ class ModuleAutoGen(AutoGen): - if os.path.exists (self.TimeStampPath): - os.remove (self.TimeStampPath) - -- SaveFileOnChange(self.TimeStampPath, "\n".join(FileSet), False) -+ SaveFileOnChange(self.TimeStampPath, "\n".join(sorted(FileSet)), False) - - # Ignore generating makefile when it is a binary module - if self.IsBinaryModule: -Index: git/BaseTools/Source/Python/AutoGen/BuildEngine.py -=================================================================== ---- git.orig/BaseTools/Source/Python/AutoGen/BuildEngine.py -+++ git/BaseTools/Source/Python/AutoGen/BuildEngine.py -@@ -70,6 +70,9 @@ class TargetDescBlock(object): - else: - return str(Other) == self.Target.Path - -+ def __lt__(self, other): -+ return str(self) < str(other) -+ - def AddInput(self, Input): - if Input not in self.Inputs: - self.Inputs.append(Input) -Index: git/BaseTools/Source/C/GenFw/Elf64Convert.c -=================================================================== ---- git.orig/BaseTools/Source/C/GenFw/Elf64Convert.c -+++ git/BaseTools/Source/C/GenFw/Elf64Convert.c -@@ -14,6 +14,8 @@ SPDX-License-Identifier: BSD-2-Clause-Pa - #ifndef __GNUC__ - #include - #include -+#else -+#define _GNU_SOURCE - #endif - #include - #include -@@ -770,7 +772,7 @@ ScanSections64 ( - } - mCoffOffset = mDebugOffset + sizeof(EFI_IMAGE_DEBUG_DIRECTORY_ENTRY) + - sizeof(EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY) + -- strlen(mInImageName) + 1; -+ strlen(basename(mInImageName)) + 1; - - mCoffOffset = CoffAlign(mCoffOffset); - if (SectionCount == 0) { -@@ -1609,7 +1611,7 @@ WriteDebug64 ( - EFI_IMAGE_DEBUG_DIRECTORY_ENTRY *Dir; - EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY *Nb10; - -- Len = strlen(mInImageName) + 1; -+ Len = strlen(basename(mInImageName)) + 1; - - Dir = (EFI_IMAGE_DEBUG_DIRECTORY_ENTRY*)(mCoffFile + mDebugOffset); - Dir->Type = EFI_IMAGE_DEBUG_TYPE_CODEVIEW; -@@ -1619,7 +1621,7 @@ WriteDebug64 ( - - Nb10 = (EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY*)(Dir + 1); - Nb10->Signature = CODEVIEW_SIGNATURE_NB10; -- strcpy ((char *)(Nb10 + 1), mInImageName); -+ strcpy ((char *)(Nb10 + 1), basename(mInImageName)); - - - NtHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *)(mCoffFile + mNtHdrOffset); diff --git a/poky/meta/recipes-core/ovmf/ovmf/zero.patch b/poky/meta/recipes-core/ovmf/ovmf/zero.patch deleted file mode 100644 index af7a9d31f..000000000 --- a/poky/meta/recipes-core/ovmf/ovmf/zero.patch +++ /dev/null @@ -1,84 +0,0 @@ -Pass --zero to GenFw in release builds so that the sections that link back to -the intermediate binaries (containing build paths) are removed. - -Upstream-Status: Pending (discussion at https://bugzilla.tianocore.org/show_bug.cgi?id=3256) -Signed-off-by: Ross Burton - -From 6303b065802c9427c718fda129360189b79316e7 Mon Sep 17 00:00:00 2001 -From: Ross Burton -Date: Tue, 16 Mar 2021 16:49:49 +0000 -Subject: [PATCH] Strip build paths - ---- - OvmfPkg/AmdSev/AmdSevX64.dsc | 1 + - OvmfPkg/Bhyve/BhyveX64.dsc | 1 + - OvmfPkg/OvmfPkgIa32.dsc | 2 ++ - OvmfPkg/OvmfPkgIa32X64.dsc | 1 + - OvmfPkg/OvmfPkgX64.dsc | 1 + - OvmfPkg/OvmfXen.dsc | 1 + - 6 files changed, 7 insertions(+) - -diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc -index 4a1cdf5aca..132f55cf69 100644 ---- a/OvmfPkg/Bhyve/BhyveX64.dsc -+++ b/OvmfPkg/Bhyve/BhyveX64.dsc -@@ -76,6 +76,7 @@ - GCC:*_*_X64_GENFW_FLAGS = --keepexceptiontable - INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable - !endif -+ RELEASE_*_*_GENFW_FLAGS = --zero - - # - # Disable deprecated APIs. -diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc -index 1eaf3e99c6..ce20f09df8 100644 ---- a/OvmfPkg/OvmfPkgIa32.dsc -+++ b/OvmfPkg/OvmfPkgIa32.dsc -@@ -90,6 +90,8 @@ - - !include NetworkPkg/NetworkBuildOptions.dsc.inc - -+ RELEASE_*_*_GENFW_FLAGS = --zero -+ - [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] - GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 - XCODE:*_*_*_DLINK_FLAGS = -seg1addr 0x1000 -segalign 0x1000 -diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc -index 4a5a430147..97cc438250 100644 ---- a/OvmfPkg/OvmfPkgIa32X64.dsc -+++ b/OvmfPkg/OvmfPkgIa32X64.dsc -@@ -84,6 +84,7 @@ - GCC:*_*_X64_GENFW_FLAGS = --keepexceptiontable - INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable - !endif -+ RELEASE_*_*_GENFW_FLAGS = --zero - - # - # Disable deprecated APIs. -diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc -index d4d601b444..f544fb04bf 100644 ---- a/OvmfPkg/OvmfPkgX64.dsc -+++ b/OvmfPkg/OvmfPkgX64.dsc -@@ -84,6 +84,7 @@ - GCC:*_*_X64_GENFW_FLAGS = --keepexceptiontable - INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable - !endif -+ RELEASE_*_*_GENFW_FLAGS = --zero - - # - # Disable deprecated APIs. -diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc -index 507029404f..fcaa35acf1 100644 ---- a/OvmfPkg/OvmfXen.dsc -+++ b/OvmfPkg/OvmfXen.dsc -@@ -74,6 +74,7 @@ - GCC:*_*_X64_GENFW_FLAGS = --keepexceptiontable - INTEL:*_*_X64_GENFW_FLAGS = --keepexceptiontable - !endif -+ RELEASE_*_*_GENFW_FLAGS = --zero - - # - # Disable deprecated APIs. --- -2.25.1 - diff --git a/poky/meta/recipes-core/ovmf/ovmf_git.bb b/poky/meta/recipes-core/ovmf/ovmf_git.bb index 888ea082e..90dae2aed 100644 --- a/poky/meta/recipes-core/ovmf/ovmf_git.bb +++ b/poky/meta/recipes-core/ovmf/ovmf_git.bb @@ -15,15 +15,15 @@ PACKAGECONFIG[secureboot] = ",,," SRC_URI = "gitsm://github.com/tianocore/edk2.git;branch=master;protocol=https \ file://0001-ovmf-update-path-to-native-BaseTools.patch \ file://0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch \ - file://0004-ovmf-Update-to-latest.patch \ - file://zero.patch \ - file://debug_prefix_map.patch \ - file://reproducible.patch \ + file://0003-ovmf-Update-to-latest.patch \ + file://0004-Strip-build-paths.patch \ + file://0005-debug-prefix-map.patch \ + file://0006-reproducible.patch \ file://0001-Fix-VLA-parameter-warning.patch \ " -PV = "edk2-stable202102" -SRCREV = "ef91b07388e1c0a50c604e5350eeda98428ccea6" +PV = "edk2-stable202105" +SRCREV = "e1999b264f1f9d7230edf2448f757c73da567832" UPSTREAM_CHECK_GITTAGREGEX = "(?Pedk2-stable.*)" inherit deploy diff --git a/poky/meta/recipes-core/systemd/systemd-conf/wired.network b/poky/meta/recipes-core/systemd/systemd-conf/wired.network index e7b69970d..740628724 100644 --- a/poky/meta/recipes-core/systemd/systemd-conf/wired.network +++ b/poky/meta/recipes-core/systemd/systemd-conf/wired.network @@ -1,5 +1,6 @@ [Match] Type=ether +Name=!veth* KernelCommandLine=!nfsroot KernelCommandLine=!ip diff --git a/poky/meta/recipes-core/systemd/systemd/0010-Use-uintmax_t-for-handling-rlim_t.patch b/poky/meta/recipes-core/systemd/systemd/0010-Use-uintmax_t-for-handling-rlim_t.patch index af1a6bb05..940db4c5c 100644 --- a/poky/meta/recipes-core/systemd/systemd/0010-Use-uintmax_t-for-handling-rlim_t.patch +++ b/poky/meta/recipes-core/systemd/systemd/0010-Use-uintmax_t-for-handling-rlim_t.patch @@ -47,9 +47,18 @@ index b7e18768e3..3195ab205d 100644 #if SIZEOF_DEV_T == 8 # define DEV_FMT "%" PRIu64 diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c -index 23d108d5df..94373c9422 100644 +index 23d108d5df..b037734ee3 100644 --- a/src/basic/rlimit-util.c +++ b/src/basic/rlimit-util.c +@@ -43,7 +43,7 @@ int setrlimit_closest(int resource, const struct rlimit *rlim) { + fixed.rlim_max == highest.rlim_max) + return 0; + +- log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", rlim->rlim_max, rlimit_to_string(resource), fixed.rlim_max); ++ log_debug("Failed at setting rlimit " RLIM_FMT " for resource RLIMIT_%s. Will attempt setting value " RLIM_FMT " instead.", (uintmax_t)rlim->rlim_max, rlimit_to_string(resource), (uintmax_t)fixed.rlim_max); + + if (setrlimit(resource, &fixed) < 0) + return -errno; @@ -308,13 +308,13 @@ int rlimit_format(const struct rlimit *rl, char **ret) { if (rl->rlim_cur >= RLIM_INFINITY && rl->rlim_max >= RLIM_INFINITY) s = strdup("infinity"); diff --git a/poky/meta/recipes-core/systemd/systemd_248.3.bb b/poky/meta/recipes-core/systemd/systemd_248.3.bb index 4e6565649..37607708f 100644 --- a/poky/meta/recipes-core/systemd/systemd_248.3.bb +++ b/poky/meta/recipes-core/systemd/systemd_248.3.bb @@ -507,6 +507,7 @@ FILES_${PN}-extra-utils = "\ ${bindir}/systemd-cgls \ ${bindir}/systemd-cgtop \ ${bindir}/systemd-stdio-bridge \ + ${bindir}/systemd-sysext \ ${base_bindir}/systemd-ask-password \ ${base_bindir}/systemd-tty-ask-password-agent \ ${systemd_unitdir}/system/systemd-ask-password-console.path \ diff --git a/poky/meta/recipes-core/util-linux/util-linux-libuuid_2.36.2.bb b/poky/meta/recipes-core/util-linux/util-linux-libuuid_2.36.2.bb deleted file mode 100644 index 9612c491c..000000000 --- a/poky/meta/recipes-core/util-linux/util-linux-libuuid_2.36.2.bb +++ /dev/null @@ -1,16 +0,0 @@ -# To allow util-linux to optionally build-depend on cryptsetup, libuuid is -# split out of the main recipe, as it's needed by cryptsetup - -require util-linux.inc - -inherit autotools gettext pkgconfig - -S = "${WORKDIR}/util-linux-${PV}" -EXTRA_OECONF += "--disable-all-programs --enable-libuuid" -LICENSE = "BSD-3-Clause" - -do_install_append() { - rm -rf ${D}${datadir} ${D}${bindir} ${D}${base_bindir} ${D}${sbindir} ${D}${base_sbindir} ${D}${exec_prefix}/sbin -} - -BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-core/util-linux/util-linux-libuuid_2.37.bb b/poky/meta/recipes-core/util-linux/util-linux-libuuid_2.37.bb new file mode 100644 index 000000000..9612c491c --- /dev/null +++ b/poky/meta/recipes-core/util-linux/util-linux-libuuid_2.37.bb @@ -0,0 +1,16 @@ +# To allow util-linux to optionally build-depend on cryptsetup, libuuid is +# split out of the main recipe, as it's needed by cryptsetup + +require util-linux.inc + +inherit autotools gettext pkgconfig + +S = "${WORKDIR}/util-linux-${PV}" +EXTRA_OECONF += "--disable-all-programs --enable-libuuid" +LICENSE = "BSD-3-Clause" + +do_install_append() { + rm -rf ${D}${datadir} ${D}${bindir} ${D}${base_bindir} ${D}${sbindir} ${D}${base_sbindir} ${D}${exec_prefix}/sbin +} + +BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-core/util-linux/util-linux.inc b/poky/meta/recipes-core/util-linux/util-linux.inc index 6b47f417a..9d7d8a23a 100644 --- a/poky/meta/recipes-core/util-linux/util-linux.inc +++ b/poky/meta/recipes-core/util-linux/util-linux.inc @@ -35,6 +35,6 @@ 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://Automake-use-EXTRA_LTLIBRARIES-instead-of-noinst_LTL.patch \ + file://8a3a74160b96498d672e3652827aa7e6d7f3a120.patch \ " -SRC_URI[sha256sum] = "f7516ba9d8689343594356f0e5e1a5f0da34adfbc89023437735872bb5024c5f" +SRC_URI[sha256sum] = "bd07b7e98839e0359842110525a3032fdb8eaf3a90bedde3dd1652d32d15cce5" diff --git a/poky/meta/recipes-core/util-linux/util-linux/8a3a74160b96498d672e3652827aa7e6d7f3a120.patch b/poky/meta/recipes-core/util-linux/util-linux/8a3a74160b96498d672e3652827aa7e6d7f3a120.patch new file mode 100644 index 000000000..a5bb00ab6 --- /dev/null +++ b/poky/meta/recipes-core/util-linux/util-linux/8a3a74160b96498d672e3652827aa7e6d7f3a120.patch @@ -0,0 +1,29 @@ +From 8a3a74160b96498d672e3652827aa7e6d7f3a120 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 15 Jun 2021 12:04:43 +0200 +Subject: [PATCH] mkswap: fix holes detection (infinite loop and/or + stack-buffer-underflow) + +Reported-by: Brian Lane +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1971877 +Fix: https://github.com/karelzak/util-linux/issues/1348 +Signed-off-by: Karel Zak +Upstream-Status: Backport +Signed-off-by: Alexander Kanavin +--- + disk-utils/mkswap.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c +index 27374fd72..c45a3a317 100644 +--- a/disk-utils/mkswap.c ++++ b/disk-utils/mkswap.c +@@ -267,6 +267,8 @@ static void check_extents(struct mkswap_control *ctl) + return; + + n = fiemap->fm_mapped_extents; ++ if (n == 0) ++ break; + + for (i = 0; i < n; i++) { + struct fiemap_extent *e = &fiemap->fm_extents[i]; diff --git a/poky/meta/recipes-core/util-linux/util-linux/Automake-use-EXTRA_LTLIBRARIES-instead-of-noinst_LTL.patch b/poky/meta/recipes-core/util-linux/util-linux/Automake-use-EXTRA_LTLIBRARIES-instead-of-noinst_LTL.patch deleted file mode 100644 index 272518914..000000000 --- a/poky/meta/recipes-core/util-linux/util-linux/Automake-use-EXTRA_LTLIBRARIES-instead-of-noinst_LTL.patch +++ /dev/null @@ -1,49 +0,0 @@ -Author: Luca Boccassi -Description: Automake: use EXTRA_LTLIBRARIES instead of noinst_LTLIBRARIES - noinst_LTLIBRARIES causes the libraries to be always built - unconditionally. EXTRA_LTLIBRARIES causes them to be built - only if other build target needs them. - In other words, avoid building libcommon.a and libtcolors.a - unless they are needed by another library/executable and - save some build time. -Upstream-Status: backport, commit:c65953d72bbc7412f32e566d9fa6e780d84f0696 ---- a/Makefile.am -+++ b/Makefile.am -@@ -39,7 +39,7 @@ bashcompletiondir = @bashcompletiondir@ - - dist_noinst_HEADERS = - noinst_PROGRAMS = --noinst_LTLIBRARIES = -+EXTRA_LTLIBRARIES = - usrbin_exec_PROGRAMS = - usrsbin_exec_PROGRAMS = - dist_man_MANS = -@@ -169,7 +169,7 @@ else - edit_cmd += -e 's|@vendordir[@]||g' - endif - --CLEANFILES += $(PATHFILES) -+CLEANFILES += $(PATHFILES) $(EXTRA_LTLIBRARIES) - EXTRA_DIST += $(PATHFILES:=.in) - - $(PATHFILES): Makefile ---- a/lib/Makemodule.am -+++ b/lib/Makemodule.am -@@ -9,7 +9,7 @@ - # Note that you need "make install-strip" (or proper rpm / Debian build) - # to generate binaries with only relevant stuff. - # --noinst_LTLIBRARIES += libcommon.la -+EXTRA_LTLIBRARIES += libcommon.la - libcommon_la_CFLAGS = $(AM_CFLAGS) - libcommon_la_SOURCES = \ - lib/blkdev.c \ -@@ -59,7 +59,7 @@ libcommon_la_SOURCES += lib/sysfs.c - endif - endif - --noinst_LTLIBRARIES += libtcolors.la -+EXTRA_LTLIBRARIES += libtcolors.la - libtcolors_la_CFLAGS = $(AM_CFLAGS) - libtcolors_la_SOURCES = lib/colors.c lib/color-names.c include/colors.h include/color-names.h - libtcolors_la_LIBADD = diff --git a/poky/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch b/poky/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch index 748b6ef09..f1cbdb3be 100644 --- a/poky/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch +++ b/poky/meta/recipes-core/util-linux/util-linux/avoid_parallel_tests.patch @@ -1,20 +1,29 @@ +From ee3c7812e1efa6719af68b994804f0e6caceabd8 Mon Sep 17 00:00:00 2001 +From: Tudor Florea +Date: Mon, 14 Jun 2021 14:00:31 +0200 +Subject: [PATCH] util-linux: Add ptest + Ptest needs buildtest-TESTS and runtest-TESTS targets. serial-tests is required to generate those targets. -Revert run.sh script accordingly to serialize running tests +Revert run.sh script accordingly to serialize running tests Signed-off-by: Tudor Florea -Upstream-Status: Inappropriate +Upstream-Status: Inappropriate + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -Index: util-linux-2.32/configure.ac -=================================================================== ---- util-linux-2.32.orig/configure.ac -+++ util-linux-2.32/configure.ac +diff --git a/configure.ac b/configure.ac +index 5664f9f..075ef27 100644 +--- a/configure.ac ++++ b/configure.ac @@ -11,7 +11,7 @@ AC_CONFIG_MACRO_DIR([m4]) dnl AC_USE_SYSTEM_EXTENSIONS must be called before any macros that run - dnl the compiler (like AC_PROG_LIBTOOL) to avoid autoconf errors. + dnl the compiler (like LT_INIT) to avoid autoconf errors. AC_USE_SYSTEM_EXTENSIONS --AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects]) -+AM_INIT_AUTOMAKE([-Wall foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects serial-tests]) +-AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects]) ++AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign 1.10 tar-pax no-dist-gzip dist-xz subdir-objects serial-tests]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) diff --git a/poky/meta/recipes-core/util-linux/util-linux/ptest.patch b/poky/meta/recipes-core/util-linux/util-linux/ptest.patch index 0537f7d85..ba2bd3f6a 100644 --- a/poky/meta/recipes-core/util-linux/util-linux/ptest.patch +++ b/poky/meta/recipes-core/util-linux/util-linux/ptest.patch @@ -1,23 +1,24 @@ -Define TESTS variable +From af073c13ef184ca75811df688e0a0a25827b36c3 Mon Sep 17 00:00:00 2001 +From: Tudor Florea +Date: Thu, 3 Dec 2015 04:08:00 +0100 +Subject: [PATCH] Define TESTS variable Signed-off-by: Tudor Florea Upstream-Status: Pending + --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am -index bbaccb1..7d5a6bb 100644 +index 886598d..1cf4346 100644 --- a/Makefile.am +++ b/Makefile.am -@@ -48,6 +48,7 @@ systemdsystemunit_DATA = +@@ -57,6 +57,7 @@ systemdsystemunit_DATA = dist_bashcompletion_DATA = check_PROGRAMS = dist_check_SCRIPTS = +TESTS = $(check_PROGRAMS) PATHFILES = - --- -2.8.3 - + ADOCFILES_COMMON = diff --git a/poky/meta/recipes-core/util-linux/util-linux_2.36.2.bb b/poky/meta/recipes-core/util-linux/util-linux_2.36.2.bb deleted file mode 100644 index c79cf782d..000000000 --- a/poky/meta/recipes-core/util-linux/util-linux_2.36.2.bb +++ /dev/null @@ -1,332 +0,0 @@ -require util-linux.inc - -#gtk-doc is not enabled as it requires xmlto which requires util-linux -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" -PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', '${PN}-pylibmount', '', d)}" - -python util_linux_binpackages () { - def pkg_hook(f, pkg, file_regex, output_pattern, modulename): - pn = d.getVar('PN') - d.appendVar('RRECOMMENDS_%s' % pn, ' %s' % pkg) - - if d.getVar('ALTERNATIVE_' + pkg): - return - if d.getVarFlag('ALTERNATIVE_LINK_NAME', modulename): - d.setVar('ALTERNATIVE_' + pkg, modulename) - - bindirs = sorted(list(set(d.expand("${base_sbindir} ${base_bindir} ${sbindir} ${bindir}").split()))) - for dir in bindirs: - do_split_packages(d, root=dir, - file_regex=r'(.*)', output_pattern='${PN}-%s', - description='${PN} %s', - hook=pkg_hook, extra_depends='') - - # There are some symlinks for some binaries which we have ignored - # above. Add them to the package owning the binary they are - # pointing to - extras = {} - dvar = d.getVar('PKGD') - for root in bindirs: - for walkroot, dirs, files in os.walk(dvar + root): - for f in files: - file = os.path.join(walkroot, f) - if not os.path.islink(file): - continue - - pkg = os.path.basename(os.readlink(file)) - extras[pkg] = extras.get(pkg, '') + ' ' + file.replace(dvar, '', 1) - - pn = d.getVar('PN') - for pkg, links in extras.items(): - of = d.getVar('FILES_' + pn + '-' + pkg) - links = of + links - d.setVar('FILES_' + pn + '-' + pkg, links) -} - -# we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS -PACKAGE_PREPROCESS_FUNCS =+ "util_linux_binpackages " - -# skip libuuid as it will be packaged by the util-linux-libuuid recipe -python util_linux_libpackages() { - do_split_packages(d, root=d.getVar('UTIL_LINUX_LIBDIR'), file_regex=r'^lib(?!uuid)(.*)\.so\..*$', - output_pattern='${PN}-lib%s', - description='${PN} lib%s', - extra_depends='', prepend=True, allow_links=True) -} - -PACKAGESPLITFUNCS =+ "util_linux_libpackages" - -PACKAGES_DYNAMIC = "^${PN}-.*" - -CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms" -UTIL_LINUX_LIBDIR = "${libdir}" -UTIL_LINUX_LIBDIR_class-target = "${base_libdir}" -EXTRA_OECONF = "\ - --enable-libuuid --enable-libblkid \ - \ - --enable-fsck --enable-kill --enable-last --enable-mesg \ - --enable-mount --enable-partx --enable-raw --enable-rfkill \ - --enable-unshare --enable-write \ - \ - --disable-bfs --disable-chfn-chsh --disable-login \ - --disable-makeinstall-chown --disable-minix --disable-newgrp \ - --disable-use-tty-group --disable-vipw \ - \ - --without-udev \ - \ - usrsbin_execdir='${sbindir}' \ - --libdir='${UTIL_LINUX_LIBDIR}' \ -" - -EXTRA_OECONF_append_class-target = " --enable-setpriv" -EXTRA_OECONF_append_class-native = " --without-cap-ng --disable-setpriv" -EXTRA_OECONF_append_class-nativesdk = " --without-cap-ng --disable-setpriv" -EXTRA_OECONF_append = " --disable-hwclock-gplv3" - -# enable pcre2 for native/nativesdk to match host distros -# this helps to keep same expectations when using the SDK or -# build host versions during development -# -PACKAGECONFIG ?= "pcre2" -PACKAGECONFIG_class-target ?= "${@bb.utils.filter('DISTRO_FEATURES', '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" -# Build python bindings for libmount -PACKAGECONFIG[pylibmount] = "--with-python=3 --enable-pylibmount,--without-python --disable-pylibmount,python3" -# Readline support -PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline" -# PCRE support in hardlink -PACKAGECONFIG[pcre2] = ",,libpcre2" -PACKAGECONFIG[cryptsetup] = "--with-cryptsetup,--without-cryptsetup,cryptsetup" - -EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}'" - -ALLOW_EMPTY_${PN} = "1" -FILES_${PN} = "" -FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*" -FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la" -FILES_${PN}-mount = "${sysconfdir}/default/mountall" -FILES_${PN}-runuser = "${sysconfdir}/pam.d/runuser*" -FILES_${PN}-su = "${sysconfdir}/pam.d/su-l" -CONFFILES_${PN}-su = "${sysconfdir}/pam.d/su-l" -FILES_${PN}-pylibmount = "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \ - ${PYTHON_SITEPACKAGES_DIR}/libmount/__init__.* \ - ${PYTHON_SITEPACKAGES_DIR}/libmount/__pycache__/*" - -# Util-linux' blkid replaces the e2fsprogs one -RCONFLICTS_${PN}-blkid = "${MLPREFIX}e2fsprogs-blkid" -RREPLACES_${PN}-blkid = "${MLPREFIX}e2fsprogs-blkid" - -RRECOMMENDS_${PN}_class-native = "" -RRECOMMENDS_${PN}_class-nativesdk = "" -RDEPENDS_${PN}_class-native = "" -RDEPENDS_${PN}_class-nativesdk = "" - -RDEPENDS_${PN} += " util-linux-libuuid" -RDEPENDS_${PN}-dev += " util-linux-libuuid-dev" - -RPROVIDES_${PN}-dev = "${PN}-libblkid-dev ${PN}-libmount-dev" - -RDEPENDS_${PN}-bash-completion += "${PN}-lsblk" -RDEPENDS_${PN}-ptest += "bash bc btrfs-tools coreutils e2fsprogs grep iproute2 kmod mdadm procps sed socat which xz" -RRECOMMENDS_${PN}-ptest += "kernel-module-scsi-debug" -RDEPENDS_${PN}-swaponoff = "${PN}-swapon ${PN}-swapoff" -ALLOW_EMPTY_${PN}-swaponoff = "1" - -#SYSTEMD_PACKAGES = "${PN}-uuidd ${PN}-fstrim" -SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.socket uuidd.service" -SYSTEMD_AUTO_ENABLE_${PN}-uuidd = "disable" -SYSTEMD_SERVICE_${PN}-fstrim = "fstrim.timer fstrim.service" -SYSTEMD_AUTO_ENABLE_${PN}-fstrim = "disable" - -do_install () { - # with ccache the timestamps on compiled files may - # end up earlier than on their inputs, this allows - # for the resultant compilation in the install step. - oe_runmake 'CC=${CC}' 'LD=${LD}' \ - 'LDFLAGS=${LDFLAGS}' 'DESTDIR=${D}' install - - mkdir -p ${D}${base_bindir} - - sbinprogs="agetty ctrlaltdel cfdisk vipw vigr" - sbinprogs_a="pivot_root hwclock mkswap losetup swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root nologin" - binprogs_a="dmesg getopt kill more umount mount login su mountpoint" - - if [ "${base_sbindir}" != "${sbindir}" ]; then - mkdir -p ${D}${base_sbindir} - for p in $sbinprogs $sbinprogs_a; do - if [ -f "${D}${sbindir}/$p" ]; then - mv "${D}${sbindir}/$p" "${D}${base_sbindir}/$p" - fi - done - fi - - if [ "${base_bindir}" != "${bindir}" ]; then - mkdir -p ${D}${base_bindir} - for p in $binprogs_a; do - if [ -f "${D}${bindir}/$p" ]; then - mv "${D}${bindir}/$p" "${D}${base_bindir}/$p" - fi - done - fi - - install -d ${D}${sysconfdir}/default/ - echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall - - rm -f ${D}${bindir}/chkdupexe -} - -do_install_append_class-target () { - if [ "${@bb.utils.filter('PACKAGECONFIG', 'pam', d)}" ]; then - install -d ${D}${sysconfdir}/pam.d - install -m 0644 ${WORKDIR}/runuser.pamd ${D}${sysconfdir}/pam.d/runuser - install -m 0644 ${WORKDIR}/runuser-l.pamd ${D}${sysconfdir}/pam.d/runuser-l - # Required for "su -" aka "su --login" because - # otherwise it uses "other", which has "auth pam_deny.so" - # and thus prevents the operation. - ln -s su ${D}${sysconfdir}/pam.d/su-l - fi -} -# nologin causes a conflict with shadow-native -# kill causes a conflict with coreutils-native (if ${bindir}==${base_bindir}) -do_install_append_class-native () { - rm -f ${D}${base_sbindir}/nologin - rm -f ${D}${base_bindir}/kill -} - -# dm-verity support introduces a circular build dependency, so util-linux-libuuid is split out for target builds -# Need to build libuuid for uuidgen, but then delete it and let the other recipe ship it -do_install_append () { - rm -rf ${D}${includedir}/uuid ${D}${libdir}/pkgconfig/uuid.pc ${D}${libdir}/libuuid* ${D}${base_libdir}/libuuid* -} - -ALTERNATIVE_PRIORITY = "80" - -ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid" -ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev" -ALTERNATIVE_LINK_NAME[cal] = "${bindir}/cal" -ALTERNATIVE_LINK_NAME[chrt] = "${bindir}/chrt" -ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg" -ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject" -ALTERNATIVE_LINK_NAME[fallocate] = "${bindir}/fallocate" -ALTERNATIVE_LINK_NAME[fdisk] = "${base_sbindir}/fdisk" -ALTERNATIVE_LINK_NAME[flock] = "${bindir}/flock" -ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck" -ALTERNATIVE_LINK_NAME[fsfreeze] = "${sbindir}/fsfreeze" -ALTERNATIVE_LINK_NAME[fstrim] = "${base_sbindir}/fstrim" -ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt" -ALTERNATIVE_${PN}-agetty = "getty" -ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty" -ALTERNATIVE_TARGET[getty] = "${base_sbindir}/agetty" -ALTERNATIVE_LINK_NAME[hexdump] = "${bindir}/hexdump" -ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock" -ALTERNATIVE_LINK_NAME[ionice] = "${bindir}/ionice" -ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill" -ALTERNATIVE_${PN}-last = "last lastb" -ALTERNATIVE_LINK_NAME[last] = "${bindir}/last" -ALTERNATIVE_LINK_NAME[lastb] = "${bindir}/lastb" -ALTERNATIVE_LINK_NAME[logger] = "${bindir}/logger" -ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup" -ALTERNATIVE_LINK_NAME[mesg] = "${bindir}/mesg" -ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap" -ALTERNATIVE_LINK_NAME[mcookie] = "${bindir}/mcookie" -ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more" -ALTERNATIVE_LINK_NAME[mount] = "${base_bindir}/mount" -ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint" -ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin" -ALTERNATIVE_LINK_NAME[nsenter] = "${bindir}/nsenter" -ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root" -ALTERNATIVE_LINK_NAME[prlimit] = "${bindir}/prlimit" -ALTERNATIVE_LINK_NAME[readprofile] = "${sbindir}/readprofile" -ALTERNATIVE_LINK_NAME[renice] = "${bindir}/renice" -ALTERNATIVE_LINK_NAME[rev] = "${bindir}/rev" -ALTERNATIVE_LINK_NAME[rfkill] = "${sbindir}/rfkill" -ALTERNATIVE_LINK_NAME[rtcwake] = "${sbindir}/rtcwake" -ALTERNATIVE_LINK_NAME[setpriv] = "${bindir}/setpriv" -ALTERNATIVE_LINK_NAME[setsid] = "${bindir}/setsid" -ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su" -ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin" -ALTERNATIVE_LINK_NAME[swapoff] = "${base_sbindir}/swapoff" -ALTERNATIVE_LINK_NAME[swapon] = "${base_sbindir}/swapon" -ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root" -ALTERNATIVE_LINK_NAME[taskset] = "${bindir}/taskset" -ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount" -ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare" -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" -do_compile_ptest() { - oe_runmake buildtest-TESTS -} - -do_install_ptest() { - mkdir -p ${D}${PTEST_PATH}/tests/ts - find . -name 'test*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; - find ./.libs -name 'sample*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; - find ./.libs -name 'test*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; - - cp ${S}/tests/*.sh ${D}${PTEST_PATH}/tests/ - cp -pR ${S}/tests/expected ${D}${PTEST_PATH}/tests/expected - cp -pR ${S}/tests/ts ${D}${PTEST_PATH}/tests/ - cp ${WORKDIR}/build/config.h ${D}${PTEST_PATH} - - # The original paths of executables to be tested point to a local folder containing - # the executables. We want to test the installed executables, not the local copies. - # So strip the paths, the executables will be located via "which" - sed -i \ - -e '/^TS_CMD/ s|$top_builddir/||g' \ - -e '/^TS_HELPER/ s|$top_builddir|${PTEST_PATH}|g' \ - ${D}${PTEST_PATH}/tests/commands.sh - - # Change 'if [ ! -x "$1" ]' to 'if [ ! -x "`which $1 2>/dev/null`"]' - sed -i -e \ - '/^\tif[[:space:]]\[[[:space:]]![[:space:]]-x[[:space:]]"$1"/s|$1|`which $1 2>/dev/null`|g' \ - ${D}${PTEST_PATH}/tests/functions.sh - - # Running "kill" without the the complete path would use the shell's built-in kill - sed -i -e \ - '/^TS_CMD_KILL/ s|kill|${PTEST_PATH}/bin/kill|g' \ - ${D}${PTEST_PATH}/tests/commands.sh - - - sed -i 's|@base_sbindir@|${base_sbindir}|g' ${D}${PTEST_PATH}/run-ptest - -} diff --git a/poky/meta/recipes-core/util-linux/util-linux_2.37.bb b/poky/meta/recipes-core/util-linux/util-linux_2.37.bb new file mode 100644 index 000000000..9a50c75e7 --- /dev/null +++ b/poky/meta/recipes-core/util-linux/util-linux_2.37.bb @@ -0,0 +1,302 @@ +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 +DEPENDS = "libcap-ng ncurses virtual/crypt zlib util-linux-libuuid" + +PACKAGES =+ "${PN}-swaponoff" +PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', '${PN}-pylibmount', '', d)}" + +python util_linux_binpackages () { + def pkg_hook(f, pkg, file_regex, output_pattern, modulename): + pn = d.getVar('PN') + d.appendVar('RRECOMMENDS_%s' % pn, ' %s' % pkg) + + if d.getVar('ALTERNATIVE_' + pkg): + return + if d.getVarFlag('ALTERNATIVE_LINK_NAME', modulename): + d.setVar('ALTERNATIVE_' + pkg, modulename) + + bindirs = sorted(list(set(d.expand("${base_sbindir} ${base_bindir} ${sbindir} ${bindir}").split()))) + for dir in bindirs: + do_split_packages(d, root=dir, + file_regex=r'(.*)', output_pattern='${PN}-%s', + description='${PN} %s', + hook=pkg_hook, extra_depends='') + + # There are some symlinks for some binaries which we have ignored + # above. Add them to the package owning the binary they are + # pointing to + extras = {} + dvar = d.getVar('PKGD') + for root in bindirs: + for walkroot, dirs, files in os.walk(dvar + root): + for f in files: + file = os.path.join(walkroot, f) + if not os.path.islink(file): + continue + + pkg = os.path.basename(os.readlink(file)) + extras[pkg] = extras.get(pkg, '') + ' ' + file.replace(dvar, '', 1) + + pn = d.getVar('PN') + for pkg, links in extras.items(): + of = d.getVar('FILES_' + pn + '-' + pkg) + links = of + links + d.setVar('FILES_' + pn + '-' + pkg, links) +} + +# we must execute before update-alternatives PACKAGE_PREPROCESS_FUNCS +PACKAGE_PREPROCESS_FUNCS =+ "util_linux_binpackages " + +# skip libuuid as it will be packaged by the util-linux-libuuid recipe +python util_linux_libpackages() { + do_split_packages(d, root=d.getVar('UTIL_LINUX_LIBDIR'), file_regex=r'^lib(?!uuid)(.*)\.so\..*$', + output_pattern='${PN}-lib%s', + description='${PN} lib%s', + extra_depends='', prepend=True, allow_links=True) +} + +PACKAGESPLITFUNCS =+ "util_linux_libpackages" + +PACKAGES_DYNAMIC = "^${PN}-.*" + +CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms" +UTIL_LINUX_LIBDIR = "${libdir}" +UTIL_LINUX_LIBDIR_class-target = "${base_libdir}" +EXTRA_OECONF = "\ + --enable-libuuid --enable-libblkid \ + \ + --enable-fsck --enable-kill --enable-last --enable-mesg \ + --enable-mount --enable-partx --enable-raw --enable-rfkill \ + --enable-unshare --enable-write \ + \ + --disable-bfs --disable-chfn-chsh --disable-login \ + --disable-makeinstall-chown --disable-minix --disable-newgrp \ + --disable-use-tty-group --disable-vipw \ + \ + --without-udev \ + \ + usrsbin_execdir='${sbindir}' \ + --libdir='${UTIL_LINUX_LIBDIR}' \ +" + +EXTRA_OECONF_append_class-target = " --enable-setpriv" +EXTRA_OECONF_append_class-native = " --without-cap-ng --disable-setpriv" +EXTRA_OECONF_append_class-nativesdk = " --without-cap-ng --disable-setpriv" +EXTRA_OECONF_append = " --disable-hwclock-gplv3" + +# enable pcre2 for native/nativesdk to match host distros +# this helps to keep same expectations when using the SDK or +# build host versions during development +# +PACKAGECONFIG ?= "pcre2" +PACKAGECONFIG_class-target ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" +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" +# Build python bindings for libmount +PACKAGECONFIG[pylibmount] = "--with-python=3 --enable-pylibmount,--without-python --disable-pylibmount,python3" +# Readline support +PACKAGECONFIG[readline] = "--with-readline,--without-readline,readline" +# PCRE support in hardlink +PACKAGECONFIG[pcre2] = ",,libpcre2" +PACKAGECONFIG[cryptsetup] = "--with-cryptsetup,--without-cryptsetup,cryptsetup" + +EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}'" + +ALLOW_EMPTY_${PN} = "1" +FILES_${PN} = "" +FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*" +FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.la" +FILES_${PN}-mount = "${sysconfdir}/default/mountall" +FILES_${PN}-runuser = "${sysconfdir}/pam.d/runuser*" +FILES_${PN}-su = "${sysconfdir}/pam.d/su-l" +CONFFILES_${PN}-su = "${sysconfdir}/pam.d/su-l" +FILES_${PN}-pylibmount = "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \ + ${PYTHON_SITEPACKAGES_DIR}/libmount/__init__.* \ + ${PYTHON_SITEPACKAGES_DIR}/libmount/__pycache__/*" + +# Util-linux' blkid replaces the e2fsprogs one +RCONFLICTS_${PN}-blkid = "${MLPREFIX}e2fsprogs-blkid" +RREPLACES_${PN}-blkid = "${MLPREFIX}e2fsprogs-blkid" + +RRECOMMENDS_${PN}_class-native = "" +RRECOMMENDS_${PN}_class-nativesdk = "" +RDEPENDS_${PN}_class-native = "" +RDEPENDS_${PN}_class-nativesdk = "" + +RDEPENDS_${PN} += " util-linux-libuuid" +RDEPENDS_${PN}-dev += " util-linux-libuuid-dev" + +RPROVIDES_${PN}-dev = "${PN}-libblkid-dev ${PN}-libmount-dev" + +RDEPENDS_${PN}-bash-completion += "${PN}-lsblk" +RDEPENDS_${PN}-ptest += "bash bc btrfs-tools coreutils e2fsprogs grep iproute2 kmod mdadm procps sed socat which xz" +RRECOMMENDS_${PN}-ptest += "kernel-module-scsi-debug" +RDEPENDS_${PN}-swaponoff = "${PN}-swapon ${PN}-swapoff" +ALLOW_EMPTY_${PN}-swaponoff = "1" + +#SYSTEMD_PACKAGES = "${PN}-uuidd ${PN}-fstrim" +SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.socket uuidd.service" +SYSTEMD_AUTO_ENABLE_${PN}-uuidd = "disable" +SYSTEMD_SERVICE_${PN}-fstrim = "fstrim.timer fstrim.service" +SYSTEMD_AUTO_ENABLE_${PN}-fstrim = "disable" + +do_install () { + # with ccache the timestamps on compiled files may + # end up earlier than on their inputs, this allows + # for the resultant compilation in the install step. + oe_runmake 'CC=${CC}' 'LD=${LD}' \ + 'LDFLAGS=${LDFLAGS}' 'DESTDIR=${D}' install + + mkdir -p ${D}${base_bindir} + + sbinprogs="agetty ctrlaltdel cfdisk vipw vigr" + sbinprogs_a="pivot_root hwclock mkswap losetup swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root nologin" + binprogs_a="dmesg getopt kill more umount mount login su mountpoint" + + if [ "${base_sbindir}" != "${sbindir}" ]; then + mkdir -p ${D}${base_sbindir} + for p in $sbinprogs $sbinprogs_a; do + if [ -f "${D}${sbindir}/$p" ]; then + mv "${D}${sbindir}/$p" "${D}${base_sbindir}/$p" + fi + done + fi + + if [ "${base_bindir}" != "${bindir}" ]; then + mkdir -p ${D}${base_bindir} + for p in $binprogs_a; do + if [ -f "${D}${bindir}/$p" ]; then + mv "${D}${bindir}/$p" "${D}${base_bindir}/$p" + fi + done + fi + + install -d ${D}${sysconfdir}/default/ + echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall + + rm -f ${D}${bindir}/chkdupexe +} + +do_install_append_class-target () { + if [ "${@bb.utils.filter('PACKAGECONFIG', 'pam', d)}" ]; then + install -d ${D}${sysconfdir}/pam.d + install -m 0644 ${WORKDIR}/runuser.pamd ${D}${sysconfdir}/pam.d/runuser + install -m 0644 ${WORKDIR}/runuser-l.pamd ${D}${sysconfdir}/pam.d/runuser-l + # Required for "su -" aka "su --login" because + # otherwise it uses "other", which has "auth pam_deny.so" + # and thus prevents the operation. + ln -s su ${D}${sysconfdir}/pam.d/su-l + fi +} +# nologin causes a conflict with shadow-native +# kill causes a conflict with coreutils-native (if ${bindir}==${base_bindir}) +do_install_append_class-native () { + rm -f ${D}${base_sbindir}/nologin + rm -f ${D}${base_bindir}/kill +} + +# dm-verity support introduces a circular build dependency, so util-linux-libuuid is split out for target builds +# Need to build libuuid for uuidgen, but then delete it and let the other recipe ship it +do_install_append () { + rm -rf ${D}${includedir}/uuid ${D}${libdir}/pkgconfig/uuid.pc ${D}${libdir}/libuuid* ${D}${base_libdir}/libuuid* +} + +ALTERNATIVE_PRIORITY = "80" + +ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid" +ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev" +ALTERNATIVE_LINK_NAME[cal] = "${bindir}/cal" +ALTERNATIVE_LINK_NAME[chrt] = "${bindir}/chrt" +ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg" +ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject" +ALTERNATIVE_LINK_NAME[fallocate] = "${bindir}/fallocate" +ALTERNATIVE_LINK_NAME[fdisk] = "${base_sbindir}/fdisk" +ALTERNATIVE_LINK_NAME[flock] = "${bindir}/flock" +ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck" +ALTERNATIVE_LINK_NAME[fsfreeze] = "${sbindir}/fsfreeze" +ALTERNATIVE_LINK_NAME[fstrim] = "${base_sbindir}/fstrim" +ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt" +ALTERNATIVE_${PN}-agetty = "getty" +ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty" +ALTERNATIVE_TARGET[getty] = "${base_sbindir}/agetty" +ALTERNATIVE_LINK_NAME[hexdump] = "${bindir}/hexdump" +ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock" +ALTERNATIVE_LINK_NAME[ionice] = "${bindir}/ionice" +ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill" +ALTERNATIVE_${PN}-last = "last lastb" +ALTERNATIVE_LINK_NAME[last] = "${bindir}/last" +ALTERNATIVE_LINK_NAME[lastb] = "${bindir}/lastb" +ALTERNATIVE_LINK_NAME[logger] = "${bindir}/logger" +ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup" +ALTERNATIVE_LINK_NAME[mesg] = "${bindir}/mesg" +ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap" +ALTERNATIVE_LINK_NAME[mcookie] = "${bindir}/mcookie" +ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more" +ALTERNATIVE_LINK_NAME[mount] = "${base_bindir}/mount" +ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint" +ALTERNATIVE_LINK_NAME[nologin] = "${base_sbindir}/nologin" +ALTERNATIVE_LINK_NAME[nsenter] = "${bindir}/nsenter" +ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root" +ALTERNATIVE_LINK_NAME[prlimit] = "${bindir}/prlimit" +ALTERNATIVE_LINK_NAME[readprofile] = "${sbindir}/readprofile" +ALTERNATIVE_LINK_NAME[renice] = "${bindir}/renice" +ALTERNATIVE_LINK_NAME[rev] = "${bindir}/rev" +ALTERNATIVE_LINK_NAME[rfkill] = "${sbindir}/rfkill" +ALTERNATIVE_LINK_NAME[rtcwake] = "${sbindir}/rtcwake" +ALTERNATIVE_LINK_NAME[setpriv] = "${bindir}/setpriv" +ALTERNATIVE_LINK_NAME[setsid] = "${bindir}/setsid" +ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su" +ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin" +ALTERNATIVE_LINK_NAME[swapoff] = "${base_sbindir}/swapoff" +ALTERNATIVE_LINK_NAME[swapon] = "${base_sbindir}/swapon" +ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root" +ALTERNATIVE_LINK_NAME[taskset] = "${bindir}/taskset" +ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount" +ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare" +ALTERNATIVE_LINK_NAME[utmpdump] = "${bindir}/utmpdump" +ALTERNATIVE_LINK_NAME[uuidgen] = "${bindir}/uuidgen" +ALTERNATIVE_LINK_NAME[wall] = "${bindir}/wall" + +BBCLASSEXTEND = "native nativesdk" + +PTEST_BINDIR = "1" +do_compile_ptest() { + oe_runmake buildtest-TESTS +} + +do_install_ptest() { + mkdir -p ${D}${PTEST_PATH}/tests/ts + find . -name 'test*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; + find ./.libs -name 'sample*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; + find ./.libs -name 'test*' -maxdepth 1 -type f -perm -111 -exec cp {} ${D}${PTEST_PATH} \; + + cp ${S}/tests/*.sh ${D}${PTEST_PATH}/tests/ + cp -pR ${S}/tests/expected ${D}${PTEST_PATH}/tests/expected + cp -pR ${S}/tests/ts ${D}${PTEST_PATH}/tests/ + cp ${WORKDIR}/build/config.h ${D}${PTEST_PATH} + + # The original paths of executables to be tested point to a local folder containing + # the executables. We want to test the installed executables, not the local copies. + # So strip the paths, the executables will be located via "which" + sed -i \ + -e '/^TS_CMD/ s|$top_builddir/||g' \ + -e '/^TS_HELPER/ s|$top_builddir|${PTEST_PATH}|g' \ + ${D}${PTEST_PATH}/tests/commands.sh + + # Change 'if [ ! -x "$1" ]' to 'if [ ! -x "`which $1 2>/dev/null`"]' + sed -i -e \ + '/^\tif[[:space:]]\[[[:space:]]![[:space:]]-x[[:space:]]"$1"/s|$1|`which $1 2>/dev/null`|g' \ + ${D}${PTEST_PATH}/tests/functions.sh + + # Running "kill" without the the complete path would use the shell's built-in kill + sed -i -e \ + '/^TS_CMD_KILL/ s|kill|${PTEST_PATH}/bin/kill|g' \ + ${D}${PTEST_PATH}/tests/commands.sh + + + sed -i 's|@base_sbindir@|${base_sbindir}|g' ${D}${PTEST_PATH}/run-ptest + +} -- cgit v1.2.3