Date   

Re: [PATCH] libva: move wayland PACKAGECONFIG to libva.inc

Alexander Kanavin
 

Right, then the correct fix is to move all PACKAGECONFIG options to libva.inc, then set
PACKAGECONFIG ?= "" in libva-initial.

Alex


On Sat, 11 Dec 2021 at 11:00, Markus Volk <f_l_k@...> wrote:

I was able to narrow the issue down a little bit. I can reproduce it with plain poky by adding this to local.conf


PACKAGECONFIG:append:pn-libdrm = " udev"
DISTRO_FEATURES:append = " systemd"

and do

'bitbake libva-initial'

Am 10.12.21 um 16:47 schrieb Khem Raj:


On Fri, Dec 10, 2021 at 6:33 AM Markus Volk <f_l_k@...> wrote:

Thats strange indeed. Wayland is set as a DISTRO_FEATURE for my image, so it gets built by a lot of packages. This wasn't a clean build, i had sstate cache availbale when i started to experiment with libva and normally it doesn't get  built inside my image because i can't use it on my board. First i did 'bitbake libva' and this succeeded. Second i added 'va' PACKAGECONFIG to a mesa.bbappend and started rebuilding the image. Now the build for libva-initial was started and failed with the error about missing wayland-scanner.

I also wondered what is pulling  wayland into  its sysroot . Did 'bitbake -c cleanstate libva-initial libva' and tried to build libva-initial again with 'bitbake libva-initial' and had the same issue. On my machine this is reproducible


Post configure logs including meson run  logs for this package perhaps there is some hint in there 


Markus

Am 10.12.21 um 15:06 schrieb Alexander Kanavin:
| Run-time dependency wayland-client found: YES 1.19.0

Can you please explain how the issue can be reproduced? I find it odd that libva-initial (which only needs libdrm, and is required by mesa) has wayland in its sysroot in your build - where does that come from? There's a chance the problem is elsewhere.

Alex

On Fri, 10 Dec 2021 at 15:03, Markus Volk <f_l_k@...> wrote:
I encountered an error while trying to build libva under wayland. libva-initial
was missing wayland-native dependency and failed like this:

| Run-time dependency xfixes found: NO (tried pkgconfig and cmake)
| Run-time dependency wayland-client found: YES 1.19.0
| Program wayland-scanner /usr/bin/wayland-scanner found: NO
|
| ../libva-2.13.0/meson.build:107:4: ERROR: Program 'wayland-scanner /usr/bin/wayland-scanner' not found
|
| A full log can be found at /home/flk/build/poky/build-rock/tmp/work/cortexa72-cortexa53-crypto-poky-linux/libva-initial/2.13.0-r0/build/meson-logs/meson-log.txt
| ERROR: meson failed
| WARNING: exit code 1 from a shell command.

This commit moves the PACKAGECONFIG[wayland] to libva.inc to make it available to libva-initial also

Signed-off-by: MarkusVolk <f_l_k@...>
---
 meta/recipes-graphics/libva/libva.inc       | 7 +++++++
 meta/recipes-graphics/libva/libva_2.13.0.bb | 4 +---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-graphics/libva/libva.inc b/meta/recipes-graphics/libva/libva.inc
index bcf9757c1a..0e2721e291 100644
--- a/meta/recipes-graphics/libva/libva.inc
+++ b/meta/recipes-graphics/libva/libva.inc
@@ -27,3 +27,10 @@ UPSTREAM_CHECK_URI = "https://github.com/intel/libva/releases"
 DEPENDS = "libdrm"

 inherit meson pkgconfig
+
+PACKAGECONFIG:append = " \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)} \
+"
+
+PACKAGECONFIG[wayland] = "-Dwith_wayland=yes,-Dwith_wayland=no,wayland-native wayland"
+
diff --git a/meta/recipes-graphics/libva/libva_2.13.0.bb b/meta/recipes-graphics/libva/libva_2.13.0.bb
index ed2be289fc..a8c6355b01 100644
--- a/meta/recipes-graphics/libva/libva_2.13.0.bb
+++ b/meta/recipes-graphics/libva/libva_2.13.0.bb
@@ -2,14 +2,12 @@ require libva.inc

 PACKAGECONFIG ??= " \
     ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'glx', '', d)} \
-    ${@bb.utils.filter('DISTRO_FEATURES', 'x11 wayland', d)} \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} \
 "

 PACKAGECONFIG[x11] = "-Dwith_x11=yes,-Dwith_x11=no,virtual/libx11 libxext libxfixes"
 PACKAGECONFIG[glx] = "-Dwith_glx=yes,-Dwith_glx=no,virtual/mesa"

-PACKAGECONFIG[wayland] = "-Dwith_wayland=yes,-Dwith_wayland=no,wayland-native wayland"
-
 PACKAGES =+ "${PN}-x11 ${PN}-glx ${PN}-wayland"

 RDEPENDS:${PN}-x11 =+ "${PN}"
--
2.25.1










    




Re: The state of DKMS in the Yocto community

Bruce Ashfield
 

On Fri, Dec 10, 2021 at 3:58 PM Alex Stewart <alex.stewart@...> wrote:

Hey List,

I'm trying to work out the mysterious state of DKMS in OE-Core.

Our (NI) OE distributions rely heavily on DKMS to (un)install our
ecosystem of kernel drivers at runtime across our product lines. To
facilitate that, we authored a dkms_2.4.0.bb recipe [1] back in 2017,
which we have carried out-of-stream since.

We tried to upstream it, and the patched rev'ed a couple of times [2];
but it seems to have never made it into a yocto release.

Though some other recipes mention DKMS passingly, I don't see anywhere
that OE-Core officially supports it. Nor does my googling reveal anyone
else who uses DKMS. I find that a little hard to believe, though I
understand that it's probably relatively rare in the embedded space.


@all
So does anyone else on the list use DKMS in their yocto distribution?
Are you maintaining a DKMS recipe out-of-stream as well?


@maintainers
If NI upgraded our DKMS recipe to a more recent version than 2.4.0 and
submitted it again to OE-Core, would you accept it? If not, we will move
it to our own meta layer and accept that we are unique in this regard.
I used to have a DKMS recipe myself (at my previous employer), but
never submitted it, because generally speaking, there are better ways
to do things in OE.

DKMS tends to avoid proper cross compilation (which of course we
already do), or is often used to distribute proprietary code (which we
don't want to encourage), or is avoiding the need to upstream the
module code (which we also don't want to encourage). It also only
tends to be used on a subset of the architectures that have enough
memory/cpu to build on target, so by definition it is a bit more
niche.

We of course already have the ability to build modules on the target
(we have a test case in core that does just that), so what is in core
can support what DKMS needs to build on target.

I don't see this as something that makes sense in oe-core (but maybe
I'm not fully understanding the case, and where the current support is
failing), but could of course be contributed to another layer.

Cheers,

Bruce




[1]
https://github.com/ni/openembedded-core/commit/5789a27b68d95f3840bb8c4cb0d7b28d538c9a50

[2] https://lists.openembedded.org/g/openembedded-core/message/100680

Thanks,

--
Alex Stewart
Software Engineer - NI Real-Time OS
NI (National Instruments)

alex.stewart@...




--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II


Re: [oe] Help with Inclusive Language in OpenEmbedded/Yocto Project

Armin Kuster
 

On 12/6/21 5:01 PM, Jon Mason wrote:
This email is a follow-up from the session held on Friday at the
OpenEmbedded Developer's Virtual Meeting (see
https://www.openembedded.org/wiki/OEDVM_Nov_2021)

The session was not recorded, but the slides can be found at
https://docs.google.com/presentation/d/146ueVVTMeA8JI43wqv5kFmdYEygqqmfGH0z1VRL2bDA/edit?usp=sharing

The outcome from the discussion was that inclusive language changes
are something that we want to accomplish in the kirkstone release
timeframe (with an exception for the "master" branch name, which will
be handled at a future date).

There has already been a pass at collecting the needed changes at
https://wiki.yoctoproject.org/wiki/Inclusive_language

This is not as simple as a find/replace of offending words. There is
a desire for backward compatibility or to provide some kind of "you
want X, which is now Y" (which complicates things).

The intention of this email is to see who is interested in helping
out. Once we know how many people are available and what time frames,
we can plan out a roadmap. So, please email me (or respond to this
thread publicly) and I'll add you to the list. There will then be a
follow-up zoom call in the next week or so to plan out the roadmap.

We will document the roadmap and everything else on the YP wiki page above.

Questions and comments are welcome, but not interested in debating the
necessity or timeframe of this task. It has already been decided.
Thanks for driving this.

please add me to the list.

-armin

Thanks,
Jon



Re: The state of DKMS in the Yocto community

Leon Woestenberg
 

Hello Alex,

with DKMS, do you mean cross-compiling out-of-kernel modules on the
build machine (that runs the Yocto/OpenEmbedded driven build)?

Or do you mean provisioning the target with enough tools to allow
compiling out-of-kernel modules there from source?

In the first case, yes, I can share such recipe for reasonably recent releases.

Regards,

Leon.

--
Leon Woestenberg
leon@...
T: +31 40 711 42 76
M: +31 6 472 30 372

Sidebranch Embedded Systems
Eindhoven, The Netherlands
http://www.sidebranch.com

On Fri, Dec 10, 2021 at 9:58 PM Alex Stewart <alex.stewart@...> wrote:

Hey List,

I'm trying to work out the mysterious state of DKMS in OE-Core.

Our (NI) OE distributions rely heavily on DKMS to (un)install our
ecosystem of kernel drivers at runtime across our product lines. To
facilitate that, we authored a dkms_2.4.0.bb recipe [1] back in 2017,
which we have carried out-of-stream since.

We tried to upstream it, and the patched rev'ed a couple of times [2];
but it seems to have never made it into a yocto release.

Though some other recipes mention DKMS passingly, I don't see anywhere
that OE-Core officially supports it. Nor does my googling reveal anyone
else who uses DKMS. I find that a little hard to believe, though I
understand that it's probably relatively rare in the embedded space.


@all
So does anyone else on the list use DKMS in their yocto distribution?
Are you maintaining a DKMS recipe out-of-stream as well?


@maintainers
If NI upgraded our DKMS recipe to a more recent version than 2.4.0 and
submitted it again to OE-Core, would you accept it? If not, we will move
it to our own meta layer and accept that we are unique in this regard.


[1]
https://github.com/ni/openembedded-core/commit/5789a27b68d95f3840bb8c4cb0d7b28d538c9a50

[2] https://lists.openembedded.org/g/openembedded-core/message/100680

Thanks,

--
Alex Stewart
Software Engineer - NI Real-Time OS
NI (National Instruments)

alex.stewart@...




[PATCH v2] puzzles: Upgrade to latest git with patches merged

Richard Purdie
 

This upgrades to the latest upstream version where our fixes have equivalent
fixes merged upstream so our patches are no longer needed.

Signed-off-by: Richard Purdie <richard.purdie@...>
---
...Check-for-excessive-values-to-malloc.patch | 45 ------------
...01-map-Fix-stringop-overflow-warning.patch | 34 ---------
...isade-Fix-warnings-with-clang-on-arm.patch | 72 -------------------
...-string-lenght-parameter-to-be-size_.patch | 30 --------
...ix-compiling-failure-with-option-g-O.patch | 33 ---------
.../puzzles/files/fix-ki-uninitialized.patch | 32 ---------
meta/recipes-sato/puzzles/puzzles_git.bb | 11 +--
7 files changed, 2 insertions(+), 255 deletions(-)
delete mode 100644 meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch
delete mode 100644 meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch
delete mode 100644 meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch
delete mode 100644 meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch
delete mode 100644 meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch
delete mode 100644 meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch

diff --git a/meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch b/meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch
deleted file mode 100644
index b572b55d1cf..00000000000
--- a/meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-tree234: Avoid excessive values to malloc
-
-with whole program optimizers like lto, smalloc() is inlined the excessive
-constant argument is propagated to malloc() and ultimately triggers the warning.
-
-| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c: In function 'disptree':
-| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:46:17: error: argument 1 value '18446744073709551612' exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=]
-| 46 | #define smalloc malloc
-| | ^
-| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:1631:17: note: in expansion of macro 'smalloc'
-| 1631 | leveldata = smalloc(ht * (width+2));
-| | ^~~~~~~
-| In file included from tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:29:
-| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/recipe-sysroot/usr/include/stdlib.h:539:14: note: in a call to allocation function 'malloc' declared here
-| 539 | extern void *malloc (size_t __size) __THROW __attribute_malloc__
-| | ^~~~~~
-| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:46:17: error: argument 1 value '18446744073709551600' exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=]
-| 46 | #define smalloc malloc
-| | ^
-| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:1632:18: note: in expansion of macro 'smalloc'
-| 1632 | ctx.levels = smalloc(ht * sizeof(char *));
-| | ^~~~~~~
-| In file included from tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:29:
-| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/recipe-sysroot/usr/include/stdlib.h:539:14: note: in a call to allocation function 'malloc' declared here
-| 539 | extern void *malloc (size_t __size) __THROW __attribute_malloc__
-| | ^~~~~~
-| cc1: some warnings being treated as errors
-
-Upstream-Status: Submitted [email discussion with upstream]
-
-Signed-off-by: Richard Purdie <richard.purdie@...>
-
-Index: git/tree234.c
-===================================================================
---- git.orig/tree234.c
-+++ git/tree234.c
-@@ -1621,7 +1621,7 @@ void disptree(tree234 *t) {
- dispctx ctx;
- char *leveldata;
- int width = count234(t);
-- int ht = height234(t) * 3 - 2;
-+ unsigned int ht = height234(t) * 3 - 2;
- int i;
-
- if (!t->root) {
diff --git a/meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch b/meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch
deleted file mode 100644
index 7f46d3ec0eb..00000000000
--- a/meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From: Khem Raj <raj.khem@...>
-map: Fix stringop-overflow warning
-
-Fixes
-
-../git/map.c: In function 'new_game_desc':
-../git/map.c:1663:23: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
- 1663 | ret[retlen++] = ',';
- | ~~~~~~~~~~~~~~^~~~~
-../git/./map.c: In function 'new_game_desc':
-../git/./map.c:1663:23: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
- 1663 | ret[retlen++] = ',';
- | ~~~~~~~~~~~~~~^~~~~
-
-Upstream-Status: Submitted [email discussion with upstream]
-
-Signed-off-by: Richard Purdie <richard.purdie@...>
-Signed-off-by: Khem Raj <raj.khem@...>
-
-Index: git/map.c
-===================================================================
---- git.orig/map.c
-+++ git/map.c
-@@ -1659,6 +1659,10 @@ static char *new_game_desc(const game_pa
- }
- }
-
-+ if (retlen + 10 >= retsize) {
-+ retsize = retlen + 256;
-+ ret = sresize(ret, retsize, char);
-+ }
- ret[retlen++] = 'a'-1 + run;
- ret[retlen++] = ',';
-
diff --git a/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch b/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch
deleted file mode 100644
index 07eb1d32f65..00000000000
--- a/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From: Khem Raj <raj.khem@...>
-
-palisade: Fix warnings with clang on arm
-
-ARM treats 'char' as unsigned char when 'char' is not qualified with
-'signed' or 'unsigned' explicitly.
-
-This results in warnings e.g.
-
-palisade.c:531:22: error: comparison of constant -1 with expression of
-type 'clue' (aka 'char') is always false
-[-Werror,-Wtautological-constant-out-of-range-compare]
- if (clues[i] == EMPTY) continue;
-
-Therefore, typcast the contant to char in such places to be explicit
-
-Upstream-Status: Submitted [email discussion with upstream]
-
-Signed-off-by: Richard Purdie <richard.purdie@...>
-Signed-off-by: Khem Raj <raj.khem@...>
-
-Index: git/palisade.c
-===================================================================
---- git.orig/palisade.c
-+++ git/palisade.c
-@@ -46,7 +46,7 @@ struct game_params {
- int w, h, k;
- };
-
--typedef char clue;
-+typedef signed char clue;
- typedef unsigned char borderflag;
-
- typedef struct shared_state {
-@@ -242,7 +242,7 @@ typedef struct solver_ctx {
- * thing is done. See how it is propagated across multiple squares.]
- */
-
--#define EMPTY (~0)
-+#define EMPTY ((clue)-1)
-
- #define BIT(i) (1 << (i))
- #define BORDER(i) BIT(i)
-@@ -622,7 +622,7 @@ static char *new_game_desc(const game_pa
- {
- int w = params->w, h = params->h, wh = w*h, k = params->k;
-
-- clue *numbers = snewn(wh + 1, clue), *p;
-+ clue *numbers = snewn(wh + 1, clue);
- borderflag *rim = snewn(wh, borderflag);
- borderflag *scratch_borders = snewn(wh, borderflag);
-
-@@ -682,7 +682,8 @@ static char *new_game_desc(const game_pa
- sfree(shuf);
- sfree(dsf);
-
-- p = numbers;
-+ char *output = snewn(wh + 1, char), *p = output;
-+
- r = 0;
- for (i = 0; i < wh; ++i) {
- if (numbers[i] != EMPTY) {
-@@ -699,7 +700,8 @@ static char *new_game_desc(const game_pa
- }
- *p++ = '\0';
-
-- return sresize(numbers, p - numbers, clue);
-+ sfree(numbers);
-+ return sresize(output, p - output, char);
- }
-
- static const char *validate_desc(const game_params *params, const char *desc)
diff --git a/meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch b/meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch
deleted file mode 100644
index 5e240bfea57..00000000000
--- a/meta/recipes-sato/puzzles/files/0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: Khem Raj <raj.khem@...>
-
-pattern.c: Change string lenght parameter to be size_t in do_row()
-
-This fixes below error on some architectures e.g. RISC-V
-
-pattern.c:455:9: error: 'memset' specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] 455 | memset(deduced, DOT, (size_t)len); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Upstream-Status: Submitted [email discussion with upstream]
-
-Signed-off-by: Richard Purdie <richard.purdie@...>
-Signed-off-by: Khem Raj <raj.khem@...>
-
----
- pattern.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Index: git/pattern.c
-===================================================================
---- git.orig/pattern.c
-+++ git/pattern.c
-@@ -429,7 +429,7 @@ static bool do_row(unsigned char *known,
- unsigned char *row,
- unsigned char *minpos_done, unsigned char *maxpos_done,
- unsigned char *minpos_ok, unsigned char *maxpos_ok,
-- unsigned char *start, int len, int step, int *data,
-+ unsigned char *start, size_t len, int step, int *data,
- unsigned int *changed
- #ifdef STANDALONE_SOLVER
- , const char *rowcol, int index, int cluewid
diff --git a/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch b/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch
deleted file mode 100644
index 4ee75431667..00000000000
--- a/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From: Hongxu Jia <hongxu.jia@...>
-
-gtk.c: fix compiling failure with option -g -O
-
-There was a compile failure with option -g -O
-...
-././gtk.c: In function 'main':
-././gtk.c:2911:6: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized]
- fprintf(stderr, "%s: %s\n", pname, error);
- ^
-cc1: all warnings being treated as errors
-...
-
-Fix by initializing pointer 'error' with NULL
-
-Upstream-Status: Submitted [email discussion with upstream]
-
-Signed-off-by: Richard Purdie <richard.purdie@...>
-Signed-off-by: Hongxu Jia <hongxu.jia@...>
-
-Index: git/gtk.c
-===================================================================
---- git.orig/gtk.c
-+++ git/gtk.c
-@@ -3578,7 +3578,7 @@ static void list_presets_from_menu(struc
- int main(int argc, char **argv)
- {
- char *pname = argv[0];
-- char *error;
-+ char *error = NULL;
- int ngenerate = 0, px = 1, py = 1;
- bool print = false;
- bool time_generation = false, test_solve = false, list_presets = false;
diff --git a/meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch b/meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch
deleted file mode 100644
index b182240240b..00000000000
--- a/meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-tree123: avoid compiler unitialized variable error
-
-The compiler does not realize that we must go through the while()
-loop at least once, so we replace it with a for() loop.
-
-Upstream-Status: Submitted [email discussion with upstream]
-
-Signed-off-by: Richard Purdie <richard.purdie@...>
-Signed-off-by: Joe Slater <joe.slater@...>
-
-Index: git/tree234.c
-===================================================================
---- git.orig/tree234.c
-+++ git/tree234.c
-@@ -335,7 +335,7 @@ static void *add234_internal(tree234 *t,
- }
-
- n = t->root;
-- while (n) {
-+ do {
- LOG((" node %p: %p/%d \"%s\" %p/%d \"%s\" %p/%d \"%s\" %p/%d\n",
- n,
- n->kids[0], n->counts[0], n->elems[0],
-@@ -388,7 +388,7 @@ static void *add234_internal(tree234 *t,
- if (!n->kids[ki])
- break;
- n = n->kids[ki];
-- }
-+ } while (n);
-
- add234_insert(NULL, e, NULL, &t->root, n, ki);
-
diff --git a/meta/recipes-sato/puzzles/puzzles_git.bb b/meta/recipes-sato/puzzles/puzzles_git.bb
index 8ac62d52e57..f2fe7d7b969 100644
--- a/meta/recipes-sato/puzzles/puzzles_git.bb
+++ b/meta/recipes-sato/puzzles/puzzles_git.bb
@@ -7,17 +7,10 @@ LIC_FILES_CHKSUM = "file://LICENCE;md5=6e7d24cf1c949887ee9447a1e2a4a24c"
# gtk support includes a bunch of x11 headers
REQUIRED_DISTRO_FEATURES = "x11"

-SRC_URI = "git://git.tartarus.org/simon/puzzles.git;branch=main \
- file://fix-compiling-failure-with-option-g-O.patch \
- file://0001-palisade-Fix-warnings-with-clang-on-arm.patch \
- file://0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch \
- file://fix-ki-uninitialized.patch \
- file://0001-malloc-Check-for-excessive-values-to-malloc.patch \
- file://0001-map-Fix-stringop-overflow-warning.patch \
- "
+SRC_URI = "git://git.tartarus.org/simon/puzzles.git;branch=main"

UPSTREAM_CHECK_COMMITS = "1"
-SRCREV = "640f9235c79cdb1a924b0148cb312b0f02253364"
+SRCREV = "b56c994b721f7cb5c5bcf09c5d695d4ae07d3052"
PE = "2"
PV = "0.0+git${SRCPV}"

--
2.32.0


[PATCH] puzzles: Upgrade to latest git with patches merged

Richard Purdie
 

This upgrades to the latest upstream version where several of our fixes
have equivalent fixes merged upstream. The remaining patch should be
fixed soon to.

Signed-off-by: Richard Purdie <richard.purdie@...>
---
...Check-for-excessive-values-to-malloc.patch | 45 ------------
...01-map-Fix-stringop-overflow-warning.patch | 34 ---------
...isade-Fix-warnings-with-clang-on-arm.patch | 72 -------------------
...ix-compiling-failure-with-option-g-O.patch | 33 ---------
.../puzzles/files/fix-ki-uninitialized.patch | 32 ---------
meta/recipes-sato/puzzles/puzzles_git.bb | 7 +-
6 files changed, 1 insertion(+), 222 deletions(-)
delete mode 100644 meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch
delete mode 100644 meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch
delete mode 100644 meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch
delete mode 100644 meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch
delete mode 100644 meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch

diff --git a/meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch b/meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch
deleted file mode 100644
index b572b55d1cf..00000000000
--- a/meta/recipes-sato/puzzles/files/0001-malloc-Check-for-excessive-values-to-malloc.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-tree234: Avoid excessive values to malloc
-
-with whole program optimizers like lto, smalloc() is inlined the excessive
-constant argument is propagated to malloc() and ultimately triggers the warning.
-
-| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c: In function 'disptree':
-| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:46:17: error: argument 1 value '18446744073709551612' exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=]
-| 46 | #define smalloc malloc
-| | ^
-| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:1631:17: note: in expansion of macro 'smalloc'
-| 1631 | leveldata = smalloc(ht * (width+2));
-| | ^~~~~~~
-| In file included from tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:29:
-| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/recipe-sysroot/usr/include/stdlib.h:539:14: note: in a call to allocation function 'malloc' declared here
-| 539 | extern void *malloc (size_t __size) __THROW __attribute_malloc__
-| | ^~~~~~
-| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:46:17: error: argument 1 value '18446744073709551600' exceeds maximum object size 9223372036854775807 [-Werror=alloc-size-larger-than=]
-| 46 | #define smalloc malloc
-| | ^
-| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:1632:18: note: in expansion of macro 'smalloc'
-| 1632 | ctx.levels = smalloc(ht * sizeof(char *));
-| | ^~~~~~~
-| In file included from tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/git/tree234.c:29:
-| tmp/work/core2-64-poky-linux/puzzles/2_0.0+gitAUTOINC+640f9235c7-r0/recipe-sysroot/usr/include/stdlib.h:539:14: note: in a call to allocation function 'malloc' declared here
-| 539 | extern void *malloc (size_t __size) __THROW __attribute_malloc__
-| | ^~~~~~
-| cc1: some warnings being treated as errors
-
-Upstream-Status: Submitted [email discussion with upstream]
-
-Signed-off-by: Richard Purdie <richard.purdie@...>
-
-Index: git/tree234.c
-===================================================================
---- git.orig/tree234.c
-+++ git/tree234.c
-@@ -1621,7 +1621,7 @@ void disptree(tree234 *t) {
- dispctx ctx;
- char *leveldata;
- int width = count234(t);
-- int ht = height234(t) * 3 - 2;
-+ unsigned int ht = height234(t) * 3 - 2;
- int i;
-
- if (!t->root) {
diff --git a/meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch b/meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch
deleted file mode 100644
index 7f46d3ec0eb..00000000000
--- a/meta/recipes-sato/puzzles/files/0001-map-Fix-stringop-overflow-warning.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From: Khem Raj <raj.khem@...>
-map: Fix stringop-overflow warning
-
-Fixes
-
-../git/map.c: In function 'new_game_desc':
-../git/map.c:1663:23: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
- 1663 | ret[retlen++] = ',';
- | ~~~~~~~~~~~~~~^~~~~
-../git/./map.c: In function 'new_game_desc':
-../git/./map.c:1663:23: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
- 1663 | ret[retlen++] = ',';
- | ~~~~~~~~~~~~~~^~~~~
-
-Upstream-Status: Submitted [email discussion with upstream]
-
-Signed-off-by: Richard Purdie <richard.purdie@...>
-Signed-off-by: Khem Raj <raj.khem@...>
-
-Index: git/map.c
-===================================================================
---- git.orig/map.c
-+++ git/map.c
-@@ -1659,6 +1659,10 @@ static char *new_game_desc(const game_pa
- }
- }
-
-+ if (retlen + 10 >= retsize) {
-+ retsize = retlen + 256;
-+ ret = sresize(ret, retsize, char);
-+ }
- ret[retlen++] = 'a'-1 + run;
- ret[retlen++] = ',';
-
diff --git a/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch b/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch
deleted file mode 100644
index 07eb1d32f65..00000000000
--- a/meta/recipes-sato/puzzles/files/0001-palisade-Fix-warnings-with-clang-on-arm.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From: Khem Raj <raj.khem@...>
-
-palisade: Fix warnings with clang on arm
-
-ARM treats 'char' as unsigned char when 'char' is not qualified with
-'signed' or 'unsigned' explicitly.
-
-This results in warnings e.g.
-
-palisade.c:531:22: error: comparison of constant -1 with expression of
-type 'clue' (aka 'char') is always false
-[-Werror,-Wtautological-constant-out-of-range-compare]
- if (clues[i] == EMPTY) continue;
-
-Therefore, typcast the contant to char in such places to be explicit
-
-Upstream-Status: Submitted [email discussion with upstream]
-
-Signed-off-by: Richard Purdie <richard.purdie@...>
-Signed-off-by: Khem Raj <raj.khem@...>
-
-Index: git/palisade.c
-===================================================================
---- git.orig/palisade.c
-+++ git/palisade.c
-@@ -46,7 +46,7 @@ struct game_params {
- int w, h, k;
- };
-
--typedef char clue;
-+typedef signed char clue;
- typedef unsigned char borderflag;
-
- typedef struct shared_state {
-@@ -242,7 +242,7 @@ typedef struct solver_ctx {
- * thing is done. See how it is propagated across multiple squares.]
- */
-
--#define EMPTY (~0)
-+#define EMPTY ((clue)-1)
-
- #define BIT(i) (1 << (i))
- #define BORDER(i) BIT(i)
-@@ -622,7 +622,7 @@ static char *new_game_desc(const game_pa
- {
- int w = params->w, h = params->h, wh = w*h, k = params->k;
-
-- clue *numbers = snewn(wh + 1, clue), *p;
-+ clue *numbers = snewn(wh + 1, clue);
- borderflag *rim = snewn(wh, borderflag);
- borderflag *scratch_borders = snewn(wh, borderflag);
-
-@@ -682,7 +682,8 @@ static char *new_game_desc(const game_pa
- sfree(shuf);
- sfree(dsf);
-
-- p = numbers;
-+ char *output = snewn(wh + 1, char), *p = output;
-+
- r = 0;
- for (i = 0; i < wh; ++i) {
- if (numbers[i] != EMPTY) {
-@@ -699,7 +700,8 @@ static char *new_game_desc(const game_pa
- }
- *p++ = '\0';
-
-- return sresize(numbers, p - numbers, clue);
-+ sfree(numbers);
-+ return sresize(output, p - output, char);
- }
-
- static const char *validate_desc(const game_params *params, const char *desc)
diff --git a/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch b/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch
deleted file mode 100644
index 4ee75431667..00000000000
--- a/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From: Hongxu Jia <hongxu.jia@...>
-
-gtk.c: fix compiling failure with option -g -O
-
-There was a compile failure with option -g -O
-...
-././gtk.c: In function 'main':
-././gtk.c:2911:6: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized]
- fprintf(stderr, "%s: %s\n", pname, error);
- ^
-cc1: all warnings being treated as errors
-...
-
-Fix by initializing pointer 'error' with NULL
-
-Upstream-Status: Submitted [email discussion with upstream]
-
-Signed-off-by: Richard Purdie <richard.purdie@...>
-Signed-off-by: Hongxu Jia <hongxu.jia@...>
-
-Index: git/gtk.c
-===================================================================
---- git.orig/gtk.c
-+++ git/gtk.c
-@@ -3578,7 +3578,7 @@ static void list_presets_from_menu(struc
- int main(int argc, char **argv)
- {
- char *pname = argv[0];
-- char *error;
-+ char *error = NULL;
- int ngenerate = 0, px = 1, py = 1;
- bool print = false;
- bool time_generation = false, test_solve = false, list_presets = false;
diff --git a/meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch b/meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch
deleted file mode 100644
index b182240240b..00000000000
--- a/meta/recipes-sato/puzzles/files/fix-ki-uninitialized.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-tree123: avoid compiler unitialized variable error
-
-The compiler does not realize that we must go through the while()
-loop at least once, so we replace it with a for() loop.
-
-Upstream-Status: Submitted [email discussion with upstream]
-
-Signed-off-by: Richard Purdie <richard.purdie@...>
-Signed-off-by: Joe Slater <joe.slater@...>
-
-Index: git/tree234.c
-===================================================================
---- git.orig/tree234.c
-+++ git/tree234.c
-@@ -335,7 +335,7 @@ static void *add234_internal(tree234 *t,
- }
-
- n = t->root;
-- while (n) {
-+ do {
- LOG((" node %p: %p/%d \"%s\" %p/%d \"%s\" %p/%d \"%s\" %p/%d\n",
- n,
- n->kids[0], n->counts[0], n->elems[0],
-@@ -388,7 +388,7 @@ static void *add234_internal(tree234 *t,
- if (!n->kids[ki])
- break;
- n = n->kids[ki];
-- }
-+ } while (n);
-
- add234_insert(NULL, e, NULL, &t->root, n, ki);
-
diff --git a/meta/recipes-sato/puzzles/puzzles_git.bb b/meta/recipes-sato/puzzles/puzzles_git.bb
index 8ac62d52e57..da466f3efca 100644
--- a/meta/recipes-sato/puzzles/puzzles_git.bb
+++ b/meta/recipes-sato/puzzles/puzzles_git.bb
@@ -8,16 +8,11 @@ LIC_FILES_CHKSUM = "file://LICENCE;md5=6e7d24cf1c949887ee9447a1e2a4a24c"
REQUIRED_DISTRO_FEATURES = "x11"

SRC_URI = "git://git.tartarus.org/simon/puzzles.git;branch=main \
- file://fix-compiling-failure-with-option-g-O.patch \
- file://0001-palisade-Fix-warnings-with-clang-on-arm.patch \
file://0001-pattern.c-Change-string-lenght-parameter-to-be-size_.patch \
- file://fix-ki-uninitialized.patch \
- file://0001-malloc-Check-for-excessive-values-to-malloc.patch \
- file://0001-map-Fix-stringop-overflow-warning.patch \
"

UPSTREAM_CHECK_COMMITS = "1"
-SRCREV = "640f9235c79cdb1a924b0148cb312b0f02253364"
+SRCREV = "d399a6b23051335ce3107f11822ae352816fcd50"
PE = "2"
PV = "0.0+git${SRCPV}"

--
2.32.0


Re: [poky][dunfell][PATCH] busybox: Fix multiple security issues in awk

Ranjitsinh Rathod
 

Hi Steve,

Just sent a v2 patch for this after rebasing and removing the patch fuzz warning.

Thanks,
Ranjitsinh Rathod


[meta][dunfell][PATCH v2] busybox: Fix multiple security issues in awk

Ranjitsinh Rathod
 

From: Sana Kazi <Sana.Kazi@...>

CVE-2021-423xx-awk.patch fixes below listed CVEs for busybox:
CVE-2021-42378, CVE-2021-42379, CVE-2021-42380, CVE-2021-42381,
CVE-2021-42382, CVE-2021-42384, CVE-2021-42385, CVE-2021-42386

Signed-off-by: Sana Kazi <Sana.Kazi@...>
Signed-off-by: Ranjitsinh Rathod <ranjitsinh.rathod@...>
Signed-off-by: Ranjitsinh Rathod <ranjitsinhrathod1991@...>
---
meta/recipes-core/busybox/busybox_1.31.1.bb | 1 +
.../busybox/files/CVE-2021-423xx-awk.patch | 215 ++++++++++++++++++
2 files changed, 216 insertions(+)
create mode 100644 meta/recipes-core/busybox/files/CVE-2021-423xx-awk.patch

diff --git a/meta/recipes-core/busybox/busybox_1.31.1.bb b/meta/recipes-core/busybox/busybox_1.31.1.bb
index 14ac710f3b..38b448b3e1 100644
--- a/meta/recipes-core/busybox/busybox_1.31.1.bb
+++ b/meta/recipes-core/busybox/busybox_1.31.1.bb
@@ -54,6 +54,7 @@ SRC_URI = "https://busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
file://0001-mktemp-add-tmpdir-option.patch \
file://CVE-2021-42374.patch \
file://CVE-2021-42376.patch \
+ file://CVE-2021-423xx-awk.patch \
"
SRC_URI_append_libc-musl = " file://musl.cfg "

diff --git a/meta/recipes-core/busybox/files/CVE-2021-423xx-awk.patch b/meta/recipes-core/busybox/files/CVE-2021-423xx-awk.patch
new file mode 100644
index 0000000000..7e3d47b88c
--- /dev/null
+++ b/meta/recipes-core/busybox/files/CVE-2021-423xx-awk.patch
@@ -0,0 +1,215 @@
+From a21708eb8d07b4a6dbc1d3e4ace4c5721515a84c Mon Sep 17 00:00:00 2001
+From: Sana Kazi <Sana.Kazi@...>
+Date: Wed, 8 Dec 2021 12:25:34 +0530
+Subject: [PATCH] busybox: Fix multiple security issues in awk
+
+Description: fix multiple security issues in awk
+Origin: backported awk.c from busybox 1.34.1
+
+CVE: CVE-2021-42378
+CVE: CVE-2021-42379
+CVE: CVE-2021-42380
+CVE: CVE-2021-42381
+CVE: CVE-2021-42382
+CVE: CVE-2021-42384
+CVE: CVE-2021-42385
+CVE: CVE-2021-42386
+
+Upstream-Status: Backport [https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/busybox/1:1.30.1-6ubuntu3.1/busybox_1.30.1-6ubuntu3.1.debian.tar.xz]
+
+Comment: Refreshed first hunk and removed few hunks as they are already present in source.
+
+Signed-off-by: Sana Kazi <Sana.Kazi@...>
+Signed-off-by: Ranjitsinh Rathod <Ranjitsinh.Rathod@...>
+
+---
+ editors/awk.c | 80 ++++++++++++++++++++++++++++++++++++++-------------
+ 1 file changed, 60 insertions(+), 20 deletions(-)
+
+diff --git a/editors/awk.c b/editors/awk.c
+index d25508e..4e4f282 100644
+--- a/editors/awk.c
++++ b/editors/awk.c
+@@ -272,7 +272,8 @@ typedef struct tsplitter_s {
+ /* if previous token class is CONCAT1 and next is CONCAT2, concatenation */
+ /* operator is inserted between them */
+ #define TC_CONCAT1 (TC_VARIABLE | TC_ARRTERM | TC_SEQTERM \
+- | TC_STRING | TC_NUMBER | TC_UOPPOST)
++ | TC_STRING | TC_NUMBER | TC_UOPPOST \
++ | TC_LENGTH)
+ #define TC_CONCAT2 (TC_OPERAND | TC_UOPPRE)
+
+ #define OF_RES1 0x010000
+@@ -404,7 +405,7 @@ static const char tokenlist[] ALIGN1 =
+
+ #define OC_B OC_BUILTIN
+
+-static const uint32_t tokeninfo[] = {
++static const uint32_t tokeninfo[] ALIGN4 = {
+ 0,
+ 0,
+ OC_REGEXP,
+@@ -1070,8 +1071,10 @@ static uint32_t next_token(uint32_t expected)
+ const uint32_t *ti;
+
+ if (t_rollback) {
++ debug_printf_parse("%s: using rolled-back token\n", __func__);
+ t_rollback = FALSE;
+ } else if (concat_inserted) {
++ debug_printf_parse("%s: using concat-inserted token\n", __func__);
+ concat_inserted = FALSE;
+ t_tclass = save_tclass;
+ t_info = save_info;
+@@ -1200,7 +1203,11 @@ static uint32_t next_token(uint32_t expected)
+ goto readnext;
+
+ /* insert concatenation operator when needed */
+- if ((ltclass & TC_CONCAT1) && (tc & TC_CONCAT2) && (expected & TC_BINOP)) {
++ debug_printf_parse("%s: %x %x %x concat_inserted?\n", __func__,
++ (ltclass & TC_CONCAT1), (tc & TC_CONCAT2), (expected & TC_BINOP));
++ if ((ltclass & TC_CONCAT1) && (tc & TC_CONCAT2) && (expected & TC_BINOP)
++ && !(ltclass == TC_LENGTH && tc == TC_SEQSTART) /* but not for "length(..." */
++ ) {
+ concat_inserted = TRUE;
+ save_tclass = tc;
+ save_info = t_info;
+@@ -1208,6 +1215,7 @@ static uint32_t next_token(uint32_t expected)
+ t_info = OC_CONCAT | SS | P(35);
+ }
+
++ debug_printf_parse("%s: t_tclass=tc=%x\n", __func__, t_tclass);
+ t_tclass = tc;
+ }
+ ltclass = t_tclass;
+@@ -1218,6 +1226,7 @@ static uint32_t next_token(uint32_t expected)
+ EMSG_UNEXP_EOS : EMSG_UNEXP_TOKEN);
+ }
+
++ debug_printf_parse("%s: returning, ltclass:%x t_double:%f\n", __func__, ltclass, t_double);
+ return ltclass;
+ #undef concat_inserted
+ #undef save_tclass
+@@ -1282,7 +1291,7 @@ static node *parse_expr(uint32_t iexp)
+ glptr = NULL;
+
+ } else if (tc & (TC_BINOP | TC_UOPPOST)) {
+- debug_printf_parse("%s: TC_BINOP | TC_UOPPOST\n", __func__);
++ debug_printf_parse("%s: TC_BINOP | TC_UOPPOST tc:%x\n", __func__, tc);
+ /* for binary and postfix-unary operators, jump back over
+ * previous operators with higher priority */
+ vn = cn;
+@@ -1350,8 +1359,10 @@ static node *parse_expr(uint32_t iexp)
+ v = cn->l.v = xzalloc(sizeof(var));
+ if (tc & TC_NUMBER)
+ setvar_i(v, t_double);
+- else
++ else {
+ setvar_s(v, t_string);
++ xtc &= ~TC_UOPPOST; /* "str"++ is not allowed */
++ }
+ break;
+
+ case TC_REGEXP:
+@@ -1387,7 +1398,12 @@ static node *parse_expr(uint32_t iexp)
+
+ case TC_LENGTH:
+ debug_printf_parse("%s: TC_LENGTH\n", __func__);
+- next_token(TC_SEQSTART | TC_OPTERM | TC_GRPTERM);
++ next_token(TC_SEQSTART /* length(...) */
++ | TC_OPTERM /* length; (or newline)*/
++ | TC_GRPTERM /* length } */
++ | TC_BINOPX /* length <op> NUM */
++ | TC_COMMA /* print length, 1 */
++ );
+ rollback_token();
+ if (t_tclass & TC_SEQSTART) {
+ /* It was a "(" token. Handle just like TC_BUILTIN */
+@@ -1747,12 +1763,34 @@ static void fsrealloc(int size)
+ nfields = size;
+ }
+
++static int regexec1_nonempty(const regex_t *preg, const char *s, regmatch_t pmatch[])
++{
++ int r = regexec(preg, s, 1, pmatch, 0);
++ if (r == 0 && pmatch[0].rm_eo == 0) {
++ /* For example, happens when FS can match
++ * an empty string (awk -F ' *'). Logically,
++ * this should split into one-char fields.
++ * However, gawk 5.0.1 searches for first
++ * _non-empty_ separator string match:
++ */
++ size_t ofs = 0;
++ do {
++ ofs++;
++ if (!s[ofs])
++ return REG_NOMATCH;
++ regexec(preg, s + ofs, 1, pmatch, 0);
++ } while (pmatch[0].rm_eo == 0);
++ pmatch[0].rm_so += ofs;
++ pmatch[0].rm_eo += ofs;
++ }
++ return r;
++}
++
+ static int awk_split(const char *s, node *spl, char **slist)
+ {
+- int l, n;
++ int n;
+ char c[4];
+ char *s1;
+- regmatch_t pmatch[2]; // TODO: why [2]? [1] is enough...
+
+ /* in worst case, each char would be a separate field */
+ *slist = s1 = xzalloc(strlen(s) * 2 + 3);
+@@ -1769,29 +1807,31 @@ static int awk_split(const char *s, node *spl, char **slist)
+ return n; /* "": zero fields */
+ n++; /* at least one field will be there */
+ do {
++ int l;
++ regmatch_t pmatch[2]; // TODO: why [2]? [1] is enough...
++
+ l = strcspn(s, c+2); /* len till next NUL or \n */
+- if (regexec(icase ? spl->r.ire : spl->l.re, s, 1, pmatch, 0) == 0
++ if (regexec1_nonempty(icase ? spl->r.ire : spl->l.re, s, pmatch) == 0
+ && pmatch[0].rm_so <= l
+ ) {
++ /* if (pmatch[0].rm_eo == 0) ... - impossible */
+ l = pmatch[0].rm_so;
+- if (pmatch[0].rm_eo == 0) {
+- l++;
+- pmatch[0].rm_eo++;
+- }
+ n++; /* we saw yet another delimiter */
+ } else {
+ pmatch[0].rm_eo = l;
+ if (s[l])
+ pmatch[0].rm_eo++;
+ }
+- memcpy(s1, s, l);
+- /* make sure we remove *all* of the separator chars */
+- do {
+- s1[l] = '\0';
+- } while (++l < pmatch[0].rm_eo);
+- nextword(&s1);
++ s1 = mempcpy(s1, s, l);
++ *s1++ = '\0';
+ s += pmatch[0].rm_eo;
+ } while (*s);
++
++ /* echo a-- | awk -F-- '{ print NF, length($NF), $NF }'
++ * should print "2 0 ":
++ */
++ *s1 = '\0';
++
+ return n;
+ }
+ if (c[0] == '\0') { /* null split */
+@@ -1995,7 +2035,7 @@ static int ptest(node *pattern)
+ static int awk_getline(rstream *rsm, var *v)
+ {
+ char *b;
+- regmatch_t pmatch[2];
++ regmatch_t pmatch[2]; // TODO: why [2]? [1] is enough...
+ int size, a, p, pp = 0;
+ int fd, so, eo, r, rp;
+ char c, *m, *s;
--
2.17.1


Re: [PATCH] wayland: upgrade 1.19.0 -> 1.20.0

Richard Purdie
 

On Thu, 2021-12-09 at 17:30 -0500, Denys Dmytriyenko wrote:
Wayland 1.20.0 is released!

This release contains the following major changes:

- FreeBSD support has been entirely upstreamed and has been added to
our continuous integration system.
- The autotools build system has been dropped. Meson has replaced it.
- A few protocol additions: wl_surface.offset allows clients to update
a surface's buffer offset independently from the buffer,
wl_output.name and description allow clients to identify outputs
without depending on xdg-output-unstable-v1.
- In protocol definitions, events have a new "type" attribute and can
now be marked as destructors.
- A number of bug fixes, including a race condition when destroying
proxies in multi-threaded clients.

Drop patch to fix strndup detection on MinGW that no longer applies, as
meson claims to had that fixed since version 0.54.2

Signed-off-by: Denys Dmytriyenko <denis@...>
---
...0001-build-Fix-strndup-detection-on-MinGW.patch | 37 ----------------------
.../{wayland_1.19.0.bb => wayland_1.20.0.bb} | 3 +-
2 files changed, 1 insertion(+), 39 deletions(-)
delete mode 100644 meta/recipes-graphics/wayland/wayland/0001-build-Fix-strndup-detection-on-MinGW.patch
rename meta/recipes-graphics/wayland/{wayland_1.19.0.bb => wayland_1.20.0.bb} (93%)

diff --git a/meta/recipes-graphics/wayland/wayland/0001-build-Fix-strndup-detection-on-MinGW.patch b/meta/recipes-graphics/wayland/wayland/0001-build-Fix-strndup-detection-on-MinGW.patch
deleted file mode 100644
index ad1063b..0000000
--- a/meta/recipes-graphics/wayland/wayland/0001-build-Fix-strndup-detection-on-MinGW.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 6a6223a8e217664a348835e92d5a602f50e18b2c Mon Sep 17 00:00:00 2001
-From: Joshua Watt <JPEWhacker@...>
-Date: Thu, 20 Feb 2020 15:20:45 -0600
-Subject: [PATCH] build: Fix strndup detection on MinGW
-
-GCC and meson conspire together to incorrectly detect that strndup()
-exists on MinGW as __builtin_strndup, when no such function exists. As a
-work around, meson will skip looking for __builtin functions if an
-'#include' is in the prefix, so add '#include <string.h>' when looking
-for strndup().
-
-See: https://github.com/mesonbuild/meson/issues/3672
-
-Signed-off-by: Joshua Watt <JPEWhacker@...>
-Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/wayland/merge_requests/63]
-
----
- meson.build | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/meson.build b/meson.build
-index 11c35fa..80729d0 100644
---- a/meson.build
-+++ b/meson.build
-@@ -36,11 +36,11 @@ have_funcs = [
- 'posix_fallocate',
- 'prctl',
- 'memfd_create',
-- 'strndup',
- ]
- foreach f: have_funcs
- config_h.set('HAVE_' + f.underscorify().to_upper(), cc.has_function(f))
- endforeach
-+config_h.set('HAVE_STRNDUP', cc.has_function('strndup') and cc.has_header_symbol('string.h', 'strndup'))
-
- if get_option('libraries')
- ffi_dep = dependency('libffi')
diff --git a/meta/recipes-graphics/wayland/wayland_1.19.0.bb b/meta/recipes-graphics/wayland/wayland_1.20.0.bb
similarity index 93%
rename from meta/recipes-graphics/wayland/wayland_1.19.0.bb
rename to meta/recipes-graphics/wayland/wayland_1.20.0.bb
index 4c9ae0f..e984414 100644
--- a/meta/recipes-graphics/wayland/wayland_1.19.0.bb
+++ b/meta/recipes-graphics/wayland/wayland_1.20.0.bb
@@ -15,9 +15,8 @@ DEPENDS = "expat libffi wayland-native"
SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
file://run-ptest \
file://0002-Do-not-hardcode-the-path-to-wayland-scanner.patch \
- file://0001-build-Fix-strndup-detection-on-MinGW.patch \
"
-SRC_URI[sha256sum] = "baccd902300d354581cd5ad3cc49daa4921d55fb416a5883e218750fef166d15"
+SRC_URI[sha256sum] = "b8a034154c7059772e0fdbd27dbfcda6c732df29cae56a82274f6ec5d7cd8725"

UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html"
https://autobuilder.yoctoproject.org/typhoon/#/builders/82/builds/2640/steps/11/logs/stdio

and there may be more to follow :(

Cheers,

Richard


Re: [PATCH] libva: move wayland PACKAGECONFIG to libva.inc

Markus Volk
 

I was able to narrow the issue down a little bit. I can reproduce it with plain poky by adding this to local.conf


PACKAGECONFIG:append:pn-libdrm = " udev"
DISTRO_FEATURES:append = " systemd"

and do

'bitbake libva-initial'

Am 10.12.21 um 16:47 schrieb Khem Raj:



On Fri, Dec 10, 2021 at 6:33 AM Markus Volk <f_l_k@...> wrote:

Thats strange indeed. Wayland is set as a DISTRO_FEATURE for my image, so it gets built by a lot of packages. This wasn't a clean build, i had sstate cache availbale when i started to experiment with libva and normally it doesn't get  built inside my image because i can't use it on my board. First i did 'bitbake libva' and this succeeded. Second i added 'va' PACKAGECONFIG to a mesa.bbappend and started rebuilding the image. Now the build for libva-initial was started and failed with the error about missing wayland-scanner.

I also wondered what is pulling  wayland into  its sysroot . Did 'bitbake -c cleanstate libva-initial libva' and tried to build libva-initial again with 'bitbake libva-initial' and had the same issue. On my machine this is reproducible


Post configure logs including meson run  logs for this package perhaps there is some hint in there 


Markus

Am 10.12.21 um 15:06 schrieb Alexander Kanavin:
| Run-time dependency wayland-client found: YES 1.19.0

Can you please explain how the issue can be reproduced? I find it odd that libva-initial (which only needs libdrm, and is required by mesa) has wayland in its sysroot in your build - where does that come from? There's a chance the problem is elsewhere.

Alex

On Fri, 10 Dec 2021 at 15:03, Markus Volk <f_l_k@...> wrote:
I encountered an error while trying to build libva under wayland. libva-initial
was missing wayland-native dependency and failed like this:

| Run-time dependency xfixes found: NO (tried pkgconfig and cmake)
| Run-time dependency wayland-client found: YES 1.19.0
| Program wayland-scanner /usr/bin/wayland-scanner found: NO
|
| ../libva-2.13.0/meson.build:107:4: ERROR: Program 'wayland-scanner /usr/bin/wayland-scanner' not found
|
| A full log can be found at /home/flk/build/poky/build-rock/tmp/work/cortexa72-cortexa53-crypto-poky-linux/libva-initial/2.13.0-r0/build/meson-logs/meson-log.txt
| ERROR: meson failed
| WARNING: exit code 1 from a shell command.

This commit moves the PACKAGECONFIG[wayland] to libva.inc to make it available to libva-initial also

Signed-off-by: MarkusVolk <f_l_k@...>
---
 meta/recipes-graphics/libva/libva.inc       | 7 +++++++
 meta/recipes-graphics/libva/libva_2.13.0.bb | 4 +---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-graphics/libva/libva.inc b/meta/recipes-graphics/libva/libva.inc
index bcf9757c1a..0e2721e291 100644
--- a/meta/recipes-graphics/libva/libva.inc
+++ b/meta/recipes-graphics/libva/libva.inc
@@ -27,3 +27,10 @@ UPSTREAM_CHECK_URI = "https://github.com/intel/libva/releases"
 DEPENDS = "libdrm"

 inherit meson pkgconfig
+
+PACKAGECONFIG:append = " \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'wayland', d)} \
+"
+
+PACKAGECONFIG[wayland] = "-Dwith_wayland=yes,-Dwith_wayland=no,wayland-native wayland"
+
diff --git a/meta/recipes-graphics/libva/libva_2.13.0.bb b/meta/recipes-graphics/libva/libva_2.13.0.bb
index ed2be289fc..a8c6355b01 100644
--- a/meta/recipes-graphics/libva/libva_2.13.0.bb
+++ b/meta/recipes-graphics/libva/libva_2.13.0.bb
@@ -2,14 +2,12 @@ require libva.inc

 PACKAGECONFIG ??= " \
     ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'glx', '', d)} \
-    ${@bb.utils.filter('DISTRO_FEATURES', 'x11 wayland', d)} \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} \
 "

 PACKAGECONFIG[x11] = "-Dwith_x11=yes,-Dwith_x11=no,virtual/libx11 libxext libxfixes"
 PACKAGECONFIG[glx] = "-Dwith_glx=yes,-Dwith_glx=no,virtual/mesa"

-PACKAGECONFIG[wayland] = "-Dwith_wayland=yes,-Dwith_wayland=no,wayland-native wayland"
-
 PACKAGES =+ "${PN}-x11 ${PN}-glx ${PN}-wayland"

 RDEPENDS:${PN}-x11 =+ "${PN}"
--
2.25.1












Re: [PATCH 10/29] meson: upgrade 0.60.1 -> 0.60.2

Alexander Kanavin
 

Perhaps meta-oe build in the AB should be adjusted?


Alex


On Sat, 11 Dec 2021 at 03:42, Khem Raj <raj.khem@...> wrote:
On Fri, Dec 10, 2021 at 9:01 AM Khem Raj <raj.khem@...> wrote:
>
> this breaks gjs also see https://github.com/mesonbuild/meson/issues/9472
>

I have a fix for gjs [1] but I was thinking meta-gnome is a good
testcase for meson. So when upgrading meson it will be good to add
this layer
to test and build world.


[1] https://lore.kernel.org/openembedded-devel/20211210173603.2826515-1-raj.khem@.../T/#u

> On Wed, Dec 8, 2021 at 2:00 PM Alexander Kanavin <alex.kanavin@...> wrote:
> >
> > From: Alexander Kanavin <alex.kanavin@...>
> >
> > Signed-off-by: Alexander Kanavin <alex.kanavin@...>
> > ---
> >  meta/recipes-devtools/meson/meson.inc                           | 2 +-
> >  .../recipes-devtools/meson/{meson_0.60.1.bb => meson_0.60.2.bb} | 0
> >  .../{nativesdk-meson_0.60.1.bb => nativesdk-meson_0.60.2.bb}    | 0
> >  3 files changed, 1 insertion(+), 1 deletion(-)
> >  rename meta/recipes-devtools/meson/{meson_0.60.1.bb => meson_0.60.2.bb} (100%)
> >  rename meta/recipes-devtools/meson/{nativesdk-meson_0.60.1.bb => nativesdk-meson_0.60.2.bb} (100%)
> >
> > diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc
> > index f383ad9f74..7fbb246b87 100644
> > --- a/meta/recipes-devtools/meson/meson.inc
> > +++ b/meta/recipes-devtools/meson/meson.inc
> > @@ -15,7 +15,7 @@ SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${P
> >             file://0002-Support-building-allarch-recipes-again.patch \
> >             file://0001-is_debianlike-always-return-False.patch \
> >             "
> > -SRC_URI[sha256sum] = "5add789c953d984b500858b2851ee3d7add0460cf1a6f852f0a721af17384e13"
> > +SRC_URI[sha256sum] = "64e6968565bf1b8152f4f9d6ca8154efb9e14caa9aabf7b22e71e6c5d053e921"
> >
> >  UPSTREAM_CHECK_URI = "https://github.com/mesonbuild/meson/releases"
> >  UPSTREAM_CHECK_REGEX = "meson-(?P<pver>\d+(\.\d+)+)\.tar"
> > diff --git a/meta/recipes-devtools/meson/meson_0.60.1.bb b/meta/recipes-devtools/meson/meson_0.60.2.bb
> > similarity index 100%
> > rename from meta/recipes-devtools/meson/meson_0.60.1.bb
> > rename to meta/recipes-devtools/meson/meson_0.60.2.bb
> > diff --git a/meta/recipes-devtools/meson/nativesdk-meson_0.60.1.bb b/meta/recipes-devtools/meson/nativesdk-meson_0.60.2.bb
> > similarity index 100%
> > rename from meta/recipes-devtools/meson/nativesdk-meson_0.60.1.bb
> > rename to meta/recipes-devtools/meson/nativesdk-meson_0.60.2.bb
> > --
> > 2.20.1
> >
> >
> >
> >


Re: [PATCH 10/29] meson: upgrade 0.60.1 -> 0.60.2

Khem Raj
 

On Fri, Dec 10, 2021 at 9:01 AM Khem Raj <raj.khem@...> wrote:

this breaks gjs also see https://github.com/mesonbuild/meson/issues/9472
I have a fix for gjs [1] but I was thinking meta-gnome is a good
testcase for meson. So when upgrading meson it will be good to add
this layer
to test and build world.


[1] https://lore.kernel.org/openembedded-devel/20211210173603.2826515-1-raj.khem@gmail.com/T/#u

On Wed, Dec 8, 2021 at 2:00 PM Alexander Kanavin <alex.kanavin@...> wrote:

From: Alexander Kanavin <alex.kanavin@...>

Signed-off-by: Alexander Kanavin <alex.kanavin@...>
---
meta/recipes-devtools/meson/meson.inc | 2 +-
.../recipes-devtools/meson/{meson_0.60.1.bb => meson_0.60.2.bb} | 0
.../{nativesdk-meson_0.60.1.bb => nativesdk-meson_0.60.2.bb} | 0
3 files changed, 1 insertion(+), 1 deletion(-)
rename meta/recipes-devtools/meson/{meson_0.60.1.bb => meson_0.60.2.bb} (100%)
rename meta/recipes-devtools/meson/{nativesdk-meson_0.60.1.bb => nativesdk-meson_0.60.2.bb} (100%)

diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc
index f383ad9f74..7fbb246b87 100644
--- a/meta/recipes-devtools/meson/meson.inc
+++ b/meta/recipes-devtools/meson/meson.inc
@@ -15,7 +15,7 @@ SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${P
file://0002-Support-building-allarch-recipes-again.patch \
file://0001-is_debianlike-always-return-False.patch \
"
-SRC_URI[sha256sum] = "5add789c953d984b500858b2851ee3d7add0460cf1a6f852f0a721af17384e13"
+SRC_URI[sha256sum] = "64e6968565bf1b8152f4f9d6ca8154efb9e14caa9aabf7b22e71e6c5d053e921"

UPSTREAM_CHECK_URI = "https://github.com/mesonbuild/meson/releases"
UPSTREAM_CHECK_REGEX = "meson-(?P<pver>\d+(\.\d+)+)\.tar"
diff --git a/meta/recipes-devtools/meson/meson_0.60.1.bb b/meta/recipes-devtools/meson/meson_0.60.2.bb
similarity index 100%
rename from meta/recipes-devtools/meson/meson_0.60.1.bb
rename to meta/recipes-devtools/meson/meson_0.60.2.bb
diff --git a/meta/recipes-devtools/meson/nativesdk-meson_0.60.1.bb b/meta/recipes-devtools/meson/nativesdk-meson_0.60.2.bb
similarity index 100%
rename from meta/recipes-devtools/meson/nativesdk-meson_0.60.1.bb
rename to meta/recipes-devtools/meson/nativesdk-meson_0.60.2.bb
--
2.20.1




The state of DKMS in the Yocto community

Alex Stewart
 

Hey List,

I'm trying to work out the mysterious state of DKMS in OE-Core.

Our (NI) OE distributions rely heavily on DKMS to (un)install our ecosystem of kernel drivers at runtime across our product lines. To facilitate that, we authored a dkms_2.4.0.bb recipe [1] back in 2017, which we have carried out-of-stream since.

We tried to upstream it, and the patched rev'ed a couple of times [2]; but it seems to have never made it into a yocto release.

Though some other recipes mention DKMS passingly, I don't see anywhere that OE-Core officially supports it. Nor does my googling reveal anyone else who uses DKMS. I find that a little hard to believe, though I understand that it's probably relatively rare in the embedded space.


@all
So does anyone else on the list use DKMS in their yocto distribution? Are you maintaining a DKMS recipe out-of-stream as well?


@maintainers
If NI upgraded our DKMS recipe to a more recent version than 2.4.0 and submitted it again to OE-Core, would you accept it? If not, we will move it to our own meta layer and accept that we are unique in this regard.


[1] https://github.com/ni/openembedded-core/commit/5789a27b68d95f3840bb8c4cb0d7b28d538c9a50

[2] https://lists.openembedded.org/g/openembedded-core/message/100680

Thanks,

--
Alex Stewart
Software Engineer - NI Real-Time OS
NI (National Instruments)

alex.stewart@...


Re: [dunfell 16/18] cmake: FindGTest: Add target for gmock library

Jasper Orschulko
 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hello everyone,

after some digging we identified the issue to be on our part.
We have been using "GTEST_LIBRARY" and "GTEST_MAIN_LIBRARY" in our
CMake scripts instead of "GTEST_LIBRARIES" and "GTEST_MAIN_LIBRARIES",
as described in the cmake docs:
https://cmake.org/cmake/help/v3.16/module/FindGTest.html#result-variables

So all good here! :)

- --
With best regards

Jasper Orschulko
DevOps Engineer

Tel. +49 30 58 58 14 265
Fax +49 30 58 58 14 999
Jasper.Orschulko@...

• • • • • • • • • • • • • • • • • • • • • • • • • •

iris-GmbH
infrared & intelligent sensors
Schnellerstraße 1-5 | 12439 Berlin

https://iris-sensing.com/





On Thu, 2021-12-09 at 09:32 -1000, Steve Sakoman wrote:
On Thu, Dec 9, 2021 at 7:38 AM Jasper Orschulko
<Jasper.Orschulko@...> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

I can't provide any details yet, but I can say with certainty that
this
patch breaks our build (using the parent commit
        746b301d37f9b7333f3d93e6fb7ea2808665df41 as refspec during
the build worksasexpected):

[...] undefined reference to `testing::*

Can someone confirm this issue? Feel free to reach out for further
details.
I've not seen any issues in either local or autobuilder testing, so I
think we need more details!

Steve

On Fri, 2021-12-03 at 08:19 -1000, Steve Sakoman wrote:
From: Eero Aaltonen <eero.aaltonen@...>

`googlemock` has been absorbed into the
[googletest](https://github.com/google/googletest) project and is
built
and installed from the same source tree.

`googletest` has provided a CMake Config-file Package starting
with
GTest 1.8.1. `find_package(GTest ...)` by default dispatches
first to
CMake Find Module. Starting with CMake commit
2327b4330cce157d616ff8b611b3e77568d00351 in CMake v3.20.0 the
module
dispatches onward to the Config-file Package so that the same
targets
are available. In pre v3.20.0 versions of CMake however the Find
Module
masks the targets provided by the upstream `GTest` package.

Update `Modules/FindGTest.cmake` to provide the same targets as
the
CMake Config-file Package and backwards compatible targets and
result
variables.

Signed-off-by: Eero Aaltonen <eero.aaltonen@...>
Signed-off-by: Steve Sakoman <steve@...>
---
 .../cmake/cmake-native_3.16.5.bb              |   1 +
 ...ndGTest-Add-target-for-gmock-library.patch | 255
++++++++++++++++++
 2 files changed, 256 insertions(+)
 create mode 100644 meta/recipes-devtools/cmake/cmake/0006-cmake-
FindGTest-Add-target-for-gmock-library.patch

diff --git a/meta/recipes-devtools/cmake/cmake-native_3.16.5.bb
b/meta/recipes-devtools/cmake/cmake-native_3.16.5.bb
index b2952ee5f5..96a7be6770 100644
--- a/meta/recipes-devtools/cmake/cmake-native_3.16.5.bb
+++ b/meta/recipes-devtools/cmake/cmake-native_3.16.5.bb
@@ -7,6 +7,7 @@ SRC_URI += "file://OEToolchainConfig.cmake \
             file://environment.d-cmake.sh \

file://0001-CMakeDetermineSystem-use-oe-environment-vars-to-load.patch
 \

file://0005-Disable-use-of-ext2fs-ext2_fs.h-by-cmake-s-internal-.patch
 \
+
file://0006-cmake-FindGTest-Add-target-for-gmock-library.patch \
             "


diff --git a/meta/recipes-devtools/cmake/cmake/0006-cmake-
FindGTest-
Add-target-for-gmock-library.patch b/meta/recipes-
devtools/cmake/cmake/0006-cmake-FindGTest-Add-target-for-gmock-
library.patch
new file mode 100644
index 0000000000..267f586a71
--- /dev/null
+++ b/meta/recipes-devtools/cmake/cmake/0006-cmake-FindGTest-Add-
target-for-gmock-library.patch
@@ -0,0 +1,255 @@
+From 39eae0d6c1b398f18761abac7f55944f0290f8a1 Mon Sep 17
00:00:00
2001
+From: Eero Aaltonen <eero.aaltonen@...>
+Date: Sun, 17 Oct 2021 17:13:07 +0300
+Subject: [PATCH] FindGTest: Add target for gmock library
+
+`googlemock` has been absorbed into the
+[googletest](https://github.com/google/googletest) project and
is
built
+and installed from the same source tree.
+
+As GTest may be built with or without GMock, skip GMock if it is
not
+present.
+
+Do not provide result variables for GMock.  They are not
provided by
+upstream GTest's CMake Package Configuration File.
+
+Also update the test case to cover linking to `GTest::gmock`.
+
+The patch was imported from the Kitware git server
+(git@...:cmake/cmake.git) as of commit id
+50bf457a0dd857cf976b22c5be7d333493233d1e
+
+Patch was modified to support upper case variable `GTEST_FOUND`.
+
+Upstream-Status: Accepted
[https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6632]
+Milestone: 3.23.0
+
+Signed-off-by: Eero Aaltonen <eero.aaltonen@...>
+---
+ .../dev/FindGTest-target-for-gmock.rst        |   4 +
+ Modules/FindGTest.cmake                       | 133
+++++++++++++++---
+ Tests/FindGTest/Test/CMakeLists.txt           |   4 +
+ 3 files changed, 121 insertions(+), 20 deletions(-)
+ create mode 100644 Help/release/dev/FindGTest-target-for-
gmock.rst
+
+diff --git a/Help/release/dev/FindGTest-target-for-gmock.rst
b/Help/release/dev/FindGTest-target-for-gmock.rst
+new file mode 100644
+index 0000000000..f78242c80e
+--- /dev/null
++++ b/Help/release/dev/FindGTest-target-for-gmock.rst
+@@ -0,0 +1,4 @@
++FindGTest-target-for-gmock
++--------------------------
++
++* The :module:`FindGTest` module now provides a target for
GMock,
if found.
+diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake
+index e015a9840f..0331049594 100644
+--- a/Modules/FindGTest.cmake
++++ b/Modules/FindGTest.cmake
+@@ -7,10 +7,23 @@ FindGTest
+
+ Locate the Google C++ Testing Framework.
+
++.. versionadded:: 3.20
++  Upstream ``GTestConfig.cmake`` is used if possible.
++
+ Imported targets
+ ^^^^^^^^^^^^^^^^
+
+-This module defines the following :prop_tgt:`IMPORTED` targets:
++  This module defines the following :prop_tgt:`IMPORTED`
targets:
++
++``GTest::gtest``
++  The Google Test ``gtest`` library, if found; adds
Thread::Thread
++  automatically
++``GTest::gtest_main``
++  The Google Test ``gtest_main`` library, if found
++
++.. deprecated:: 3.20
++  For backwards compatibility, this module defines additionally
the
++  following deprecated :prop_tgt:`IMPORTED` targets (available
since 3.5):
+
+ ``GTest::GTest``
+   The Google Test ``gtest`` library, if found; adds
Thread::Thread
+@@ -18,7 +31,6 @@ This module defines the following
:prop_tgt:`IMPORTED` targets:
+ ``GTest::Main``
+   The Google Test ``gtest_main`` library, if found
+
+-
+ Result variables
+ ^^^^^^^^^^^^^^^^
+
+@@ -146,8 +158,42 @@ function(__gtest_import_library _target
_var
_config)
+     endif()
+ endfunction()
+
++function(__gtest_define_backwards_compatible_library_targets)
++    set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES}
${GTEST_MAIN_LIBRARIES} PARENT_SCOPE)
++
++    # Add targets mapping the same library names as defined in
++    # older versions of CMake's FindGTest
++    if(NOT TARGET GTest::GTest)
++        add_library(GTest::GTest INTERFACE IMPORTED)
++        target_link_libraries(GTest::GTest INTERFACE
GTest::gtest)
++    endif()
++    if(NOT TARGET GTest::Main)
++        add_library(GTest::Main INTERFACE IMPORTED)
++        target_link_libraries(GTest::Main INTERFACE
GTest::gtest_main)
++    endif()
++endfunction()
++
+ #
+
++include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs
.cma
ke)
++
++# first specifically look for the CMake version of GTest
++find_package(GTest QUIET NO_MODULE)
++
++# if we found the GTest cmake package then we are done, and
++# can print what we found and return.
++if(GTest_FOUND)
++    set(GTEST_FOUND ${GTest_FOUND})
++    FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTest HANDLE_COMPONENTS
CONFIG_MODE)
++
++    set(GTEST_LIBRARIES      GTest::gtest)
++    set(GTEST_MAIN_LIBRARIES GTest::gtest_main)
++
++    __gtest_define_backwards_compatible_library_targets()
++
++    return()
++endif()
++
+ if(NOT DEFINED GTEST_MSVC_SEARCH)
+     set(GTEST_MSVC_SEARCH MD)
+ endif()
+@@ -194,50 +240,97 @@ if(MSVC AND GTEST_MSVC_SEARCH STREQUAL
"MD")
+     __gtest_find_library(GTEST_LIBRARY_DEBUG      gtest-mdd
gtestd)
+     __gtest_find_library(GTEST_MAIN_LIBRARY       gtest_main-md
gtest_main)
+     __gtest_find_library(GTEST_MAIN_LIBRARY_DEBUG gtest_main-
mdd
gtest_maind)
++    __gtest_find_library(GMOCK_LIBRARY            gmock-md 
gmock)
++    __gtest_find_library(GMOCK_LIBRARY_DEBUG      gmock-mdd
gmockd)
++    __gtest_find_library(GMOCK_MAIN_LIBRARY       gmock_main-md
gmock_main)
++    __gtest_find_library(GMOCK_MAIN_LIBRARY_DEBUG gmock_main-
mdd
gmock_maind)
+ else()
+     __gtest_find_library(GTEST_LIBRARY            gtest)
+     __gtest_find_library(GTEST_LIBRARY_DEBUG      gtestd)
+     __gtest_find_library(GTEST_MAIN_LIBRARY       gtest_main)
+     __gtest_find_library(GTEST_MAIN_LIBRARY_DEBUG gtest_maind)
++    __gtest_find_library(GMOCK_LIBRARY            gmock)
++    __gtest_find_library(GMOCK_LIBRARY_DEBUG      gmockd)
++    __gtest_find_library(GMOCK_MAIN_LIBRARY       gmock_main)
++    __gtest_find_library(GMOCK_MAIN_LIBRARY_DEBUG gmock_maind)
+ endif()
+
+-
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.c
make
)
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTest DEFAULT_MSG
GTEST_LIBRARY
GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
+
+-if(GTEST_FOUND)
++if(GMOCK_LIBRARY AND GMOCK_MAIN_LIBRARY)
++    set(GMock_FOUND True)
++else()
++    set(GMock_FOUND False)
++endif()
++
++if(GTest_FOUND)
+     set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIR})
+     __gtest_append_debugs(GTEST_LIBRARIES      GTEST_LIBRARY)
+     __gtest_append_debugs(GTEST_MAIN_LIBRARIES
GTEST_MAIN_LIBRARY)
+-    set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES}
${GTEST_MAIN_LIBRARIES})
+
+     find_package(Threads QUIET)
+
+-    if(NOT TARGET GTest::GTest)
++    if(NOT TARGET GTest::gtest)
+         __gtest_determine_library_type(GTEST_LIBRARY)
+-        add_library(GTest::GTest ${GTEST_LIBRARY_TYPE}
IMPORTED)
++        add_library(GTest::gtest ${GTEST_LIBRARY_TYPE}
IMPORTED)
+         if(TARGET Threads::Threads)
+-            set_target_properties(GTest::GTest PROPERTIES
++            set_target_properties(GTest::gtest PROPERTIES
+                 INTERFACE_LINK_LIBRARIES Threads::Threads)
+         endif()
+         if(GTEST_LIBRARY_TYPE STREQUAL "SHARED")
+-            set_target_properties(GTest::GTest PROPERTIES
++            set_target_properties(GTest::gtest PROPERTIES
+                 INTERFACE_COMPILE_DEFINITIONS
"GTEST_LINKED_AS_SHARED_LIBRARY=1")
+         endif()
+         if(GTEST_INCLUDE_DIRS)
+-            set_target_properties(GTest::GTest PROPERTIES
++            set_target_properties(GTest::gtest PROPERTIES
+                 INTERFACE_INCLUDE_DIRECTORIES
"${GTEST_INCLUDE_DIRS}")
+         endif()
+-        __gtest_import_library(GTest::GTest GTEST_LIBRARY "")
+-        __gtest_import_library(GTest::GTest GTEST_LIBRARY
"RELEASE")
+-        __gtest_import_library(GTest::GTest GTEST_LIBRARY
"DEBUG")
++        __gtest_import_library(GTest::gtest GTEST_LIBRARY "")
++        __gtest_import_library(GTest::gtest GTEST_LIBRARY
"RELEASE")
++        __gtest_import_library(GTest::gtest GTEST_LIBRARY
"DEBUG")
+     endif()
+-    if(NOT TARGET GTest::Main)
++    if(NOT TARGET GTest::gtest_main)
+         __gtest_determine_library_type(GTEST_MAIN_LIBRARY)
+-        add_library(GTest::Main ${GTEST_MAIN_LIBRARY_TYPE}
IMPORTED)
+-        set_target_properties(GTest::Main PROPERTIES
+-            INTERFACE_LINK_LIBRARIES "GTest::GTest")
+-        __gtest_import_library(GTest::Main GTEST_MAIN_LIBRARY
"")
+-        __gtest_import_library(GTest::Main GTEST_MAIN_LIBRARY
"RELEASE")
+-        __gtest_import_library(GTest::Main GTEST_MAIN_LIBRARY
"DEBUG")
++        add_library(GTest::gtest_main
${GTEST_MAIN_LIBRARY_TYPE}
IMPORTED)
++        set_target_properties(GTest::gtest_main PROPERTIES
++            INTERFACE_LINK_LIBRARIES "GTest::gtest")
++        __gtest_import_library(GTest::gtest_main
GTEST_MAIN_LIBRARY
"")
++        __gtest_import_library(GTest::gtest_main
GTEST_MAIN_LIBRARY
"RELEASE")
++        __gtest_import_library(GTest::gtest_main
GTEST_MAIN_LIBRARY
"DEBUG")
++    endif()
++
++    __gtest_define_backwards_compatible_library_targets()
++endif()
++
++if(GMock_FOUND)
++    if(NOT TARGET GTest::gmock)
++        __gtest_determine_library_type(GMOCK_LIBRARY)
++        add_library(GTest::gmock ${GMOCK_LIBRARY_TYPE}
IMPORTED)
++        set(_gmock_link_libraries "GTest::gtest")
++        if(TARGET Threads::Threads)
++            list(APPEND _gmock_link_libraries Threads::Threads)
++        endif()
++        set_target_properties(GTest::gmock PROPERTIES
++            INTERFACE_LINK_LIBRARIES
"${_gmock_link_libraries}")
++        if(GMOCK_LIBRARY_TYPE STREQUAL "SHARED")
++            set_target_properties(GTest::gmock PROPERTIES
++                INTERFACE_COMPILE_DEFINITIONS
"GMOCK_LINKED_AS_SHARED_LIBRARY=1")
++        endif()
++        if(GTEST_INCLUDE_DIRS)
++            set_target_properties(GTest::gmock PROPERTIES
++                INTERFACE_INCLUDE_DIRECTORIES
"${GTEST_INCLUDE_DIRS}")
++        endif()
++        __gtest_import_library(GTest::gmock GMOCK_LIBRARY "")
++        __gtest_import_library(GTest::gmock GMOCK_LIBRARY
"RELEASE")
++        __gtest_import_library(GTest::gmock GMOCK_LIBRARY
"DEBUG")
++    endif()
++    if(NOT TARGET GTest::gmock_main)
++        __gtest_determine_library_type(GMOCK_MAIN_LIBRARY)
++        add_library(GTest::gmock_main
${GMOCK_MAIN_LIBRARY_TYPE}
IMPORTED)
++        set_target_properties(GTest::gmock_main PROPERTIES
++            INTERFACE_LINK_LIBRARIES "GTest::gmock")
++        __gtest_import_library(GTest::gmock_main
GMOCK_MAIN_LIBRARY
"")
++        __gtest_import_library(GTest::gmock_main
GMOCK_MAIN_LIBRARY
"RELEASE")
++        __gtest_import_library(GTest::gmock_main
GMOCK_MAIN_LIBRARY
"DEBUG")
+     endif()
+ endif()
+diff --git a/Tests/FindGTest/Test/CMakeLists.txt
b/Tests/FindGTest/Test/CMakeLists.txt
+index b65b9d28f6..7d3a378a65 100644
+--- a/Tests/FindGTest/Test/CMakeLists.txt
++++ b/Tests/FindGTest/Test/CMakeLists.txt
+@@ -12,3 +12,7 @@ add_executable(test_gtest_var main.cxx)
+ target_include_directories(test_gtest_var PRIVATE
${GTEST_INCLUDE_DIRS})
+ target_link_libraries(test_gtest_var PRIVATE
${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+ add_test(NAME test_gtest_var COMMAND test_gtest_var)
++
++add_executable(test_gmock_tgt main.cxx)
++target_link_libraries(test_gmock_tgt GTest::gmock_main)
++add_test(NAME test_gmock_tgt COMMAND test_gmock_tgt)
+--
+2.17.1
+
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEE4WyPMIC5Ap4+Ooo1Ygqew07VMNUFAmGyPwAACgkQYgqew07V
MNU+qwf/a6pDdacJlCGlNha+d2AbkAqiAlC/djP0i5h17mhRhvfZWwvm8DlyXUNL
oYjhi7y6PvO2H7TTsACey7bBcGBwyikTrpBrloxaa+KDKkG1OIvpzJBlRNGA/PUT
vZMmDtL6S4E3SuxwBT8P/ShH+RSijJDWVq+9UgNz6jyuNIx4lSVU9lVTACNpN4Mj
PI5YXl3g6HZA364UnEZ+KFKwoc5Ihm5U71KkKKekNaOVNf4rzkcwy8bQFc0WyH42
4N/sPDByu/8INnabZm04ypqIOAMGOKsLjuZqvy2PeFiBoXCRsxJD9SF6iFFVeuuc
/lP9iIFOIHxUFkeopGvLH7ol8YQtow==
=72K+
-----END PGP SIGNATURE-----


-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEE4WyPMIC5Ap4+Ooo1Ygqew07VMNUFAmGzoSAACgkQYgqew07V
MNUawAf/aoqsdt2f0at05sKUMQRvby+wwBdq+0MnSzQvnkalYZmqVWu9EmVobIaL
PgZyzhBFaCMhiKA80sirEqDwippgOyVMtydaXJBNhztCnsyg2pbmouaOZsmjeJ/L
bCbJhK+z3eaXzDivZ37/5oIs97hynTgeanJlpowsuE6FXEX8Q8hU7vPjhVjGTeIE
wKEGDqDJUMwrmaSmDf+pQcikE5TmsOZyGS006c6S6FmpifImzwM8J/sxmOWtTaN1
EmDGj7h7lsG3+v7XkOODTdDn0Teoe61x0uIfPqvK35ig8V6SP/ylwKF81zK248d/
TWMB7wqyaL6+9gkqvreG96h4eFY6JQ==
=+DGS
-----END PGP SIGNATURE-----


[PATCH] elf: Discard input .note.gnu.build-id sections

Valery Chernous
 

From: Valerii Chernous <vchernou@...>

Originally issue:
building of glibc 2.32 or 2.34 with option "-Wl,--build-id"
produce libc.so.6 with section ".note.gnu.build-id" that have
invalid(double, 0x48) section size. It happens because glibc
use sublibraries for linking libc.so.6
ld produce this sublibraries with build-id section and on last
linking stage loads this sections as input for linking.
ld should create new(valid) ".note.gnu.build-id" into function
ldelf_setup_build_id on last linking stage but it skip creating because
build-id section already exists.
As result libc.so.6 contain ".note.gnu.build-id" with build-ids from
sublibraries and without valid build-id

Howto solved:
1. Discard input .note.gnu.build-id sections.
2. Clear the build ID field before writing.
3. Use bfd_make_section_anyway_with_flags to create the output
.note.gnu.build-id section.

Upstream-Status: Backport

Reference to upstream patch:
[https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=1f1d0f8888a6c944e612b416a2a6e11abcf5199f]

Signed-off-by: Valerii Chernous <vchernou@...>
Signed-off-by: Valery Chernous <valery.chernous@...>
---
.../binutils/binutils-2.37.inc | 1 +
...rd-input-.note.gnu.build-id-sections.patch | 215 ++++++++++++++++++
2 files changed, 216 insertions(+)
create mode 100644 meta/recipes-devtools/binutils/binutils/0001-elf-Discard-input-.note.gnu.build-id-sections.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.37.inc b/meta/recipes-devtools/binutils/binutils-2.37.inc
index 8f91c6460d..c565adc4b7 100644
--- a/meta/recipes-devtools/binutils/binutils-2.37.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.37.inc
@@ -35,5 +35,6 @@ SRC_URI = "\
file://0015-sync-with-OE-libtool-changes.patch \
file://0016-Check-for-clang-before-checking-gcc-version.patch \
file://0017-bfd-Close-the-file-descriptor-if-there-is-no-archive.patch \
+ file://0001-elf-Discard-input-.note.gnu.build-id-sections.patch \
"
S = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0001-elf-Discard-input-.note.gnu.build-id-sections.patch b/meta/recipes-devtools/binutils/binutils/0001-elf-Discard-input-.note.gnu.build-id-sections.patch
new file mode 100644
index 0000000000..c93af4e46f
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0001-elf-Discard-input-.note.gnu.build-id-sections.patch
@@ -0,0 +1,215 @@
+From b2e18d3ea300f7491705b6e86a7cc3d6366e3b1f Mon Sep 17 00:00:00 2001
+From: "H.J. Lu" <hjl.tools@...>
+Date: Tue, 30 Nov 2021 20:40:38 -0800
+Subject: [PATCH] elf: Discard input .note.gnu.build-id sections
+
+1. Discard input .note.gnu.build-id sections.
+2. Clear the build ID field before writing.
+3. Use bfd_make_section_anyway_with_flags to create the output
+.note.gnu.build-id section.
+
+ PR ld/28639
+ * ldelf.c (ldelf_after_open): Discard input .note.gnu.build-id
+ sections, excluding the first one.
+ (write_build_id): Clear the build ID field before writing.
+ (ldelf_setup_build_id): Use bfd_make_section_anyway_with_flags
+ to create the output .note.gnu.build-id section.
+ * testsuite/ld-elf/build-id.exp: New file.
+ * testsuite/ld-elf/pr28639a.rd: Likewise.
+ * testsuite/ld-elf/pr28639b.rd: Likewise.
+ * testsuite/ld-elf/pr28639c.rd: Likewise.
+ * testsuite/ld-elf/pr28639d.rd: Likewise.
+
+Upstream-Status: Backport
+
+Reference to upstream patch:
+[https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=1f1d0f8888a6c944e612b416a2a6e11abcf5199f]
+---
+ ld/ldelf.c | 15 ++++++-
+ ld/testsuite/ld-elf/build-id.exp | 77 ++++++++++++++++++++++++++++++++
+ ld/testsuite/ld-elf/pr28639a.rd | 6 +++
+ ld/testsuite/ld-elf/pr28639b.rd | 6 +++
+ ld/testsuite/ld-elf/pr28639c.rd | 10 +++++
+ ld/testsuite/ld-elf/pr28639d.rd | 4 ++
+ 6 files changed, 117 insertions(+), 1 deletion(-)
+ create mode 100644 ld/testsuite/ld-elf/build-id.exp
+ create mode 100644 ld/testsuite/ld-elf/pr28639a.rd
+ create mode 100644 ld/testsuite/ld-elf/pr28639b.rd
+ create mode 100644 ld/testsuite/ld-elf/pr28639c.rd
+ create mode 100644 ld/testsuite/ld-elf/pr28639d.rd
+
+diff --git a/ld/ldelf.c b/ld/ldelf.c
+index 21e655bb55c..8501d98b48f 100644
+--- a/ld/ldelf.c
++++ b/ld/ldelf.c
+@@ -1043,6 +1043,15 @@ ldelf_after_open (int use_libpath, int native, int is_linux, int is_freebsd,
+ /* Do not allow executable files to be used as inputs to the link. */
+ for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
+ {
++ /* Discard input .note.gnu.build-id sections. */
++ s = bfd_get_section_by_name (abfd, ".note.gnu.build-id");
++ while (s != NULL)
++ {
++ if (s != elf_tdata (link_info.output_bfd)->o->build_id.sec)
++ s->flags |= SEC_EXCLUDE;
++ s = bfd_get_next_section_by_name (NULL, s);
++ }
++
+ if (abfd->xvec->flavour == bfd_target_elf_flavour
+ && !bfd_input_just_syms (abfd)
+ && elf_tdata (abfd) != NULL
+@@ -1387,6 +1396,9 @@ write_build_id (bfd *abfd)
+ id_bits = contents + size;
+ size = asec->size - size;
+
++ /* Clear the build ID field. */
++ memset (id_bits, 0, size);
++
+ bfd_h_put_32 (abfd, sizeof "GNU", &e_note->namesz);
+ bfd_h_put_32 (abfd, size, &e_note->descsz);
+ bfd_h_put_32 (abfd, NT_GNU_BUILD_ID, &e_note->type);
+@@ -1418,7 +1430,8 @@ ldelf_setup_build_id (bfd *ibfd)
+
+ flags = (SEC_ALLOC | SEC_LOAD | SEC_IN_MEMORY
+ | SEC_LINKER_CREATED | SEC_READONLY | SEC_DATA);
+- s = bfd_make_section_with_flags (ibfd, ".note.gnu.build-id", flags);
++ s = bfd_make_section_anyway_with_flags (ibfd, ".note.gnu.build-id",
++ flags);
+ if (s != NULL && bfd_set_section_alignment (s, 2))
+ {
+ struct elf_obj_tdata *t = elf_tdata (link_info.output_bfd);
+diff --git a/ld/testsuite/ld-elf/build-id.exp b/ld/testsuite/ld-elf/build-id.exp
+new file mode 100644
+index 00000000000..19c22a75c4d
+--- /dev/null
++++ b/ld/testsuite/ld-elf/build-id.exp
+@@ -0,0 +1,77 @@
++# Expect script for --build-id tests.
++# Copyright (C) 2021 Free Software Foundation, Inc.
++#
++# This file is part of the GNU Binutils.
++#
++# This program 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 of the License, or
++# (at your option) any later version.
++#
++# This program 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.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
++# MA 02110-1301, USA.
++#
++
++# Exclude non-ELF targets.
++
++if ![is_elf_format] {
++ return
++}
++
++if { [istarget frv-*-*] || [istarget lm32-*-*] } {
++ return
++}
++
++if { !([istarget *-*-linux*]
++ || [istarget arm*-*-uclinuxfdpiceabi]
++ || [istarget *-*-nacl*]
++ || [istarget *-*-gnu*]) } then {
++ return
++}
++
++run_ld_link_tests [list \
++ [list \
++ "pr28639a.o" \
++ "-r --build-id=md5" \
++ "" \
++ "" \
++ {start.s} \
++ {{readelf {--notes} pr28639a.rd}} \
++ "pr28639a.o" \
++ ] \
++ [list \
++ "pr28639a.o" \
++ "-r --build-id" \
++ "" \
++ "" \
++ {dummy.s} \
++ {{readelf {--notes} pr28639b.rd}} \
++ "pr28639b.o" \
++ ] \
++ [list \
++ "pr28639a" \
++ "--build-id tmpdir/pr28639a.o tmpdir/pr28639b.o" \
++ "" \
++ "" \
++ {dummy.s} \
++ {{readelf {--notes} pr28639b.rd} \
++ {readelf {--notes} pr28639c.rd}} \
++ "pr28639a" \
++ ] \
++ [list \
++ "pr28639b" \
++ "--build-id=none tmpdir/pr28639a.o tmpdir/pr28639b.o" \
++ "" \
++ "" \
++ {dummy.s} \
++ {{readelf {--notes} pr28639d.rd}} \
++ "pr28639b" \
++ ] \
++]
+diff --git a/ld/testsuite/ld-elf/pr28639a.rd b/ld/testsuite/ld-elf/pr28639a.rd
+new file mode 100644
+index 00000000000..e85087064d0
+--- /dev/null
++++ b/ld/testsuite/ld-elf/pr28639a.rd
+@@ -0,0 +1,6 @@
++#...
++Displaying notes found in: \.note\.gnu\.build-id
++ Owner Data size Description
++ GNU 0x00000010 NT_GNU_BUILD_ID \(unique build ID bitstring\)
++ Build ID: [0-9a-f]+
++#pass
+diff --git a/ld/testsuite/ld-elf/pr28639b.rd b/ld/testsuite/ld-elf/pr28639b.rd
+new file mode 100644
+index 00000000000..04dcb04bec2
+--- /dev/null
++++ b/ld/testsuite/ld-elf/pr28639b.rd
+@@ -0,0 +1,6 @@
++#...
++Displaying notes found in: \.note\.gnu\.build-id
++ Owner Data size Description
++ GNU 0x00000014 NT_GNU_BUILD_ID \(unique build ID bitstring\)
++ Build ID: [0-9a-f]+
++#pass
+diff --git a/ld/testsuite/ld-elf/pr28639c.rd b/ld/testsuite/ld-elf/pr28639c.rd
+new file mode 100644
+index 00000000000..64221e5fa51
+--- /dev/null
++++ b/ld/testsuite/ld-elf/pr28639c.rd
+@@ -0,0 +1,10 @@
++#failif
++#...
++Displaying notes found in: \.note\.gnu\.build-id
++ Owner Data size Description
++ GNU 0x[0-9a-f]+ NT_GNU_BUILD_ID \(unique build ID bitstring\)
++ Build ID: [0-9a-f]+
++ Owner Data size Description
++ GNU 0x[0-9a-f]+ NT_GNU_BUILD_ID \(unique build ID bitstring\)
++ Build ID: [0-9a-f]+
++#...
+diff --git a/ld/testsuite/ld-elf/pr28639d.rd b/ld/testsuite/ld-elf/pr28639d.rd
+new file mode 100644
+index 00000000000..897c8493efa
+--- /dev/null
++++ b/ld/testsuite/ld-elf/pr28639d.rd
+@@ -0,0 +1,4 @@
++#failif
++#...
++Displaying notes found in: \.note\.gnu\.build-id
++#...
+--
+
--
2.25.1


Re: [PATCH 10/29] meson: upgrade 0.60.1 -> 0.60.2

Khem Raj
 

On Wed, Dec 8, 2021 at 2:00 PM Alexander Kanavin <alex.kanavin@...> wrote:

From: Alexander Kanavin <alex.kanavin@...>

Signed-off-by: Alexander Kanavin <alex.kanavin@...>
---
meta/recipes-devtools/meson/meson.inc | 2 +-
.../recipes-devtools/meson/{meson_0.60.1.bb => meson_0.60.2.bb} | 0
.../{nativesdk-meson_0.60.1.bb => nativesdk-meson_0.60.2.bb} | 0
3 files changed, 1 insertion(+), 1 deletion(-)
rename meta/recipes-devtools/meson/{meson_0.60.1.bb => meson_0.60.2.bb} (100%)
rename meta/recipes-devtools/meson/{nativesdk-meson_0.60.1.bb => nativesdk-meson_0.60.2.bb} (100%)

diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc
index f383ad9f74..7fbb246b87 100644
--- a/meta/recipes-devtools/meson/meson.inc
+++ b/meta/recipes-devtools/meson/meson.inc
@@ -15,7 +15,7 @@ SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${P
file://0002-Support-building-allarch-recipes-again.patch \
file://0001-is_debianlike-always-return-False.patch \
"
-SRC_URI[sha256sum] = "5add789c953d984b500858b2851ee3d7add0460cf1a6f852f0a721af17384e13"
+SRC_URI[sha256sum] = "64e6968565bf1b8152f4f9d6ca8154efb9e14caa9aabf7b22e71e6c5d053e921"

UPSTREAM_CHECK_URI = "https://github.com/mesonbuild/meson/releases"
UPSTREAM_CHECK_REGEX = "meson-(?P<pver>\d+(\.\d+)+)\.tar"
diff --git a/meta/recipes-devtools/meson/meson_0.60.1.bb b/meta/recipes-devtools/meson/meson_0.60.2.bb
similarity index 100%
rename from meta/recipes-devtools/meson/meson_0.60.1.bb
rename to meta/recipes-devtools/meson/meson_0.60.2.bb
diff --git a/meta/recipes-devtools/meson/nativesdk-meson_0.60.1.bb b/meta/recipes-devtools/meson/nativesdk-meson_0.60.2.bb
similarity index 100%
rename from meta/recipes-devtools/meson/nativesdk-meson_0.60.1.bb
rename to meta/recipes-devtools/meson/nativesdk-meson_0.60.2.bb
--
2.20.1




Re: [RFC PATCH 08/10] qemu: remove obsolete support for renamed libtool

Ross Burton <ross@...>
 

On Fri, 10 Dec 2021 at 15:58, Khem Raj <raj.khem@...> wrote:
libtool is now longer renamed to ${host}-libtool, so
Typo now should be no
Argh.

Dug out git-filter-branch, now fixed in poky-contrib:ross/libtool.

Ross


Re: [PATCH] perf: Tweak for mips n64

Richard Purdie
 

On Fri, 2021-12-10 at 07:56 -0800, Khem Raj wrote:


On Fri, Dec 10, 2021 at 4:05 AM Richard Purdie
<richard.purdie@...> wrote:
With the changes to binutils, perf's direct calls to ld break for mips n64.
We already have tweaks for n32 so match those with the ones for n64.

Signed-off-by: Richard Purdie <richard.purdie@...>
---
 meta/recipes-kernel/perf/perf.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-
kernel/perf/perf.bb
index 7bbc1ad70c5..ec0c6efe15f 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -125,9 +125,11 @@ PERF_SRC ?= "Makefile \

 PERF_EXTRA_LDFLAGS = ""

-# MIPS N32
+# MIPS N32/N64
 PERF_EXTRA_LDFLAGS:mipsarchn32eb = "-m elf32btsmipn32"
 PERF_EXTRA_LDFLAGS:mipsarchn32el = "-m elf32ltsmipn32"
+PERF_EXTRA_LDFLAGS:mipsarchn64eb = "-m elf64btsmip"
+PERF_EXTRA_LDFLAGS:mipsarchn64el = "-m elf64ltsmip"

Hmm this tells me that the default is not really changed in binutils to use
n64 abi with out the patch to binutils configure 

N32 patch above is perhaps fine because that’s not our default 

Perhaps we need to check a bit more here as to what’s going on
In the x86 case, ld looks at the existing object files and sets it's emulation
mode accordingly if none were specified. It seems mips lacks this and there was
a binutils patch which changed the default which I have dropped in -next. The
N32 case is another example of it which we never patched. Unlike the gcc case,
there is no option to change the default when compiling binutils.

Most of the time we don't need that patch as programs use CC/CCLD for linking
and the correct flags are specified there through the gcc driver, perf is the
only one in core which seems to use ld directly like this.

We could start to try and fix the autodetection for mips in the compiler but for
an architecture which has minimal mindshare, I'm not sure it is worth the
effort. Using the same approach as we already have for N32 and dropping the
patch seemed like the reasonable course of action?

Cheers,

Richard


Re: [RFC PATCH 08/10] qemu: remove obsolete support for renamed libtool

Khem Raj
 



On Fri, Dec 10, 2021 at 6:22 AM Ross Burton <ross@...> wrote:
libtool is now longer renamed to ${host}-libtool, so

Typo now should be no 

remove the changes
to support this.

Signed-off-by: Ross Burton <ross.burton@...>
---
 meta/recipes-devtools/qemu/qemu.inc | 2 --
 1 file changed, 2 deletions(-)

diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index ea7dfaecef8..fe35f94acf7 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -98,8 +98,6 @@ EXTRA_OECONF = " \
     ${PACKAGECONFIG_CONFARGS} \
     "

-export LIBTOOL="${HOST_SYS}-libtool"
-
 B = "${WORKDIR}/build"

 #EXTRA_OECONF:append = " --python=${HOSTTOOLS_DIR}/python3"
--
2.25.1





Re: [RFC PATCH 01/10] libtool: don't prefix the installed binary

Ross Burton <ross@...>
 

On Fri, 10 Dec 2021 at 15:17, Khem Raj <raj.khem@...> wrote:
Does it mean that it can now run original libtool script accidentally which is pregenerated part of package which may be not what we want
Not really, if we run libtoolize then we replace any existing libtool
binary. If we don't run libtoolize then there isn't our binary in the
first place. Also, libtool-cross/libtool-native provide our libtool
binary on $PATH.

Ross

9501 - 9520 of 169063