[OE-core] [PATCH v12] Rust Oe-Selftest implementation

2023-02-22 Thread Pgowda
From: pgowda 

The patch implements Rust testing framework similar to other selftest,
specifically the gcc selftest in OE. It uses the client and server
based method to test the binaries for cross-target on the image.
The test framework is a wrapper around the Rust build system as ./x.py
test. It tests many functionalities of Rust distribution like tools,
documentation, libraries, packages, tools, Cargo, Crater etc.
Please refer the following link for detailed description of Rust
testing:-
https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests

To support the rust tests in oe-core, the following functions were
added:-
setup_cargo_environment(): Build bootstrap and some early stage tools.
do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
do_configure(): To generate config.toml
do_compile(): To build "remote-test-server" for qemu target image.

Approximate Number of Tests Run in the Rust Testsuite :- 18000
Approximate Number of Tests that FAIL in bitbake environment :- 100-150
Normally majority of the testcases are present in major folder "test/"
It contributes to more than 80% of the testcases present in Rust test
framework. These tests pass as expected on any Rust versions without
much fuss. The tests that fail are of less important and contribute to
less than 2% of the total testcases. These minor tests are observed to
work on some versions and fail on others. They have to be added, ignored
or excluded for different versions as per the behavior.
These tests have been ignored or excluded in the Rust selftest
environment to generate success of completing the testsuite.

These tests work in parallel mode even in the skipped test mode as
expected. Although the patch to disable tests is large, it is very simple
in that it only disables tests. When updating to a newer version of Rust,
the patch can usually be ported in a day.

Tested for X86, X86-64, ARM, ARM64 and MIPS64 on CentOS release 6.10

Signed-off-by: pgowda 
Signed-off-by: Vinay Kumar 
---
 meta/lib/oeqa/selftest/cases/rust.py  |  54 ++
 .../rust/files/rust-oe-selftest.patch | 736 ++
 meta/recipes-devtools/rust/rust-source.inc|   1 +
 meta/recipes-devtools/rust/rust_1.67.1.bb |   6 +
 4 files changed, 797 insertions(+)
 create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
 create mode 100644 meta/recipes-devtools/rust/files/rust-oe-selftest.patch

diff --git a/meta/lib/oeqa/selftest/cases/rust.py 
b/meta/lib/oeqa/selftest/cases/rust.py
new file mode 100644
index 00..f9889b840c
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: MIT
+import os
+import subprocess
+from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, 
runqemu, Command
+from oeqa.utils.sshcontrol import SSHControl
+
+# Total time taken for testing is of about 2hr 20min, with PARALLEL_MAKE set 
to 40 number of jobs.
+class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
+def test_rust(self, *args, **kwargs):
+# build remote-test-server before image build
+recipe = "rust"
+bitbake("{} -c test_compile".format(recipe))
+builddir = get_bb_var("RUSTSRC", "rust")
+# build core-image-minimal with required packages
+default_installed_packages = ["libgcc", "libstdc++", "libatomic", 
"libgomp"]
+features = []
+features.append('IMAGE_FEATURES += "ssh-server-dropbear"')
+features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" 
".join(default_installed_packages)))
+self.write_config("\n".join(features))
+bitbake("core-image-minimal")
+# wrap the execution with a qemu instance.
+# Tests are run with 512 tasks in parallel to execute all tests very 
quickly
+with runqemu("core-image-minimal", runqemuparams = "nographic", 
qemuparams = "-m 512") as qemu:
+# Copy remote-test-server to image through scp
+ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user="root")
+ssh.copy_to(builddir + "/" + 
"build/x86_64-unknown-linux-gnu/stage1-tools-bin/remote-test-server","~/")
+# Execute remote-test-server on image through background ssh
+command = '~/remote-test-server --bind 0.0.0.0:12345 -v'
+sshrun=subprocess.Popen(("ssh", '-o',  
'UserKnownHostsFile=/dev/null', '-o',  'StrictHostKeyChecking=no', '-f', 
"root@%s" % qemu.ip, command), shell=False, stdout=subprocess.PIPE, 
stderr=subprocess.PIPE)
+# Get the values of variables.
+tcpath = get_b

[OE-core] [PATCH] Binutils : Fix CVE-2022-4285

2022-12-19 Thread Pgowda
From: pgowda 

Upstream-Status: Backport 
[https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5c831a3c7f3ca98d6aba1200353311e1a1f84c70]

Signed-off-by: pgowda 
---
 .../binutils/binutils-2.39.inc|  1 +
 .../binutils/0015-CVE-2022-4285.patch | 37 +++
 2 files changed, 38 insertions(+)
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0015-CVE-2022-4285.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.39.inc 
b/meta/recipes-devtools/binutils/binutils-2.39.inc
index b040e57037..419571d56c 100644
--- a/meta/recipes-devtools/binutils/binutils-2.39.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.39.inc
@@ -35,6 +35,7 @@ SRC_URI = "\
  file://0014-CVE-2022-38128-1.patch \
  file://0014-CVE-2022-38128-2.patch \
  file://0014-CVE-2022-38128-3.patch \
+ file://0015-CVE-2022-4285.patch \
 "
 S  = "${WORKDIR}/git"
 # Already in 2.39 branch
diff --git a/meta/recipes-devtools/binutils/binutils/0015-CVE-2022-4285.patch 
b/meta/recipes-devtools/binutils/binutils/0015-CVE-2022-4285.patch
new file mode 100644
index 00..46ec0b15a3
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0015-CVE-2022-4285.patch
@@ -0,0 +1,37 @@
+From 5c831a3c7f3ca98d6aba1200353311e1a1f84c70 Mon Sep 17 00:00:00 2001
+From: Nick Clifton 
+Date: Wed, 19 Oct 2022 15:09:12 +0100
+Subject: [PATCH] Fix an illegal memory access when parsing an ELF file
+ containing corrupt symbol version information.
+
+   PR 29699
+   * elf.c (_bfd_elf_slurp_version_tables): Fail if the sh_info field
+   of the section header is zero.
+
+Upstream-Status: Backport
+[https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5c831a3c7f3ca98d6aba1200353311e1a1f84c70]
+
+Signed-off-by: Pgowda 
+---
+ bfd/ChangeLog | 6 ++
+ bfd/elf.c | 4 +++-
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/bfd/elf.c b/bfd/elf.c
+index fe00e0f9189..7cd7febcf95 100644
+--- a/bfd/elf.c
 b/bfd/elf.c
+@@ -8918,7 +8918,9 @@ _bfd_elf_slurp_version_tables (bfd *abfd, bool 
default_imported_symver)
+ bfd_set_error (bfd_error_file_too_big);
+ goto error_return_verref;
+   }
+-  elf_tdata (abfd)->verref = (Elf_Internal_Verneed *) bfd_alloc (abfd, 
amt);
++  if (amt == 0)
++  goto error_return_verref;
++  elf_tdata (abfd)->verref = (Elf_Internal_Verneed *) bfd_zalloc (abfd, 
amt);
+   if (elf_tdata (abfd)->verref == NULL)
+   goto error_return_verref;
+ 
+-- 
+2.31.1
+
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#174819): 
https://lists.openembedded.org/g/openembedded-core/message/174819
Mute This Topic: https://lists.openembedded.org/mt/95766745/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [kirkstone][PATCH] binutils : Fix CVE-2022-38128

2022-10-13 Thread Pgowda
From: pgowda 

Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=f07c08e115e27cddf5a0030dc6332bbee1bd9c6a]
Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=175b91507b83ad42607d2f6dadaf55b7b511bdbe]
Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=695c6dfe7e85006b98c8b746f3fd5f913c94ebff]

Signed-off-by: pgowda 
---
 .../binutils/binutils-2.38.inc|   3 +
 .../binutils/0018-CVE-2022-38128-1.patch  | 350 ++
 .../binutils/0018-CVE-2022-38128-2.patch  | 436 ++
 .../binutils/0018-CVE-2022-38128-3.patch  |  95 
 4 files changed, 884 insertions(+)
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0018-CVE-2022-38128-1.patch
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0018-CVE-2022-38128-2.patch
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0018-CVE-2022-38128-3.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.38.inc 
b/meta/recipes-devtools/binutils/binutils-2.38.inc
index fc88d4a79e..8259ec3232 100644
--- a/meta/recipes-devtools/binutils/binutils-2.38.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.38.inc
@@ -39,5 +39,8 @@ SRC_URI = "\
  file://0017-CVE-2022-38127-2.patch \
  file://0017-CVE-2022-38127-3.patch \
  file://0017-CVE-2022-38127-4.patch \
+ file://0018-CVE-2022-38128-1.patch \
+ file://0018-CVE-2022-38128-2.patch \
+ file://0018-CVE-2022-38128-3.patch \
 "
 S  = "${WORKDIR}/git"
diff --git 
a/meta/recipes-devtools/binutils/binutils/0018-CVE-2022-38128-1.patch 
b/meta/recipes-devtools/binutils/binutils/0018-CVE-2022-38128-1.patch
new file mode 100644
index 00..0a490d86b3
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0018-CVE-2022-38128-1.patch
@@ -0,0 +1,350 @@
+From f07c08e115e27cddf5a0030dc6332bbee1bd9c6a Mon Sep 17 00:00:00 2001
+From: Alan Modra 
+Date: Thu, 21 Jul 2022 08:38:14 +0930
+Subject: [PATCH] binutils/dwarf.c: abbrev caching
+
+I'm inclined to think that abbrev caching is counter-productive.  The
+time taken to search the list of abbrevs converted to internal form is
+non-zero, and it's easy to decode the raw abbrevs.  It's especially
+silly to cache empty lists of decoded abbrevs (happens with zero
+padding in .debug_abbrev), or abbrevs as they are displayed when there
+is no further use of those abbrevs.  This patch stops caching in those
+cases.
+
+   * dwarf.c (record_abbrev_list_for_cu): Add free_list param.
+   Put abbrevs on abbrev_lists here.
+   (new_abbrev_list): Delete function.
+   (process_abbrev_set): Return newly allocated list.  Move
+   abbrev base, offset and size checking to..
+   (find_and_process_abbrev_set): ..here, new function.  Handle
+   lookup of cached abbrevs here, and calculate start and end
+   for process_abbrev_set.  Return free_list if newly alloc'd.
+   (process_debug_info): Consolidate cached list lookup, new list
+   alloc and processing into find_and_process_abbrev_set call.
+   Free list when not cached.
+   (display_debug_abbrev): Similarly.
+
+Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=f07c08e115e27cddf5a0030dc6332bbee1bd9c6a]
+
+Signed-off-by: Pgowda 
+---
+ binutils/dwarf.c | 208 +--
+ 1 file changed, 110 insertions(+), 98 deletions(-)
+
+diff --git a/binutils/dwarf.c b/binutils/dwarf.c
+index 267ed3bb382..2fc352f74c5 100644
+--- a/binutils/dwarf.c
 b/binutils/dwarf.c
+@@ -882,8 +882,15 @@ static unsigned long  next_free_abbrev_m
+ #define ABBREV_MAP_ENTRIES_INCREMENT   8
+ 
+ static void
+-record_abbrev_list_for_cu (dwarf_vma start, dwarf_vma end, abbrev_list * list)
++record_abbrev_list_for_cu (dwarf_vma start, dwarf_vma end,
++ abbrev_list *list, abbrev_list *free_list)
+ {
++  if (free_list != NULL)
++{
++  list->next = abbrev_lists;
++  abbrev_lists = list;
++}
++
+   if (cu_abbrev_map == NULL)
+ {
+   num_abbrev_map_entries = INITIAL_NUM_ABBREV_MAP_ENTRIES;
+@@ -936,20 +943,6 @@ free_all_abbrevs (void)
+ }
+ 
+ static abbrev_list *
+-new_abbrev_list (dwarf_vma abbrev_base, dwarf_vma abbrev_offset)
+-{
+-  abbrev_list * list = (abbrev_list *) xcalloc (sizeof * list, 1);
+-
+-  list->abbrev_base = abbrev_base;
+-  list->abbrev_offset = abbrev_offset;
+-
+-  list->next = abbrev_lists;
+-  abbrev_lists = list;
+-
+-  return list;
+-}
+-
+-static abbrev_list *
+ find_abbrev_list_by_abbrev_offset (dwarf_vma abbrev_base,
+  dwarf_vma abbrev_offset)
+ {
+@@ -966,7 +959,7 @@ find_abbrev_list_by_abbrev_offset (dwarf
+ /* Find the abbreviation map for the CU that includes OFFSET.
+OFFSET is an absolute offset from the start of the .debug_info section.  */
+ /* FIXME: This function is going to slow down readelf & o

[OE-core] [kirkstone][PATCH] binutils : Fix CVE-2022-38127

2022-09-29 Thread Pgowda
From: pgowda 

Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=19c26da69d68d5d863f37c06ad73ab6292d02ffa]
Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=ec41dd75c866599fc03c390c6afb5736c159c0ff]
Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=f18acc9c4e5d18f4783f3a7d59e3ec95d7af0199]
Upstream-Status: Backport
[https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e98e7d9a70dcc987bff0e925f20b78cd4a2979ed]

Signed-off-by: pgowda 
---
 .../binutils/binutils-2.38.inc|4 +
 .../binutils/0017-CVE-2022-38127-1.patch  | 1224 +
 .../binutils/0017-CVE-2022-38127-2.patch  |  188 +++
 .../binutils/0017-CVE-2022-38127-3.patch  |  211 +++
 .../binutils/0017-CVE-2022-38127-4.patch  |   43 +
 5 files changed, 1670 insertions(+)
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0017-CVE-2022-38127-1.patch
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0017-CVE-2022-38127-2.patch
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0017-CVE-2022-38127-3.patch
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0017-CVE-2022-38127-4.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.38.inc 
b/meta/recipes-devtools/binutils/binutils-2.38.inc
index 2ddeb0ed39..fc88d4a79e 100644
--- a/meta/recipes-devtools/binutils/binutils-2.38.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.38.inc
@@ -35,5 +35,9 @@ SRC_URI = "\
  file://0014-CVE-2019-1010204.patch \
  file://0015-CVE-2022-38533.patch \
  file://0016-CVE-2022-38126.patch \
+ file://0017-CVE-2022-38127-1.patch \
+ file://0017-CVE-2022-38127-2.patch \
+ file://0017-CVE-2022-38127-3.patch \
+ file://0017-CVE-2022-38127-4.patch \
 "
 S  = "${WORKDIR}/git"
diff --git 
a/meta/recipes-devtools/binutils/binutils/0017-CVE-2022-38127-1.patch 
b/meta/recipes-devtools/binutils/binutils/0017-CVE-2022-38127-1.patch
new file mode 100644
index 00..9bbf1d6453
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0017-CVE-2022-38127-1.patch
@@ -0,0 +1,1224 @@
+From 19c26da69d68d5d863f37c06ad73ab6292d02ffa Mon Sep 17 00:00:00 2001
+From: Nick Clifton 
+Date: Wed, 6 Apr 2022 14:43:37 +0100
+Subject: [PATCH] Add code to display the contents of .debug_loclists sections
+ which contain offset entry tables.
+
+   PR 28981
+   * dwarf.c (fetch_indexed_value): Rename to fecth_indexed_addr and
+   return the address, rather than a string.
+   (fetch_indexed_value): New function - returns a value indexed by a
+   DW_FORM_loclistx or DW_FORM_rnglistx form.
+   (read_and_display_attr_value): Add support for DW_FORM_loclistx
+   and DW_FORM_rnglistx.
+   (process_debug_info): Load the loclists and rnglists sections.
+   (display_loclists_list): Add support for DW_LLE_base_addressx,
+   DW_LLE_startx_endx, DW_LLE_startx_length and
+   DW_LLE_default_location.
+   (display_offset_entry_loclists): New function.  Displays a
+   .debug_loclists section that contains offset entry tables.
+   (display_debug_loc): Call the new function.
+   (display_debug_rnglists_list): Add support for
+   DW_RLE_base_addressx, DW_RLE_startx_endx and DW_RLE_startx_length.
+   (display_debug_ranges): Display the contents of the section's
+   header.
+   * dwarf.h (struct debug_info): Add loclists_base field.
+   * testsuite/binutils-all/dw5.W: Update expected output.
+   * testsuite/binutils-all/x86-64/pr26808.dump: Likewise.
+
+Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=19c26da69d68d5d863f37c06ad73ab6292d02ffa]
+
+Signed-off-by: Pgowda 
+---
+ binutils/ChangeLog|  24 +
+ binutils/dwarf.c  | 513 +++---
+ binutils/dwarf.h  |   4 +
+ binutils/testsuite/binutils-all/dw5.W |   2 +-
+ .../binutils-all/x86-64/pr26808.dump  |  82 +--
+ gas/ChangeLog |   5 +
+ gas/testsuite/gas/elf/dwarf-5-irp.d   |   2 +-
+ 7 files changed, 517 insertions(+), 115 deletions(-)
+
+diff --git a/binutils/dwarf.c b/binutils/dwarf.c
+index 15b3c81a138..bc862f77c04 100644
+--- a/binutils/dwarf.c
 b/binutils/dwarf.c
+@@ -240,7 +240,7 @@ static const char *
+ dwarf_vmatoa_1 (const char *fmtch, dwarf_vma value, unsigned num_bytes)
+ {
+   /* As dwarf_vmatoa is used more then once in a printf call
+- for output, we are cycling through an fixed array of pointers
++ for output, we are cycling through a fixed array of pointers
+  for return address.  */
+   static int buf_pos = 0;
+   static struct dwarf_vmatoa_buf
+@@ -796,24 +796,70 @@ fetch_indexed_string (dwarf_vma idx, str
+   return ret;
+ }
+ 
+-static const char *
+-fetch_indexed_value (dwarf_vma offset, dwarf_vma bytes

[OE-core] [PATCH] binutils : Fix CVE-2022-38128

2022-09-21 Thread Pgowda
From: pgowda 

Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=f07c08e115e27cddf5a0030dc6332bbee1bd9c6a]
Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=175b91507b83ad42607d2f6dadaf55b7b511bdbe]
Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=patch;h=695c6dfe7e85006b98c8b746f3fd5f913c94ebff]

Signed-off-by: pgowda 
---
 .../binutils/binutils-2.39.inc|   3 +
 .../binutils/0014-CVE-2022-38128-1.patch  | 350 
 .../binutils/0014-CVE-2022-38128-2.patch  | 536 ++
 .../binutils/0014-CVE-2022-38128-3.patch  |  95 
 4 files changed, 984 insertions(+)
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0014-CVE-2022-38128-1.patch
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0014-CVE-2022-38128-2.patch
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0014-CVE-2022-38128-3.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.39.inc 
b/meta/recipes-devtools/binutils/binutils-2.39.inc
index e4fdb73243..b040e57037 100644
--- a/meta/recipes-devtools/binutils/binutils-2.39.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.39.inc
@@ -32,6 +32,9 @@ SRC_URI = "\
  file://0011-Check-for-clang-before-checking-gcc-version.patch \
  file://0012-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \
  file://0013-CVE-2022-38533.patch \
+ file://0014-CVE-2022-38128-1.patch \
+ file://0014-CVE-2022-38128-2.patch \
+ file://0014-CVE-2022-38128-3.patch \
 "
 S  = "${WORKDIR}/git"
 # Already in 2.39 branch
diff --git 
a/meta/recipes-devtools/binutils/binutils/0014-CVE-2022-38128-1.patch 
b/meta/recipes-devtools/binutils/binutils/0014-CVE-2022-38128-1.patch
new file mode 100644
index 00..0a490d86b3
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0014-CVE-2022-38128-1.patch
@@ -0,0 +1,350 @@
+From f07c08e115e27cddf5a0030dc6332bbee1bd9c6a Mon Sep 17 00:00:00 2001
+From: Alan Modra 
+Date: Thu, 21 Jul 2022 08:38:14 +0930
+Subject: [PATCH] binutils/dwarf.c: abbrev caching
+
+I'm inclined to think that abbrev caching is counter-productive.  The
+time taken to search the list of abbrevs converted to internal form is
+non-zero, and it's easy to decode the raw abbrevs.  It's especially
+silly to cache empty lists of decoded abbrevs (happens with zero
+padding in .debug_abbrev), or abbrevs as they are displayed when there
+is no further use of those abbrevs.  This patch stops caching in those
+cases.
+
+   * dwarf.c (record_abbrev_list_for_cu): Add free_list param.
+   Put abbrevs on abbrev_lists here.
+   (new_abbrev_list): Delete function.
+   (process_abbrev_set): Return newly allocated list.  Move
+   abbrev base, offset and size checking to..
+   (find_and_process_abbrev_set): ..here, new function.  Handle
+   lookup of cached abbrevs here, and calculate start and end
+   for process_abbrev_set.  Return free_list if newly alloc'd.
+   (process_debug_info): Consolidate cached list lookup, new list
+   alloc and processing into find_and_process_abbrev_set call.
+   Free list when not cached.
+   (display_debug_abbrev): Similarly.
+
+Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=f07c08e115e27cddf5a0030dc6332bbee1bd9c6a]
+
+Signed-off-by: Pgowda 
+---
+ binutils/dwarf.c | 208 +--
+ 1 file changed, 110 insertions(+), 98 deletions(-)
+
+diff --git a/binutils/dwarf.c b/binutils/dwarf.c
+index 267ed3bb382..2fc352f74c5 100644
+--- a/binutils/dwarf.c
 b/binutils/dwarf.c
+@@ -882,8 +882,15 @@ static unsigned long  next_free_abbrev_m
+ #define ABBREV_MAP_ENTRIES_INCREMENT   8
+ 
+ static void
+-record_abbrev_list_for_cu (dwarf_vma start, dwarf_vma end, abbrev_list * list)
++record_abbrev_list_for_cu (dwarf_vma start, dwarf_vma end,
++ abbrev_list *list, abbrev_list *free_list)
+ {
++  if (free_list != NULL)
++{
++  list->next = abbrev_lists;
++  abbrev_lists = list;
++}
++
+   if (cu_abbrev_map == NULL)
+ {
+   num_abbrev_map_entries = INITIAL_NUM_ABBREV_MAP_ENTRIES;
+@@ -936,20 +943,6 @@ free_all_abbrevs (void)
+ }
+ 
+ static abbrev_list *
+-new_abbrev_list (dwarf_vma abbrev_base, dwarf_vma abbrev_offset)
+-{
+-  abbrev_list * list = (abbrev_list *) xcalloc (sizeof * list, 1);
+-
+-  list->abbrev_base = abbrev_base;
+-  list->abbrev_offset = abbrev_offset;
+-
+-  list->next = abbrev_lists;
+-  abbrev_lists = list;
+-
+-  return list;
+-}
+-
+-static abbrev_list *
+ find_abbrev_list_by_abbrev_offset (dwarf_vma abbrev_base,
+  dwarf_vma abbrev_offset)
+ {
+@@ -966,7 +959,7 @@ find_abbrev_list_by_abbrev_offset (dwarf
+ /* Find the abbreviation map for the CU that includes OFFSET.
+OFFSET is an absolute offset from the start of the .de

[OE-core] [kirkstone][PATCH] binutils - CVE-2022-38126

2022-09-15 Thread Pgowda
From: pgowda 

Upstream-Status: Backport 
[https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e3e5ae049371a27fd1737aba946fe26d06e029b5]

Signed-off-by: pgowda 
---
 .../binutils/binutils-2.38.inc|  1 +
 .../binutils/0016-CVE-2022-38126.patch| 34 +++
 2 files changed, 35 insertions(+)
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0016-CVE-2022-38126.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.38.inc 
b/meta/recipes-devtools/binutils/binutils-2.38.inc
index 8aa8295881..2ddeb0ed39 100644
--- a/meta/recipes-devtools/binutils/binutils-2.38.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.38.inc
@@ -34,5 +34,6 @@ SRC_URI = "\
  file://0013-Avoid-as-info-race-condition.patch \
  file://0014-CVE-2019-1010204.patch \
  file://0015-CVE-2022-38533.patch \
+ file://0016-CVE-2022-38126.patch \
 "
 S  = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0016-CVE-2022-38126.patch 
b/meta/recipes-devtools/binutils/binutils/0016-CVE-2022-38126.patch
new file mode 100644
index 00..8200e28a81
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0016-CVE-2022-38126.patch
@@ -0,0 +1,34 @@
+From e3e5ae049371a27fd1737aba946fe26d06e029b5 Mon Sep 17 00:00:00 2001
+From: Nick Clifton 
+Date: Mon, 27 Jun 2022 13:43:02 +0100
+Subject: [PATCH] Replace a run-time assertion failure with a warning message
+ when parsing corrupt DWARF data.
+
+   PR 29289
+   * dwarf.c (display_debug_names): Replace assert with a warning
+   message.
+
+Upstream-Status: Backport 
[https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e3e5ae049371a27fd1737aba946fe26d06e029b5]
+
+Signed-off-by: Pgowda 
+---
+ binutils/dwarf.c   | 7 ++-
+
+diff --git a/binutils/dwarf.c b/binutils/dwarf.c
+index 37b477b886d..b99c56987da 100644
+--- a/binutils/dwarf.c
 b/binutils/dwarf.c
+@@ -9802,7 +9802,12 @@ display_debug_names (struct dwarf_sectio
+   printf (_("Out of %lu items there are %zu bucket clashes"
+   " (longest of %zu entries).\n"),
+ (unsigned long) name_count, hash_clash_count, longest_clash);
+-  assert (name_count == buckets_filled + hash_clash_count);
++
++  if (name_count != buckets_filled + hash_clash_count)
++  warn (_("The name_count (%lu) is not the same as the used bucket_count 
(%lu) + the hash clash count (%lu)"),
++(unsigned long) name_count,
++(unsigned long) buckets_filled,
++(unsigned long) hash_clash_count);
+ 
+   struct abbrev_lookup_entry
+   {
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#170686): 
https://lists.openembedded.org/g/openembedded-core/message/170686
Mute This Topic: https://lists.openembedded.org/mt/93697203/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH v10] Rust Oe-Selftest implementation

2022-09-07 Thread Pgowda
Hi Richard,

Thanks for pointing this out and your help in improving the patch.
I am using an Ubuntu-18.04 machine and am not able to see the error.

>> Something is mangling spaces in your patch. There shouldn't be tabs here.
Fixed.

>> I think this can be merged with the RustSelfTestBase class as I don't
Merged.

>> If we want to change grammar, it should be in a separate patch.
Removed it.

>> addtask do_test_compile after do_configure do_rust_gen_targets
>> put that alongside the task definition.
Added along with addtask definition.

Please find the patch posted with all the above modifications as :-
https://lists.openembedded.org/g/openembedded-core/message/170420

Thanks,
Pgowda

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#170421): 
https://lists.openembedded.org/g/openembedded-core/message/170421
Mute This Topic: https://lists.openembedded.org/mt/93454351/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH v11] Rust Oe-Selftest implementation

2022-09-07 Thread Pgowda
From: pgowda 

The patch implements Rust testing framework similar to other selftest,
specifically the gcc selftest in OE. It uses the client and server
based method to test the binaries for cross-target on the image.
The test framework is a wrapper around the Rust build system as ./x.py
test. It tests many functionalities of Rust distribution like tools,
documentation, libraries, packages, tools, Cargo, Crater etc.
Please refer the following link for detailed description of Rust
testing:-
https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests

To support the rust tests in oe-core, the following functions were
added:-
setup_cargo_environment(): Build bootstrap and some early stage tools.
do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
do_configure(): To generate config.toml
do_compile(): To build "remote-test-server" for qemu target image.

Approximate Number of Tests Run in the Rust Testsuite :- 18000
Approximate Number of Tests that FAIL in bitbake environment :- 100-150
Normally majority of the testcases are present in major folder "test/"
It contributes to more than 80% of the testcases present in Rust test
framework. These tests pass as expected on any Rust versions without
much fuss. The tests that fail are of less important and contribute to
less than 2% of the total testcases. These minor tests are observed to
work on some versions and fail on others. They have to be added, ignored
or excluded for different versions as per the behavior.
These tests have been ignored or excluded in the Rust selftest
environment to generate success of completing the testsuite.

These tests work in parallel mode even in the skipped test mode as
expected. Although the patch to disable tests is large, it is very simple
in that it only disables tests. When updating to a newer version of Rust,
the patch can usually be ported in a day.

Signed-off-by: pgowda 
Signed-off-by: Vinay Kumar 
---
 meta/lib/oeqa/selftest/cases/rust.py  |  54 ++
 meta/recipes-devtools/rust/rust-source.inc|   3 +-
 meta/recipes-devtools/rust/rust.inc   |   1 +
 .../rust/rust/rust-oe-selftest.patch  | 508 ++
 meta/recipes-devtools/rust/rust_1.63.0.bb |   5 +
 5 files changed, 570 insertions(+), 1 deletion(-)
 create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
 create mode 100644 meta/recipes-devtools/rust/rust/rust-oe-selftest.patch

diff --git a/meta/lib/oeqa/selftest/cases/rust.py 
b/meta/lib/oeqa/selftest/cases/rust.py
new file mode 100644
index 00..e06ddaa6d7
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: MIT
+import os
+import subprocess
+from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, 
runqemu, Command
+from oeqa.utils.sshcontrol import SSHControl
+
+# Total time taken for testing is of about 2hr 20min, with PARALLEL_MAKE set 
to 40 number of jobs.
+class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
+def test_rust(self, *args, **kwargs):
+# build remote-test-server before image build
+recipe = "rust"
+bitbake("{} -c test_compile".format(recipe))
+builddir = get_bb_var("RUSTSRC", "rust")
+# build core-image-minimal with required packages
+default_installed_packages = ["libgcc", "libstdc++", "libatomic", 
"libgomp"]
+features = []
+features.append('IMAGE_FEATURES += "ssh-server-openssh"')
+features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" 
".join(default_installed_packages)))
+self.write_config("\n".join(features))
+bitbake("core-image-minimal")
+# wrap the execution with a qemu instance.
+# Tests are run with 512 tasks in parallel to execute all tests very 
quickly
+with runqemu("core-image-minimal", runqemuparams = "nographic", 
qemuparams = "-m 512") as qemu:
+# Copy remote-test-server to image through scp
+ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user="root")
+ssh.copy_to(builddir + "/" + 
"build/x86_64-unknown-linux-gnu/stage1-tools-bin/remote-test-server","~/")
+# Execute remote-test-server on image through background ssh
+command = '~/remote-test-server -v remote'
+sshrun=subprocess.Popen(("ssh", '-o',  
'UserKnownHostsFile=/dev/null', '-o',  'StrictHostKeyChecking=no', '-f', 
"root@%s" % qemu.ip, command), shell=False, stdout=subprocess.PIPE, 
stderr=subprocess.PIPE)
+# Get the values of variables.
+tcpath = get_bb_var("TAR

[OE-core] [kirkstone][PATCH] binutils : CVE-2022-38533

2022-09-05 Thread Pgowda
From: pgowda 

Upstream-Status: Backport
[https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ef186fe54aa6d281a3ff8a9528417e5cc614c797]

Signed-off-by: pgowda 
---
 .../binutils/binutils-2.38.inc|  1 +
 .../binutils/0015-CVE-2022-38533.patch| 36 +++
 2 files changed, 37 insertions(+)
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0015-CVE-2022-38533.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.38.inc 
b/meta/recipes-devtools/binutils/binutils-2.38.inc
index eed252976a..8aa8295881 100644
--- a/meta/recipes-devtools/binutils/binutils-2.38.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.38.inc
@@ -33,5 +33,6 @@ SRC_URI = "\
  file://0012-Check-for-clang-before-checking-gcc-version.patch \
  file://0013-Avoid-as-info-race-condition.patch \
  file://0014-CVE-2019-1010204.patch \
+ file://0015-CVE-2022-38533.patch \
 "
 S  = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0015-CVE-2022-38533.patch 
b/meta/recipes-devtools/binutils/binutils/0015-CVE-2022-38533.patch
new file mode 100644
index 00..5d9ac2cb1f
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0015-CVE-2022-38533.patch
@@ -0,0 +1,36 @@
+From ef186fe54aa6d281a3ff8a9528417e5cc614c797 Mon Sep 17 00:00:00 2001
+From: Alan Modra 
+Date: Sat, 13 Aug 2022 15:32:47 +0930
+Subject: [PATCH] PR29482 - strip: heap-buffer-overflow
+
+   PR 29482
+   * coffcode.h (coff_set_section_contents): Sanity check _LIB.
+
+Upstream-Status: Backport 
[https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ef186fe54aa6d281a3ff8a9528417e5cc614c797]
+
+Signed-off-by: Pgowda 
+
+---
+ bfd/coffcode.h | 7 +--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/bfd/coffcode.h b/bfd/coffcode.h
+index 67aaf158ca1..52027981c3f 100644
+--- a/bfd/coffcode.h
 b/bfd/coffcode.h
+@@ -4302,10 +4302,13 @@ coff_set_section_contents (bfd * abfd,
+ 
+   rec = (bfd_byte *) location;
+   recend = rec + count;
+-  while (rec < recend)
++  while (recend - rec >= 4)
+ {
++  size_t len = bfd_get_32 (abfd, rec);
++  if (len == 0 || len > (size_t) (recend - rec) / 4)
++break;
++  rec += len * 4;
+   ++section->lma;
+-  rec += bfd_get_32 (abfd, rec) * 4;
+ }
+ 
+   BFD_ASSERT (rec == recend);
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#170335): 
https://lists.openembedded.org/g/openembedded-core/message/170335
Mute This Topic: https://lists.openembedded.org/mt/93495009/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] binutils : CVE-2022-38533

2022-09-05 Thread Pgowda
From: pgowda 

Upstream-Status: Backport 
[https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ef186fe54aa6d281a3ff8a9528417e5cc614c797]

Signed-off-by: pgowda 
---
 .../binutils/binutils-2.39.inc|  1 +
 .../binutils/0013-CVE-2022-38533.patch| 36 +++
 2 files changed, 37 insertions(+)
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0013-CVE-2022-38533.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.39.inc 
b/meta/recipes-devtools/binutils/binutils-2.39.inc
index 89612a3eae..37627c8f93 100644
--- a/meta/recipes-devtools/binutils/binutils-2.39.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.39.inc
@@ -31,5 +31,6 @@ SRC_URI = "\
  file://0010-sync-with-OE-libtool-changes.patch \
  file://0011-Check-for-clang-before-checking-gcc-version.patch \
  file://0012-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \
+ file://0013-CVE-2022-38533.patch \
 "
 S  = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0013-CVE-2022-38533.patch 
b/meta/recipes-devtools/binutils/binutils/0013-CVE-2022-38533.patch
new file mode 100644
index 00..5d9ac2cb1f
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0013-CVE-2022-38533.patch
@@ -0,0 +1,36 @@
+From ef186fe54aa6d281a3ff8a9528417e5cc614c797 Mon Sep 17 00:00:00 2001
+From: Alan Modra 
+Date: Sat, 13 Aug 2022 15:32:47 +0930
+Subject: [PATCH] PR29482 - strip: heap-buffer-overflow
+
+   PR 29482
+   * coffcode.h (coff_set_section_contents): Sanity check _LIB.
+
+Upstream-Status: Backport 
[https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ef186fe54aa6d281a3ff8a9528417e5cc614c797]
+
+Signed-off-by: Pgowda 
+
+---
+ bfd/coffcode.h | 7 +--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/bfd/coffcode.h b/bfd/coffcode.h
+index 67aaf158ca1..52027981c3f 100644
+--- a/bfd/coffcode.h
 b/bfd/coffcode.h
+@@ -4302,10 +4302,13 @@ coff_set_section_contents (bfd * abfd,
+ 
+   rec = (bfd_byte *) location;
+   recend = rec + count;
+-  while (rec < recend)
++  while (recend - rec >= 4)
+ {
++  size_t len = bfd_get_32 (abfd, rec);
++  if (len == 0 || len > (size_t) (recend - rec) / 4)
++break;
++  rec += len * 4;
+   ++section->lma;
+-  rec += bfd_get_32 (abfd, rec) * 4;
+ }
+ 
+   BFD_ASSERT (rec == recend);
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#170318): 
https://lists.openembedded.org/g/openembedded-core/message/170318
Mute This Topic: https://lists.openembedded.org/mt/93480984/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH v10] Rust Oe-Selftest implementation

2022-09-05 Thread Pgowda
Hi Richard,

Thanks very much for reviewing the patch and your comments regarding it.

>> thread 'main' panicked at 'RUSTDOC_LIBDIR was not set',
>> src/bootstrap/bin/rustdoc.rs:15:48
>> note: run with `RUST_BACKTRACE=1` environment variable to display a
>> backtrace
>> error: could not document `core`

I tried on different environments but could not reproduce the error.
Can you please share with me the oe-selftest.log file to reproduce and
work on it?

>> Something is mangling spaces in your patch. There shouldn't be tabs
Modified the complete file to remove TABS and use white spaces.

>> I think this can be merged with the RustSelfTestBase class as I don't
Merge with RustSelfTestBase.

>> If we want to change grammar, it should be in a separate patch.
Removed it from the patch

>> put that alongside the task definition.
Done.

All modifications are done as per the review comments.
However, I still see that the test PASSes and did not see the mentioned error.

=
rust.RustSelfTestSystemEmulated.test_rust: PASSED (4812.37s)
2022-09-05 13:43:50,332 - oe-selftest - INFO - SUMMARY:
2022-09-05 13:43:50,332 - oe-selftest - INFO - oe-selftest () - Ran 1
test in 4875.349s
2022-09-05 13:43:50,332 - oe-selftest - INFO - oe-selftest - OK - All
required tests passed (successes=1, skipped=0, failures=0, errors=0)
=

I am using the following command to run the rust-testsuite:-
oe-selftest -r rust.RustSelfTestSystemEmulated.test_rust
Please let me know if I am missing anything to reproduce the error.

Thanks,
Naveen

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#170317): 
https://lists.openembedded.org/g/openembedded-core/message/170317
Mute This Topic: https://lists.openembedded.org/mt/93454351/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH v10] Rust Oe-Selftest implementation

2022-09-04 Thread Pgowda
From: pgowda 

The patch implements Rust testing framework similar to other selftest,
specifically the gcc selftest in OE. It uses the client and server
based method to test the binaries for cross-target on the image.
The test framework is a wrapper around the Rust build system as ./x.py
test. It tests many functionalities of Rust distribution like tools,
documentation, libraries, packages, tools, Cargo, Crater etc.
Please refer the following link for detailed description of Rust
testing:-
https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests

To support the rust tests in oe-core, the following functions were
added:-
setup_cargo_environment(): Build bootstrap and some early stage tools.
do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
do_configure(): To generate config.toml
do_compile(): To build "remote-test-server" for qemu target image.

Approximate Number of Tests Run in the Rust Testsuite :- 18000
Approximate Number of Tests that FAIL in bitbake environment :- 100-150
Normally majority of the testcases are present in major folder "test/"
It contributes to more than 80% of the testcases present in Rust test
framework. These tests pass as expected on any Rust versions without
much fuss. The tests that fail are of less important and contribute to
less than 2% of the total testcases. These minor tests are observed to
work on some versions and fail on others. They have to be added, ignored
or excluded for different versions as per the behavior.
These tests have been ignored or excluded in the Rust selftest
environment to generate success of completing the testsuite.

These tests work in parallel mode even in the skipped test mode as
expected. Although the patch to disable tests is large, it is very simple
in that it only disables tests. When updating to a newer version of Rust,
the patch can usually be ported in a day.

Signed-off-by: pgowda 
Signed-off-by: Vinay Kumar 
---
 meta/lib/oeqa/selftest/cases/rust.py  |  63 +++
 meta/recipes-devtools/rust/rust-source.inc|   3 +-
 meta/recipes-devtools/rust/rust.inc   |   3 +-
 .../rust/rust/rust-oe-selftest.patch  | 508 ++
 meta/recipes-devtools/rust/rust_1.63.0.bb |   5 +
 5 files changed, 580 insertions(+), 2 deletions(-)
 create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
 create mode 100644 meta/recipes-devtools/rust/rust/rust-oe-selftest.patch

diff --git a/meta/lib/oeqa/selftest/cases/rust.py 
b/meta/lib/oeqa/selftest/cases/rust.py
new file mode 100644
index 00..274bfc144a
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: MIT
+import os
+import subprocess
+from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, 
runqemu, Command
+from oeqa.utils.sshcontrol import SSHControl
+
+# Total time taken for testing is of about 2hr 20min, with PARALLEL_MAKE set 
to 40 number of jobs.
+class RustSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
+
+   def run_check_emulated(self, *args, **kwargs):
+   # build remote-test-server before image build
+   recipe = "rust"
+   bitbake("{} -c test_compile".format(recipe))
+   builddir = get_bb_var("RUSTSRC", "rust")
+   # build core-image-minimal with required packages
+   default_installed_packages = ["libgcc", "libstdc++", 
"libatomic", "libgomp"]
+   features = []
+   features.append('IMAGE_FEATURES += "ssh-server-openssh"')
+   features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" 
".join(default_installed_packages)))
+   self.write_config("\n".join(features))
+   bitbake("core-image-minimal")
+   # wrap the execution with a qemu instance.
+# Tests are run with 512 tasks in parallel to execute all 
tests very quickly
+   with runqemu("core-image-minimal", runqemuparams = "nographic", 
qemuparams = "-m 512") as qemu:
+   # Copy remote-test-server to image through scp
+   ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, 
user="root")
+   ssh.copy_to(builddir + "/" + 
"build/x86_64-unknown-linux-gnu/stage1-tools-bin/remote-test-server","~/")
+   # Execute remote-test-server on image through 
background ssh
+   command = '~/remote-test-server -v remote'
+   sshrun=subprocess.Popen(("ssh", '-o',  
'UserKnownHostsFile=/dev/null', '-o',  'StrictHostKeyChecking=no', '-f', 
"root@%s&

[OE-core] [PATCH] rust: Fix cross compilation error for rust-testuite

2022-09-04 Thread Pgowda
From: pgowda 

Fixes the following error while building the rust-testuite
error: linker cc not found

Signed-off-by: pgowda 
---
 meta/recipes-devtools/rust/rust.inc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-devtools/rust/rust.inc 
b/meta/recipes-devtools/rust/rust.inc
index 284347dedc..a3d93eca4a 100644
--- a/meta/recipes-devtools/rust/rust.inc
+++ b/meta/recipes-devtools/rust/rust.inc
@@ -116,6 +116,9 @@ python do_configure() {
 # Whether or not to optimize the compiler and standard library
 config.set("rust", "optimize", e(True))
 
+# Override default linker cc.
+config.set("rust", "default-linker", e(d.expand("${RUST_BUILD_CCLD}")))
+
 # [build]
 config.add_section("build")
 config.set("build", "submodules", e(False))
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#170279): 
https://lists.openembedded.org/g/openembedded-core/message/170279
Mute This Topic: https://lists.openembedded.org/mt/93454339/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] rust: Enable verbose-tests to get the test results in readable format

2022-09-04 Thread Pgowda
From: pgowda 

Emits complete details regarding the test results to understand
and debug from logfiles

Signed-off-by: pgowda 
---
 meta/recipes-devtools/rust/rust.inc | 4 
 1 file changed, 4 insertions(+)

diff --git a/meta/recipes-devtools/rust/rust.inc 
b/meta/recipes-devtools/rust/rust.inc
index 284347dedc..a0164c2f6b 100644
--- a/meta/recipes-devtools/rust/rust.inc
+++ b/meta/recipes-devtools/rust/rust.inc
@@ -116,6 +116,10 @@ python do_configure() {
 # Whether or not to optimize the compiler and standard library
 config.set("rust", "optimize", e(True))
 
+# Emits extraneous output from tests to ensure that failures of the test
+# harness are debuggable just from logfiles
+config.set("rust", "verbose-tests", e(True))
+
 # [build]
 config.add_section("build")
 config.set("build", "submodules", e(False))
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#170278): 
https://lists.openembedded.org/g/openembedded-core/message/170278
Mute This Topic: https://lists.openembedded.org/mt/93454332/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] rust: Add linker configurations for cross compilation

2022-09-04 Thread Pgowda
From: pgowda 

Adds the cross compilation linker for build, host and target.
Ensure the main rust config has the appropriate sections added
to match the configurations.

Signed-off-by: pgowda 
---
 meta/recipes-devtools/rust/rust.inc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-devtools/rust/rust.inc 
b/meta/recipes-devtools/rust/rust.inc
index 284347dedc..20fd797a90 100644
--- a/meta/recipes-devtools/rust/rust.inc
+++ b/meta/recipes-devtools/rust/rust.inc
@@ -81,6 +81,7 @@ python do_configure() {
 
 config.set(host_section, "cxx", e(d.expand("${RUST_TARGET_CXX}")))
 config.set(host_section, "cc", e(d.expand("${RUST_TARGET_CC}")))
+config.set(host_section, "linker", e(d.expand("${RUST_TARGET_CCLD}")))
 if "musl" in host_section:
 config.set(host_section, "musl-root", 
e(d.expand("${STAGING_DIR_HOST}${exec_prefix}")))
 
@@ -94,6 +95,7 @@ python do_configure() {
 
 config.set(build_section, "cxx", e(d.expand("${RUST_BUILD_CXX}")))
 config.set(build_section, "cc", e(d.expand("${RUST_BUILD_CC}")))
+   config.set(build_section, "linker", e(d.expand("${RUST_BUILD_CCLD}")))
 
 target_section = "target.{}".format(d.getVar('RUST_TARGET_SYS', True))
 if target_section != host_section and target_section != build_section:
@@ -103,6 +105,7 @@ python do_configure() {
 
 config.set(target_section, "cxx", e(d.expand("${RUST_TARGET_CXX}")))
 config.set(target_section, "cc", e(d.expand("${RUST_TARGET_CC}")))
+   config.set(target_section, "linker", e(d.expand("${RUST_TARGET_CCLD}")))
 
 # [llvm]
 config.add_section("llvm")
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#170276): 
https://lists.openembedded.org/g/openembedded-core/message/170276
Mute This Topic: https://lists.openembedded.org/mt/93454315/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [RFC] Rust Oe-Selftest implementation

2022-08-26 Thread Pgowda
From: pgowda 

Implemented Rust Oe-Selftest on the latest Rust sources with
modifications. Rust testsuite will be merged with Rust to avoid
duplication. rust-testsuite.inc modifications will be merged into
rust.inc file. There were errors encountered during the rust-testsuite
build which are fixed. However, there is a linker error as follows which
if fixed would run the testsuite successfully.
Please consider the current patch for review and let us know if any
modifications are required for the final draft of the patch.


  Compiling rustc-main v0.0.0 
(tmp/work/core2-64-poky-linux/rust-testsuite/1.62.1-r0/rustc-1.62.1-src/compiler/rustc)
error: linking with 
`tmp/work/core2-64-poky-linux/rust-testsuite/1.62.1-r0/wrapper/target-rust-cc` 
failed: exit status: 1

rustc-1.62.1-src/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-poky-linux-gnu/release/deps/librustc_driver-b7e5da8186904a15.so:
 undefined reference to `compressBound'
  collect2: error: ld returned 1 exit status

  = help: some `extern` functions couldn't be found; some native libraries may 
need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native 
libraries to link with Cargo (see 
https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `rustc-main` due to previous error


Signed-off-by: pgowda 
---
 meta/classes-recipe/rust-common.bbclass   |   2 +
 .../classes-recipe/rust-target-config.bbclass |   1 -
 meta/lib/oeqa/selftest/cases/rust.py  |  58 +++
 meta/recipes-devtools/rust/rust-testsuite.inc | 174 +++
 .../rust-testsuite/rust-oe-selftest.patch | 444 ++
 .../rust/rust-testsuite_1.62.1.bb |   3 +
 6 files changed, 681 insertions(+), 1 deletion(-)
 create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite.inc
 create mode 100644 
meta/recipes-devtools/rust/rust-testsuite/rust-oe-selftest.patch
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite_1.62.1.bb

diff --git a/meta/classes-recipe/rust-common.bbclass 
b/meta/classes-recipe/rust-common.bbclass
index 93bf6c8be6..7b1b818a04 100644
--- a/meta/classes-recipe/rust-common.bbclass
+++ b/meta/classes-recipe/rust-common.bbclass
@@ -57,6 +57,8 @@ def rust_base_triple(d, thing):
 bpn = d.getVar('BPN')
 if thing == "BUILD" and bpn in ["rust"]:
 return arch + "-unknown-linux-gnu"
+if thing == "BUILD" and bpn in ["rust-testsuite"]:
+return arch + "-unknown-linux-gnu"
 
 vendor = d.getVar('{}_VENDOR'.format(thing))
 
diff --git a/meta/classes-recipe/rust-target-config.bbclass 
b/meta/classes-recipe/rust-target-config.bbclass
index 3405086402..e30eaa1da3 100644
--- a/meta/classes-recipe/rust-target-config.bbclass
+++ b/meta/classes-recipe/rust-target-config.bbclass
@@ -362,7 +362,6 @@ def rust_gen_target(d, thing, wd, arch):
 tspec['linker-is-gnu'] = True
 tspec['linker-flavor'] = "gcc"
 tspec['has-rpath'] = True
-tspec['has-elf-tls'] = True
 tspec['position-independent-executables'] = True
 tspec['panic-strategy'] = d.getVar("RUST_PANIC_STRATEGY")
 
diff --git a/meta/lib/oeqa/selftest/cases/rust.py 
b/meta/lib/oeqa/selftest/cases/rust.py
new file mode 100644
index 00..64134a91cd
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: MIT
+import os
+import subprocess
+from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, 
runqemu, Command
+from oeqa.utils.sshcontrol import SSHControl
+
+# Total time taken for testing is of about 2hr 20min, with PARALLEL_MAKE set 
to 40 number of jobs.
+class RustSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
+
+   def run_check_emulated(self, *args, **kwargs):
+   # build remote-test-server before image build
+   recipe = "rust-testsuite"
+   bitbake("{} -c compile".format(recipe))
+   builddir = get_bb_var("B", "rust-testsuite")
+   # build core-image-minimal with required packages
+   default_installed_packages = ["libgcc", "libstdc++", 
"libatomic", "libgomp"]
+   features = []
+   features.append('IMAGE_FEATURES += "ssh-server-openssh"')
+   features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" 
".joi

Re: [OE-core] [PATCH v8] Rust Oe-Selftest implementation

2022-08-06 Thread Pgowda
Hi Luca,

Thanks for informing me about the error.
The patch has been updated to fix the libstdc++ environment issue as
reported by you.
https://lists.openembedded.org/g/openembedded-core/message/168974

Thanks,
Pgowda
On Fri, Aug 5, 2022 at 12:42 PM Luca Ceresoli  wrote:
>
> Hello Pgowda,
>
> On Wed,  3 Aug 2022 19:57:34 +0530
> "Pgowda"  wrote:
>
> > From: pgowda 
> >
> > The patch implements Rust testing framework similar to other selftest,
> > specifically the gcc selftest in OE. It uses the client and server
> > based method to test the binaries for cross-target on the image.
> > The test framework is a wrapper around the Rust build system as ./x.py
> > test.
> > It tests many functionalities of Rust distribution like tools,
> > documentation, libraries, packages, tools, Cargo, Crater etc.
> > Please refer the following link for detailed description of Rust
> > testing:-
> > https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests
> >
> > To support the rust tests in oe-core, the following functions were
> > added:-
> > setup_cargo_environment(): Build bootstrap and some early stage tools.
> > do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
> > do_configure(): To generate config.toml
> > do_compile(): To build "remote-test-server" for qemu target image.
> >
> > Approximate Number of Tests Run in the Rust Testsuite :- 18000
> > Approximate Number of Tests that FAIL in bitbake environment :- 100-150
> > Normally majority of the testcases are present in major folder "test/"
> > It contributes to more than 80% of the testcases present in Rust test
> > framework. These tests pass as expected on any Rust versions without
> > much fuss. The tests that fail are of less important and contribute to
> > less than 2% of the total testcases. These minor tests are observed to
> > work on some versions and fail on others. They have to be added, ignored
> > or excluded for different versions as per the behavior.
> > These tests have been ignored or excluded in the Rust selftest
> > environment to generate success of completing the testsuite.
> >
> > These tests work in parallel mode even in the skipped test mode as
> > expected. Although the patch to disable tests is large, it is very simple
> > in that it only disables tests. When updating to a newer version of Rust,
> > the patch can usually be ported in a day.
> >
> > Signed-off-by: pgowda 
> > Signed-off-by: Vinay Kumar 
>
>
> This patch triggers the same error I had reported for v7:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/73/builds/5588/steps/18/logs/stdio
>
> https://lists.openembedded.org/g/openembedded-core/message/168816
>
> Can please try to reproduce the issue locally, to ensure you can
> investigate it?
>
>
> Also, when sending a new version, don't forget to add a short changelog
> as suggested by Randy:
> https://lists.openembedded.org/g/openembedded-core/message/168821
>
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#168975): 
https://lists.openembedded.org/g/openembedded-core/message/168975
Mute This Topic: https://lists.openembedded.org/mt/92793172/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH v9] Rust Oe-Selftest implementation

2022-08-06 Thread Pgowda
From: pgowda 

The patch implements Rust testing framework similar to other selftest,
specifically the gcc selftest in OE. It uses the client and server
based method to test the binaries for cross-target on the image.
The test framework is a wrapper around the Rust build system as ./x.py
test. It tests many functionalities of Rust distribution like tools,
documentation, libraries, packages, tools, Cargo, Crater etc.
Please refer the following link for detailed description of Rust
testing:-
https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests

To support the rust tests in oe-core, the following functions were
added:-
setup_cargo_environment(): Build bootstrap and some early stage tools.
do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
do_configure(): To generate config.toml
do_compile(): To build "remote-test-server" for qemu target image.

Approximate Number of Tests Run in the Rust Testsuite :- 18000
Approximate Number of Tests that FAIL in bitbake environment :- 100-150
Normally majority of the testcases are present in major folder "test/"
It contributes to more than 80% of the testcases present in Rust test
framework. These tests pass as expected on any Rust versions without
much fuss. The tests that fail are of less important and contribute to
less than 2% of the total testcases. These minor tests are observed to
work on some versions and fail on others. They have to be added, ignored
or excluded for different versions as per the behavior.
These tests have been ignored or excluded in the Rust selftest
environment to generate success of completing the testsuite.

These tests work in parallel mode even in the skipped test mode as
expected. Although the patch to disable tests is large, it is very simple
in that it only disables tests. When updating to a newer version of Rust,
the patch can usually be ported in a day.

Signed-off-by: pgowda 
Signed-off-by: Vinay Kumar 
---
 meta/classes/rust-target-config.bbclass   |   3 +-
 meta/conf/distro/include/maintainers.inc  |   1 +
 meta/lib/oeqa/selftest/cases/rust.py  |  57 +++
 meta/recipes-devtools/rust/rust-testsuite.inc | 165 ++
 .../rust-testsuite/rust-oe-selftest.patch | 477 ++
 .../rust/rust-testsuite_1.62.0.bb |   3 +
 6 files changed, 705 insertions(+), 1 deletion(-)
 create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite.inc
 create mode 100644 
meta/recipes-devtools/rust/rust-testsuite/rust-oe-selftest.patch
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite_1.62.0.bb

diff --git a/meta/classes/rust-target-config.bbclass 
b/meta/classes/rust-target-config.bbclass
index 87b7dee3ed..17eb18eba1 100644
--- a/meta/classes/rust-target-config.bbclass
+++ b/meta/classes/rust-target-config.bbclass
@@ -344,7 +344,8 @@ def rust_gen_target(d, thing, wd, arch):
 tspec['linker-is-gnu'] = True
 tspec['linker-flavor'] = "gcc"
 tspec['has-rpath'] = True
-tspec['has-elf-tls'] = True
+# FIXME: Around 270 testcases fail with elf-tls enabled.
+# tspec['has-elf-tls'] = True
 tspec['position-independent-executables'] = True
 tspec['panic-strategy'] = d.getVar("RUST_PANIC_STRATEGY")
 
diff --git a/meta/conf/distro/include/maintainers.inc 
b/meta/conf/distro/include/maintainers.inc
index e20275c674..9f6418456f 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -723,6 +723,7 @@ RECIPE_MAINTAINER:pn-rust-crosssdk-${SDK_ARCH}-glibc = 
"Randy MacLeod https://rustc-dev-guide.rust-lang.org/tests/intro.html;
+SECTION = "test"
+LICENSE = "MIT | Apache-2.0"
+
+SRC_URI += "file://rust-oe-selftest.patch;striplevel=1"
+
+inherit rust
+inherit cargo_common
+
+DEPENDS += "file-native zlib"
+EXCLUDE_FROM_WORLD = "1"
+
+S = "${RUSTSRC}"
+CCLD:append = " -lz"
+
+# Path of target specification file "target-poky-linux.json"
+export RUST_TARGET_PATH="${STAGING_LIBDIR_NATIVE}/rustlib"
+
+export FORCE_CRATE_HASH="${BB_TASKHASH}"
+
+# We don't want to use bitbakes vendoring because the rust sources do their
+# own vendoring.
+CARGO_DISABLE_BITBAKE_VENDORING = "1"
+
+# We can't use RUST_BUILD_SYS here because that may be "musl" if
+# TCLIBC="musl". Snapshots are always -unknown-linux-gnu
+SNAPSHOT_BUILD_SYS = "${BUILD_ARCH}-unknown-linux-gnu"
+setup_cargo_environment () {
+# The first step is to build bootstrap and some early stage tools,
+# these are build for the same target as the snapshot, e.g.
+# x86_64-unknown-linux-gnu.
+# Later stages are build for the native target (i.e. target.x86_64-linux)
+cargo_common_do_configure
+
+printf '[target.%s]\n' "${SNAPSHOT_BUILD_SYS}" >> ${CARGO_HOME}/config
+printf "linker = '%s'\n&q

Re: [OE-core] [PATCH v8] Rust Oe-Selftest implementation

2022-08-05 Thread Pgowda
Hi Luca,

Thanks for the update.
The issue is due to the requirement of libstdc++ in rust-1.62.
It was not the same with 1.61 and earlier.
It requires the installation of libstdc++ in the host machine.
Can you please let us know whether it should be fixed in rust-testsuite
or can they be installed in the host machine as a prerequisite for rust-1.62??

Thanks,
Pgowda

On Fri, Aug 5, 2022 at 12:42 PM Luca Ceresoli  wrote:
>
> Hello Pgowda,
>
> On Wed,  3 Aug 2022 19:57:34 +0530
> "Pgowda"  wrote:
>
> > From: pgowda 
> >
> > The patch implements Rust testing framework similar to other selftest,
> > specifically the gcc selftest in OE. It uses the client and server
> > based method to test the binaries for cross-target on the image.
> > The test framework is a wrapper around the Rust build system as ./x.py
> > test.
> > It tests many functionalities of Rust distribution like tools,
> > documentation, libraries, packages, tools, Cargo, Crater etc.
> > Please refer the following link for detailed description of Rust
> > testing:-
> > https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests
> >
> > To support the rust tests in oe-core, the following functions were
> > added:-
> > setup_cargo_environment(): Build bootstrap and some early stage tools.
> > do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
> > do_configure(): To generate config.toml
> > do_compile(): To build "remote-test-server" for qemu target image.
> >
> > Approximate Number of Tests Run in the Rust Testsuite :- 18000
> > Approximate Number of Tests that FAIL in bitbake environment :- 100-150
> > Normally majority of the testcases are present in major folder "test/"
> > It contributes to more than 80% of the testcases present in Rust test
> > framework. These tests pass as expected on any Rust versions without
> > much fuss. The tests that fail are of less important and contribute to
> > less than 2% of the total testcases. These minor tests are observed to
> > work on some versions and fail on others. They have to be added, ignored
> > or excluded for different versions as per the behavior.
> > These tests have been ignored or excluded in the Rust selftest
> > environment to generate success of completing the testsuite.
> >
> > These tests work in parallel mode even in the skipped test mode as
> > expected. Although the patch to disable tests is large, it is very simple
> > in that it only disables tests. When updating to a newer version of Rust,
> > the patch can usually be ported in a day.
> >
> > Signed-off-by: pgowda 
> > Signed-off-by: Vinay Kumar 
>
>
> This patch triggers the same error I had reported for v7:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/73/builds/5588/steps/18/logs/stdio
>
> https://lists.openembedded.org/g/openembedded-core/message/168816
>
> Can please try to reproduce the issue locally, to ensure you can
> investigate it?
>
>
> Also, when sending a new version, don't forget to add a short changelog
> as suggested by Randy:
> https://lists.openembedded.org/g/openembedded-core/message/168821
>
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#168932): 
https://lists.openembedded.org/g/openembedded-core/message/168932
Mute This Topic: https://lists.openembedded.org/mt/92793172/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH v7] Rust Oe-Selftest implementation

2022-08-03 Thread Pgowda
Hi Luca,

Updated the maintainers list and submitted the patch as:-
https://lists.openembedded.org/g/openembedded-core/message/168819

Thanks,
Pgowda

On Wed, Aug 3, 2022 at 7:13 PM Luca Ceresoli  wrote:
>
> Hi Pgowda,
>
> On Wed, 3 Aug 2022 15:40:15 +0200
> "Luca Ceresoli via lists.openembedded.org"
>  wrote:
>
> > On Tue,  2 Aug 2022 17:50:05 +0530
> > "Pgowda"  wrote:
> >
> > > From: pgowda 
> > >
> > > The patch implements Rust testing framework similar to other selftest,
> > > specifically the gcc selftest in OE. It uses the client and server
> > > based method to test the binaries for cross-target on the image.
> > > The test framework is a wrapper around the Rust build system as ./x.py
> > > test.
> > > It tests many functionalities of Rust distribution like tools,
> > > documentation, libraries, packages, tools, Cargo, Crater etc.
> > > Please refer the following link for detailed description of Rust
> > > testing:-
> > > https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests
> > >
> > > To support the rust tests in oe-core, the following functions were
> > > added:-
> > > setup_cargo_environment(): Build bootstrap and some early stage tools.
> > > do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
> > > do_configure(): To generate config.toml
> > > do_compile(): To build "remote-test-server" for qemu target image.
> > >
> > > Approximate Number of Tests Run in the Rust Testsuite :- 18000
> > > Approximate Number of Tests that FAIL in bitbake environment :- 100-150
> > > Normally majority of the testcases are present in major folder "test/"
> > > It contributes to more than 80% of the testcases present in Rust test
> > > framework. These tests pass as expected on any Rust versions without
> > > much fuss. The tests that fail are of less important and contribute to
> > > less than 2% of the total testcases. These minor tests are observed to
> > > work on some versions and fail on others. They have to be added, ignored
> > > or excluded for different versions as per the behavior.
> > > These tests have been ignored or excluded in the Rust selftest
> > > environment to generate success of completing the testsuite.
> > >
> > > These tests work in parallel mode even in the skipped test mode as
> > > expected. Although the patch to disable tests is large, it is very simple
> > > in that it only disables tests. When updating to a newer version of Rust,
> > > the patch can usually be ported in a day.
> > >
> > > Signed-off-by: pgowda 
> > > Signed-off-by: Vinay Kumar 
> >
> > This patch fails because of:
> >
> >   AssertionError:
> >   The following recipes do not have a maintainer assigned to them. Please 
> > add an entry to meta/conf/distro/include/maintainers.inc file.
> >   rust-testsuite 
> > (/home/pokybuild/yocto-worker/oe-selftest-centos/build/meta/recipes-devtools/rust/rust-testsuite_1.62.0.bb)
> >
> > Some logs:
> >
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/79/builds/3917/steps/15/logs/stdio
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/3866/steps/14/logs/stdio
>
> ...and there is another failure, this time it is an actual build error:
>
> | CMake Error at 
> /home/pokybuild/yocto-worker/qemux86-64/build/build-st-789666/tmp/work/core2-64-poky-linux/rust-testsuite/1.62.0-r0/recipe-sysroot-native/usr/share/cmake-3.23/Modules/CMakeTestCXXCompiler.cmake:62
>  (message):
> |   The C++ compiler
> |
> | 
> "/home/pokybuild/yocto-worker/qemux86-64/build/build-st-789666/tmp/work/core2-64-poky-linux/rust-testsuite/1.62.0-r0/wrapper/build-rust-cxx"
> |
> |   is not able to compile a simple test program.
> |
> |   It fails with the following output:
> |
> [...]
> | 
> /home/pokybuild/yocto-worker/qemux86-64/build/build-st-789666/tmp/hosttools/ld:
>  cannot find -lstdc++
> | collect2: error: ld returned 1 exit status
>
> Full log at:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/73/builds/5569/steps/19/logs/stdio
>
>
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#168820): 
https://lists.openembedded.org/g/openembedded-core/message/168820
Mute This Topic: https://lists.openembedded.org/mt/92768863/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH v8] Rust Oe-Selftest implementation

2022-08-03 Thread Pgowda
From: pgowda 

The patch implements Rust testing framework similar to other selftest,
specifically the gcc selftest in OE. It uses the client and server
based method to test the binaries for cross-target on the image.
The test framework is a wrapper around the Rust build system as ./x.py
test.
It tests many functionalities of Rust distribution like tools,
documentation, libraries, packages, tools, Cargo, Crater etc.
Please refer the following link for detailed description of Rust
testing:-
https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests

To support the rust tests in oe-core, the following functions were
added:-
setup_cargo_environment(): Build bootstrap and some early stage tools.
do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
do_configure(): To generate config.toml
do_compile(): To build "remote-test-server" for qemu target image.

Approximate Number of Tests Run in the Rust Testsuite :- 18000
Approximate Number of Tests that FAIL in bitbake environment :- 100-150
Normally majority of the testcases are present in major folder "test/"
It contributes to more than 80% of the testcases present in Rust test
framework. These tests pass as expected on any Rust versions without
much fuss. The tests that fail are of less important and contribute to
less than 2% of the total testcases. These minor tests are observed to
work on some versions and fail on others. They have to be added, ignored
or excluded for different versions as per the behavior.
These tests have been ignored or excluded in the Rust selftest
environment to generate success of completing the testsuite.

These tests work in parallel mode even in the skipped test mode as
expected. Although the patch to disable tests is large, it is very simple
in that it only disables tests. When updating to a newer version of Rust,
the patch can usually be ported in a day.

Signed-off-by: pgowda 
Signed-off-by: Vinay Kumar 
---
 meta/classes/rust-target-config.bbclass   |   3 +-
 meta/conf/distro/include/maintainers.inc  |   1 +
 meta/lib/oeqa/selftest/cases/rust.py  |  57 +++
 meta/recipes-devtools/rust/rust-testsuite.inc | 164 ++
 .../rust-testsuite/rust-oe-selftest.patch | 477 ++
 .../rust/rust-testsuite_1.62.0.bb |   3 +
 6 files changed, 704 insertions(+), 1 deletion(-)
 create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite.inc
 create mode 100644 
meta/recipes-devtools/rust/rust-testsuite/rust-oe-selftest.patch
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite_1.62.0.bb

diff --git a/meta/classes/rust-target-config.bbclass 
b/meta/classes/rust-target-config.bbclass
index 87b7dee3ed..17eb18eba1 100644
--- a/meta/classes/rust-target-config.bbclass
+++ b/meta/classes/rust-target-config.bbclass
@@ -344,7 +344,8 @@ def rust_gen_target(d, thing, wd, arch):
 tspec['linker-is-gnu'] = True
 tspec['linker-flavor'] = "gcc"
 tspec['has-rpath'] = True
-tspec['has-elf-tls'] = True
+# FIXME: Around 270 testcases fail with elf-tls enabled.
+# tspec['has-elf-tls'] = True
 tspec['position-independent-executables'] = True
 tspec['panic-strategy'] = d.getVar("RUST_PANIC_STRATEGY")
 
diff --git a/meta/conf/distro/include/maintainers.inc 
b/meta/conf/distro/include/maintainers.inc
index e20275c674..9f6418456f 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -723,6 +723,7 @@ RECIPE_MAINTAINER:pn-rust-crosssdk-${SDK_ARCH}-glibc = 
"Randy MacLeod https://rustc-dev-guide.rust-lang.org/tests/intro.html;
+SECTION = "test"
+LICENSE = "MIT | Apache-2.0"
+
+SRC_URI += "file://rust-oe-selftest.patch;striplevel=1"
+
+inherit rust
+inherit cargo_common
+
+DEPENDS += "file-native zlib"
+EXCLUDE_FROM_WORLD = "1"
+
+S = "${RUSTSRC}"
+CCLD:append = " -lz"
+
+# Path of target specification file "target-poky-linux.json"
+export RUST_TARGET_PATH="${STAGING_LIBDIR_NATIVE}/rustlib"
+
+export FORCE_CRATE_HASH="${BB_TASKHASH}"
+
+# We don't want to use bitbakes vendoring because the rust sources do their
+# own vendoring.
+CARGO_DISABLE_BITBAKE_VENDORING = "1"
+
+# We can't use RUST_BUILD_SYS here because that may be "musl" if
+# TCLIBC="musl". Snapshots are always -unknown-linux-gnu
+SNAPSHOT_BUILD_SYS = "${BUILD_ARCH}-unknown-linux-gnu"
+setup_cargo_environment () {
+# The first step is to build bootstrap and some early stage tools,
+# these are build for the same target as the snapshot, e.g.
+# x86_64-unknown-linux-gnu.
+# Later stages are build for the native target (i.e. target.x86_64-linux)
+cargo_common_do_configure
+
+printf '[target.%s]\n' "${SNAPSHOT_BUILD_SYS}" >> ${CARGO_HOME}/config
+printf "linker = '%s'\n&q

Re: [OE-core] [PATCH v6] Rust Oe-Selftest implementation

2022-08-02 Thread Pgowda
Hi Luca,

Thanks very much for checking the patch and comment about the elf-tls.

An explanatory comment has been added as per your suggestion and patch
posted as:-
https://lists.openembedded.org/g/openembedded-core/message/168778

Thanks,
Pgowda

On Tue, Aug 2, 2022 at 3:22 PM Luca Ceresoli  wrote:
>
> Hi Pgowda,
>
> On Tue, 2 Aug 2022 14:37:54 +0530
> "Pgowda"  wrote:
>
> > Hi Luca,
> >
> > There were around 270 testcase failing when "has-elf-tls" has been
> > enabled while building llvm.
> > Hence, we had to remove the option to enable the proper working of these 
> > tests.
> > The patch has been tested on Ubuntu and also fedora (using docker image).
>
> Thanks for the explanation. Then why not adding an explanatory comment,
> as below?
>
> # Disabled because.
> #tspec['has-elf-tls'] = True
>
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#168779): 
https://lists.openembedded.org/g/openembedded-core/message/168779
Mute This Topic: https://lists.openembedded.org/mt/92764644/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH v7] Rust Oe-Selftest implementation

2022-08-02 Thread Pgowda
From: pgowda 

The patch implements Rust testing framework similar to other selftest,
specifically the gcc selftest in OE. It uses the client and server
based method to test the binaries for cross-target on the image.
The test framework is a wrapper around the Rust build system as ./x.py
test.
It tests many functionalities of Rust distribution like tools,
documentation, libraries, packages, tools, Cargo, Crater etc.
Please refer the following link for detailed description of Rust
testing:-
https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests

To support the rust tests in oe-core, the following functions were
added:-
setup_cargo_environment(): Build bootstrap and some early stage tools.
do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
do_configure(): To generate config.toml
do_compile(): To build "remote-test-server" for qemu target image.

Approximate Number of Tests Run in the Rust Testsuite :- 18000
Approximate Number of Tests that FAIL in bitbake environment :- 100-150
Normally majority of the testcases are present in major folder "test/"
It contributes to more than 80% of the testcases present in Rust test
framework. These tests pass as expected on any Rust versions without
much fuss. The tests that fail are of less important and contribute to
less than 2% of the total testcases. These minor tests are observed to
work on some versions and fail on others. They have to be added, ignored
or excluded for different versions as per the behavior.
These tests have been ignored or excluded in the Rust selftest
environment to generate success of completing the testsuite.

These tests work in parallel mode even in the skipped test mode as
expected. Although the patch to disable tests is large, it is very simple
in that it only disables tests. When updating to a newer version of Rust,
the patch can usually be ported in a day.

Signed-off-by: pgowda 
Signed-off-by: Vinay Kumar 
---
 meta/classes/rust-target-config.bbclass   |   3 +-
 meta/lib/oeqa/selftest/cases/rust.py  |  57 +++
 meta/recipes-devtools/rust/rust-testsuite.inc | 164 ++
 .../rust-testsuite/rust-oe-selftest.patch | 477 ++
 .../rust/rust-testsuite_1.62.0.bb |   3 +
 5 files changed, 703 insertions(+), 1 deletion(-)
 create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite.inc
 create mode 100644 
meta/recipes-devtools/rust/rust-testsuite/rust-oe-selftest.patch
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite_1.62.0.bb

diff --git a/meta/classes/rust-target-config.bbclass 
b/meta/classes/rust-target-config.bbclass
index 87b7dee3ed..17eb18eba1 100644
--- a/meta/classes/rust-target-config.bbclass
+++ b/meta/classes/rust-target-config.bbclass
@@ -344,7 +344,8 @@ def rust_gen_target(d, thing, wd, arch):
 tspec['linker-is-gnu'] = True
 tspec['linker-flavor'] = "gcc"
 tspec['has-rpath'] = True
-tspec['has-elf-tls'] = True
+# FIXME: Around 270 testcases fail with elf-tls enabled.
+# tspec['has-elf-tls'] = True
 tspec['position-independent-executables'] = True
 tspec['panic-strategy'] = d.getVar("RUST_PANIC_STRATEGY")
 
diff --git a/meta/lib/oeqa/selftest/cases/rust.py 
b/meta/lib/oeqa/selftest/cases/rust.py
new file mode 100644
index 00..80d6f310c9
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: MIT
+import os
+import subprocess
+from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, 
runqemu, Command
+from oeqa.utils.sshcontrol import SSHControl
+
+# Total time taken for testing is of about 2hr 20min, with PARALLEL_MAKE set 
to 40 number of jobs.
+class RustSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
+
+   def run_check_emulated(self, *args, **kwargs):
+   # build remote-test-server before image build
+   recipe = "rust-testsuite"
+   bitbake("{} -c compile".format(recipe))
+   builddir = get_bb_var("B", "rust-testsuite")
+   # build core-image-minimal with required packages
+   default_installed_packages = ["libgcc", "libstdc++", 
"libatomic", "libgomp"]
+   features = []
+   features.append('IMAGE_FEATURES += "ssh-server-openssh"')
+   features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" 
".join(default_installed_packages)))
+   self.write_config("\n".join(features))
+   bitbake("core-image-minimal")
+   # wrap the execution with a qemu instance
+   with runqemu("core-image-minimal", runq

Re: [OE-core] [PATCH v6] Rust Oe-Selftest implementation

2022-08-02 Thread Pgowda
Hi Luca,

There were around 270 testcase failing when "has-elf-tls" has been
enabled while building llvm.
Hence, we had to remove the option to enable the proper working of these tests.
The patch has been tested on Ubuntu and also fedora (using docker image).

Thanks,
Pgowda

On Tue, Aug 2, 2022 at 2:08 PM Luca Ceresoli  wrote:
>
> On Tue,  2 Aug 2022 09:23:52 +0530
> "Pgowda"  wrote:
>
> > From: pgowda 
> >
> > The patch implements Rust testing framework similar to other selftest,
> > specifically the gcc selftest in OE. It uses the client and server
> > based method to test the binaries for cross-target on the image.
> > The test framework is a wrapper around the Rust build system as ./x.py
> > test.
> > It tests many functionalities of Rust distribution like tools,
> > documentation, libraries, packages, tools, Cargo, Crater etc.
> > Please refer the following link for detailed description of Rust
> > testing:-
> > https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests
> >
> > To support the rust tests in oe-core, the following functions were
> > added:-
> > setup_cargo_environment(): Build bootstrap and some early stage tools.
> > do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
> > do_configure(): To generate config.toml
> > do_compile(): To build "remote-test-server" for qemu target image.
> >
> > Approximate Number of Tests Run in the Rust Testsuite :- 18000
> > Approximate Number of Tests that FAIL in bitbake environment :- 100-150
> > Normally majority of the testcases are present in major folder "test/"
> > It contributes to more than 80% of the testcases present in Rust test
> > framework. These tests pass as expected on any Rust versions without
> > much fuss. The tests that fail are of less important and contribute to
> > less than 2% of the total testcases. These minor tests are observed to
> > work on some versions and fail on others. They have to be added, ignored
> > or excluded for different versions as per the behavior.
> > These tests have been ignored or excluded in the Rust selftest
> > environment to generate success of completing the testsuite.
> >
> > These tests work in parallel mode even in the skipped test mode as
> > expected. Although the patch to disable tests is large, it is very simple
> > in that it only disables tests. When updating to a newer version of Rust,
> > the patch can usually be ported in a day.
> >
> > Signed-off-by: pgowda 
> > Signed-off-by: Vinay Kumar 
> > ---
> >  meta/classes/rust-target-config.bbclass   |   2 +-
> >  meta/lib/oeqa/selftest/cases/rust.py  |  57 +++
> >  meta/recipes-devtools/rust/rust-testsuite.inc | 164 ++
> >  .../rust-testsuite/rust-oe-selftest.patch | 477 ++
> >  .../rust/rust-testsuite_1.62.0.bb |   3 +
> >  5 files changed, 702 insertions(+), 1 deletion(-)
> >  create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
> >  create mode 100644 meta/recipes-devtools/rust/rust-testsuite.inc
> >  create mode 100644 
> > meta/recipes-devtools/rust/rust-testsuite/rust-oe-selftest.patch
> >  create mode 100644 meta/recipes-devtools/rust/rust-testsuite_1.62.0.bb
> >
> > diff --git a/meta/classes/rust-target-config.bbclass 
> > b/meta/classes/rust-target-config.bbclass
> > index 87b7dee3ed..26dc931971 100644
> > --- a/meta/classes/rust-target-config.bbclass
> > +++ b/meta/classes/rust-target-config.bbclass
> > @@ -344,7 +344,7 @@ def rust_gen_target(d, thing, wd, arch):
> >  tspec['linker-is-gnu'] = True
> >  tspec['linker-flavor'] = "gcc"
> >  tspec['has-rpath'] = True
> > -tspec['has-elf-tls'] = True
> > +#tspec['has-elf-tls'] = True
>
> I'm not sure of the meaning of the above change, can you clarify that?
>
> Thanks.
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#168772): 
https://lists.openembedded.org/g/openembedded-core/message/168772
Mute This Topic: https://lists.openembedded.org/mt/92764644/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH v6] Rust Oe-Selftest implementation

2022-08-01 Thread Pgowda
From: pgowda 

The patch implements Rust testing framework similar to other selftest,
specifically the gcc selftest in OE. It uses the client and server
based method to test the binaries for cross-target on the image.
The test framework is a wrapper around the Rust build system as ./x.py
test.
It tests many functionalities of Rust distribution like tools,
documentation, libraries, packages, tools, Cargo, Crater etc.
Please refer the following link for detailed description of Rust
testing:-
https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests

To support the rust tests in oe-core, the following functions were
added:-
setup_cargo_environment(): Build bootstrap and some early stage tools.
do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
do_configure(): To generate config.toml
do_compile(): To build "remote-test-server" for qemu target image.

Approximate Number of Tests Run in the Rust Testsuite :- 18000
Approximate Number of Tests that FAIL in bitbake environment :- 100-150
Normally majority of the testcases are present in major folder "test/"
It contributes to more than 80% of the testcases present in Rust test
framework. These tests pass as expected on any Rust versions without
much fuss. The tests that fail are of less important and contribute to
less than 2% of the total testcases. These minor tests are observed to
work on some versions and fail on others. They have to be added, ignored
or excluded for different versions as per the behavior.
These tests have been ignored or excluded in the Rust selftest
environment to generate success of completing the testsuite.

These tests work in parallel mode even in the skipped test mode as
expected. Although the patch to disable tests is large, it is very simple
in that it only disables tests. When updating to a newer version of Rust,
the patch can usually be ported in a day.

Signed-off-by: pgowda 
Signed-off-by: Vinay Kumar 
---
 meta/classes/rust-target-config.bbclass   |   2 +-
 meta/lib/oeqa/selftest/cases/rust.py  |  57 +++
 meta/recipes-devtools/rust/rust-testsuite.inc | 164 ++
 .../rust-testsuite/rust-oe-selftest.patch | 477 ++
 .../rust/rust-testsuite_1.62.0.bb |   3 +
 5 files changed, 702 insertions(+), 1 deletion(-)
 create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite.inc
 create mode 100644 
meta/recipes-devtools/rust/rust-testsuite/rust-oe-selftest.patch
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite_1.62.0.bb

diff --git a/meta/classes/rust-target-config.bbclass 
b/meta/classes/rust-target-config.bbclass
index 87b7dee3ed..26dc931971 100644
--- a/meta/classes/rust-target-config.bbclass
+++ b/meta/classes/rust-target-config.bbclass
@@ -344,7 +344,7 @@ def rust_gen_target(d, thing, wd, arch):
 tspec['linker-is-gnu'] = True
 tspec['linker-flavor'] = "gcc"
 tspec['has-rpath'] = True
-tspec['has-elf-tls'] = True
+#tspec['has-elf-tls'] = True
 tspec['position-independent-executables'] = True
 tspec['panic-strategy'] = d.getVar("RUST_PANIC_STRATEGY")
 
diff --git a/meta/lib/oeqa/selftest/cases/rust.py 
b/meta/lib/oeqa/selftest/cases/rust.py
new file mode 100644
index 00..80d6f310c9
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: MIT
+import os
+import subprocess
+from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, 
runqemu, Command
+from oeqa.utils.sshcontrol import SSHControl
+
+# Total time taken for testing is of about 2hr 20min, with PARALLEL_MAKE set 
to 40 number of jobs.
+class RustSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
+
+   def run_check_emulated(self, *args, **kwargs):
+   # build remote-test-server before image build
+   recipe = "rust-testsuite"
+   bitbake("{} -c compile".format(recipe))
+   builddir = get_bb_var("B", "rust-testsuite")
+   # build core-image-minimal with required packages
+   default_installed_packages = ["libgcc", "libstdc++", 
"libatomic", "libgomp"]
+   features = []
+   features.append('IMAGE_FEATURES += "ssh-server-openssh"')
+   features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" 
".join(default_installed_packages)))
+   self.write_config("\n".join(features))
+   bitbake("core-image-minimal")
+   # wrap the execution with a qemu instance
+   with runqemu("core-image-minimal", runqemuparams = "nographic",

Re: [OE-core][kirkstone 10/27] glibc: stable 2.35 branch updates

2022-07-25 Thread Pgowda
Hi,

I had referred the following link in buildroot :-
https://lore.kernel.org/buildroot/20220720213853.1a27184...@busybox.osuosl.org/t/

Sending the patches would be very helpful.

Thanks,
Pgowda

On Mon, Jul 25, 2022 at 4:03 PM Martin Jansa  wrote:
>
> Hi,
>
> it was reverted in buildroot as well in:
> https://lore.kernel.org/all/20220615022348.914136-1-james.hillia...@gmail.com/t/
>
> reverting it in both master and kirkstone is probably good work around for 
> now, I can send a patch later today as I already have it reverted in my 
> builds.
>
> Regards,
>
> On Mon, Jul 25, 2022 at 12:18 PM pgowda cve  wrote:
>>
>> Hi Martin,
>>
>> Thanks for the confirmation from your side.
>> I had the same issue and reverting the commit on master branch fixed the 
>> issue.
>> Please let me know whether the patch should be reverted in the master branch 
>> to
>> avoid building issues when "DEBUG_BUILD" is enabled.
>>
>> Thanks & Regards
>> Pgowda
>> On Sun, Jul 24, 2022 at 11:25 PM Martin Jansa  wrote:
>> >
>> > On Thu, Jul 14, 2022 at 6:36 AM Steve Sakoman  wrote:
>> >>
>> >> From: Sundeep KOKKONDA 
>> >>
>> >> Below commits on Glibc-2.35 development branch are updated.
>> >>
>> >> glibc:
>> >> 
>> >> 2d05ba7f8e Linux: Implement a useful version of _startup_fatal
>> >
>> > ...
>> >
>> > This last commit seems to cause build failure with DEBUG_BUILD:
>> >
>> > x86_64-webos-linux-gcc  -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse 
>> > --sysroot=/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/recipe-sysroot
>> >  
>> > -Wl,-rpath-link=/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/math:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/elf:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/dlfcn:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/nss:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/nis:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/rt:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/resolv:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/mathvec:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/support:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/nptl
>> >  -o 
>> > /OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/support/shell-container
>> >  -pie -Wl,-O1 -nostdlib -nostartfiles  -Wl,-O1 -Wl,--hash-style=gnu 
>> > -Wl,--as-needed 
>> > -fmacro-prefix-map=/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0=/usr/src/debug/glibc/2.35-r0
>> >   
>> > -fdebug-prefix-map=/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0=/usr/src/debug/glibc/2.35-r0
>> >   
>> > -fdebug-prefix-map=/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/recipe-sysroot=
>> >   
>> > -fdebug-prefix-map=/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/recipe-sysroot-native=
>> >   -fuse-ld=bfd  -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both 
>> > /OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/csu/Scrt1.o
>> >  
>> > /OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/csu/crti.o
>> >  `x86_64-webos-linux-gcc  -m64 -march=core2 -mtune=core2 -msse3 
>> > -mfpmath=sse 
>> > --sysroot=/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/recipe-sysroot
>> >   --print-file-name=crtbeginS.o` 
>> > /OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-we

Re: [OE-core][kirkstone 10/27] glibc: stable 2.35 branch updates

2022-07-25 Thread Pgowda
Hi Martin,

Thanks for the confirmation from your side.
I had the same issue and reverting the commit on master branch fixed the issue.
Please let me know whether the patch should be reverted in the master branch to
avoid building issues when "DEBUG_BUILD" is enabled.

Thanks & Regards
Pgowda
On Sun, Jul 24, 2022 at 11:25 PM Martin Jansa  wrote:
>
> On Thu, Jul 14, 2022 at 6:36 AM Steve Sakoman  wrote:
>>
>> From: Sundeep KOKKONDA 
>>
>> Below commits on Glibc-2.35 development branch are updated.
>>
>> glibc:
>> 
>> 2d05ba7f8e Linux: Implement a useful version of _startup_fatal
>
> ...
>
> This last commit seems to cause build failure with DEBUG_BUILD:
>
> x86_64-webos-linux-gcc  -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse 
> --sysroot=/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/recipe-sysroot
>  
> -Wl,-rpath-link=/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/math:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/elf:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/dlfcn:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/nss:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/nis:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/rt:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/resolv:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/mathvec:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/support:/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/nptl
>  -o 
> /OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/support/shell-container
>  -pie -Wl,-O1 -nostdlib -nostartfiles  -Wl,-O1 -Wl,--hash-style=gnu 
> -Wl,--as-needed 
> -fmacro-prefix-map=/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0=/usr/src/debug/glibc/2.35-r0
>   
> -fdebug-prefix-map=/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0=/usr/src/debug/glibc/2.35-r0
>   
> -fdebug-prefix-map=/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/recipe-sysroot=
>   
> -fdebug-prefix-map=/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/recipe-sysroot-native=
>   -fuse-ld=bfd  -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both 
> /OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/csu/Scrt1.o
>  
> /OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/csu/crti.o
>  `x86_64-webos-linux-gcc  -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse 
> --sysroot=/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/recipe-sysroot
>   --print-file-name=crtbeginS.o` 
> /OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/support/shell-container.o
>  
> /OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/support/libsupport_nonshared.a
>   -Wl,-dynamic-linker=/lib/ld-linux-x86-64.so.2 -Wl,-z,now 
> /OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/libc.so.6
>  
> /OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/libc_nonshared.a
>  -Wl,--as-needed 
> /OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/elf/ld.so
>  -Wl,--no-as-needed -lgcc  `x86_64-webos-linux-gcc  -m64 -march=core2 
> -mtune=core2 -msse3 -mfpmath=sse 
> --sysroot=/OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/recipe-sysroot
>   --print-file-name=crtendS.o` 
> /OE/build/luneos-kirkstone/webos-ports/tmp-glibc/work/core2-64-webos-linux/glibc/2.35-r0/build-x86_64-webos-linux/csu/crtn.o
> /OE/build/luneos-kirkstone/webos-ports/tmp-glib

[OE-core] [kirkstone][PATCH] gcc: Backport a fix for gcc bug 105039

2022-07-20 Thread Pgowda
From: Naveen 

Backport a fix from:
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=9234cdca6ee88badfc00297e72f13dac4e540c79

which fixes rust recursion issues in the demangler.

Signed-off-by: Naveen 
---
 meta/recipes-devtools/gcc/gcc-11.3.inc|  2 +-
 .../gcc/gcc/0030-rust-recursion-limit.patch   | 92 +++
 2 files changed, 93 insertions(+), 1 deletion(-)
 create mode 100644 
meta/recipes-devtools/gcc/gcc/0030-rust-recursion-limit.patch

diff --git a/meta/recipes-devtools/gcc/gcc-11.3.inc 
b/meta/recipes-devtools/gcc/gcc-11.3.inc
index acbb43a25f..2cebeb2bc8 100644
--- a/meta/recipes-devtools/gcc/gcc-11.3.inc
+++ b/meta/recipes-devtools/gcc/gcc-11.3.inc
@@ -59,7 +59,7 @@ SRC_URI = "\
file://0027-libatomic-Do-not-enforce-march-on-aarch64.patch \

file://0028-debug-101473-apply-debug-prefix-maps-before-checksum.patch \
file://0029-Fix-install-path-of-linux64.h.patch \
-   \
+   file://0030-rust-recursion-limit.patch \
file://0001-CVE-2021-42574.patch \
file://0002-CVE-2021-42574.patch \
file://0003-CVE-2021-42574.patch \
diff --git a/meta/recipes-devtools/gcc/gcc/0030-rust-recursion-limit.patch 
b/meta/recipes-devtools/gcc/gcc/0030-rust-recursion-limit.patch
new file mode 100644
index 00..bbe2f18f6f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/0030-rust-recursion-limit.patch
@@ -0,0 +1,92 @@
+From 9234cdca6ee88badfc00297e72f13dac4e540c79 Mon Sep 17 00:00:00 2001
+From: Nick Clifton 
+Date: Fri, 1 Jul 2022 15:58:52 +0100
+Subject: [PATCH] Add a recursion limit to the demangle_const function in the
+ Rust demangler.
+
+libiberty/
+   PR demangler/105039
+   * rust-demangle.c (demangle_const): Add recursion limit.
+
+Upstream-Status: Backport 
[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=9234cdca6ee88badfc00297e72f13dac4e540c79]
+---
+ libiberty/rust-demangle.c | 29 -
+ 1 file changed, 20 insertions(+), 9 deletions(-)
+
+diff --git a/libiberty/rust-demangle.c b/libiberty/rust-demangle.c
+index bb58d900e27..36afcfae278 100644
+--- a/libiberty/rust-demangle.c
 b/libiberty/rust-demangle.c
+@@ -126,7 +126,7 @@ parse_integer_62 (struct rust_demangler *rdm)
+ return 0;
+ 
+   x = 0;
+-  while (!eat (rdm, '_'))
++  while (!eat (rdm, '_') && !rdm->errored)
+ {
+   c = next (rdm);
+   x *= 62;
+@@ -1148,6 +1148,15 @@ demangle_const (struct rust_demangler *rdm)
+   if (rdm->errored)
+ return;
+ 
++  if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
++{
++  ++ rdm->recursion;
++  if (rdm->recursion > RUST_MAX_RECURSION_COUNT)
++  /* FIXME: There ought to be a way to report
++ that the recursion limit has been reached.  */
++  goto fail_return;
++}
++
+   if (eat (rdm, 'B'))
+ {
+   backref = parse_integer_62 (rdm);
+@@ -1158,7 +1167,7 @@ demangle_const (struct rust_demangler *rdm)
+   demangle_const (rdm);
+   rdm->next = old_next;
+ }
+-  return;
++  goto pass_return;
+ }
+ 
+   ty_tag = next (rdm);
+@@ -1167,7 +1176,7 @@ demangle_const (struct rust_demangler *rdm)
+ /* Placeholder. */
+ case 'p':
+   PRINT ("_");
+-  return;
++  goto pass_return;
+ 
+ /* Unsigned integer types. */
+ case 'h':
+@@ -1200,18 +1209,20 @@ demangle_const (struct rust_demangler *rdm)
+   break;
+ 
+ default:
+-  rdm->errored = 1;
+-  return;
++  goto fail_return;
+ }
+ 
+-  if (rdm->errored)
+-return;
+-
+-  if (rdm->verbose)
++  if (!rdm->errored && rdm->verbose)
+ {
+   PRINT (": ");
+   PRINT (basic_type (ty_tag));
+ }
++
++ fail_return:
++  rdm->errored = 1;
++ pass_return:
++  if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
++-- rdm->recursion;
+ }
+ 
+ static void
+-- 
+2.31.1
+
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#168347): 
https://lists.openembedded.org/g/openembedded-core/message/168347
Mute This Topic: https://lists.openembedded.org/mt/92500879/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] gcc : Bug-105039

2022-07-11 Thread Pgowda
From: pgowda 

Upstream-Status: Backport 
[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=9234cdca6ee88badfc00297e72f13dac4e540c79]

Signed-off-by: pgowda 
---
 meta/recipes-devtools/gcc/gcc-12.1.inc|  1 +
 .../gcc/gcc/0026-rust-recursion-limit.patch   | 92 +++
 2 files changed, 93 insertions(+)
 create mode 100644 
meta/recipes-devtools/gcc/gcc/0026-rust-recursion-limit.patch

diff --git a/meta/recipes-devtools/gcc/gcc-12.1.inc 
b/meta/recipes-devtools/gcc/gcc-12.1.inc
index 250b587e78..8c6c4a0305 100644
--- a/meta/recipes-devtools/gcc/gcc-12.1.inc
+++ b/meta/recipes-devtools/gcc/gcc-12.1.inc
@@ -63,6 +63,7 @@ SRC_URI = "${BASEURI} \
file://0023-libatomic-Do-not-enforce-march-on-aarch64.patch \
file://0024-Fix-install-path-of-linux64.h.patch \
file://0025-Move-sched.h-include-ahead-of-user-headers.patch \
+   file://0026-rust-recursion-limit.patch \
 "
 SRC_URI[sha256sum] = 
"62fd634889f31c02b64af2c468f064b47ad1ca78411c45abe6ac4b5f8dd19c7b"
 
diff --git a/meta/recipes-devtools/gcc/gcc/0026-rust-recursion-limit.patch 
b/meta/recipes-devtools/gcc/gcc/0026-rust-recursion-limit.patch
new file mode 100644
index 00..bbe2f18f6f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/0026-rust-recursion-limit.patch
@@ -0,0 +1,92 @@
+From 9234cdca6ee88badfc00297e72f13dac4e540c79 Mon Sep 17 00:00:00 2001
+From: Nick Clifton 
+Date: Fri, 1 Jul 2022 15:58:52 +0100
+Subject: [PATCH] Add a recursion limit to the demangle_const function in the
+ Rust demangler.
+
+libiberty/
+   PR demangler/105039
+   * rust-demangle.c (demangle_const): Add recursion limit.
+
+Upstream-Status: Backport 
[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=9234cdca6ee88badfc00297e72f13dac4e540c79]
+---
+ libiberty/rust-demangle.c | 29 -
+ 1 file changed, 20 insertions(+), 9 deletions(-)
+
+diff --git a/libiberty/rust-demangle.c b/libiberty/rust-demangle.c
+index bb58d900e27..36afcfae278 100644
+--- a/libiberty/rust-demangle.c
 b/libiberty/rust-demangle.c
+@@ -126,7 +126,7 @@ parse_integer_62 (struct rust_demangler *rdm)
+ return 0;
+ 
+   x = 0;
+-  while (!eat (rdm, '_'))
++  while (!eat (rdm, '_') && !rdm->errored)
+ {
+   c = next (rdm);
+   x *= 62;
+@@ -1148,6 +1148,15 @@ demangle_const (struct rust_demangler *rdm)
+   if (rdm->errored)
+ return;
+ 
++  if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
++{
++  ++ rdm->recursion;
++  if (rdm->recursion > RUST_MAX_RECURSION_COUNT)
++  /* FIXME: There ought to be a way to report
++ that the recursion limit has been reached.  */
++  goto fail_return;
++}
++
+   if (eat (rdm, 'B'))
+ {
+   backref = parse_integer_62 (rdm);
+@@ -1158,7 +1167,7 @@ demangle_const (struct rust_demangler *rdm)
+   demangle_const (rdm);
+   rdm->next = old_next;
+ }
+-  return;
++  goto pass_return;
+ }
+ 
+   ty_tag = next (rdm);
+@@ -1167,7 +1176,7 @@ demangle_const (struct rust_demangler *rdm)
+ /* Placeholder. */
+ case 'p':
+   PRINT ("_");
+-  return;
++  goto pass_return;
+ 
+ /* Unsigned integer types. */
+ case 'h':
+@@ -1200,18 +1209,20 @@ demangle_const (struct rust_demangler *rdm)
+   break;
+ 
+ default:
+-  rdm->errored = 1;
+-  return;
++  goto fail_return;
+ }
+ 
+-  if (rdm->errored)
+-return;
+-
+-  if (rdm->verbose)
++  if (!rdm->errored && rdm->verbose)
+ {
+   PRINT (": ");
+   PRINT (basic_type (ty_tag));
+ }
++
++ fail_return:
++  rdm->errored = 1;
++ pass_return:
++  if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
++-- rdm->recursion;
+ }
+ 
+ static void
+-- 
+2.31.1
+
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#167872): 
https://lists.openembedded.org/g/openembedded-core/message/167872
Mute This Topic: https://lists.openembedded.org/mt/92310962/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [kirkstone] Binutils, Glibc: Updated with latest commits

2022-07-04 Thread Pgowda
From: Pgowda 

Below commits are on Binutils-2.38 and Glibc-2.35 development branches are 
updated.

glibc:
b6aade18a7 nss: handle stat failure in check_reload_and_get (BZ #28752)
ccac2d6d95 nss: add assert to DB_LOOKUP_FCT (BZ #28752)
9d8ae95604 nios2: Remove _dl_skip_args usage (BZ# 29187)
8468be8433 hppa: Remove _dl_skip_args usage (BZ# 29165)
99978cd42c NEWS: Add a bug fix entry for BZ #29225
97dd8b3f70 nptl: Fix __libc_cleanup_pop_restore asynchronous restore (BZ#29214)
0a1572b8bb powerpc: Fix VSX register number on __strncpy_power9 [BZ #29197]
fe9ca732ac socket: Fix mistyped define statement in socket/sys/socket.h (BZ 
#29225)
d7d1eebd4d iconv: Use 64 bit stat for gconv_parseconfdir (BZ# 29213)
c5a75ecec8 catgets: Use 64 bit stat for __open_catalog (BZ# 29211)
e429695805 inet: Use 64 bit stat for ruserpass (BZ# 29210)
6ea3c0aba4 socket: Use 64 bit stat for isfdtype (BZ# 29209)
9bcf5b12f8 posix: Use 64 bit stat for fpathconf (_PC_ASYNC_IO) (BZ# 29208)
45e5d0f533 posix: Use 64 bit stat for posix_fallocate fallback (BZ# 29207)
37c94dc999 misc: Use 64 bit stat for getusershell (BZ# 29204)
cb49c14183 misc: Use 64 bit stat for daemon (BZ# 29203)
6abb4002df Fix deadlock when pthread_atfork handler calls pthread_atfork or 
dlclose
ac87df8d75 x86: Fallback {str|wcs}cmp RTM in the ncmp overflow case [BZ #29127]
478cd506ea string.h: fix __fortified_attr_access macro call [BZ #29162]
2b128a7d30 linux: Add a getauxval test [BZ #23293]
f5f7144dfc rtld: Use generic argv adjustment in ld.so [BZ #23293]
04892c543e S390: Enable static PIE
72d9dcfd16 csu: Implement and use _dl_early_allocate during static startup
b5ddf33c6e Linux: Introduce __brk_call for invoking the brk system call
2d05ba7f8e Linux: Implement a useful version of _startup_fatal
55ee3afa0d ia64: Always define IA64_USE_NEW_STUB as a flag macro
d66cca3fbb Linux: Define MMAP_CALL_INTERNAL
a7b122a7b4 i386: Honor I386_USE_SYSENTER for 6-argument Linux system calls
d1772c9376 i386: Remove OPTIMIZE_FOR_GCC_5 from Linux libc-do-syscall.S
58bb3aeaae elf: Remove __libc_init_secure
0a5c6c9d99 Linux: Consolidate auxiliary vector parsing (redo)
76304dfdaf Linux: Include  in dl-sysdep.c only for SHARED
788eb21ff0 Revert "Linux: Consolidate auxiliary vector parsing"
150039ff07 Linux: Consolidate auxiliary vector parsing
3948c6ca89 Linux: Assume that NEED_DL_SYSINFO_DSO is always defined
29f833f5ab Linux: Remove DL_FIND_ARG_COMPONENTS
1695c5e0f6 Linux: Remove HAVE_AUX_SECURE, HAVE_AUX_XID, HAVE_AUX_PAGESIZE
756d583c9e elf: Merge dl-sysdep.c into the Linux version
2c4fc8e5ca x86: Optimize {str|wcs}rchr-evex
fdbc8439ac x86: Optimize {str|wcs}rchr-avx2
b05c0c8b28 x86: Optimize {str|wcs}rchr-sse2
bc35e22be4 x86-64: Fix SSE2 memcmp and SSSE3 memmove for x32
4d1841deb7 x86: Fix missing __wmemcmp def for disable-multiarch build
cee9939f67 x86: Cleanup page cross code in memcmp-avx2-movbe.S
0909286ffa x86: Remove memcmp-sse4.S
5a8df6485c x86: Optimize memcmp SSE2 in memcmp.S
af0865571a x86: Small improvements for wcslen
3b710e32d8 x86: Remove AVX str{n}casecmp
fc5d42bf82 x86: Add EVEX optimized str{n}casecmp
33fcf8344f x86: Add AVX2 optimized str{n}casecmp
3496d64d69 x86: Optimize str{n}casecmp TOLOWER logic in strcmp-sse42.S
283982b362 x86: Optimize str{n}casecmp TOLOWER logic in strcmp.S
420cd6f155 x86: Remove strspn-sse2.S and use the generic implementation
4b61d76521 x86: Remove strpbrk-sse2.S and use the generic implementation
2fef1961a7 x86: Remove strcspn-sse2.S and use the generic implementation
1ed2813eb1 x86: Optimize strspn in strspn-c.c
3214c878f2 x86: Optimize strcspn and strpbrk in strcspn-c.c
ff9772ac19 x86: Code cleanup in strchr-evex and comment justifying branch
424bbd4d25 x86: Code cleanup in strchr-avx2 and comment justifying branch
0a10b8b181 x86_64: Remove bcopy optimizations
f0a53588da x86-64: Define __memcmpeq in ld.so
a133623048 x86-64: Remove bzero weak alias in SS2 memset
18baf86f51 x86_64/multiarch: Sort sysdep_routines and put one entry per line
d422197a69 x86: Improve L to support L(XXX_SYMBOL (YYY, ZZZ))
58947e1fa5 fortify: Ensure that __glibc_fortify condition is a constant [BZ 
#29141]
28ea43f8d6 dlfcn: Implement the RTLD_DI_PHDR request type for dlinfo
78f82ab4ef manual: Document the dlinfo function
bbb017a2bb NEWS: Add a bug fix entry for BZ #29109
5c0d94d780 linux: Fix posix_spawn return code if clone fails (BZ#29109)
059e36d9ed x86: Fix fallback for wcsncmp_avx2 in strcmp-avx2.S [BZ #28896]
676f7bcf11 x86: Fix bug in strncmp-evex and strncmp-avx2 [BZ #28895]
c394d7e11a x86: Set .text section in memset-vec-unaligned-erms
de0cd691b2 x86-64: Optimize bzero
0bf9c8b5fe x86: Remove SSSE3 instruction for broadcast in memset.S (SSE2 Only)
58596411ad x86: Improve vec generation in memset-vec-unaligned-erms.S
36766c02af x86-64: Fix strcmp-evex.S
250e277797 x86-64: Fix strcmp-avx2.S
34ef810945 x86: Optimize strcmp-evex.S
b68e782f8e x86: Optimize strcmp-avx2.S
ec5b79aac7 manual: Clarify that abbreviations of long options are allowed
0bcb

[OE-core] [kirkstone] Binutils, Glibc: Updated with latest commits

2022-07-04 Thread Pgowda
 Automatic date update in version.in

Signed-off-by: Pgowda 
---
 meta/recipes-core/glibc/glibc-version.inc| 2 +-
 meta/recipes-devtools/binutils/binutils-2.38.inc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-core/glibc/glibc-version.inc 
b/meta/recipes-core/glibc/glibc-version.inc
index 080e905b6e..99017ce1d4 100644
--- a/meta/recipes-core/glibc/glibc-version.inc
+++ b/meta/recipes-core/glibc/glibc-version.inc
@@ -1,6 +1,6 @@
 SRCBRANCH ?= "release/2.35/master"
 PV = "2.35"
-SRCREV_glibc ?= "24962427071fa532c3c48c918e9d64d719cc8a6c"
+SRCREV_glibc ?= "b6aade18a7e5719c942aa2da6cf3157aca993fa4"
 SRCREV_localedef ?= "794da69788cbf9bf57b59a852f9f11307663fa87"
 
 GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
diff --git a/meta/recipes-devtools/binutils/binutils-2.38.inc 
b/meta/recipes-devtools/binutils/binutils-2.38.inc
index dc0a2a4054..c2502e0901 100644
--- a/meta/recipes-devtools/binutils/binutils-2.38.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.38.inc
@@ -18,7 +18,7 @@ SRCBRANCH ?= "binutils-2_38-branch"
 
 UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P\d+_(\d_?)*)"
 
-SRCREV ?= "134f17ef688ba4c72a6c4e57af7382882cc1a705"
+SRCREV ?= "eed56ee299b9ef8754bb4e53f2e9cf2a7c28c04d"
 BINUTILS_GIT_URI ?= 
"git://sourceware.org/git/binutils-gdb.git;branch=${SRCBRANCH};protocol=git"
 SRC_URI = "\
  ${BINUTILS_GIT_URI} \
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#167595): 
https://lists.openembedded.org/g/openembedded-core/message/167595
Mute This Topic: https://lists.openembedded.org/mt/92160650/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [kirkstone][PATCH] binutils : CVE-2019-1010204

2022-06-29 Thread Pgowda
Upstream-Status: Backport 
[https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2a4fc266dbf77ed7ab83da16468e9ba627b8bc2d]

Signed-off-by: Pgowda 
---
 .../binutils/binutils-2.38.inc|  1 +
 .../binutils/0014-CVE-2019-1010204.patch  | 49 +++
 2 files changed, 50 insertions(+)
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0014-CVE-2019-1010204.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.38.inc 
b/meta/recipes-devtools/binutils/binutils-2.38.inc
index dc0a2a4054..a069071c97 100644
--- a/meta/recipes-devtools/binutils/binutils-2.38.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.38.inc
@@ -32,5 +32,6 @@ SRC_URI = "\
  file://0011-sync-with-OE-libtool-changes.patch \
  file://0012-Check-for-clang-before-checking-gcc-version.patch \
  file://0013-Avoid-as-info-race-condition.patch \
+ file://0014-CVE-2019-1010204.patch \
 "
 S  = "${WORKDIR}/git"
diff --git 
a/meta/recipes-devtools/binutils/binutils/0014-CVE-2019-1010204.patch 
b/meta/recipes-devtools/binutils/binutils/0014-CVE-2019-1010204.patch
new file mode 100644
index 00..dad4a62038
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0014-CVE-2019-1010204.patch
@@ -0,0 +1,49 @@
+From 2a4fc266dbf77ed7ab83da16468e9ba627b8bc2d Mon Sep 17 00:00:00 2001
+From: Nick Clifton 
+Date: Mon, 27 Jun 2022 13:07:40 +0100
+Subject: [PATCH] Have gold's File_read::do_read() function check the start
+ parameter
+
+   PR 23765
+   * fileread.cc (File_read::do_read): Check start parameter before
+   computing number of bytes to read.
+
+Upstream-Status: Backport 
[https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2a4fc266dbf77ed7ab83da16468e9ba627b8bc2d]
+
+Signed-off-by: Pgowda 
+---
+ gold/ChangeLog   | 6 ++
+ gold/fileread.cc | 6 ++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/gold/ChangeLog b/gold/ChangeLog
+index 5103dab7b67..8557dc6db7f 100644
+--- a/gold/ChangeLog
 b/gold/ChangeLog
+@@ -1,3 +1,9 @@
++2022-06-27  Nick Clifton  
++
++  PR 23765
++  * fileread.cc (File_read::do_read): Check start parameter before
++  computing number of bytes to read.
++
+ 2022-02-17  Nick Clifton  
+ 
+   * po/sr.po: Updated Serbian translation.
+diff --git a/gold/fileread.cc b/gold/fileread.cc
+index 2b653f78c2e..af2df215468 100644
+--- a/gold/fileread.cc
 b/gold/fileread.cc
+@@ -385,6 +385,12 @@ File_read::do_read(off_t start, section_
+   ssize_t bytes;
+   if (this->whole_file_view_ != NULL)
+ {
++  // See PR 23765 for an example of a testcase that triggers this error.
++  if (((ssize_t) start) < 0)
++  gold_fatal(_("%s: read failed, starting offset (%#llx) less than zero"),
++ this->filename().c_str(),
++ static_cast(start));
++  
+   bytes = this->size_ - start;
+   if (static_cast(bytes) >= size)
+   {
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#167372): 
https://lists.openembedded.org/g/openembedded-core/message/167372
Mute This Topic: https://lists.openembedded.org/mt/92062326/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH v6] Rust Oe-Selftest implementation

2022-06-29 Thread Pgowda
Hi Richard,

Thanks very much for pointing that out.
I could reproduce the issue on the docker host that does not contain zlib-devel.
Trying to analyse the issue on dependency of zlib.
It would be helpful if you could give some pointers on zlib dependency
as it would have been seen in other recipes as well.
It would help us in fixing the issue appropriately.

Thanks,
Pgowda

On Mon, Jun 6, 2022 at 2:21 PM Richard Purdie
 wrote:
>
> On Fri, 2022-06-03 at 18:37 +0530, pgowda cve wrote:
> > Hi Luca,
> >
> > Regarding the issue
> > https://bugzilla.yoctoproject.org/show_bug.cgi?id=14818
> >
> > I ran the Oe-Selftest for Rust as well as completed packages and did
> > not come across any issues.
> > a@yow-fedora-builder1 build]$ uname -a
> > Linux yow-fedora-builder1 5.16.18-200.fc35.x86_64 #1 SMP PREEMPT Mon
> > Mar 28 14:10:07 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
> >
> > The log of tests can be seen as follows:-
> > The command used to run the test was as mentioned in the Bugzilla.
> > oe-selftest -a -t machine -t toolchain-system -j 15
> >
> > test_libatomic: PASSED (113.76s)
> > 2022-06-03 08:39:19,084 - oe-selftest - INFO - RESULTS -
> > gcc.GccLibGompSelfTestSystemEmulated.test_libgomp: PASSED (637.21s)
> > 2022-06-03 08:39:19,084 - oe-selftest - INFO - RESULTS -
> > gcc.GccLibItmSelfTestSystemEmulated.test_libitm: PASSED (133.31s)
> > 2022-06-03 08:39:19,084 - oe-selftest - INFO - RESULTS -
> > gcc.GccLibStdCxxSelfTestSystemEmulated.test_libstdcxx: PASSED
> > (2546.63s)
> > 2022-06-03 08:39:19,084 - oe-selftest - INFO - RESULTS -
> > gcc.GxxCrossSelfTestSystemEmulated.test_cross_gxx: PASSED (744.56s)
> > 2022-06-03 08:39:19,084 - oe-selftest - INFO - RESULTS -
> > glibc.GlibcSelfTestSystemEmulated.test_glibc: PASSED (1101.43s)
> > 2022-06-03 08:39:19,085 - oe-selftest - INFO - RESULTS -
> > meta_ide.MetaIDE.test_meta_ide_can_build_cpio_project: PASSED (54.33s)
> > 2022-06-03 08:39:19,085 - oe-selftest - INFO - RESULTS -
> > meta_ide.MetaIDE.test_meta_ide_can_compile_c_program: PASSED (0.19s)
> > 2022-06-03 08:39:19,085 - oe-selftest - INFO - RESULTS -
> > meta_ide.MetaIDE.test_meta_ide_had_installed_meta_ide_support: PASSED
> > (0.01s)
> > 2022-06-03 08:39:19,085 - oe-selftest - INFO - RESULTS -
> > runqemu.QemuTest.test_qemu_can_shutdown: PASSED (45.98s)
> > 2022-06-03 08:39:19,085 - oe-selftest - INFO - RESULTS -
> > rust.RustSelfTestSystemEmulated.test_rust: PASSED (8381.70s)
> > 2022-06-03 08:39:19,085 - oe-selftest - INFO - RESULTS -
> > gcc.GccLibSspSelfTestSystemEmulated.test_libssp: SKIPPED (3.92s)
> > 2022-06-03 08:39:22,336 - oe-selftest - INFO - SUMMARY:
> > 2022-06-03 08:39:22,336 - oe-selftest - INFO - oe-selftest () - Ran 16
> > tests in 19613.479s
> > 2022-06-03 08:39:22,336 - oe-selftest - INFO - oe-selftest - OK - All
> > required tests passed (successes=15, skipped=1, failures=0, errors=0)
> >
> > I also ran the Rust Oe-Selftest individually and did not find any issues.
> > Can you please share the environment file so that I can reproduce and
> > fix the issue?
>
> There isn't any magic environment we can share here I'm afraid. We
> don't know why it happens on some autobuilder workers and not on
> others, this is something we need to investigate and fix. This is one
> of the challenges of these "intermittent" issues.
>
> The errors seem to relate to zlib so it may be worth looking at whether
> host headers influence the rust build and those may be causing some
> kind of determinism issue. You may have to build the binaries one a
> system with the headers, then run them on a system without for example.
>
> Cheers,
>
> Richard
>
>
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#167369): 
https://lists.openembedded.org/g/openembedded-core/message/167369
Mute This Topic: https://lists.openembedded.org/mt/91327291/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] binutils : CVE-2019-1010204

2022-06-28 Thread Pgowda
Upstream-Status: Backport 
[https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2a4fc266dbf77ed7ab83da16468e9ba627b8bc2d]

Signed-off-by: Pgowda 
---
 .../binutils/binutils-2.38.inc|  1 +
 .../binutils/0014-CVE-2019-1010204.patch  | 49 +++
 2 files changed, 50 insertions(+)
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0014-CVE-2019-1010204.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.38.inc 
b/meta/recipes-devtools/binutils/binutils-2.38.inc
index dc0a2a4054..a069071c97 100644
--- a/meta/recipes-devtools/binutils/binutils-2.38.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.38.inc
@@ -32,5 +32,6 @@ SRC_URI = "\
  file://0011-sync-with-OE-libtool-changes.patch \
  file://0012-Check-for-clang-before-checking-gcc-version.patch \
  file://0013-Avoid-as-info-race-condition.patch \
+ file://0014-CVE-2019-1010204.patch \
 "
 S  = "${WORKDIR}/git"
diff --git 
a/meta/recipes-devtools/binutils/binutils/0014-CVE-2019-1010204.patch 
b/meta/recipes-devtools/binutils/binutils/0014-CVE-2019-1010204.patch
new file mode 100644
index 00..dad4a62038
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0014-CVE-2019-1010204.patch
@@ -0,0 +1,49 @@
+From 2a4fc266dbf77ed7ab83da16468e9ba627b8bc2d Mon Sep 17 00:00:00 2001
+From: Nick Clifton 
+Date: Mon, 27 Jun 2022 13:07:40 +0100
+Subject: [PATCH] Have gold's File_read::do_read() function check the start
+ parameter
+
+   PR 23765
+   * fileread.cc (File_read::do_read): Check start parameter before
+   computing number of bytes to read.
+
+Upstream-Status: Backport 
[https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2a4fc266dbf77ed7ab83da16468e9ba627b8bc2d]
+
+Signed-off-by: Pgowda 
+---
+ gold/ChangeLog   | 6 ++
+ gold/fileread.cc | 6 ++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/gold/ChangeLog b/gold/ChangeLog
+index 5103dab7b67..8557dc6db7f 100644
+--- a/gold/ChangeLog
 b/gold/ChangeLog
+@@ -1,3 +1,9 @@
++2022-06-27  Nick Clifton  
++
++  PR 23765
++  * fileread.cc (File_read::do_read): Check start parameter before
++  computing number of bytes to read.
++
+ 2022-02-17  Nick Clifton  
+ 
+   * po/sr.po: Updated Serbian translation.
+diff --git a/gold/fileread.cc b/gold/fileread.cc
+index 2b653f78c2e..af2df215468 100644
+--- a/gold/fileread.cc
 b/gold/fileread.cc
+@@ -385,6 +385,12 @@ File_read::do_read(off_t start, section_
+   ssize_t bytes;
+   if (this->whole_file_view_ != NULL)
+ {
++  // See PR 23765 for an example of a testcase that triggers this error.
++  if (((ssize_t) start) < 0)
++  gold_fatal(_("%s: read failed, starting offset (%#llx) less than zero"),
++ this->filename().c_str(),
++ static_cast(start));
++  
+   bytes = this->size_ - start;
+   if (static_cast(bytes) >= size)
+   {
-- 
2.25.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#167366): 
https://lists.openembedded.org/g/openembedded-core/message/167366
Mute This Topic: https://lists.openembedded.org/mt/92059622/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH v6] Rust Oe-Selftest implementation

2022-06-03 Thread Pgowda
Hi Luca,

Regarding the issue
https://bugzilla.yoctoproject.org/show_bug.cgi?id=14818

I ran the Oe-Selftest for Rust as well as completed packages and did
not come across any issues.
a@yow-fedora-builder1 build]$ uname -a
Linux yow-fedora-builder1 5.16.18-200.fc35.x86_64 #1 SMP PREEMPT Mon
Mar 28 14:10:07 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

The log of tests can be seen as follows:-
The command used to run the test was as mentioned in the Bugzilla.
oe-selftest -a -t machine -t toolchain-system -j 15

test_libatomic: PASSED (113.76s)
2022-06-03 08:39:19,084 - oe-selftest - INFO - RESULTS -
gcc.GccLibGompSelfTestSystemEmulated.test_libgomp: PASSED (637.21s)
2022-06-03 08:39:19,084 - oe-selftest - INFO - RESULTS -
gcc.GccLibItmSelfTestSystemEmulated.test_libitm: PASSED (133.31s)
2022-06-03 08:39:19,084 - oe-selftest - INFO - RESULTS -
gcc.GccLibStdCxxSelfTestSystemEmulated.test_libstdcxx: PASSED
(2546.63s)
2022-06-03 08:39:19,084 - oe-selftest - INFO - RESULTS -
gcc.GxxCrossSelfTestSystemEmulated.test_cross_gxx: PASSED (744.56s)
2022-06-03 08:39:19,084 - oe-selftest - INFO - RESULTS -
glibc.GlibcSelfTestSystemEmulated.test_glibc: PASSED (1101.43s)
2022-06-03 08:39:19,085 - oe-selftest - INFO - RESULTS -
meta_ide.MetaIDE.test_meta_ide_can_build_cpio_project: PASSED (54.33s)
2022-06-03 08:39:19,085 - oe-selftest - INFO - RESULTS -
meta_ide.MetaIDE.test_meta_ide_can_compile_c_program: PASSED (0.19s)
2022-06-03 08:39:19,085 - oe-selftest - INFO - RESULTS -
meta_ide.MetaIDE.test_meta_ide_had_installed_meta_ide_support: PASSED
(0.01s)
2022-06-03 08:39:19,085 - oe-selftest - INFO - RESULTS -
runqemu.QemuTest.test_qemu_can_shutdown: PASSED (45.98s)
2022-06-03 08:39:19,085 - oe-selftest - INFO - RESULTS -
rust.RustSelfTestSystemEmulated.test_rust: PASSED (8381.70s)
2022-06-03 08:39:19,085 - oe-selftest - INFO - RESULTS -
gcc.GccLibSspSelfTestSystemEmulated.test_libssp: SKIPPED (3.92s)
2022-06-03 08:39:22,336 - oe-selftest - INFO - SUMMARY:
2022-06-03 08:39:22,336 - oe-selftest - INFO - oe-selftest () - Ran 16
tests in 19613.479s
2022-06-03 08:39:22,336 - oe-selftest - INFO - oe-selftest - OK - All
required tests passed (successes=15, skipped=1, failures=0, errors=0)

I also ran the Rust Oe-Selftest individually and did not find any issues.
Can you please share the environment file so that I can reproduce and
fix the issue?

Thanks,
Pgowda

On Tue, May 31, 2022 at 6:35 PM Luca Ceresoli  wrote:
>
> Hi Pgowda,
>
> Il giorno Wed, 25 May 2022 09:57:48 +0200
> "Luca Ceresoli via lists.openembedded.org"
>  ha scritto:
>
> > Pgowda,
> >
> > Il giorno Tue, 24 May 2022 21:32:58 -0700
> > "Pgowda"  ha scritto:
> >
> > > The patch implements Rust testing framework similar to other selftest,
> > > specifically the gcc selftest in OE. It uses the client and server
> > > based method to test the binaries for cross-target on the image.
> > > The test framework is a wrapper around the Rust build system as ./x.py
> > > test.
> > > It tests many functionalities of Rust distribution like tools,
> > > documentation, libraries, packages, tools, Cargo, Crater etc.
> > > Please refer the following link for detailed description of Rust
> > > testing:-
> > > https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests
> > >
> > > To support the rust tests in oe-core, the following functions were
> > > added:-
> > > setup_cargo_environment(): Build bootstrap and some early stage tools.
> > > do_rust_setup_snapshot(): Install the snapshot version of rust
> > > binaries. do_configure(): To generate config.toml
> > > do_compile(): To build "remote-test-server" for qemu target image.
> > >
> > > Approximate Number of Tests Run in the Rust Testsuite :- 18000
> > > Approximate Number of Tests that FAIL in bitbake environment :-
> > > 100-150 Normally majority of the testcases are present in major
> > > folder "test/" It contributes to more than 80% of the testcases
> > > present in Rust test framework. These tests pass as expected on any
> > > Rust versions without much fuss. The tests that fail are of less
> > > important and contribute to less than 2% of the total testcases.
> > > These minor tests are observed to work on some versions and fail on
> > > others. They have to be added, ignored or excluded for different
> > > versions as per the behavior. These tests have been ignored or
> > > excluded in the Rust selftest environment to generate success of
> > > completing the testsuite.
> > >
> > > These tests work in parallel mode even in the skipped test mode as
> > > expected. Although the patch to disable tests is large, it is very
> > > simple 

[OE-core] [PATCH v6] Rust Oe-Selftest implementation

2022-05-24 Thread Pgowda
The patch implements Rust testing framework similar to other selftest,
specifically the gcc selftest in OE. It uses the client and server
based method to test the binaries for cross-target on the image.
The test framework is a wrapper around the Rust build system as ./x.py
test.
It tests many functionalities of Rust distribution like tools,
documentation, libraries, packages, tools, Cargo, Crater etc.
Please refer the following link for detailed description of Rust
testing:-
https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests

To support the rust tests in oe-core, the following functions were
added:-
setup_cargo_environment(): Build bootstrap and some early stage tools.
do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
do_configure(): To generate config.toml
do_compile(): To build "remote-test-server" for qemu target image.

Approximate Number of Tests Run in the Rust Testsuite :- 18000
Approximate Number of Tests that FAIL in bitbake environment :- 100-150
Normally majority of the testcases are present in major folder "test/"
It contributes to more than 80% of the testcases present in Rust test
framework. These tests pass as expected on any Rust versions without
much fuss. The tests that fail are of less important and contribute to
less than 2% of the total testcases. These minor tests are observed to
work on some versions and fail on others. They have to be added, ignored
or excluded for different versions as per the behavior.
These tests have been ignored or excluded in the Rust selftest
environment to generate success of completing the testsuite.

These tests work in parallel mode even in the skipped test mode as
expected. Although the patch to disable tests is large, it is very simple
in that it only disables tests. When updating to a newer version of Rust,
the patch can usually be ported in a day.

Signed-off-by: pgowda 
Signed-off-by: Vinay Kumar 
---
 meta/conf/distro/include/maintainers.inc  |   1 +
 meta/lib/oeqa/selftest/cases/rust.py  |  57 +++
 meta/recipes-devtools/rust/rust-common.inc|   1 -
 meta/recipes-devtools/rust/rust-testsuite.inc | 163 +++
 .../rust-testsuite/rust-oe-selftest.patch | 417 ++
 .../rust/rust-testsuite_1.60.0.bb |   3 +
 6 files changed, 641 insertions(+), 1 deletion(-)
 create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite.inc
 create mode 100644 
meta/recipes-devtools/rust/rust-testsuite/rust-oe-selftest.patch
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite_1.60.0.bb

diff --git a/meta/conf/distro/include/maintainers.inc 
b/meta/conf/distro/include/maintainers.inc
index 3990d1d507..cecb02b1c6 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -719,6 +719,7 @@ RECIPE_MAINTAINER:pn-rust-crosssdk-${SDK_ARCH}-glibc = 
"Randy MacLeod https://rustc-dev-guide.rust-lang.org/tests/intro.html;
+SECTION = "test"
+LICENSE = "MIT | Apache-2.0"
+
+SRC_URI += "file://rust-oe-selftest.patch;striplevel=1"
+
+inherit rust
+inherit cargo_common
+
+DEPENDS += "file-native"
+EXCLUDE_FROM_WORLD = "1"
+
+S = "${RUSTSRC}"
+
+# Path of target specification file "target-poky-linux.json"
+export RUST_TARGET_PATH="${STAGING_LIBDIR_NATIVE}/rustlib"
+
+export FORCE_CRATE_HASH="${BB_TASKHASH}"
+
+# We don't want to use bitbakes vendoring because the rust sources do their
+# own vendoring.
+CARGO_DISABLE_BITBAKE_VENDORING = "1"
+
+# We can't use RUST_BUILD_SYS here because that may be "musl" if
+# TCLIBC="musl". Snapshots are always -unknown-linux-gnu
+SNAPSHOT_BUILD_SYS = "${BUILD_ARCH}-unknown-linux-gnu"
+setup_cargo_environment () {
+# The first step is to build bootstrap and some early stage tools,
+# these are build for the same target as the snapshot, e.g.
+# x86_64-unknown-linux-gnu.
+# Later stages are build for the native target (i.e. target.x86_64-linux)
+cargo_common_do_configure
+
+printf '[target.%s]\n' "${SNAPSHOT_BUILD_SYS}" >> ${CARGO_HOME}/config
+printf "linker = '%s'\n" "${RUST_BUILD_CCLD}" >> ${CARGO_HOME}/config
+}
+
+include rust-common.inc
+
+do_rust_setup_snapshot () {
+for installer in "${WORKDIR}/rust-snapshot-components/"*"/install.sh"; do
+"${installer}" --prefix="${WORKDIR}/rust-snapshot" --disable-ldconfig
+done
+
+# Need to use uninative's loader if enabled/present since the library paths
+# are used internally by rust and result in symbol mismatches if we don't
+if [ ! -z "${UNINATIVE_LOADER}" -a -e "${UNINATIVE_LOADER}" ]; then
+for bin in cargo rustc rustdoc; do
+patchelf-uninative ${WORKDIR}/rust-snapshot/bin/$bin 
--

Re: [OE-core] [PATCH v5] Rust Oe-Selftest implementation

2022-05-24 Thread Pgowda
Gentle Ping on the following patch

On Fri, May 13, 2022 at 5:50 PM pgowda  wrote:
>
> The patch implements Rust testing framework similar to other selftest,
> specifically the gcc selftest in OE. It uses the client and server
> based method to test the binaries for cross-target on the image.
> The test framework is a wrapper around the Rust build system as ./x.py
> test.
> It tests many functionalities of Rust distribution like tools,
> documentation, libraries, packages, tools, Cargo, Crater etc.
> Please refer the following link for detailed description of Rust
> testing:-
> https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests
>
> To support the rust tests in oe-core, the following functions were
> added:-
> setup_cargo_environment(): Build bootstrap and some early stage tools.
> do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
> do_configure(): To generate config.toml
> do_compile(): To build "remote-test-server" for qemu target image.
>
> Approximate Number of Tests Run in the Rust Testsuite :- 18000
> Approximate Number of Tests that FAIL in bitbake environment :- 100-150
> Normally majority of the testcases are present in major folder "test/"
> It contributes to more than 80% of the testcases present in Rust test
> framework. These tests pass as expected on any Rust versions without
> much fuss. The tests that fail are of less important and contribute to
> less than 2% of the total testcases. These minor tests are observed to
> work on some versions and fail on others. They have to be added, ignored
> or excluded for different versions as per the behavior.
> These tests have been ignored or excluded in the Rust selftest
> environment to generate success of completing the testsuite.
>
> These tests work in parallel mode even in the skipped test mode as
> expected. Although the patch to disable tests is large, it is very simple
> in that it only disables tests. When updating to a newer version of Rust,
> the patch can usually be ported in a day.
>
> Signed-off-by: pgowda 
> Signed-off-by: Vinay Kumar 
> ---
>  meta/lib/oeqa/selftest/cases/rust.py  |  57 +++
>  meta/recipes-devtools/rust/rust-common.inc|   1 -
>  meta/recipes-devtools/rust/rust-testsuite.inc | 163 +++
>  .../rust-testsuite/rust-oe-selftest.patch | 417 ++
>  .../rust/rust-testsuite_1.60.0.bb |   3 +
>  5 files changed, 640 insertions(+), 1 deletion(-)
>  create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
>  create mode 100644 meta/recipes-devtools/rust/rust-testsuite.inc
>  create mode 100644 
> meta/recipes-devtools/rust/rust-testsuite/rust-oe-selftest.patch
>  create mode 100644 meta/recipes-devtools/rust/rust-testsuite_1.60.0.bb
>
> diff --git a/meta/lib/oeqa/selftest/cases/rust.py 
> b/meta/lib/oeqa/selftest/cases/rust.py
> new file mode 100644
> index 00..80d6f310c9
> --- /dev/null
> +++ b/meta/lib/oeqa/selftest/cases/rust.py
> @@ -0,0 +1,57 @@
> +# SPDX-License-Identifier: MIT
> +import os
> +import subprocess
> +from oeqa.core.decorator import OETestTag
> +from oeqa.core.case import OEPTestResultTestCase
> +from oeqa.selftest.case import OESelftestTestCase
> +from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, 
> runqemu, Command
> +from oeqa.utils.sshcontrol import SSHControl
> +
> +# Total time taken for testing is of about 2hr 20min, with PARALLEL_MAKE set 
> to 40 number of jobs.
> +class RustSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
> +
> +   def run_check_emulated(self, *args, **kwargs):
> +   # build remote-test-server before image build
> +   recipe = "rust-testsuite"
> +   bitbake("{} -c compile".format(recipe))
> +   builddir = get_bb_var("B", "rust-testsuite")
> +   # build core-image-minimal with required packages
> +   default_installed_packages = ["libgcc", "libstdc++", 
> "libatomic", "libgomp"]
> +   features = []
> +   features.append('IMAGE_FEATURES += "ssh-server-openssh"')
> +   features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" 
> ".join(default_installed_packages)))
> +   self.write_config("\n".join(features))
> +   bitbake("core-image-minimal")
> +   # wrap the execution with a qemu instance
> +   with runqemu("core-image-minimal", runqemuparams = 
> "nographic", qemuparams = "-m 512") as qemu:
> +   # Copy remote-test-server to image through

Re: [OE-core] [PATCH] glibc: ptest: Add lib32-glibc-tests PROVIDES

2022-05-13 Thread Pgowda
Hi Richard,

Thanks for the confirmation.

> What you really need is a way to replicate the failure. How did you
> test this locally?

I ran the complete Oe-selftest suite with the latest poky sources
after applying the patch:-
oe-selftest -a -t machine -t toolchain-system

Can you please let me know if I have to export any specific
environment to replicate the failure?

Thanks,
Pgowda

On Fri, May 13, 2022 at 6:15 PM  wrote:
>
> On Fri, 2022-05-13 at 17:58 +0530, Pgowda wrote:
> > Hi Luca,
> >
> > I have checked it again at my end and it seems to be working fine.
> > The error is related to "setup NFS mount on target" and does not seem
> > to be related to the patch.
> > Can the patch be included again while running oe-selftest and checked?
>
> No, it doesn't need to be checked again, it is breaking oe-selftest
> when used to test target machine glibc.
>
> The change in in the glibc ptest recipe and the failure is in
> "glibc.GlibcSelfTestSystemEmulated.test_glibc" i.e. in the glibc tests
> so there is a clear connection between these two things.
>
> We need to work out why it breaks it and fix that. Running it again
> doesn't help us at all.
>
> What you really need is a way to replicate the failure. How did you
> test this locally?
>
> Cheers,
>
> Richard
>
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#165559): 
https://lists.openembedded.org/g/openembedded-core/message/165559
Mute This Topic: https://lists.openembedded.org/mt/90831085/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH] glibc: ptest: Add lib32-glibc-tests PROVIDES

2022-05-13 Thread Pgowda
Hi Luca,

I have checked it again at my end and it seems to be working fine.
The error is related to "setup NFS mount on target" and does not seem
to be related to the patch.
Can the patch be included again while running oe-selftest and checked?

Thanks,
Pgowda

On Thu, May 5, 2022 at 3:55 PM pgowda cve  wrote:
>
> Hi Luca,
>
> Thanks for providing the build error details with the patch.
> I did a run of the provided test after applying the patch and found
> that it runs successfully.
> Please find the details of the log that were run successfully.
>
> 
> 2022-05-05 00:28:57,451 - oe-selftest - INFO - RESULTS -
> gcc.GxxCrossSelfTestSystemEmulated.test_cross_gxx: PASSED (1137.41s)
> 2022-05-05 00:28:57,451 - oe-selftest - INFO - RESULTS -
> glibc.GlibcSelfTestSystemEmulated.test_glibc: PASSED (41315.04s)
> 2022-05-05 00:28:57,452 - oe-selftest - INFO - RESULTS -
> meta_ide.MetaIDE.test_meta_ide_can_build_cpio_project: PASSED (53.59s)
> 2022-05-05 00:28:57,452 - oe-selftest - INFO - RESULTS -
> meta_ide.MetaIDE.test_meta_ide_can_compile_c_program: PASSED (0.35s)
> 2022-05-05 00:28:57,452 - oe-selftest - INFO - RESULTS -
> meta_ide.MetaIDE.test_meta_ide_had_installed_meta_ide_support: PASSED
> (0.01s)
> 2022-05-05 00:28:57,452 - oe-selftest - INFO - RESULTS -
> runqemu.QemuTest.test_qemu_can_shutdown: PASSED (30.84s)
> 2022-05-05 00:28:57,452 - oe-selftest - INFO - RESULTS -
> gcc.GccLibSspSelfTestSystemEmulated.test_libssp: SKIPPED (4.00s)
> 2022-05-05 00:28:59,823 - oe-selftest - INFO - SUMMARY:
> 2022-05-05 00:28:59,824 - oe-selftest - INFO - oe-selftest () - Ran 15
> tests in 49960.164s
> 2022-05-05 00:28:59,824 - oe-selftest - INFO - oe-selftest - OK - All
> required tests passed (successes=14, skipped=1, failures=0, errors=0)
> 
>
> I did a run of the following command in latest Poky sources after
> applying the patch:-
> oe-selftest -a -t machine -t toolchain-system
>
> pgowda@ala-lpggp3:/pgowda/check$ uname -a
> Linux 5.4.0-107-generic #121~18.04.1-Ubuntu SMP Thu Mar 24 17:21:33
> UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
>
> The following error was seen in the log provided which triggered the failure.
> However, I could not see the issue when I ran the Oe-selftest.
>
> Exception: Failed to setup NFS mount on target ('mount: mounting
> 192.168.7.13:/home/pokybuild/yocto-worker/qemux86-64/build/build-st-1441279/tmp/work
> on /home/pokybuild/yocto-worker/qemux86-64/build/build-st-1441279/tmp/work
> failed: Input/output error')
>
> Can you please provide me with the details of the environment to check
> and reproduce the issue?
>
> Thanks
> Pgowda
>
> On Tue, May 3, 2022 at 2:00 AM Luca Ceresoli  
> wrote:
> >
> > Hi Pgowda,
> >
> > Il giorno Mon,  2 May 2022 01:08:51 -0700
> > "Pgowda"  ha scritto:
> >
> > > While running lib32-glibc-tests, it fails with the following error
> > > as the recipe is not PROVIDED. BBCLASSEXTEND is cleaned in glibc-tests
> > > and is not able to recognize the multilibs.
> > >
> > > ERROR: Nothing PROVIDES 'lib32-glibc-tests'
> > >
> > > Signed-off-by: pgowda 
> >
> > It seems like this patch is triggering some build error:
> >
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/73/builds/5100/steps/19/logs/stdio
> >
> >
> >
> > --
> > Luca Ceresoli, Bootlin
> > Embedded Linux and Kernel engineering
> > https://bootlin.com

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#165557): 
https://lists.openembedded.org/g/openembedded-core/message/165557
Mute This Topic: https://lists.openembedded.org/mt/90831085/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH v5] Rust Oe-Selftest implementation

2022-05-13 Thread Pgowda
The patch implements Rust testing framework similar to other selftest,
specifically the gcc selftest in OE. It uses the client and server
based method to test the binaries for cross-target on the image.
The test framework is a wrapper around the Rust build system as ./x.py
test.
It tests many functionalities of Rust distribution like tools,
documentation, libraries, packages, tools, Cargo, Crater etc.
Please refer the following link for detailed description of Rust
testing:-
https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests

To support the rust tests in oe-core, the following functions were
added:-
setup_cargo_environment(): Build bootstrap and some early stage tools.
do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
do_configure(): To generate config.toml
do_compile(): To build "remote-test-server" for qemu target image.

Approximate Number of Tests Run in the Rust Testsuite :- 18000
Approximate Number of Tests that FAIL in bitbake environment :- 100-150
Normally majority of the testcases are present in major folder "test/"
It contributes to more than 80% of the testcases present in Rust test
framework. These tests pass as expected on any Rust versions without
much fuss. The tests that fail are of less important and contribute to
less than 2% of the total testcases. These minor tests are observed to
work on some versions and fail on others. They have to be added, ignored
or excluded for different versions as per the behavior.
These tests have been ignored or excluded in the Rust selftest
environment to generate success of completing the testsuite.

These tests work in parallel mode even in the skipped test mode as
expected. Although the patch to disable tests is large, it is very simple
in that it only disables tests. When updating to a newer version of Rust,
the patch can usually be ported in a day.

Signed-off-by: pgowda 
Signed-off-by: Vinay Kumar 
---
 meta/lib/oeqa/selftest/cases/rust.py  |  57 +++
 meta/recipes-devtools/rust/rust-common.inc|   1 -
 meta/recipes-devtools/rust/rust-testsuite.inc | 163 +++
 .../rust-testsuite/rust-oe-selftest.patch | 417 ++
 .../rust/rust-testsuite_1.60.0.bb |   3 +
 5 files changed, 640 insertions(+), 1 deletion(-)
 create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite.inc
 create mode 100644 
meta/recipes-devtools/rust/rust-testsuite/rust-oe-selftest.patch
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite_1.60.0.bb

diff --git a/meta/lib/oeqa/selftest/cases/rust.py 
b/meta/lib/oeqa/selftest/cases/rust.py
new file mode 100644
index 00..80d6f310c9
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: MIT
+import os
+import subprocess
+from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, 
runqemu, Command
+from oeqa.utils.sshcontrol import SSHControl
+
+# Total time taken for testing is of about 2hr 20min, with PARALLEL_MAKE set 
to 40 number of jobs.
+class RustSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
+
+   def run_check_emulated(self, *args, **kwargs):
+   # build remote-test-server before image build
+   recipe = "rust-testsuite"
+   bitbake("{} -c compile".format(recipe))
+   builddir = get_bb_var("B", "rust-testsuite")
+   # build core-image-minimal with required packages
+   default_installed_packages = ["libgcc", "libstdc++", 
"libatomic", "libgomp"]
+   features = []
+   features.append('IMAGE_FEATURES += "ssh-server-openssh"')
+   features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" 
".join(default_installed_packages)))
+   self.write_config("\n".join(features))
+   bitbake("core-image-minimal")
+   # wrap the execution with a qemu instance
+   with runqemu("core-image-minimal", runqemuparams = "nographic", 
qemuparams = "-m 512") as qemu:
+   # Copy remote-test-server to image through scp
+   ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, 
user="root")
+   ssh.copy_to(builddir + "/" + 
"build/x86_64-unknown-linux-gnu/stage1-tools-bin/remote-test-server","~/")
+   # Execute remote-test-server on image through 
background ssh
+   command = '~/remote-test-server -v remote'
+   sshrun=subprocess.Popen(("ssh", '-o',  
'UserKnownHostsFile=/dev/null', '

Re: [OE-core] [PATCH] glibc: ptest: Add lib32-glibc-tests PROVIDES

2022-05-05 Thread Pgowda
Hi Luca,

Thanks for providing the build error details with the patch.
I did a run of the provided test after applying the patch and found
that it runs successfully.
Please find the details of the log that were run successfully.


2022-05-05 00:28:57,451 - oe-selftest - INFO - RESULTS -
gcc.GxxCrossSelfTestSystemEmulated.test_cross_gxx: PASSED (1137.41s)
2022-05-05 00:28:57,451 - oe-selftest - INFO - RESULTS -
glibc.GlibcSelfTestSystemEmulated.test_glibc: PASSED (41315.04s)
2022-05-05 00:28:57,452 - oe-selftest - INFO - RESULTS -
meta_ide.MetaIDE.test_meta_ide_can_build_cpio_project: PASSED (53.59s)
2022-05-05 00:28:57,452 - oe-selftest - INFO - RESULTS -
meta_ide.MetaIDE.test_meta_ide_can_compile_c_program: PASSED (0.35s)
2022-05-05 00:28:57,452 - oe-selftest - INFO - RESULTS -
meta_ide.MetaIDE.test_meta_ide_had_installed_meta_ide_support: PASSED
(0.01s)
2022-05-05 00:28:57,452 - oe-selftest - INFO - RESULTS -
runqemu.QemuTest.test_qemu_can_shutdown: PASSED (30.84s)
2022-05-05 00:28:57,452 - oe-selftest - INFO - RESULTS -
gcc.GccLibSspSelfTestSystemEmulated.test_libssp: SKIPPED (4.00s)
2022-05-05 00:28:59,823 - oe-selftest - INFO - SUMMARY:
2022-05-05 00:28:59,824 - oe-selftest - INFO - oe-selftest () - Ran 15
tests in 49960.164s
2022-05-05 00:28:59,824 - oe-selftest - INFO - oe-selftest - OK - All
required tests passed (successes=14, skipped=1, failures=0, errors=0)


I did a run of the following command in latest Poky sources after
applying the patch:-
oe-selftest -a -t machine -t toolchain-system

pgowda@ala-lpggp3:/pgowda/check$ uname -a
Linux 5.4.0-107-generic #121~18.04.1-Ubuntu SMP Thu Mar 24 17:21:33
UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

The following error was seen in the log provided which triggered the failure.
However, I could not see the issue when I ran the Oe-selftest.

Exception: Failed to setup NFS mount on target ('mount: mounting
192.168.7.13:/home/pokybuild/yocto-worker/qemux86-64/build/build-st-1441279/tmp/work
on /home/pokybuild/yocto-worker/qemux86-64/build/build-st-1441279/tmp/work
failed: Input/output error')

Can you please provide me with the details of the environment to check
and reproduce the issue?

Thanks
Pgowda

On Tue, May 3, 2022 at 2:00 AM Luca Ceresoli  wrote:
>
> Hi Pgowda,
>
> Il giorno Mon,  2 May 2022 01:08:51 -0700
> "Pgowda"  ha scritto:
>
> > While running lib32-glibc-tests, it fails with the following error
> > as the recipe is not PROVIDED. BBCLASSEXTEND is cleaned in glibc-tests
> > and is not able to recognize the multilibs.
> >
> > ERROR: Nothing PROVIDES 'lib32-glibc-tests'
> >
> > Signed-off-by: pgowda 
>
> It seems like this patch is triggering some build error:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/73/builds/5100/steps/19/logs/stdio
>
>
>
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#165295): 
https://lists.openembedded.org/g/openembedded-core/message/165295
Mute This Topic: https://lists.openembedded.org/mt/90831085/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] glibc: ptest: Add lib32-glibc-tests PROVIDES

2022-05-02 Thread Pgowda
While running lib32-glibc-tests, it fails with the following error
as the recipe is not PROVIDED. BBCLASSEXTEND is cleaned in glibc-tests
and is not able to recognize the multilibs.

ERROR: Nothing PROVIDES 'lib32-glibc-tests'

Signed-off-by: pgowda 
---
 meta/recipes-core/glibc/glibc-tests_2.35.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/glibc/glibc-tests_2.35.bb 
b/meta/recipes-core/glibc/glibc-tests_2.35.bb
index 414f8660de..2515e98bb3 100644
--- a/meta/recipes-core/glibc/glibc-tests_2.35.bb
+++ b/meta/recipes-core/glibc/glibc-tests_2.35.bb
@@ -18,7 +18,7 @@ python __anonymous() {
d.setVar("PROVIDES", "${PN} ${PN}-ptest")
d.setVar("RPROVIDES", "${PN} ${PN}-ptest")
 
-   d.setVar("BBCLASSEXTEND", "")
+#   d.setVar("BBCLASSEXTEND", "")
d.setVar("RRECOMMENDS", "")
d.setVar("SYSTEMD_SERVICE:nscd", "")
d.setVar("SYSTEMD_PACKAGES", "")
-- 
2.35.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#165161): 
https://lists.openembedded.org/g/openembedded-core/message/165161
Mute This Topic: https://lists.openembedded.org/mt/90831085/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH] rust: update 1.59.0 -> 1.60.0

2022-04-26 Thread Pgowda
Hi,

@Khem
>> right, this might be good to have as comment on top of that assignment
>> for future reference
Thanks for the info.
It's been updated as per your comments.

> like the the version bump in tcmode-default.inc was missing.
Thanks for mentioning it.
I figured it out after seeing the warning message from Luca Ceresoli.
It's was updated, tested for all the recipes and a new version of the
patch is posted as:-
https://lists.openembedded.org/g/openembedded-core/message/164872

Thanks,
Pgowda

On Tue, Apr 26, 2022 at 5:36 PM Alex Kiernan  wrote:
>
> On Tue, Apr 26, 2022 at 12:56 PM Luca Ceresoli via
> lists.openembedded.org
>  wrote:
> >
> > Hello Pgowda,
> >
> > Il giorno Mon, 25 Apr 2022 03:05:33 -0700
> > "Pgowda"  ha scritto:
> >
> > > Rust has been upgraded to rust-1.60.0 that uses LLVM 14.
> > >
> > > Please refer the following link for more detailed features.
> > > https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html
> > > https://github.com/rust-lang/rust/blob/master/RELEASES.md
> > >
> > > Signed-off-by: pgowda 
> >
> > Testing with this patch applied triggers many warnings:
> >
> > WARNING: preferred version 1.59% of cargo-native not available (for item 
> > cargo-native)
> > WARNING: versions of cargo-native available: 1.60.0
> > WARNING: preferred version 1.59% of libstd-rs not available (for item 
> > libstd-rs)
> > WARNING: versions of libstd-rs available: 1.60.0
> > WARNING: preferred version 1.59% of libstd-rs not available (for item 
> > libstd-rs)
> > WARNING: versions of libstd-rs available: 1.60.0
> > WARNING: preferred version 1.59% of libstd-rs not available (for item 
> > libstd-rs-dev)
> > WARNING: versions of libstd-rs available: 1.60.0
> > WARNING: preferred version 1.59% of rust-native not available (for item 
> > rust-native)
> > WARNING: versions of rust-native available: 1.60.0
> > WARNING: preferred version 1.59% of rust-llvm-native not available (for 
> > item rust-llvm-native)
> > WARNING: versions of rust-llvm-native available: 1.60.0
> >
>
> When I was cherry-picking this back for thud (don't ask) it looked
> like the the version bump in tcmode-default.inc was missing.
>
> --
> Alex Kiernan

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#164873): 
https://lists.openembedded.org/g/openembedded-core/message/164873
Mute This Topic: https://lists.openembedded.org/mt/90681334/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH v2] rust: update 1.59.0 -> 1.60.0

2022-04-26 Thread Pgowda
Rust has been upgraded to rust-1.60.0 that uses LLVM 14.

Please refer the following link for more detailed features.
https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html
https://github.com/rust-lang/rust/blob/master/RELEASES.md

Signed-off-by: pgowda 
---
 meta/conf/distro/include/tcmode-default.inc   |  2 +-
 ...59.0.bb => cargo-cross-canadian_1.60.0.bb} |  0
 .../{cargo_1.59.0.bb => cargo_1.60.0.bb}  |  0
 ...syscalls-to-musl-riscv64-definitions.patch |  6 ++---
 ...checksums-for-modified-vendored-libc.patch | 12 -
 ...ibstd-rs_1.59.0.bb => libstd-rs_1.60.0.bb} |  0
 59.0.bb => rust-cross-canadian_1.60.0.bb} |  0
 ...t-cross_1.59.0.bb => rust-cross_1.60.0.bb} |  0
 ...ssdk_1.59.0.bb => rust-crosssdk_1.60.0.bb} |  0
 meta/recipes-devtools/rust/rust-llvm.inc  |  3 ++-
 .../0003-llvm-fix-include-benchmarks.patch| 25 +++
 ...ust-llvm_1.59.0.bb => rust-llvm_1.60.0.bb} |  0
 meta/recipes-devtools/rust/rust-snapshot.inc  | 25 +++
 meta/recipes-devtools/rust/rust-source.inc|  2 +-
 ...bb => rust-tools-cross-canadian_1.60.0.bb} |  0
 .../rust/{rust_1.59.0.bb => rust_1.60.0.bb}   |  0
 16 files changed, 51 insertions(+), 24 deletions(-)
 rename meta/recipes-devtools/cargo/{cargo-cross-canadian_1.59.0.bb => 
cargo-cross-canadian_1.60.0.bb} (100%)
 rename meta/recipes-devtools/cargo/{cargo_1.59.0.bb => cargo_1.60.0.bb} (100%)
 rename meta/recipes-devtools/rust/{libstd-rs_1.59.0.bb => libstd-rs_1.60.0.bb} 
(100%)
 rename meta/recipes-devtools/rust/{rust-cross-canadian_1.59.0.bb => 
rust-cross-canadian_1.60.0.bb} (100%)
 rename meta/recipes-devtools/rust/{rust-cross_1.59.0.bb => 
rust-cross_1.60.0.bb} (100%)
 rename meta/recipes-devtools/rust/{rust-crosssdk_1.59.0.bb => 
rust-crosssdk_1.60.0.bb} (100%)
 create mode 100644 
meta/recipes-devtools/rust/rust-llvm/0003-llvm-fix-include-benchmarks.patch
 rename meta/recipes-devtools/rust/{rust-llvm_1.59.0.bb => rust-llvm_1.60.0.bb} 
(100%)
 rename meta/recipes-devtools/rust/{rust-tools-cross-canadian_1.59.0.bb => 
rust-tools-cross-canadian_1.60.0.bb} (100%)
 rename meta/recipes-devtools/rust/{rust_1.59.0.bb => rust_1.60.0.bb} (100%)

diff --git a/meta/conf/distro/include/tcmode-default.inc 
b/meta/conf/distro/include/tcmode-default.inc
index 2200af5b60..941ca060bf 100644
--- a/meta/conf/distro/include/tcmode-default.inc
+++ b/meta/conf/distro/include/tcmode-default.inc
@@ -27,7 +27,7 @@ GOVERSION ?= "1.18%"
 # This can not use wildcards like 8.0.% since it is also used in mesa to denote
 # llvm version being used, so always bump it with llvm recipe version bump
 LLVMVERSION ?= "14.0.0"
-RUSTVERSION ?= "1.59%"
+RUSTVERSION ?= "1.60%"
 
 PREFERRED_VERSION_gcc ?= "${GCCVERSION}"
 PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "${GCCVERSION}"
diff --git a/meta/recipes-devtools/cargo/cargo-cross-canadian_1.59.0.bb 
b/meta/recipes-devtools/cargo/cargo-cross-canadian_1.60.0.bb
similarity index 100%
rename from meta/recipes-devtools/cargo/cargo-cross-canadian_1.59.0.bb
rename to meta/recipes-devtools/cargo/cargo-cross-canadian_1.60.0.bb
diff --git a/meta/recipes-devtools/cargo/cargo_1.59.0.bb 
b/meta/recipes-devtools/cargo/cargo_1.60.0.bb
similarity index 100%
rename from meta/recipes-devtools/cargo/cargo_1.59.0.bb
rename to meta/recipes-devtools/cargo/cargo_1.60.0.bb
diff --git 
a/meta/recipes-devtools/rust/libstd-rs/0001-Add-400-series-syscalls-to-musl-riscv64-definitions.patch
 
b/meta/recipes-devtools/rust/libstd-rs/0001-Add-400-series-syscalls-to-musl-riscv64-definitions.patch
index 5b330b85a6..12f529b07b 100644
--- 
a/meta/recipes-devtools/rust/libstd-rs/0001-Add-400-series-syscalls-to-musl-riscv64-definitions.patch
+++ 
b/meta/recipes-devtools/rust/libstd-rs/0001-Add-400-series-syscalls-to-musl-riscv64-definitions.patch
@@ -9,10 +9,10 @@ Signed-off-by: Khem Raj 
  .../linux_like/linux/musl/b64/riscv64/mod.rs  | 19 +++
  1 file changed, 19 insertions(+)
 
-diff --git 
a/vendor/libc-0.2.108/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs 
b/vendor/libc-0.2.108/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
+diff --git 
a/vendor/libc-0.2.112/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs 
b/vendor/libc-0.2.112/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
 index 6b17621c7..2036583d5 100644
 a/vendor/libc-0.2.108/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
-+++ b/vendor/libc-0.2.108/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
+--- a/vendor/libc-0.2.112/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
 b/vendor/libc-0.2.112/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
 @@ -465,6 +465,25 @@ pub const SYS_pkey_mprotect: ::c_long = 288;
  pub const SYS_pkey_alloc: ::c_long = 289;
  pub const SYS_pkey_free: ::c_long = 290;
diff --git 
a/meta/recipes-devtools/rust/libstd-rs/0001-Update-checksums-for-modified-vendored-libc.patch
 
b/meta/recipes-devtools/rus

[OE-core] [PATCH] rust: update 1.59.0 -> 1.60.0

2022-04-25 Thread Pgowda
Rust has been upgraded to rust-1.60.0 that uses LLVM 14.

Please refer the following link for more detailed features.
https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html
https://github.com/rust-lang/rust/blob/master/RELEASES.md

Signed-off-by: pgowda 
---
 ...59.0.bb => cargo-cross-canadian_1.60.0.bb} |  0
 .../{cargo_1.59.0.bb => cargo_1.60.0.bb}  |  0
 ...syscalls-to-musl-riscv64-definitions.patch |  6 ++---
 ...checksums-for-modified-vendored-libc.patch | 12 -
 ...ibstd-rs_1.59.0.bb => libstd-rs_1.60.0.bb} |  0
 59.0.bb => rust-cross-canadian_1.60.0.bb} |  0
 ...t-cross_1.59.0.bb => rust-cross_1.60.0.bb} |  0
 ...ssdk_1.59.0.bb => rust-crosssdk_1.60.0.bb} |  0
 meta/recipes-devtools/rust/rust-llvm.inc  |  3 ++-
 .../0003-llvm-fix-include-benchmarks.patch| 25 +++
 ...ust-llvm_1.59.0.bb => rust-llvm_1.60.0.bb} |  0
 meta/recipes-devtools/rust/rust-snapshot.inc  | 22 
 meta/recipes-devtools/rust/rust-source.inc|  2 +-
 ...bb => rust-tools-cross-canadian_1.60.0.bb} |  0
 .../rust/{rust_1.59.0.bb => rust_1.60.0.bb}   |  0
 15 files changed, 47 insertions(+), 23 deletions(-)
 rename meta/recipes-devtools/cargo/{cargo-cross-canadian_1.59.0.bb => 
cargo-cross-canadian_1.60.0.bb} (100%)
 rename meta/recipes-devtools/cargo/{cargo_1.59.0.bb => cargo_1.60.0.bb} (100%)
 rename meta/recipes-devtools/rust/{libstd-rs_1.59.0.bb => libstd-rs_1.60.0.bb} 
(100%)
 rename meta/recipes-devtools/rust/{rust-cross-canadian_1.59.0.bb => 
rust-cross-canadian_1.60.0.bb} (100%)
 rename meta/recipes-devtools/rust/{rust-cross_1.59.0.bb => 
rust-cross_1.60.0.bb} (100%)
 rename meta/recipes-devtools/rust/{rust-crosssdk_1.59.0.bb => 
rust-crosssdk_1.60.0.bb} (100%)
 create mode 100644 
meta/recipes-devtools/rust/rust-llvm/0003-llvm-fix-include-benchmarks.patch
 rename meta/recipes-devtools/rust/{rust-llvm_1.59.0.bb => rust-llvm_1.60.0.bb} 
(100%)
 rename meta/recipes-devtools/rust/{rust-tools-cross-canadian_1.59.0.bb => 
rust-tools-cross-canadian_1.60.0.bb} (100%)
 rename meta/recipes-devtools/rust/{rust_1.59.0.bb => rust_1.60.0.bb} (100%)

diff --git a/meta/recipes-devtools/cargo/cargo-cross-canadian_1.59.0.bb 
b/meta/recipes-devtools/cargo/cargo-cross-canadian_1.60.0.bb
similarity index 100%
rename from meta/recipes-devtools/cargo/cargo-cross-canadian_1.59.0.bb
rename to meta/recipes-devtools/cargo/cargo-cross-canadian_1.60.0.bb
diff --git a/meta/recipes-devtools/cargo/cargo_1.59.0.bb 
b/meta/recipes-devtools/cargo/cargo_1.60.0.bb
similarity index 100%
rename from meta/recipes-devtools/cargo/cargo_1.59.0.bb
rename to meta/recipes-devtools/cargo/cargo_1.60.0.bb
diff --git 
a/meta/recipes-devtools/rust/libstd-rs/0001-Add-400-series-syscalls-to-musl-riscv64-definitions.patch
 
b/meta/recipes-devtools/rust/libstd-rs/0001-Add-400-series-syscalls-to-musl-riscv64-definitions.patch
index 5b330b85a6..12f529b07b 100644
--- 
a/meta/recipes-devtools/rust/libstd-rs/0001-Add-400-series-syscalls-to-musl-riscv64-definitions.patch
+++ 
b/meta/recipes-devtools/rust/libstd-rs/0001-Add-400-series-syscalls-to-musl-riscv64-definitions.patch
@@ -9,10 +9,10 @@ Signed-off-by: Khem Raj 
  .../linux_like/linux/musl/b64/riscv64/mod.rs  | 19 +++
  1 file changed, 19 insertions(+)
 
-diff --git 
a/vendor/libc-0.2.108/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs 
b/vendor/libc-0.2.108/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
+diff --git 
a/vendor/libc-0.2.112/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs 
b/vendor/libc-0.2.112/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
 index 6b17621c7..2036583d5 100644
 a/vendor/libc-0.2.108/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
-+++ b/vendor/libc-0.2.108/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
+--- a/vendor/libc-0.2.112/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
 b/vendor/libc-0.2.112/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
 @@ -465,6 +465,25 @@ pub const SYS_pkey_mprotect: ::c_long = 288;
  pub const SYS_pkey_alloc: ::c_long = 289;
  pub const SYS_pkey_free: ::c_long = 290;
diff --git 
a/meta/recipes-devtools/rust/libstd-rs/0001-Update-checksums-for-modified-vendored-libc.patch
 
b/meta/recipes-devtools/rust/libstd-rs/0001-Update-checksums-for-modified-vendored-libc.patch
index 33071ccdf1..1569a36581 100644
--- 
a/meta/recipes-devtools/rust/libstd-rs/0001-Update-checksums-for-modified-vendored-libc.patch
+++ 
b/meta/recipes-devtools/rust/libstd-rs/0001-Update-checksums-for-modified-vendored-libc.patch
@@ -12,12 +12,10 @@ Signed-off-by: Khem Raj 
 
 diff --git a/vendor/libc-0.2.108/.cargo-checksum.json 
b/vendor/libc-0.2.108/.cargo-checksum.json
 index 6b976e48a..a6906588e 100644
 a/vendor/libc-0.2.108/.cargo-checksum.json
-+++ b/vendor/libc-0.2.108/.cargo-checksum.json
-@@ -1 +1 @@
--{"files":{"CONTRIBUTING.md":"752eea5a703d11b485c6b5f195f51bd2c79aa5159b619ce09555c779e1fb586b","Cargo

Re: [OE-core] [hardknott][PATCH] glibc: upgrade glibc-2.33 to latest version

2022-04-20 Thread Pgowda
Hi Randy,

Sorry for the misunderstanding from my side.
I am going through the list again and it seems like the required patch
was not part of the Hardknott.
It was rather a part of the Master branch.

@Mittal, Anuj , @Randy MacLeod
Please let me know if I can upgrade the GLIBC Hardknott to the latest
version of glibc-2.33?

Thanks,
Pgowda



On Wed, Apr 20, 2022 at 9:11 PM Randy MacLeod
 wrote:
>
> On 2022-04-20 11:30, pgowda cve wrote:
> > Hi Randy,
> >
> > The GLIBC was already updated to the latest version on top of [BZ #28353].
> >
> > Please find the commit which had [BZ #28353] patch along with others.
> > https://git.openembedded.org/openembedded-core/commit/?h=hardknott=d5bdff460cc8b0f38177f1f38d625eeda729b459
> >
> > Thanks,
> > Pgowda
>
>
> Ah good. I'm not sue why my repo seemed to be behind.
>
> There are still 23 commits that could be picked up, several of which
> are marked as bug fixes but since we have the patch that was my main
> concern, I'll leave it up to Anuj to see if he wants the update for 3.3.6.
>
> Naveen,
>
> We'll need that update regardless for WR Linux so please test it.
>
>
> Thanks,
>
> ../Randy
>
>
> git log --oneline 3e2a15c666e40e5ee740e5079c56d83469280323...
> 5eddc29c92 (HEAD -> release/2.33/master, origin/release/2.33/master)
> S390: Add new s390 platform z16.
> c78ad8eb47 hppa: Use END instead of PSEUDO_END in swapcontext.S
> 32f74d4f14 hppa: Implement swapcontext in assembler (bug 28960)
> baa74e8589 hppa: Fix warnings from _dl_lookup_address
> 6d9525b620 nptl: Fix cleanups for stack grows up [BZ# 28899]
> 8f56ecc19b hppa: Revise gettext trampoline design
> ea94346dbe hppa: Fix swapcontext
> aeab7584c2 Fix elf/tst-audit2 on hppa
> f341ab08fc NEWS: Add a bug fix entry for BZ #28896
> 24e95955aa x86: Fix TEST_NAME to make it a string in tst-strncmp-rtm.c
> 6f8e99b567 x86: Test wcscmp RTM in the wcsncmp overflow case [BZ #28896]
> a3cd0fe201 x86: Fallback {str|wcs}cmp RTM in the ncmp overflow case [BZ
> #28896]
> cb922428dc string: Add a testcase for wcsncmp with SIZE_MAX [BZ #28755]
> 211cce703d : Correct x86_cpu_TBM
> 55446dd8a2 socket: Do not use AF_NETLINK in __opensock
> 9495d729f6 hurd if_index: Explicitly use AF_INET for if index discovery
> 78d25827ae Linux: Simplify __opensock and fix race condition [BZ #28353]
> 1956ad4930 x86-64: Test strlen and wcslen with 0 in the RSI register [BZ
> #28064]
> 260360e89b x86: Remove wcsnlen-sse4_1 from wcslen ifunc-impl-list [BZ
> #28064]
> 1b8f2456b9 x86: Use CHECK_FEATURE_PRESENT to check HLE [BZ #27398]
> 54fdfa2b33 x86: Black list more Intel CPUs for TSX [BZ #27398]
> 0a5f5e2dc1 x86: Check RTM_ALWAYS_ABORT for RTM [BZ #28033]
> 5cb6edb6cd x86: Copy IBT and SHSTK usable only if CET is enabled
>
> $ git log --oneline 3e2a15c666e40e5ee740e5079c56d83469280323... | wc -l
> 23
>
>
>
> >
> > On Wed, Apr 20, 2022 at 8:05 PM Randy MacLeod
> >  wrote:
> >> On 2022-01-30 01:20, Pgowda wrote:
> >>> glibc-2.33 has been upgraded to latest version that includes many CVE and
> >>> other bug fixes. Ran the regressions and results are better.
> >>>
> >>> Signed-off-by: pgowda 
> >>> ---
> >>>meta/recipes-core/glibc/glibc-version.inc | 2 +-
> >>>1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/meta/recipes-core/glibc/glibc-version.inc 
> >>> b/meta/recipes-core/glibc/glibc-version.inc
> >>> index 63241ee951..e1eefdee49 100644
> >>> --- a/meta/recipes-core/glibc/glibc-version.inc
> >>> +++ b/meta/recipes-core/glibc/glibc-version.inc
> >>> @@ -1,6 +1,6 @@
> >>>SRCBRANCH ?= "release/2.33/master"
> >>>PV = "2.33"
> >>> -SRCREV_glibc ?= "55b99e9ed07688019609bd4dcd17d3ebf4572948"
> >>> +SRCREV_glibc ?= "3e2a15c666e40e5ee740e5079c56d83469280323"
> >>>SRCREV_localedef ?= "bd644c9e6f3e20c5504da1488448173c69c56c28"
> >>>
> >>>GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
> >>>
> >>> 
> >>>
> >> Naveen, Anuj, Richard,
> >>
> >> Is there time to do this one last time for hardknott  to pick up these
> >> 67 bug fixes in glibc?
> >>
> >> We're particularily interested in:
> >>
> >> 78d25827ae   2021-09-28   Linux: Simplify __opensock and fix race
> >> condition [BZ #28353]
> >>
> >> but there seem to be many good bug fixes and optimizations in the list.
> >>
> >> Naveen, please try it and test ASAP.

Re: [OE-core] [hardknott][PATCH] glibc: upgrade glibc-2.33 to latest version

2022-04-20 Thread Pgowda
Hi Randy,

The GLIBC was already updated to the latest version on top of [BZ #28353].

Please find the commit which had [BZ #28353] patch along with others.
https://git.openembedded.org/openembedded-core/commit/?h=hardknott=d5bdff460cc8b0f38177f1f38d625eeda729b459

Thanks,
Pgowda

On Wed, Apr 20, 2022 at 8:05 PM Randy MacLeod
 wrote:
>
> On 2022-01-30 01:20, Pgowda wrote:
> > glibc-2.33 has been upgraded to latest version that includes many CVE and
> > other bug fixes. Ran the regressions and results are better.
> >
> > Signed-off-by: pgowda 
> > ---
> >   meta/recipes-core/glibc/glibc-version.inc | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-core/glibc/glibc-version.inc 
> > b/meta/recipes-core/glibc/glibc-version.inc
> > index 63241ee951..e1eefdee49 100644
> > --- a/meta/recipes-core/glibc/glibc-version.inc
> > +++ b/meta/recipes-core/glibc/glibc-version.inc
> > @@ -1,6 +1,6 @@
> >   SRCBRANCH ?= "release/2.33/master"
> >   PV = "2.33"
> > -SRCREV_glibc ?= "55b99e9ed07688019609bd4dcd17d3ebf4572948"
> > +SRCREV_glibc ?= "3e2a15c666e40e5ee740e5079c56d83469280323"
> >   SRCREV_localedef ?= "bd644c9e6f3e20c5504da1488448173c69c56c28"
> >
> >   GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
> >
> > 
> >
>
> Naveen, Anuj, Richard,
>
> Is there time to do this one last time for hardknott  to pick up these
> 67 bug fixes in glibc?
>
> We're particularily interested in:
>
> 78d25827ae   2021-09-28   Linux: Simplify __opensock and fix race
> condition [BZ #28353]
>
> but there seem to be many good bug fixes and optimizations in the list.
>
> Naveen, please try it and test ASAP.
>
> ../Randy
>
> 5eddc29c92   2022-04-13   (HEAD -> release/2.33/master,
> origin/release/2.33/master) S390: Add new s390 platform z16.
> c78ad8eb47   2022-03-15   hppa: Use END instead of PSEUDO_END in
> swapcontext.S
> 32f74d4f14   2022-03-15   hppa: Implement swapcontext in assembler (bug
> 28960)
> baa74e8589   2022-03-06   hppa: Fix warnings from _dl_lookup_address
> 6d9525b620   2022-02-28   nptl: Fix cleanups for stack grows up [BZ# 28899]
> 8f56ecc19b   2022-02-22   hppa: Revise gettext trampoline design
> ea94346dbe   2022-02-18   hppa: Fix swapcontext
> aeab7584c2   2022-03-06   Fix elf/tst-audit2 on hppa
> f341ab08fc   2022-02-18   NEWS: Add a bug fix entry for BZ #28896
> 24e95955aa   2022-02-18   x86: Fix TEST_NAME to make it a string in
> tst-strncmp-rtm.c
> 6f8e99b567   2022-02-18   x86: Test wcscmp RTM in the wcsncmp overflow
> case [BZ #28896]
> a3cd0fe201   2022-02-15   x86: Fallback {str|wcs}cmp RTM in the ncmp
> overflow case [BZ #28896]
> cb922428dc   2022-02-17   string: Add a testcase for wcsncmp with
> SIZE_MAX [BZ #28755]
> 211cce703d   2021-02-02   : Correct x86_cpu_TBM
> 55446dd8a2   2021-11-22   socket: Do not use AF_NETLINK in __opensock
> 9495d729f6   2021-10-18   hurd if_index: Explicitly use AF_INET for if
> index discovery
> 78d25827ae   2021-09-28   Linux: Simplify __opensock and fix race
> condition [BZ #28353]
> 1956ad4930   2021-07-08   x86-64: Test strlen and wcslen with 0 in the
> RSI register [BZ #28064]
> 260360e89b   2021-07-08   x86: Remove wcsnlen-sse4_1 from wcslen
> ifunc-impl-list [BZ #28064]
> 1b8f2456b9   2022-01-24   x86: Use CHECK_FEATURE_PRESENT to check HLE
> [BZ #27398]
> 54fdfa2b33   2022-01-14   x86: Black list more Intel CPUs for TSX [BZ
> #27398]
> 0a5f5e2dc1   2021-06-30   x86: Check RTM_ALWAYS_ABORT for RTM [BZ #28033]
> 5cb6edb6cd   2021-06-23   x86: Copy IBT and SHSTK usable only if CET is
> enabled
> 3e2a15c666   2021-04-19   x86-64: Require BMI2 for __strlen_evex and
> __strnlen_evex
> 25941de34e   2022-01-27   NEWS: Add a bug fix entry for BZ #27974
> 2b00ee820a   2021-06-09   String: Add overflow tests for strnlen,
> memchr, and strncat [BZ #27974]
> 8a3a0177c7   2021-04-19   x86: Optimize strlen-evex.S
> cef3bffade   2021-06-23   x86: Fix overflow bug in wcsnlen-sse4_1 and
> wcsnlen-avx2 [BZ #27974]
> 3ac5a7fe8b   2021-06-23   x86-64: Add wcslen optimize for sse4.1
> 5697e2dda8   2021-06-22   x86-64: Move strlen.S to multiarch/strlen-vec.S
> 3dea108f60   2021-05-07   x86-64: Fix an unknown vector operation in
> memchr-evex.S
> 355afae940   2021-05-03   x86: Optimize memchr-evex.S
> b72b89705e   2021-04-19   x86: Optimize strlen-avx2.S
> 453ed0a0f2   2021-06-09   x86: Fix overflow bug with wmemchr-sse2 and
> wmemchr-avx2 [BZ #27974]
> e09c377806   2021-05-03   x86: Optimize memchr-avx2.S
> 902af2f5ee   2022-01-27   NEWS: Add a bug fix entry for BZ #27457
> 31dd3e3cb3   2021-04-01   x86-64: Fix ifd

[OE-core] [PATCH v3] glibc: ptest: Fix glibc-tests package issue

2022-04-19 Thread Pgowda
Run glibc-tests only when its enabled in the DISTRO_FEATURES.

Signed-off-by: pgowda 
---
 meta/recipes-core/glibc/glibc-tests_2.35.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/glibc/glibc-tests_2.35.bb 
b/meta/recipes-core/glibc/glibc-tests_2.35.bb
index 8c7ecf89ba..414f8660de 100644
--- a/meta/recipes-core/glibc/glibc-tests_2.35.bb
+++ b/meta/recipes-core/glibc/glibc-tests_2.35.bb
@@ -1,7 +1,8 @@
 require glibc_${PV}.bb
 require glibc-tests.inc
 
-inherit ptest
+inherit ptest features_check
+REQUIRED_DISTRO_FEATURES = "ptest"
 
 SRC_URI:append = " \
file://run-ptest \
-- 
2.35.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#164615): 
https://lists.openembedded.org/g/openembedded-core/message/164615
Mute This Topic: https://lists.openembedded.org/mt/90556535/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [PATCH] [PATCH] glibc: ptest: Fix glibc-tests package issue

2022-04-16 Thread Pgowda
Hi Richard,

Thanks very much for mentioning the correct way of fixing the issue.

The modified patch is posted as:-
https://lists.openembedded.org/g/openembedded-core/message/164524

Please let me know whether it's the way you mentioned it.
Or Can you please point me to other instances where it's been implemented.

Thanks & Regards
Pgowda

On Fri, Apr 15, 2022 at 6:32 PM Richard Purdie
 wrote:
>
> On Fri, 2022-04-15 at 04:11 -0700, pgowda wrote:
> > The current default DISTRO_FEATURES does not support ptest.
> > Hence, the following error is generated during "bitbake glibc-tests".
> > ERROR: glibc-tests-2.35-r0 do_package: QA Issue: glibc-tests:
> > Files/directories were installed but not shipped in any package
> > The issue is not reproduced with "DISTRO = Yocto" as DISTRO_FEATURES
> > in Yocto supports ptest. However, when we run "glibc-tests" using
> > Open-embedded master sources; it generates the error as default
> > DISTRO is used.
> >
> > Signed-off-by: pgowda 
> > ---
> >  meta/conf/distro/include/default-distrovars.inc | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
>
> This isn't quite the right approach, we should probably skip parsing of glibc-
> tests if ptests aren't in DISTRO_FEATURES?
>
> Cheers,
>
> Richard
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#164525): 
https://lists.openembedded.org/g/openembedded-core/message/164525
Mute This Topic: https://lists.openembedded.org/mt/90484254/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH v2] glibc: ptest: Fix glibc-tests package issue

2022-04-16 Thread Pgowda
The current default DISTRO_FEATURES does not support ptest.
Hence, the following error is generated during "bitbake glibc-tests".
ERROR: glibc-tests-2.35-r0 do_package: QA Issue: glibc-tests:
Files/directories were installed but not shipped in any package
The issue is not reproduced with "DISTRO = Yocto" as DISTRO_FEATURES
in Yocto supports ptest. However, when we run "glibc-tests" using
Open-embedded master sources; it generates the error as default
DISTRO is used.

Signed-off-by: pgowda 
---
 meta/recipes-core/glibc/glibc-tests_2.35.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-core/glibc/glibc-tests_2.35.bb 
b/meta/recipes-core/glibc/glibc-tests_2.35.bb
index 8c7ecf89ba..fc6eee91ec 100644
--- a/meta/recipes-core/glibc/glibc-tests_2.35.bb
+++ b/meta/recipes-core/glibc/glibc-tests_2.35.bb
@@ -29,6 +29,8 @@ RRECOMMENDS:${PN} = ""
 RDEPENDS:${PN} = " glibc sed"
 DEPENDS:append = " sed"
 
+DISTRO_FEATURES:append = " ptest"
+
 # Just build tests for target - do not run them
 do_check:append () {
oe_runmake -i check run-built-tests=no
-- 
2.35.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#164524): 
https://lists.openembedded.org/g/openembedded-core/message/164524
Mute This Topic: https://lists.openembedded.org/mt/90502323/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] [PATCH] glibc: ptest: Fix glibc-tests package issue

2022-04-15 Thread Pgowda
The current default DISTRO_FEATURES does not support ptest.
Hence, the following error is generated during "bitbake glibc-tests".
ERROR: glibc-tests-2.35-r0 do_package: QA Issue: glibc-tests:
Files/directories were installed but not shipped in any package
The issue is not reproduced with "DISTRO = Yocto" as DISTRO_FEATURES
in Yocto supports ptest. However, when we run "glibc-tests" using
Open-embedded master sources; it generates the error as default
DISTRO is used.

Signed-off-by: pgowda 
---
 meta/conf/distro/include/default-distrovars.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/conf/distro/include/default-distrovars.inc 
b/meta/conf/distro/include/default-distrovars.inc
index 3edba1b6d0..d6060ad3ba 100644
--- a/meta/conf/distro/include/default-distrovars.inc
+++ b/meta/conf/distro/include/default-distrovars.inc
@@ -16,7 +16,7 @@ DISTRO_FEATURES_DEFAULT:remove:riscv32 = "seccomp"
 # seccomp is not yet ported to ARC
 DISTRO_FEATURES_DEFAULT:remove:arc = "seccomp"
 
-DISTRO_FEATURES_DEFAULT ?= "acl alsa argp bluetooth debuginfod ext2 ipv4 ipv6 
largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11 vfat 
seccomp"
+DISTRO_FEATURES_DEFAULT ?= "acl alsa argp bluetooth debuginfod ext2 ipv4 ipv6 
largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11 vfat 
seccomp ptest"
 DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT}"
 IMAGE_FEATURES ?= ""
 
-- 
2.35.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#164422): 
https://lists.openembedded.org/g/openembedded-core/message/164422
Mute This Topic: https://lists.openembedded.org/mt/90484254/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] Binutils: Avoid Race condition in as.info

2022-03-02 Thread Pgowda
The race condition in binutils/gas folder was introduced with the
following patch. The patch avoids recursive make into the doc folder.
It would speed up the build process slightly. However, the as.info
is installed twice which resulted in the race condition sometimes.
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=bde299e063de090bf36c1fe51874d1e9f4d94c3c

On debugging the code, it was found that the issue was related to
install-data-local. On further analysis, there is already a patch in
binutils that removes install-data-local.
On applying the patch as.info is installed once as expected and there’s
no possibility of any race condition.
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=9a84a44d5df4618dd616137fa755bd71b7eacc5f

Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=9a84a44d5df4618dd616137fa755bd71b7eacc5f]

[YOCTO #14725]

Signed-off-by: pgowda 
---
 .../binutils/binutils-2.38.inc|  1 +
 .../0013-Avoid-as-info-race-condition.patch   | 75 +++
 2 files changed, 76 insertions(+)
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0013-Avoid-as-info-race-condition.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.38.inc 
b/meta/recipes-devtools/binutils/binutils-2.38.inc
index 6d4415048a..4ce74f94bf 100644
--- a/meta/recipes-devtools/binutils/binutils-2.38.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.38.inc
@@ -31,5 +31,6 @@ SRC_URI = "\
  file://0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \
  file://0011-sync-with-OE-libtool-changes.patch \
  file://0012-Check-for-clang-before-checking-gcc-version.patch \
+ file://0013-Avoid-as-info-race-condition.patch \
 "
 S  = "${WORKDIR}/git"
diff --git 
a/meta/recipes-devtools/binutils/binutils/0013-Avoid-as-info-race-condition.patch
 
b/meta/recipes-devtools/binutils/binutils/0013-Avoid-as-info-race-condition.patch
new file mode 100644
index 00..8edc12d5a9
--- /dev/null
+++ 
b/meta/recipes-devtools/binutils/binutils/0013-Avoid-as-info-race-condition.patch
@@ -0,0 +1,75 @@
+From 9a84a44d5df4618dd616137fa755bd71b7eacc5f Mon Sep 17 00:00:00 2001
+From: Mike Frysinger 
+Date: Sun, 23 Jan 2022 12:44:24 -0500
+Subject: [PATCH] gas: drop old cygnus install hack
+
+This was needed when gas was using the automake cygnus option, but
+this was removed years ago by Simon in d0ac1c44885daf68f631befa37e
+("Bump to autoconf 2.69 and automake 1.15.1").  So delete it here.
+The info pages are already & still installed by default w/out it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj 
+---
+ gas/Makefile.in  | 14 +-
+ gas/doc/local.mk |  4 
+ 2 files changed, 5 insertions(+), 13 deletions(-)
+
+diff --git a/gas/Makefile.in b/gas/Makefile.in
+index 8f0a56fd8d6..67dac53f68c 100644
+--- a/gas/Makefile.in
 b/gas/Makefile.in
+@@ -1854,7 +1854,7 @@ info: info-recursive
+ 
+ info-am: $(INFO_DEPS) info-local
+ 
+-install-data-am: install-data-local install-info-am install-man
++install-data-am: install-info-am install-man
+ 
+ install-dvi: install-dvi-recursive
+ 
+@@ -2008,10 +2008,10 @@ uninstall-man: uninstall-man1
+   distclean-DEJAGNU distclean-compile distclean-generic \
+   distclean-hdr distclean-libtool distclean-tags dvi dvi-am html \
+   html-am html-local info info-am info-local install install-am \
+-  install-data install-data-am install-data-local install-dvi \
+-  install-dvi-am install-exec install-exec-am install-exec-local \
+-  install-html install-html-am install-info install-info-am \
+-  install-man install-man1 install-pdf install-pdf-am install-ps \
++  install-data install-data-am install-dvi install-dvi-am \
++  install-exec install-exec-am install-exec-local install-html \
++  install-html-am install-info install-info-am install-man \
++  install-man1 install-pdf install-pdf-am install-ps \
+   install-ps-am install-strip installcheck installcheck-am \
+   installdirs installdirs-am maintainer-clean \
+   maintainer-clean-aminfo maintainer-clean-generic mostlyclean \
+@@ -2211,10 +2211,6 @@ doc/asconfig.texi: doc/$(CONFIG).texi 
doc/$(am__dirstamp)
+   $(AM_V_GEN)cp $(srcdir)/doc/$(CONFIG).texi doc/asconfig.texi
+   $(AM_V_at)chmod u+w doc/asconfig.texi
+ 
+-# We want install to imply install-info as per GNU standards, despite the
+-# cygnus option.
+-install-data-local: install-info
+-
+ # Maintenance
+ 
+ # We need it for the taz target in ../Makefile.in.
+diff --git a/gas/doc/local.mk b/gas/doc/local.mk
+index c2de441257c..ac205cf08a2 100644
+--- a/gas/doc/local.mk
 b/gas/doc/local.mk
+@@ -101,10 +101,6 @@ CPU_DOCS = \
+   %D%/c-z80.texi \
+   %D%/c-z8k.texi
+ 
+-# We want install to imply install-info as per GNU standards, despite the
+-# cygnus option.
+-install-data-local: install-info
+-
+ # This one isn't ready for prime time yet.  Not even a lit

[OE-core] [PATCH v4] Rust Oe-Selftest implementation

2022-02-24 Thread Pgowda
The patch implements Rust testing framework similar to other selftest,
specifically the gcc selftest in OE. It uses the client and server
based method to test the binaries for cross-target on the image.
The test framework is a wrapper around the Rust build system as ./x.py test.
It tests many functionalities of Rust distribution like tools,
documentation, libraries, packages, tools, Cargo, Crater etc.
Please refer the following link for detailed description of Rust
testing:-
https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests

To support the rust tests in oe-core, the following functions were
added:-
setup_cargo_environment(): Build bootstrap and some early stage tools.
do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
do_configure(): To generate config.toml
do_compile(): To build "remote-test-server" for qemu target image.

Approximate Number of Tests Run in the Rust Testsuite :- 18000
Approximate Number of Tests that FAIL in bitbake environment :- 100-150
Normally majority of the testcases are present in major folder "test/"
It contributes to more than 80% of the testcases present in Rust test
framework. These tests pass as expected on any Rust versions without
much fuss. The tests that fail are of less important and contribute to
less than 2% of the total testcases. These minor tests are observed to
work on some versions and fail on others. They have to be added, ignored
or excluded for different versions as per the behavior.
These tests have been ignored or excluded in the Rust selftest environment
to generate success of completing the testsuite.

With Rust-1.54.0 only 4 test modules were excluded (rustc-main, tiny).
However with Rustc-1.58.1 the following issue required excluding many more
test modules.
These tests can be included in Oe-selftest after fixing the issue.
===
"build-st/tmp/work/core2-64-poky-linux/rust-testsuite/1.58.1-r0/
rustc-1.58.1-src/build/bootstrap/debug/rustc -vV` (exit status: 101)
--- stderr
thread 'main' panicked at '
kind: NotFound, message: "No such file or directory" }',
src/bootstrap/bin/rustc.rs:175:37
===
It mentions that the rustc binary is not present inspite of it being present.

There are many tests in Rust which just checks the documents, formatting,
documentation etc. These tests can be ignored and not run as some FAILS
most of the times.

These tests work in parallel mode even in the skipped test mode as expected.
Although the patch to disable tests is large, it is very simple in that it
only disables tests. When updating to a newer version of Rust, the patch can
usually be rebased in under a day.

Signed-off-by: pgowda 
Signed-off-by: Vinay Kumar 
---
 meta/lib/oeqa/selftest/cases/rust.py  |  57 +
 meta/recipes-devtools/rust/rust-testsuite.inc | 163 +++
 .../rust-testsuite/rust-oe-selftest.patch | 995 ++
 .../rust/rust-testsuite_1.58.1.bb |   3 +
 4 files changed, 1218 insertions(+)
 create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite.inc
 create mode 100644 
meta/recipes-devtools/rust/rust-testsuite/rust-oe-selftest.patch
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite_1.58.1.bb

diff --git a/meta/lib/oeqa/selftest/cases/rust.py 
b/meta/lib/oeqa/selftest/cases/rust.py
new file mode 100644
index 00..1379b09af1
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: MIT
+import os
+import subprocess
+from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, 
runqemu, Command
+from oeqa.utils.sshcontrol import SSHControl
+
+# Total time taken for testing is of about 2hr 20min, with PARALLEL_MAKE set 
to 40 number of jobs.
+class RustSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
+
+   def run_check_emulated(self, *args, **kwargs):
+   # build remote-test-server before image build
+   recipe = "rust-testsuite"
+   bitbake("{} -c compile".format(recipe))
+   builddir = get_bb_var("B", "rust-testsuite")
+   # build core-image-minimal with required packages
+   default_installed_packages = ["libgcc", "libstdc++", 
"libatomic", "libgomp"]
+   features = []
+   features.append('IMAGE_FEATURES += "ssh-server-openssh"')
+   features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" 
".join(default_installed_packages)))
+   self.write_config("\n".join(features))
+   bitbake("core-image

[OE-core] [PATCH v3] Rust Oe-Selftest implementation

2022-02-23 Thread Pgowda
The patch implements Oe-selftest framework for Rust test.
Some of the functions are as follows:-
setup_cargo_environment(): Build bootstrap and some early stage tools.
do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
do_configure(): To generate config.toml
do_compile(): To build "remote-test-server" for qemutarget image.

The python file builds remote-test-server and executes rust testing
remotely using background ssh. It adds the necessary test environment
and variables to run the rust oe-selftest.
Print the results in case of failure of runCmd().

The patch has been run and tested for X86, X86_64, Arm & Arm64 targets
on Ubuntu-18 successfully.

Most of the tests excluded in rust.py are due to the following error:-
These tests will be included in Oe-selftest after fixing the issue.
===
"build-st/tmp/work/core2-64-poky-linux/rust-testsuite/1.58.1-r0/
rustc-1.58.1-src/build/bootstrap/debug/rustc -vV` (exit status: 101)
--- stderr
thread 'main' panicked at '
kind: NotFound, message: "No such file or directory" }',
src/bootstrap/bin/rustc.rs:175:37
=======

Signed-off-by: pgowda 
Signed-off-by: Vinay Kumar 
---
 meta/lib/oeqa/selftest/cases/rust.py  |  57 +
 meta/recipes-devtools/rust/rust-testsuite.inc | 163 +++
 .../rust-testsuite/rust-oe-selftest.patch | 995 ++
 .../rust/rust-testsuite_1.58.1.bb |   3 +
 4 files changed, 1218 insertions(+)
 create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite.inc
 create mode 100644 
meta/recipes-devtools/rust/rust-testsuite/rust-oe-selftest.patch
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite_1.58.1.bb

diff --git a/meta/lib/oeqa/selftest/cases/rust.py 
b/meta/lib/oeqa/selftest/cases/rust.py
new file mode 100644
index 00..1379b09af1
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: MIT
+import os
+import subprocess
+from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, 
runqemu, Command
+from oeqa.utils.sshcontrol import SSHControl
+
+# Total time taken for testing is of about 2hr 20min, with PARALLEL_MAKE set 
to 40 number of jobs.
+class RustSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
+
+   def run_check_emulated(self, *args, **kwargs):
+   # build remote-test-server before image build
+   recipe = "rust-testsuite"
+   bitbake("{} -c compile".format(recipe))
+   builddir = get_bb_var("B", "rust-testsuite")
+   # build core-image-minimal with required packages
+   default_installed_packages = ["libgcc", "libstdc++", 
"libatomic", "libgomp"]
+   features = []
+   features.append('IMAGE_FEATURES += "ssh-server-openssh"')
+   features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" 
".join(default_installed_packages)))
+   self.write_config("\n".join(features))
+   bitbake("core-image-minimal")
+   # wrap the execution with a qemu instance
+   with runqemu("core-image-minimal", runqemuparams = "nographic", 
qemuparams = "-m 512") as qemu:
+   # Copy remote-test-server to image through scp
+   ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, 
user="root")
+   ssh.copy_to(builddir + "/" + 
"build/x86_64-unknown-linux-gnu/stage1-tools-bin/remote-test-server","~/")
+   # Execute remote-test-server on image through 
background ssh
+   command = '~/remote-test-server -v remote'
+   sshrun=subprocess.Popen(("ssh", '-o',  
'UserKnownHostsFile=/dev/null', '-o',  'StrictHostKeyChecking=no', '-f', 
"root@%s" % qemu.ip, command),
+shell=False,
+stdout=subprocess.PIPE,
+stderr=subprocess.PIPE)
+   # Get the values of variables.
+   targetsys = get_bb_var("TARGET_SYS", "rust-testsuite")
+   rustlibpath = get_bb_var("STAGING_LIBDIR_NATIVE", 
"rust-testsuite")
+   tmpdir = get_bb_var("TMPDIR", "rust-testsuite")
+
+   # Exclude the test folders that error out while building
+   # Need to fix these errors

Re: [OE-core] [honister][PATCH V3] Rust Oe-Selftest implementation

2022-02-20 Thread Pgowda
Hi Richard,

> This looks interesting and is improving, thanks. I haven't done a full review 
> on
> it but as I glanced through it, I had some questions. See inline below.

Thanks for reviewing the patch and letting me know about your suggestions.

> Why do we patch some tests out but exclude others here? What is the 
> difference?
The excluded folders errored out even though they were ignored. There
are no tests in
some of the excluded folders. Hence, they were excluded from being run.

> What does 40 mean here?
Sorry for the confusion. It has been removed.

> python3-native is normally through an inherit python3native so this could mean
> you're not using it?
Removed as not needed.

> We're quite past 1.18.0 now so is that still needed?
Removed as not needed.

> We've just removed most LooseVersion references from OE-Core since disutils is
> deprecated. You can use bb.utils functions instead, like here:
Removed as not needed.

> We don't need/want python 2 support here?
Sorry. Did not get the comment here. Can you please elaborate?

> We're now a much later version of rust so do we need to support 1.32? That 
> could
> solve the LooseVersion problem too!
Thanks for pointing this out. It has been removed as not needed.

> s/Yocto/OE/
Done.

> PARALLEL_MAKE isn't used above so I doubt this is needed now? (I realise the
Removed as it's not required.

Thanks,
pgowda

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#162016): 
https://lists.openembedded.org/g/openembedded-core/message/162016
Mute This Topic: https://lists.openembedded.org/mt/89250540/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [honister][PATCH V4] Rust Oe-Selftest implementation

2022-02-20 Thread Pgowda
The patch implements Oe-selftest framework for Rust test.
Some of the functions are as follows:-
setup_cargo_environment(): Build bootstrap and some early stage tools.
do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
do_configure(): To generate config.toml
do_compile(): To build "remote-test-server" for qemutarget image.

The python file builds remote-test-server and executes rust testing
remotely using background ssh. It adds the necessary test environment
and variables to run the rust oe-selftest.
Print the results in case of failure of runCmd().

The patch has been run and tested for X86 and X86_64 targets on
Ubuntu-18 successfully.

Signed-off-by: pgowda 
Signed-off-by: Vinay Kumar 
---
 meta/lib/oeqa/selftest/cases/rust.py  |  53 ++
 meta/recipes-devtools/rust/rust-testsuite.inc | 160 
 .../rust-testsuite/rust-oe-selftest.patch | 872 ++
 .../rust/rust-testsuite_1.54.0.bb |   3 +
 4 files changed, 1088 insertions(+)
 create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite.inc
 create mode 100644 
meta/recipes-devtools/rust/rust-testsuite/rust-oe-selftest.patch
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite_1.54.0.bb

diff --git a/meta/lib/oeqa/selftest/cases/rust.py 
b/meta/lib/oeqa/selftest/cases/rust.py
new file mode 100644
index 00..ad28f7ab26
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: MIT
+import os
+import subprocess
+from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, 
runqemu, Command
+from oeqa.utils.sshcontrol import SSHControl
+
+# Total time taken for testing is of about 2hr 20min, with PARALLEL_MAKE set 
to 40 number of jobs.
+class RustSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
+
+   def run_check_emulated(self, *args, **kwargs):
+   # build remote-test-server before image build
+   recipe = "rust-testsuite"
+   bitbake("{} -c compile".format(recipe))
+   builddir = get_bb_var("B", "rust-testsuite")
+   # build core-image-minimal with required packages
+   default_installed_packages = ["libgcc", "libstdc++", 
"libatomic", "libgomp"]
+   features = []
+   features.append('IMAGE_FEATURES += "ssh-server-openssh"')
+   features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" 
".join(default_installed_packages)))
+   self.write_config("\n".join(features))
+   bitbake("core-image-minimal")
+   # wrap the execution with a qemu instance
+   with runqemu("core-image-minimal", runqemuparams = "nographic", 
qemuparams = "-m 512") as qemu:
+   # Copy remote-test-server to image through scp
+   ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, 
user="root")
+   ssh.copy_to(builddir + "/" + 
"build/x86_64-unknown-linux-gnu/stage1-tools-bin/remote-test-server","~/")
+   # Execute remote-test-server on image through 
background ssh
+   command = '~/remote-test-server -v remote'
+   sshrun=subprocess.Popen(("ssh", '-o',  
'UserKnownHostsFile=/dev/null', '-o',  'StrictHostKeyChecking=no', '-f', 
"root@%s" % qemu.ip, command),
+shell=False,
+stdout=subprocess.PIPE,
+stderr=subprocess.PIPE)
+   # Get the values of variables.
+   targetsys = get_bb_var("TARGET_SYS", "rust-testsuite")
+   rustlibpath = get_bb_var("STAGING_LIBDIR_NATIVE", 
"rust-testsuite")
+   tmpdir = get_bb_var("TMPDIR", "rust-testsuite")
+   testargs = "--exclude compiler/rustc --exclude 
compiler/rustc_apfloat --exclude compiler/rustc_serialize --exclude 
src/tools/tidy --exclude src/tools/compiletest --no-fail-fast --bless"
+   # Set path for target-poky-linux-gcc, RUST_TARGET_PATH 
and hosttools.
+   cmd = " export PATH=%s/../bin:$PATH;" % rustlibpath
+   cmd = cmd + " export 
PATH=%s/../bin/%s:%s/hosttools:$PATH;" % (rustlibpath, targetsys, tmpdir)
+   cmd = cmd + " export RUST_TARGET_PATH=%s/rustlib;" % 
rustlibpath
+   # Trigger testing.
+   

[OE-core] [honister][PATCH V3] Rust Oe-Selftest implementation

2022-02-19 Thread Pgowda
The patch implements Oe-selftest framework for Rust test.
Some of the functions are as follows:-
setup_cargo_environment(): Build bootstrap and some early stage tools.
do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
do_configure(): To generate config.toml
do_compile(): To build "remote-test-server" for qemutarget image.

The python file builds remote-test-server and executes rust testing
remotely using background ssh. It adds the necessary test environment
and variables to run the rust oe-selftest.
Print the results in case of failure of runCmd().

The patch has been run and tested on X86 and X86_64 targets on
Ubuntu-18 successfully.

There is an issue of loading libserde for master branch rust-1.58.1
sources as follows:-
"command did not execute successfully: oe-selftest/build-st/tmp/work
/core2-64-poky-linux/rust-testsuite/1.58.1-r0/rustc-1.58.1-src/build/
x86_64-unknown-linux-gnu/stage0-tools-bin/remote-test-client" "push"
"oe-selftest/build-st/tmp/work/core2-64-poky-linux/rust-testsuite/
1.58.1-r0/rustc-1.58.1-src/build/x86_64-unknown-linux-gnu/stage1/lib/
rustlib/x86_64-unknown-linux-gnu/lib/libserde_derive-804e1d2731595192.so"

thread 'main' panicked at 'io::copy( file, dst) failed with
Connection reset by peer (os error 104)',
src/tools/remote-test-client/src/main.rs:353:5

The patch will be posted for master branch after fixing the issue.

Signed-off-by: pgowda 
Signed-off-by: Vinay Kumar 
---
 meta/lib/oeqa/selftest/cases/rust.py  |  53 ++
 meta/recipes-devtools/rust/rust-testsuite.inc | 170 
 .../rust-testsuite/rust-oe-selftest.patch | 872 ++
 .../rust/rust-testsuite_1.54.0.bb |   3 +
 4 files changed, 1098 insertions(+)
 create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite.inc
 create mode 100644 
meta/recipes-devtools/rust/rust-testsuite/rust-oe-selftest.patch
 create mode 100644 meta/recipes-devtools/rust/rust-testsuite_1.54.0.bb

diff --git a/meta/lib/oeqa/selftest/cases/rust.py 
b/meta/lib/oeqa/selftest/cases/rust.py
new file mode 100644
index 00..ad28f7ab26
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: MIT
+import os
+import subprocess
+from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, 
runqemu, Command
+from oeqa.utils.sshcontrol import SSHControl
+
+# Total time taken for testing is of about 2hr 20min, with PARALLEL_MAKE set 
to 40 number of jobs.
+class RustSelfTestBase(OESelftestTestCase, OEPTestResultTestCase):
+
+   def run_check_emulated(self, *args, **kwargs):
+   # build remote-test-server before image build
+   recipe = "rust-testsuite"
+   bitbake("{} -c compile".format(recipe))
+   builddir = get_bb_var("B", "rust-testsuite")
+   # build core-image-minimal with required packages
+   default_installed_packages = ["libgcc", "libstdc++", 
"libatomic", "libgomp"]
+   features = []
+   features.append('IMAGE_FEATURES += "ssh-server-openssh"')
+   features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" 
".join(default_installed_packages)))
+   self.write_config("\n".join(features))
+   bitbake("core-image-minimal")
+   # wrap the execution with a qemu instance
+   with runqemu("core-image-minimal", runqemuparams = "nographic", 
qemuparams = "-m 512") as qemu:
+   # Copy remote-test-server to image through scp
+   ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, 
user="root")
+   ssh.copy_to(builddir + "/" + 
"build/x86_64-unknown-linux-gnu/stage1-tools-bin/remote-test-server","~/")
+   # Execute remote-test-server on image through 
background ssh
+   command = '~/remote-test-server -v remote'
+   sshrun=subprocess.Popen(("ssh", '-o',  
'UserKnownHostsFile=/dev/null', '-o',  'StrictHostKeyChecking=no', '-f', 
"root@%s" % qemu.ip, command),
+shell=False,
+stdout=subprocess.PIPE,
+stderr=subprocess.PIPE)
+   # Get the values of variables.
+   targetsys = get_bb_var("TARGET_SYS", "rust-testsuite")
+   rustlibpath = get_bb_var("STAGING_LIBDIR_NATIVE", 
"rust-testsuite")
+   tmpdi

Re: [OE-core] [hardknott][PATCH] glibc: upgrade glibc-2.33 to latest version

2022-02-13 Thread Pgowda
Gentle Ping on this patch.

On Sun, Jan 30, 2022 at 11:50 AM pgowda  wrote:
>
> glibc-2.33 has been upgraded to latest version that includes many CVE and
> other bug fixes. Ran the regressions and results are better.
>
> Signed-off-by: pgowda 
> ---
>  meta/recipes-core/glibc/glibc-version.inc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-core/glibc/glibc-version.inc 
> b/meta/recipes-core/glibc/glibc-version.inc
> index 63241ee951..e1eefdee49 100644
> --- a/meta/recipes-core/glibc/glibc-version.inc
> +++ b/meta/recipes-core/glibc/glibc-version.inc
> @@ -1,6 +1,6 @@
>  SRCBRANCH ?= "release/2.33/master"
>  PV = "2.33"
> -SRCREV_glibc ?= "55b99e9ed07688019609bd4dcd17d3ebf4572948"
> +SRCREV_glibc ?= "3e2a15c666e40e5ee740e5079c56d83469280323"
>  SRCREV_localedef ?= "bd644c9e6f3e20c5504da1488448173c69c56c28"
>
>  GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
> --
> 2.31.1
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161695): 
https://lists.openembedded.org/g/openembedded-core/message/161695
Mute This Topic: https://lists.openembedded.org/mt/88782078/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] gcc : Fix CVE-2021-46195

2022-02-09 Thread Pgowda
Upstream-Status: Backport 
[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=f10bec5ffa487ad3033ed5f38cfd0fc7d696deab]

Signed-off-by: pgowda 
---
 meta/recipes-devtools/gcc/gcc-11.2.inc|   1 +
 .../gcc/gcc/0001-CVE-2021-46195.patch | 128 ++
 2 files changed, 129 insertions(+)
 create mode 100644 meta/recipes-devtools/gcc/gcc/0001-CVE-2021-46195.patch

diff --git a/meta/recipes-devtools/gcc/gcc-11.2.inc 
b/meta/recipes-devtools/gcc/gcc-11.2.inc
index a62f272d3c..7a45ff76c1 100644
--- a/meta/recipes-devtools/gcc/gcc-11.2.inc
+++ b/meta/recipes-devtools/gcc/gcc-11.2.inc
@@ -67,6 +67,7 @@ SRC_URI = "\
file://0002-CVE-2021-42574.patch \
file://0003-CVE-2021-42574.patch \
file://0004-CVE-2021-42574.patch \
+   file://0001-CVE-2021-46195.patch \
 "
 SRC_URI[sha256sum] = 
"d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b"
 
diff --git a/meta/recipes-devtools/gcc/gcc/0001-CVE-2021-46195.patch 
b/meta/recipes-devtools/gcc/gcc/0001-CVE-2021-46195.patch
new file mode 100644
index 00..7b3651c73e
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/0001-CVE-2021-46195.patch
@@ -0,0 +1,128 @@
+From f10bec5ffa487ad3033ed5f38cfd0fc7d696deab Mon Sep 17 00:00:00 2001
+From: Nick Clifton 
+Date: Mon, 31 Jan 2022 14:28:42 +
+Subject: [PATCH] libiberty: Fix infinite recursion in rust demangler.
+
+libiberty/
+   PR demangler/98886
+   PR demangler/99935
+   * rust-demangle.c (struct rust_demangler): Add a recursion
+   counter.
+   (demangle_path): Increment/decrement the recursion counter upon
+   entry and exit.  Fail if the counter exceeds a fixed limit.
+   (demangle_type): Likewise.
+   (rust_demangle_callback): Initialise the recursion counter,
+   disabling if requested by the option flags.
+
+CVE: CVE-2021-46195
+Upstream-Status: Backport
+[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=f10bec5ffa487ad3033ed5f38cfd0fc7d696deab]
+Signed-off-by: Pgowda 
+---
+ libiberty/rust-demangle.c | 47 ++-
+ 1 file changed, 41 insertions(+), 6 deletions(-)
+
+diff --git a/libiberty/rust-demangle.c b/libiberty/rust-demangle.c
+index 18c760491bd..3b24d63892a 100644
+--- a/libiberty/rust-demangle.c
 b/libiberty/rust-demangle.c
+@@ -74,6 +74,12 @@ struct rust_demangler
+   /* Rust mangling version, with legacy mangling being -1. */
+   int version;
+ 
++  /* Recursion depth.  */
++  unsigned int recursion;
++  /* Maximum number of times demangle_path may be called recursively.  */
++#define RUST_MAX_RECURSION_COUNT  1024
++#define RUST_NO_RECURSION_LIMIT   ((unsigned int) -1)
++
+   uint64_t bound_lifetime_depth;
+ };
+ 
+@@ -671,6 +677,15 @@ demangle_path (struct rust_demangler *rdm, int in_value)
+   if (rdm->errored)
+ return;
+ 
++  if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
++{
++  ++ rdm->recursion;
++  if (rdm->recursion > RUST_MAX_RECURSION_COUNT)
++  /* FIXME: There ought to be a way to report
++ that the recursion limit has been reached.  */
++  goto fail_return;
++}
++
+   switch (tag = next (rdm))
+ {
+ case 'C':
+@@ -688,10 +703,7 @@ demangle_path (struct rust_demangler *rdm, int in_value)
+ case 'N':
+   ns = next (rdm);
+   if (!ISLOWER (ns) && !ISUPPER (ns))
+-{
+-  rdm->errored = 1;
+-  return;
+-}
++  goto fail_return;
+ 
+   demangle_path (rdm, in_value);
+ 
+@@ -776,9 +788,15 @@ demangle_path (struct rust_demangler *rdm, int in_value)
+ }
+   break;
+ default:
+-  rdm->errored = 1;
+-  return;
++  goto fail_return;
+ }
++  goto pass_return;
++
++ fail_return:
++  rdm->errored = 1;
++ pass_return:
++  if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
++-- rdm->recursion;
+ }
+ 
+ static void
+@@ -870,6 +888,19 @@ demangle_type (struct rust_demangler *rdm)
+   return;
+ }
+ 
++   if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
++{
++  ++ rdm->recursion;
++  if (rdm->recursion > RUST_MAX_RECURSION_COUNT)
++  /* FIXME: There ought to be a way to report
++ that the recursion limit has been reached.  */
++  {
++rdm->errored = 1;
++-- rdm->recursion;
++return;
++  }
++}
++
+   switch (tag)
+ {
+ case 'R':
+@@ -1030,6 +1061,9 @@ demangle_type (struct rust_demangler *rdm)
+   rdm->next--;
+   demangle_path (rdm, 0);
+ }
++
++  if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
++-- rdm->recursion;
+ }
+ 
+ /* A trait in a trait object may have some "existential projections"
+@@ -1320,6 +1354,7 @@ rust_demangle_callback (const char *mangled, int options,
+   rdm.skipping_printing = 0;
+   rdm.verbose = (options & DMGL_VERBOSE) != 0;
+   rdm.version = 0;
++  rdm.recursion = (options & DMGL_NO_RECURSE_LIMIT) ? RUST_NO_RECURSION_LIMIT 

Re: [OE-core] [hardknott][PATCH 1/2] glibc : Fix CVE-2021-3998

2022-01-29 Thread Pgowda
Hi Anuj,

Thanks for your comments.
There were 4 CVE fixes to GLIBC which were ported to the Hardknott branch.

However, these patches have been ported and present in glibc-2.33
latest versions.
Hence, glibc-2.33 is upgraded to the latest version which includes
these CVE and other fixes as:-
https://lists.openembedded.org/g/openembedded-core/message/161106

Regression test was performed on fresh and latest sources.
Results are better with the latest glibc-2.33 sources.

Hardknott glibc-2.33 sources
Summary of test results:
183 FAIL
   3777 PASS
 20 UNSUPPORTED
 16 XFAIL
  2 XPASS

Latest glibc-2.33
Summary of test results:
164 FAIL
   3801 PASS
 20 UNSUPPORTED
 16 XFAIL
  2 XPASS

Thanks,
Pgowda

On Tue, Jan 25, 2022 at 8:14 PM Mittal, Anuj  wrote:
>
> Can you please rebase all the glibc CVE patches for hardknott on top
> of:
>
> https://git.yoctoproject.org/poky-contrib/log/?h=anujm/hardknott
>
> and re-send the ones that are needed?
>
> Thanks,
>
> Anuj
>
> On Tue, 2022-01-25 at 03:26 -0800, pgowda wrote:
> > Upstream-Status: Backport
> > [https://sourceware.org/git/?p=glibc.git;a=commit;h=fb7bff12e81c677a6
> > 622f724edd4d4987dd9d971]
> > Upstream-Status: Backport
> > [https://sourceware.org/git/?p=glibc.git;a=commit;h=ee8d5e33adb284601
> > c00c94687bc907e10aec9bb]
> > Upstream-Status: Backport
> > [https://sourceware.org/git/?p=glibc.git;a=commit;h=84d2d0fe20bdf94fe
> > ed82b21b4d7d136db471f03]
> >
> > Signed-off-by: pgowda 
> > ---
> >  .../glibc/glibc/0001-CVE-2021-3998.patch  | 282
> > ++
> >  .../glibc/glibc/0002-CVE-2021-3998.patch  | 138 +
> >  .../glibc/glibc/0003-CVE-2021-3998.patch  |  35 +++
> >  meta/recipes-core/glibc/glibc_2.33.bb |   3 +
> >  4 files changed, 458 insertions(+)
> >  create mode 100644 meta/recipes-core/glibc/glibc/0001-CVE-2021-
> > 3998.patch
> >  create mode 100644 meta/recipes-core/glibc/glibc/0002-CVE-2021-
> > 3998.patch
> >  create mode 100644 meta/recipes-core/glibc/glibc/0003-CVE-2021-
> > 3998.patch
> >
> > diff --git a/meta/recipes-core/glibc/glibc/0001-CVE-2021-3998.patch
> > b/meta/recipes-core/glibc/glibc/0001-CVE-2021-3998.patch
> > new file mode 100644
> > index 00..32aa0eb348
> > --- /dev/null
> > +++ b/meta/recipes-core/glibc/glibc/0001-CVE-2021-3998.patch
> > @@ -0,0 +1,282 @@
> > +From fb7bff12e81c677a6622f724edd4d4987dd9d971 Mon Sep 17 00:00:00
> > 2001
> > +From: Siddhesh Poyarekar 
> > +Date: Tue, 18 Jan 2022 13:29:36 +0530
> > +Subject: [PATCH] support: Add helpers to create paths longer than
> > PATH_MAX
> > +
> > +Add new helpers support_create_and_chdir_toolong_temp_directory and
> > +support_chdir_toolong_temp_directory to create and descend into
> > +directory trees longer than PATH_MAX.
> > +
> > +Reviewed-by: Adhemerval Zanella  
> > +Signed-off-by: Siddhesh Poyarekar 
> > +
> > +Upstream-Status: Backport
> > [https://sourceware.org/git/?p=glibc.git;a=commit;h=fb7bff12e81c677a6
> > 622f724edd4d4987dd9d971]
> > +CVE: CVE-2021-3998
> > +
> > +Signed-off-by: Pgowda 
> > +---
> > + support/temp_file.c | 159
> > +---
> > + support/temp_file.h |   9 +++
> > + 2 files changed, 159 insertions(+), 9 deletions(-)
> > +
> > +diff --git a/support/temp_file.c b/support/temp_file.c
> > +index e7bb8aadb9..e41128c2d4 100644
> > +--- a/support/temp_file.c
> >  b/support/temp_file.c
> > +@@ -1,5 +1,6 @@
> > + /* Temporary file handling for tests.
> > +Copyright (C) 1998-2021 Free Software Foundation, Inc.
> > ++   Copyright The GNU Tools Authors.
> > +This file is part of the GNU C Library.
> > +
> > +The GNU C Library is free software; you can redistribute it
> > and/or
> > +@@ -20,15 +21,17 @@
> > +some 32-bit platforms. */
> > + #define _FILE_OFFSET_BITS 64
> > +
> > ++#include 
> > + #include 
> > + #include 
> > + #include 
> > +
> > ++#include 
> > + #include 
> > + #include 
> > + #include 
> > + #include 
> > +-#include 
> > ++#include 
> > +
> > + /* List of temporary files.  */
> > + static struct temp_name_list
> > +@@ -36,14 +39,20 @@ static struct temp_name_list
> > +   struct temp_name_list *next;
> > +   char *name;
> > +   pid_t owner;
> > ++  bool toolong;
> > + } *temp_name_list;
> > +
> > + /* Location of the temporary files.  Set by the test skeleton via
> > +support_set_t

[OE-core] [hardknott][PATCH] glibc: upgrade glibc-2.33 to latest version

2022-01-29 Thread Pgowda
glibc-2.33 has been upgraded to latest version that includes many CVE and
other bug fixes. Ran the regressions and results are better.

Signed-off-by: pgowda 
---
 meta/recipes-core/glibc/glibc-version.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/glibc/glibc-version.inc 
b/meta/recipes-core/glibc/glibc-version.inc
index 63241ee951..e1eefdee49 100644
--- a/meta/recipes-core/glibc/glibc-version.inc
+++ b/meta/recipes-core/glibc/glibc-version.inc
@@ -1,6 +1,6 @@
 SRCBRANCH ?= "release/2.33/master"
 PV = "2.33"
-SRCREV_glibc ?= "55b99e9ed07688019609bd4dcd17d3ebf4572948"
+SRCREV_glibc ?= "3e2a15c666e40e5ee740e5079c56d83469280323"
 SRCREV_localedef ?= "bd644c9e6f3e20c5504da1488448173c69c56c28"
 
 GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
-- 
2.31.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161106): 
https://lists.openembedded.org/g/openembedded-core/message/161106
Mute This Topic: https://lists.openembedded.org/mt/88782078/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [hardknott][PATCH 2/2] glibc : Fix CVE-2021-3999

2022-01-25 Thread Pgowda
Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=976db046bc3a3738f69255ae00b0a09b8e77fd9c]
Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=23e0e8f5f1fb5ed150253d986ecccdc90c2dcd5e]
Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=1b9cd6a7214db1812a20eb3591cf42f9190a5d1a]

Signed-off-by: pgowda 
---
 .../glibc/glibc/0001-CVE-2021-3999.patch  |  35 ++
 .../glibc/glibc/0002-CVE-2021-3999.patch  | 356 ++
 .../glibc/glibc/0003-CVE-2021-3999.patch  |  28 ++
 meta/recipes-core/glibc/glibc_2.33.bb |   3 +
 4 files changed, 422 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/0001-CVE-2021-3999.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0002-CVE-2021-3999.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0003-CVE-2021-3999.patch

diff --git a/meta/recipes-core/glibc/glibc/0001-CVE-2021-3999.patch 
b/meta/recipes-core/glibc/glibc/0001-CVE-2021-3999.patch
new file mode 100644
index 00..dfe6cfb426
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0001-CVE-2021-3999.patch
@@ -0,0 +1,35 @@
+From 976db046bc3a3738f69255ae00b0a09b8e77fd9c Mon Sep 17 00:00:00 2001
+From: Siddhesh Poyarekar 
+Date: Mon, 24 Jan 2022 10:57:09 +0530
+Subject: [PATCH] tst-realpath-toolong: Fix hurd build
+
+Define PATH_MAX to a constant if it isn't already defined, like in hurd.
+
+Signed-off-by: Siddhesh Poyarekar 
+
+Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=976db046bc3a3738f69255ae00b0a09b8e77fd9c]
+CVE: CVE-2021-3999
+
+Signed-off-by: Pgowda 
+---
+ stdlib/tst-realpath-toolong.c | 4 
+ 1 file changed, 4 insertions(+)
+
+diff --git a/stdlib/tst-realpath-toolong.c b/stdlib/tst-realpath-toolong.c
+index 8bed772460..4388890294 100644
+--- a/stdlib/tst-realpath-toolong.c
 b/stdlib/tst-realpath-toolong.c
+@@ -29,6 +29,10 @@
+ 
+ #define BASENAME "tst-realpath-toolong."
+ 
++#ifndef PATH_MAX
++# define PATH_MAX 1024
++#endif
++
+ int
+ do_test (void)
+ {
+-- 
+2.27.0
+
diff --git a/meta/recipes-core/glibc/glibc/0002-CVE-2021-3999.patch 
b/meta/recipes-core/glibc/glibc/0002-CVE-2021-3999.patch
new file mode 100644
index 00..c56856e82b
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0002-CVE-2021-3999.patch
@@ -0,0 +1,356 @@
+From 23e0e8f5f1fb5ed150253d986ecccdc90c2dcd5e Mon Sep 17 00:00:00 2001
+From: Siddhesh Poyarekar 
+Date: Fri, 21 Jan 2022 23:32:56 +0530
+Subject: [PATCH] getcwd: Set errno to ERANGE for size == 1 (CVE-2021-3999)
+
+No valid path returned by getcwd would fit into 1 byte, so reject the
+size early and return NULL with errno set to ERANGE.  This change is
+prompted by CVE-2021-3999, which describes a single byte buffer
+underflow and overflow when all of the following conditions are met:
+
+- The buffer size (i.e. the second argument of getcwd) is 1 byte
+- The current working directory is too long
+- '/' is also mounted on the current working directory
+
+Sequence of events:
+
+- In sysdeps/unix/sysv/linux/getcwd.c, the syscall returns ENAMETOOLONG
+  because the linux kernel checks for name length before it checks
+  buffer size
+
+- The code falls back to the generic getcwd in sysdeps/posix
+
+- In the generic func, the buf[0] is set to '\0' on line 250
+
+- this while loop on line 262 is bypassed:
+
+while (!(thisdev == rootdev && thisino == rootino))
+
+  since the rootfs (/) is bind mounted onto the directory and the flow
+  goes on to line 449, where it puts a '/' in the byte before the
+  buffer.
+
+- Finally on line 458, it moves 2 bytes (the underflowed byte and the
+  '\0') to the buf[0] and buf[1], resulting in a 1 byte buffer overflow.
+
+- buf is returned on line 469 and errno is not set.
+
+This resolves BZ #28769.
+
+Reviewed-by: Andreas Schwab 
+Reviewed-by: Adhemerval Zanella  
+Signed-off-by: Qualys Security Advisory 
+Signed-off-by: Siddhesh Poyarekar 
+
+Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=23e0e8f5f1fb5ed150253d986ecccdc90c2dcd5e]
+CVE: CVE-2021-3999
+
+Signed-off-by: Pgowda 
+---
+ NEWS  |   6 +
+ sysdeps/posix/getcwd.c|   7 +
+ sysdeps/unix/sysv/linux/Makefile  |   7 +-
+ .../unix/sysv/linux/tst-getcwd-smallbuff.c| 241 ++
+ 4 files changed, 260 insertions(+), 1 deletion(-)
+ create mode 100644 sysdeps/unix/sysv/linux/tst-getcwd-smallbuff.c
+
+diff --git a/NEWS b/NEWS
+index b4f81c2668..8d7467d2c1 100644
+--- a/NEWS
 b/NEWS
+@@ -152,6 +152,12 @@ Security related changes:
+   function could result in a memory leak and potential access of
+   uninitialized memory.  Reported by Qualys.
+ 
++  CVE-2021-3999: Passing a buffer of size exactly 1 byte to the getcwd
++  function may result in an off-by-one buffer underflow and overflow
++  when the current working directory is longer than PATH_MAX and also
++  corresponds to the /

[OE-core] [hardknott][PATCH 1/2] glibc : Fix CVE-2021-3998

2022-01-25 Thread Pgowda
Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=fb7bff12e81c677a6622f724edd4d4987dd9d971]
Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=ee8d5e33adb284601c00c94687bc907e10aec9bb]
Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=84d2d0fe20bdf94feed82b21b4d7d136db471f03]

Signed-off-by: pgowda 
---
 .../glibc/glibc/0001-CVE-2021-3998.patch  | 282 ++
 .../glibc/glibc/0002-CVE-2021-3998.patch  | 138 +
 .../glibc/glibc/0003-CVE-2021-3998.patch  |  35 +++
 meta/recipes-core/glibc/glibc_2.33.bb |   3 +
 4 files changed, 458 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/0001-CVE-2021-3998.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0002-CVE-2021-3998.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0003-CVE-2021-3998.patch

diff --git a/meta/recipes-core/glibc/glibc/0001-CVE-2021-3998.patch 
b/meta/recipes-core/glibc/glibc/0001-CVE-2021-3998.patch
new file mode 100644
index 00..32aa0eb348
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0001-CVE-2021-3998.patch
@@ -0,0 +1,282 @@
+From fb7bff12e81c677a6622f724edd4d4987dd9d971 Mon Sep 17 00:00:00 2001
+From: Siddhesh Poyarekar 
+Date: Tue, 18 Jan 2022 13:29:36 +0530
+Subject: [PATCH] support: Add helpers to create paths longer than PATH_MAX
+
+Add new helpers support_create_and_chdir_toolong_temp_directory and
+support_chdir_toolong_temp_directory to create and descend into
+directory trees longer than PATH_MAX.
+
+Reviewed-by: Adhemerval Zanella  
+Signed-off-by: Siddhesh Poyarekar 
+
+Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=fb7bff12e81c677a6622f724edd4d4987dd9d971]
+CVE: CVE-2021-3998
+
+Signed-off-by: Pgowda 
+---
+ support/temp_file.c | 159 +---
+ support/temp_file.h |   9 +++
+ 2 files changed, 159 insertions(+), 9 deletions(-)
+
+diff --git a/support/temp_file.c b/support/temp_file.c
+index e7bb8aadb9..e41128c2d4 100644
+--- a/support/temp_file.c
 b/support/temp_file.c
+@@ -1,5 +1,6 @@
+ /* Temporary file handling for tests.
+Copyright (C) 1998-2021 Free Software Foundation, Inc.
++   Copyright The GNU Tools Authors.
+This file is part of the GNU C Library.
+ 
+The GNU C Library is free software; you can redistribute it and/or
+@@ -20,15 +21,17 @@
+some 32-bit platforms. */
+ #define _FILE_OFFSET_BITS 64
+ 
++#include 
+ #include 
+ #include 
+ #include 
+ 
++#include 
+ #include 
+ #include 
+ #include 
+ #include 
+-#include 
++#include 
+ 
+ /* List of temporary files.  */
+ static struct temp_name_list
+@@ -36,14 +39,20 @@ static struct temp_name_list
+   struct temp_name_list *next;
+   char *name;
+   pid_t owner;
++  bool toolong;
+ } *temp_name_list;
+ 
+ /* Location of the temporary files.  Set by the test skeleton via
+support_set_test_dir.  The string is not be freed.  */
+ static const char *test_dir = _PATH_TMP;
+ 
+-void
+-add_temp_file (const char *name)
++/* Name of subdirectories in a too long temporary directory tree.  */
++static char toolong_subdir[NAME_MAX + 1];
++static bool toolong_initialized;
++static size_t toolong_path_max;
++
++static void
++add_temp_file_internal (const char *name, bool toolong)
+ {
+   struct temp_name_list *newp
+ = (struct temp_name_list *) xcalloc (sizeof (*newp), 1);
+@@ -53,12 +62,19 @@ add_temp_file (const char *name)
+   newp->name = newname;
+   newp->next = temp_name_list;
+   newp->owner = getpid ();
++  newp->toolong = toolong;
+   temp_name_list = newp;
+ }
+   else
+ free (newp);
+ }
+ 
++void
++add_temp_file (const char *name)
++{
++  add_temp_file_internal (name, false);
++}
++
+ int
+ create_temp_file_in_dir (const char *base, const char *dir, char **filename)
+ {
+@@ -90,8 +106,8 @@ create_temp_file (const char *base, char
+   return create_temp_file_in_dir (base, test_dir, filename);
+ }
+ 
+-char *
+-support_create_temp_directory (const char *base)
++static char *
++create_temp_directory_internal (const char *base, bool toolong)
+ {
+   char *path = xasprintf ("%s/%sXX", test_dir, base);
+   if (mkdtemp (path) == NULL)
+@@ -99,16 +115,132 @@ support_create_temp_directory (const cha
+   printf ("error: mkdtemp (\"%s\"): %m", path);
+   exit (1);
+ }
+-  add_temp_file (path);
++  add_temp_file_internal (path, toolong);
+   return path;
+ }
+ 
+-/* Helper functions called by the test skeleton follow.  */
++char *
++support_create_temp_directory (const char *base)
++{
++  return create_temp_directory_internal (base, false);
++}
++
++static void
++ensure_toolong_initialized (void)
++{
++  if (!toolong_initialized)
++FAIL_EXIT1 ("uninitialized toolong directory tree\n");
++}
++
++static void
++initialize_toolong (const char *base)
++{
++  long name_max = pathconf (base, _PC_NAME_MAX);
++  name_max = (name_max < 0 

[OE-core] [PATCH 2/2] glibc : Fix CVE-2021-3999

2022-01-24 Thread Pgowda
Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=8c8a71c85f2ed5cc90d08d82ce645513fc907cb6]
Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=472e799a5f2102bc0c3206dbd5a801765fceb39c]

Signed-off-by: pgowda 
---
 .../glibc/glibc/0001-CVE-2021-3999.patch  |  36 ++
 .../glibc/glibc/0002-CVE-2021-3999.patch  | 357 ++
 meta/recipes-core/glibc/glibc_2.34.bb |   2 +
 3 files changed, 395 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/0001-CVE-2021-3999.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0002-CVE-2021-3999.patch

diff --git a/meta/recipes-core/glibc/glibc/0001-CVE-2021-3999.patch 
b/meta/recipes-core/glibc/glibc/0001-CVE-2021-3999.patch
new file mode 100644
index 00..64749390b5
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0001-CVE-2021-3999.patch
@@ -0,0 +1,36 @@
+From 8c8a71c85f2ed5cc90d08d82ce645513fc907cb6 Mon Sep 17 00:00:00 2001
+From: Siddhesh Poyarekar 
+Date: Mon, 24 Jan 2022 10:57:09 +0530
+Subject: [PATCH] tst-realpath-toolong: Fix hurd build
+
+Define PATH_MAX to a constant if it isn't already defined, like in hurd.
+
+Signed-off-by: Siddhesh Poyarekar 
+(cherry picked from commit 976db046bc3a3738f69255ae00b0a09b8e77fd9c)
+
+Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=8c8a71c85f2ed5cc90d08d82ce645513fc907cb6]
+CVE: CVE-2021-3999
+
+Signed-off-by: Pgowda 
+---
+ stdlib/tst-realpath-toolong.c | 4 
+ 1 file changed, 4 insertions(+)
+
+diff --git a/stdlib/tst-realpath-toolong.c b/stdlib/tst-realpath-toolong.c
+index 8bed772460..4388890294 100644
+--- a/stdlib/tst-realpath-toolong.c
 b/stdlib/tst-realpath-toolong.c
+@@ -29,6 +29,10 @@
+ 
+ #define BASENAME "tst-realpath-toolong."
+ 
++#ifndef PATH_MAX
++# define PATH_MAX 1024
++#endif
++
+ int
+ do_test (void)
+ {
+-- 
+2.27.0
+
diff --git a/meta/recipes-core/glibc/glibc/0002-CVE-2021-3999.patch 
b/meta/recipes-core/glibc/glibc/0002-CVE-2021-3999.patch
new file mode 100644
index 00..ef3a504fdf
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0002-CVE-2021-3999.patch
@@ -0,0 +1,357 @@
+From 472e799a5f2102bc0c3206dbd5a801765fceb39c Mon Sep 17 00:00:00 2001
+From: Siddhesh Poyarekar 
+Date: Fri, 21 Jan 2022 23:32:56 +0530
+Subject: [PATCH] getcwd: Set errno to ERANGE for size == 1 (CVE-2021-3999)
+
+No valid path returned by getcwd would fit into 1 byte, so reject the
+size early and return NULL with errno set to ERANGE.  This change is
+prompted by CVE-2021-3999, which describes a single byte buffer
+underflow and overflow when all of the following conditions are met:
+
+- The buffer size (i.e. the second argument of getcwd) is 1 byte
+- The current working directory is too long
+- '/' is also mounted on the current working directory
+
+Sequence of events:
+
+- In sysdeps/unix/sysv/linux/getcwd.c, the syscall returns ENAMETOOLONG
+  because the linux kernel checks for name length before it checks
+  buffer size
+
+- The code falls back to the generic getcwd in sysdeps/posix
+
+- In the generic func, the buf[0] is set to '\0' on line 250
+
+- this while loop on line 262 is bypassed:
+
+while (!(thisdev == rootdev && thisino == rootino))
+
+  since the rootfs (/) is bind mounted onto the directory and the flow
+  goes on to line 449, where it puts a '/' in the byte before the
+  buffer.
+
+- Finally on line 458, it moves 2 bytes (the underflowed byte and the
+  '\0') to the buf[0] and buf[1], resulting in a 1 byte buffer overflow.
+
+- buf is returned on line 469 and errno is not set.
+
+This resolves BZ #28769.
+
+Reviewed-by: Andreas Schwab 
+Reviewed-by: Adhemerval Zanella  
+Signed-off-by: Qualys Security Advisory 
+Signed-off-by: Siddhesh Poyarekar 
+(cherry picked from commit 23e0e8f5f1fb5ed150253d986ecccdc90c2dcd5e)
+
+Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=472e799a5f2102bc0c3206dbd5a801765fceb39c]
+CVE: CVE-2021-3999
+
+Signed-off-by: Pgowda 
+---
+ NEWS  |   6 +
+ sysdeps/posix/getcwd.c|   7 +
+ sysdeps/unix/sysv/linux/Makefile  |   7 +-
+ .../unix/sysv/linux/tst-getcwd-smallbuff.c| 241 ++
+ 4 files changed, 260 insertions(+), 1 deletion(-)
+ create mode 100644 sysdeps/unix/sysv/linux/tst-getcwd-smallbuff.c
+
+diff --git a/NEWS b/NEWS
+index b4f81c2668..8d7467d2c1 100644
+--- a/NEWS
 b/NEWS
+@@ -214,6 +214,12 @@ Security related changes:
+   function could result in a memory leak and potential access of
+   uninitialized memory.  Reported by Qualys.
+ 
++  CVE-2021-3999: Passing a buffer of size exactly 1 byte to the getcwd
++  function may result in an off-by-one buffer underflow and overflow
++  when the current working directory is longer than PATH_MAX and also
++  corresponds to the / directory through an unprivileged mount
++  namespace.  Reported by Qualys.
++
+ The following bugs are resolved

[OE-core] [PATCH 1/2] glibc : Fix CVE-2021-3998

2022-01-24 Thread Pgowda
Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=062ff490c1467059f6cd64bb9c3d85f6cc6cf97a]
Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=f7a79879c0b2bef0dadd6caaaeeb0d26423e04e5]

Signed-off-by: pgowda 
---
 .../glibc/glibc/0001-CVE-2021-3998.patch  | 282 ++
 .../glibc/glibc/0002-CVE-2021-3998.patch  | 138 +
 meta/recipes-core/glibc/glibc_2.34.bb |   2 +
 3 files changed, 422 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/0001-CVE-2021-3998.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0002-CVE-2021-3998.patch

diff --git a/meta/recipes-core/glibc/glibc/0001-CVE-2021-3998.patch 
b/meta/recipes-core/glibc/glibc/0001-CVE-2021-3998.patch
new file mode 100644
index 00..c6bd5916e3
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0001-CVE-2021-3998.patch
@@ -0,0 +1,282 @@
+From fb7bff12e81c677a6622f724edd4d4987dd9d971 Mon Sep 17 00:00:00 2001
+From: Siddhesh Poyarekar 
+Date: Tue, 18 Jan 2022 13:29:36 +0530
+Subject: [PATCH] support: Add helpers to create paths longer than PATH_MAX
+
+Add new helpers support_create_and_chdir_toolong_temp_directory and
+support_chdir_toolong_temp_directory to create and descend into
+directory trees longer than PATH_MAX.
+
+Reviewed-by: Adhemerval Zanella  
+Signed-off-by: Siddhesh Poyarekar 
+
+Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=062ff490c1467059f6cd64bb9c3d85f6cc6cf97a]
+CVE: CVE-2021-3998
+
+Signed-off-by: Pgowda 
+---
+ support/temp_file.c | 159 +---
+ support/temp_file.h |   9 +++
+ 2 files changed, 159 insertions(+), 9 deletions(-)
+
+diff --git a/support/temp_file.c b/support/temp_file.c
+index e7bb8aadb9..e41128c2d4 100644
+--- a/support/temp_file.c
 b/support/temp_file.c
+@@ -1,5 +1,6 @@
+ /* Temporary file handling for tests.
+Copyright (C) 1998-2021 Free Software Foundation, Inc.
++   Copyright The GNU Tools Authors.
+This file is part of the GNU C Library.
+ 
+The GNU C Library is free software; you can redistribute it and/or
+@@ -20,15 +21,17 @@
+some 32-bit platforms. */
+ #define _FILE_OFFSET_BITS 64
+ 
++#include 
+ #include 
+ #include 
+ #include 
+ 
++#include 
+ #include 
+ #include 
+ #include 
+ #include 
+-#include 
++#include 
+ 
+ /* List of temporary files.  */
+ static struct temp_name_list
+@@ -36,14 +39,20 @@ static struct temp_name_list
+   struct temp_name_list *next;
+   char *name;
+   pid_t owner;
++  bool toolong;
+ } *temp_name_list;
+ 
+ /* Location of the temporary files.  Set by the test skeleton via
+support_set_test_dir.  The string is not be freed.  */
+ static const char *test_dir = _PATH_TMP;
+ 
+-void
+-add_temp_file (const char *name)
++/* Name of subdirectories in a too long temporary directory tree.  */
++static char toolong_subdir[NAME_MAX + 1];
++static bool toolong_initialized;
++static size_t toolong_path_max;
++
++static void
++add_temp_file_internal (const char *name, bool toolong)
+ {
+   struct temp_name_list *newp
+ = (struct temp_name_list *) xcalloc (sizeof (*newp), 1);
+@@ -53,12 +62,19 @@ add_temp_file (const char *name)
+   newp->name = newname;
+   newp->next = temp_name_list;
+   newp->owner = getpid ();
++  newp->toolong = toolong;
+   temp_name_list = newp;
+ }
+   else
+ free (newp);
+ }
+ 
++void
++add_temp_file (const char *name)
++{
++  add_temp_file_internal (name, false);
++}
++
+ int
+ create_temp_file_in_dir (const char *base, const char *dir, char **filename)
+ {
+@@ -90,8 +106,8 @@ create_temp_file (const char *base, char
+   return create_temp_file_in_dir (base, test_dir, filename);
+ }
+ 
+-char *
+-support_create_temp_directory (const char *base)
++static char *
++create_temp_directory_internal (const char *base, bool toolong)
+ {
+   char *path = xasprintf ("%s/%sXX", test_dir, base);
+   if (mkdtemp (path) == NULL)
+@@ -99,16 +115,132 @@ support_create_temp_directory (const cha
+   printf ("error: mkdtemp (\"%s\"): %m", path);
+   exit (1);
+ }
+-  add_temp_file (path);
++  add_temp_file_internal (path, toolong);
+   return path;
+ }
+ 
+-/* Helper functions called by the test skeleton follow.  */
++char *
++support_create_temp_directory (const char *base)
++{
++  return create_temp_directory_internal (base, false);
++}
++
++static void
++ensure_toolong_initialized (void)
++{
++  if (!toolong_initialized)
++FAIL_EXIT1 ("uninitialized toolong directory tree\n");
++}
++
++static void
++initialize_toolong (const char *base)
++{
++  long name_max = pathconf (base, _PC_NAME_MAX);
++  name_max = (name_max < 0 ? 64
++: (name_max < sizeof (toolong_subdir) ? name_max
++   : sizeof (toolong_subdir) - 1));
++
++  long path_max = pathconf (base, _PC_PATH_MAX);
++  path_max = (path_max < 0 ? 1024
++: path_max <= PTRDIFF

[OE-core] [hardknott][PATCH 3/3] gcc: upgrade to gcc-10.3 version

2022-01-22 Thread Pgowda
gcc-10.2 in Hardknott branch has been upgraded to gcc-10.3 version
that includes many bug fixes.
Regression tested on X86-64, Arm and Aarch64 without issues.

Signed-off-by: pgowda 
---
 .../gcc/{gcc-10.2.inc => gcc-10.3.inc}|  12 +-
 ...ian_10.2.bb => gcc-cross-canadian_10.3.bb} |   0
 .../{gcc-cross_10.2.bb => gcc-cross_10.3.bb}  |   0
 ...-crosssdk_10.2.bb => gcc-crosssdk_10.3.bb} |   0
 ...cc-runtime_10.2.bb => gcc-runtime_10.3.bb} |   0
 ...itizers_10.2.bb => gcc-sanitizers_10.3.bb} |   0
 ...{gcc-source_10.2.bb => gcc-source_10.3.bb} |   0
 .../gcc/gcc/0001-CVE-2021-35465.patch |  22 +-
 ...-up-__aarch64_cas16_acq_rel-fallback.patch |  66 --
 ...ight-Line-Speculation-SLS-mitigation.patch | 202 --
 ...e-SLS-mitigation-for-RET-and-BR-inst.patch | 607 
 ...h64-Mitigate-SLS-for-BLR-instruction.patch | 658 --
 ...gcc-Fix-argument-list-too-long-error.patch |   5 +-
 ...Re-introduce-spe-commandline-options.patch |   2 +-
 ...ngw32-Enable-operation_not_supported.patch |   4 +-
 .../gcc/0038-arm-neoverse-n2-support.patch|  88 ---
 .../gcc/0039-arm64-neoverse-n2-support.patch  |  60 --
 .../gcc/{gcc_10.2.bb => gcc_10.3.bb}  |   0
 ...initial_10.2.bb => libgcc-initial_10.3.bb} |   0
 .../gcc/{libgcc_10.2.bb => libgcc_10.3.bb}|   0
 ...ibgfortran_10.2.bb => libgfortran_10.3.bb} |   0
 21 files changed, 19 insertions(+), 1707 deletions(-)
 rename meta/recipes-devtools/gcc/{gcc-10.2.inc => gcc-10.3.inc} (90%)
 rename meta/recipes-devtools/gcc/{gcc-cross-canadian_10.2.bb => 
gcc-cross-canadian_10.3.bb} (100%)
 rename meta/recipes-devtools/gcc/{gcc-cross_10.2.bb => gcc-cross_10.3.bb} 
(100%)
 rename meta/recipes-devtools/gcc/{gcc-crosssdk_10.2.bb => 
gcc-crosssdk_10.3.bb} (100%)
 rename meta/recipes-devtools/gcc/{gcc-runtime_10.2.bb => gcc-runtime_10.3.bb} 
(100%)
 rename meta/recipes-devtools/gcc/{gcc-sanitizers_10.2.bb => 
gcc-sanitizers_10.3.bb} (100%)
 rename meta/recipes-devtools/gcc/{gcc-source_10.2.bb => gcc-source_10.3.bb} 
(100%)
 delete mode 100644 
meta/recipes-devtools/gcc/gcc/0001-aarch64-Fix-up-__aarch64_cas16_acq_rel-fallback.patch
 delete mode 100644 
meta/recipes-devtools/gcc/gcc/0001-aarch64-New-Straight-Line-Speculation-SLS-mitigation.patch
 delete mode 100644 
meta/recipes-devtools/gcc/gcc/0002-aarch64-Introduce-SLS-mitigation-for-RET-and-BR-inst.patch
 delete mode 100644 
meta/recipes-devtools/gcc/gcc/0003-aarch64-Mitigate-SLS-for-BLR-instruction.patch
 delete mode 100644 
meta/recipes-devtools/gcc/gcc/0038-arm-neoverse-n2-support.patch
 delete mode 100644 
meta/recipes-devtools/gcc/gcc/0039-arm64-neoverse-n2-support.patch
 rename meta/recipes-devtools/gcc/{gcc_10.2.bb => gcc_10.3.bb} (100%)
 rename meta/recipes-devtools/gcc/{libgcc-initial_10.2.bb => 
libgcc-initial_10.3.bb} (100%)
 rename meta/recipes-devtools/gcc/{libgcc_10.2.bb => libgcc_10.3.bb} (100%)
 rename meta/recipes-devtools/gcc/{libgfortran_10.2.bb => libgfortran_10.3.bb} 
(100%)

diff --git a/meta/recipes-devtools/gcc/gcc-10.2.inc 
b/meta/recipes-devtools/gcc/gcc-10.3.inc
similarity index 90%
rename from meta/recipes-devtools/gcc/gcc-10.2.inc
rename to meta/recipes-devtools/gcc/gcc-10.3.inc
index e7e3395c55..1fdfcced8e 100644
--- a/meta/recipes-devtools/gcc/gcc-10.2.inc
+++ b/meta/recipes-devtools/gcc/gcc-10.3.inc
@@ -2,11 +2,11 @@ require gcc-common.inc
 
 # Third digit in PV should be incremented after a minor release
 
-PV = "10.2.0"
+PV = "10.3.0"
 
 # BINV should be incremented to a revision after a minor gcc release
 
-BINV = "10.2.0"
+BINV = "10.3.0"
 
 FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc:${FILE_DIRNAME}/gcc/backport:"
 
@@ -65,24 +65,18 @@ SRC_URI = "\

file://0035-gentypes-genmodes-Do-not-use-__LINE__-for-maintainin.patch \
file://0036-mingw32-Enable-operation_not_supported.patch \
file://0037-libatomic-Do-not-enforce-march-on-aarch64.patch \
-   
file://0001-aarch64-New-Straight-Line-Speculation-SLS-mitigation.patch \
-   
file://0002-aarch64-Introduce-SLS-mitigation-for-RET-and-BR-inst.patch \
-   file://0003-aarch64-Mitigate-SLS-for-BLR-instruction.patch \
-   file://0001-aarch64-Fix-up-__aarch64_cas16_acq_rel-fallback.patch \
file://0001-libatomic-libgomp-libitc-Fix-bootstrap-PR70454.patch \
file://0001-CVE-2021-35465.patch \
file://0002-CVE-2021-35465.patch \
file://0003-CVE-2021-35465.patch \
file://0004-CVE-2021-35465.patch \
-   file://0038-arm-neoverse-n2-support.patch \
-   file://0039-arm64-neoverse-n2-support.patch \
file://0001-CVE-2021-42574.patch \
file://0002-CVE-2021-42574.patch \
file://0003-CVE-2021-42574.patch \
file://0004-CVE-2021-42574.patch \
file://0005-CVE-2021-4257

[OE-core] [hardknott][PATCH 2/3] binutils: upgrade binutils-2.36 to latest version

2022-01-22 Thread Pgowda
binutils-2.36 in Hardknott branch has been upgraded to latest version
that includes many bug fixes.
Regression tested on X86-64, Arm and Aarch64 without any new issues.

Signed-off-by: pgowda 
---
 .../binutils/binutils-2.36.inc|   5 +-
 .../binutils/0001-CVE-2021-20197.patch| 201 --
 .../binutils/0001-CVE-2021-42574.patch|   4 +-
 .../binutils/0002-CVE-2021-20197.patch| 170 ---
 .../binutils/0003-CVE-2021-20197.patch| 171 ---
 5 files changed, 3 insertions(+), 548 deletions(-)
 delete mode 100644 
meta/recipes-devtools/binutils/binutils/0001-CVE-2021-20197.patch
 delete mode 100644 
meta/recipes-devtools/binutils/binutils/0002-CVE-2021-20197.patch
 delete mode 100644 
meta/recipes-devtools/binutils/binutils/0003-CVE-2021-20197.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.36.inc 
b/meta/recipes-devtools/binutils/binutils-2.36.inc
index 9574ddb6e1..fa28358c2d 100644
--- a/meta/recipes-devtools/binutils/binutils-2.36.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.36.inc
@@ -24,7 +24,7 @@ BRANCH ?= "binutils-2_36-branch"
 
 UPSTREAM_CHECK_GITTAGREGEX = "binutils-(?P\d+_(\d_?)*)"
 
-SRCREV ?= "7651a4871c225925ffdfda0a8c91a6ed370cd9a1"
+SRCREV ?= "a281816c8aeb12619d34eec8959a43dfa5c6b4ec"
 BINUTILS_GIT_URI ?= 
"git://sourceware.org/git/binutils-gdb.git;branch=${BRANCH};protocol=git"
 SRC_URI = "\
  ${BINUTILS_GIT_URI} \
@@ -41,9 +41,6 @@ SRC_URI = "\
  file://0014-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \
  file://0015-sync-with-OE-libtool-changes.patch \
  file://0016-Check-for-clang-before-checking-gcc-version.patch \
- file://0001-CVE-2021-20197.patch \
- file://0002-CVE-2021-20197.patch \
- file://0003-CVE-2021-20197.patch \
  file://0017-CVE-2021-3530.patch \
  file://0018-CVE-2021-3530.patch \
  file://0001-CVE-2021-42574.patch \
diff --git a/meta/recipes-devtools/binutils/binutils/0001-CVE-2021-20197.patch 
b/meta/recipes-devtools/binutils/binutils/0001-CVE-2021-20197.patch
deleted file mode 100644
index 2b4eaba26d..00
--- a/meta/recipes-devtools/binutils/binutils/0001-CVE-2021-20197.patch
+++ /dev/null
@@ -1,201 +0,0 @@
-From 8e03235147a9e774d3ba084e93c2da1aa94d1cec Mon Sep 17 00:00:00 2001
-From: Siddhesh Poyarekar 
-Date: Mon, 22 Feb 2021 20:45:50 +0530
-Subject: [PATCH] binutils: Avoid renaming over existing files
-
-Renaming over existing files needs additional care to restore
-permissions and ownership, which may not always succeed.
-Additionally, other properties of the file such as extended attributes
-may be lost, making the operation flaky.
-
-For predictable results, resort to rename() only if the file does not
-exist, otherwise copy the file contents into the existing file.  This
-ensures that no additional tricks are needed to retain file
-properties.
-
-This also allows dropping of the redundant set_times on the tmpfile in
-objcopy/strip since now we no longer rename over existing files.
-
-binutils/
-
-   * ar.c (write_archive): Adjust call to SMART_RENAME.
-   * arsup.c (ar_save): Likewise.
-   * objcopy (strip_main): Don't set times on temporary file and
-   adjust call to SMART_RENAME.
-   (copy_main): Likewise.
-   * rename.c [!S_ISLNK]: Remove definitions.
-   (try_preserve_permissions): Remove function.
-   (smart_rename): Replace PRESERVE_DATES argument with
-   TARGET_STAT.  Use rename system call only if TO does not exist.
-   * bucomm.h (smart_rename): Adjust declaration.
-
-(cherry picked from commit 3685de750e6a091663a0abe42528cad29e960e35)
-
-Upstream-Status: Backport 
[https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8e03235147a9e774d3ba084e93c2da1aa94d1cec]
-CVE: CVE-2021-20197
-Signed-off-by: Vinay Kumar 

- binutils/ar.c  |  2 +-
- binutils/arsup.c   |  2 +-
- binutils/bucomm.h  |  3 ++-
- binutils/objcopy.c |  8 ++-
- binutils/rename.c  | 55 +-
- 6 files changed, 29 insertions(+), 54 deletions(-)
-
-diff --git a/binutils/ar.c b/binutils/ar.c
-index 45a34e3a6cf..3a91708b51c 100644
 a/binutils/ar.c
-+++ b/binutils/ar.c
-@@ -1308,7 +1308,7 @@ write_archive (bfd *iarch)
-   /* We don't care if this fails; we might be creating the archive.  */
-   bfd_close (iarch);
- 
--  if (smart_rename (new_name, old_name, 0) != 0)
-+  if (smart_rename (new_name, old_name, NULL) != 0)
- xexit (1);
-   free (old_name);
-   free (new_name);
-diff --git a/binutils/arsup.c b/binutils/arsup.c
-index 5403a0c5d74..0a1f63f6456 100644
 a/binutils/arsup.c
-+++ b/binutils/arsup.c
-@@ -351,7 +351,7 @@ ar_save (void)
- 
-   bfd_close (obfd);
- 
--  smart_rename (ofilename, real_name, 0);
-+  smart_rename (ofilename, real_name, NULL);
-   obfd = 0;
-   free (ofilename);
- }
-diff --git a/binutils/bucomm.h b/binutils/bucomm.h
-index 91f

[OE-core] [hardknott][PATCH 1/3] glibc: upgrade glibc-2.33 to latest version

2022-01-22 Thread Pgowda
glibc-2.33 has been upgraded to latest version that includes many CVE and
other bug fixes.

Signed-off-by: pgowda 
---
 meta/recipes-core/glibc/glibc-version.inc |   2 +-
 .../glibc/glibc/0031-CVE-2021-43396.patch | 182 --
 meta/recipes-core/glibc/glibc_2.33.bb |   1 -
 3 files changed, 1 insertion(+), 184 deletions(-)
 delete mode 100644 meta/recipes-core/glibc/glibc/0031-CVE-2021-43396.patch

diff --git a/meta/recipes-core/glibc/glibc-version.inc 
b/meta/recipes-core/glibc/glibc-version.inc
index 4d69187961..63241ee951 100644
--- a/meta/recipes-core/glibc/glibc-version.inc
+++ b/meta/recipes-core/glibc/glibc-version.inc
@@ -1,6 +1,6 @@
 SRCBRANCH ?= "release/2.33/master"
 PV = "2.33"
-SRCREV_glibc ?= "6090cf1330faf2deb17285758f327cb23b89ebf1"
+SRCREV_glibc ?= "55b99e9ed07688019609bd4dcd17d3ebf4572948"
 SRCREV_localedef ?= "bd644c9e6f3e20c5504da1488448173c69c56c28"
 
 GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
diff --git a/meta/recipes-core/glibc/glibc/0031-CVE-2021-43396.patch 
b/meta/recipes-core/glibc/glibc/0031-CVE-2021-43396.patch
deleted file mode 100644
index 72fd68b302..00
--- a/meta/recipes-core/glibc/glibc/0031-CVE-2021-43396.patch
+++ /dev/null
@@ -1,182 +0,0 @@
-From ff012870b2c02a62598c04daa1e54632e020fd7d Mon Sep 17 00:00:00 2001
-From: Nikita Popov 
-Date: Tue, 2 Nov 2021 13:21:42 +0500
-Subject: [PATCH] gconv: Do not emit spurious NUL character in ISO-2022-JP-3
- (bug 28524)
-
-Bugfix 27256 has introduced another issue:
-In conversion from ISO-2022-JP-3 encoding, it is possible
-to force iconv to emit extra NUL character on internal state reset.
-To do this, it is sufficient to feed iconv with escape sequence
-which switches active character set.
-The simplified check 'data->__statep->__count != ASCII_set'
-introduced by the aforementioned bugfix picks that case and
-behaves as if '\0' character has been queued thus emitting it.
-
-To eliminate this issue, these steps are taken:
-* Restore original condition
-'(data->__statep->__count & ~7) != ASCII_set'.
-It is necessary since bits 0-2 may contain
-number of buffered input characters.
-* Check that queued character is not NUL.
-Similar step is taken for main conversion loop.
-
-Bundled test case follows following logic:
-* Try to convert ISO-2022-JP-3 escape sequence
-switching active character set
-* Reset internal state by providing NULL as input buffer
-* Ensure that nothing has been converted.
-
-Signed-off-by: Nikita Popov 
-
-CVE: CVE-2021-43396
-Upstream-Status: Backport [ff012870b2c02a62598c04daa1e54632e020fd7d]

- iconvdata/Makefile|  5 +++-
- iconvdata/bug-iconv15.c   | 60 +++
- iconvdata/iso-2022-jp-3.c | 28 --
- 3 files changed, 84 insertions(+), 9 deletions(-)
- create mode 100644 iconvdata/bug-iconv15.c
-
-diff --git a/iconvdata/bug-iconv15.c b/iconvdata/bug-iconv15.c
-new file mode 100644
 /dev/null
-+++ b/iconvdata/bug-iconv15.c
-@@ -0,0 +1,60 @@
-+/* Bug 28524: Conversion from ISO-2022-JP-3 with iconv
-+   may emit spurious NUL character on state reset.
-+   Copyright (C) The GNU Toolchain Authors.
-+   This file is part of the GNU C Library.
-+
-+   The GNU C Library is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU Lesser General Public
-+   License as published by the Free Software Foundation; either
-+   version 2.1 of the License, or (at your option) any later version.
-+
-+   The GNU C Library 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
-+   Lesser General Public License for more details.
-+
-+   You should have received a copy of the GNU Lesser General Public
-+   License along with the GNU C Library; if not, see
-+   <https://www.gnu.org/licenses/>.  */
-+
-+#include 
-+#include 
-+#include 
-+
-+static int
-+do_test (void)
-+{
-+  char in[] = "\x1b(I";
-+  char *inbuf = in;
-+  size_t inleft = sizeof (in) - 1;
-+  char out[1];
-+  char *outbuf = out;
-+  size_t outleft = sizeof (out);
-+  iconv_t cd;
-+
-+  cd = iconv_open ("UTF8", "ISO-2022-JP-3");
-+  TEST_VERIFY_EXIT (cd != (iconv_t) -1);
-+
-+  /* First call to iconv should alter internal state.
-+ Now, JISX0201_Kana_set is selected and
-+ state value != ASCII_set.  */
-+  TEST_VERIFY (iconv (cd, , , , ) != (size_t) -1);
-+
-+  /* No bytes should have been added to
-+ the output buffer at this point.  */
-+  TEST_VERIFY (outbuf == out);
-+  TEST_VERIFY (outleft == sizeof (out));
-+
-+  /* Second call shall emit spurious NUL character in unpatched glibc.  */
-+  TEST_VERIFY (iconv (cd, NULL, NULL, , ) != (size_t) -1);
-+
-+  /* No characters are expected to be produced.  */
-+  TEST_VERIFY (outbuf == out);
-+  TEST_VERIFY (outleft == 

[OE-core] [hardknott][PATCH 2/2] glibc : Fix CVE-2022-23219

2022-01-20 Thread Pgowda
Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=226b46770c82899b555986583294b049c6ec9b40]
Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=ef972a4c50014a16132b5c75571cfb6b30bef136]

Signed-off-by: pgowda 
---
 .../glibc/glibc/0001-CVE-2022-23219.patch | 55 
 .../glibc/glibc/0002-CVE-2022-23219.patch | 89 +++
 meta/recipes-core/glibc/glibc_2.33.bb |  2 +
 3 files changed, 146 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/0001-CVE-2022-23219.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0002-CVE-2022-23219.patch

diff --git a/meta/recipes-core/glibc/glibc/0001-CVE-2022-23219.patch 
b/meta/recipes-core/glibc/glibc/0001-CVE-2022-23219.patch
new file mode 100644
index 00..dbed6e919c
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0001-CVE-2022-23219.patch
@@ -0,0 +1,55 @@
+From 226b46770c82899b555986583294b049c6ec9b40 Mon Sep 17 00:00:00 2001
+From: Florian Weimer 
+Date: Mon, 17 Jan 2022 10:21:34 +0100
+Subject: [PATCH] CVE-2022-23219: Buffer overflow in sunrpc clnt_create for
+ "unix" (bug 22542)
+
+Processing an overlong pathname in the sunrpc clnt_create function
+results in a stack-based buffer overflow.
+
+Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=226b46770c82899b555986583294b049c6ec9b40]
+CVE: CVE-2022-23219
+
+Reviewed-by: Siddhesh Poyarekar 
+Signed-off-by: Pgowda 
+---
+ NEWS  |  4 +++-
+ sunrpc/clnt_gen.c | 10 +++---
+ 2 files changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index ddd95a8329..38a9ddb2cf 100644
+--- a/NEWS
 b/NEWS
+@@ -151,6 +151,10 @@ Security related changes:
+   CVE-2022-23218: Passing an overlong file name to the svcunix_create
+   legacy function could result in a stack-based buffer overflow.
+ 
++  CVE-2022-23219: Passing an overlong file name to the clnt_create
++  legacy function could result in a stack-based buffer overflow when
++  using the "unix" protocol.  Reported by Martin Sebor.
++
+ The following bugs are resolved with this release:
+ 
+   [10635] libc: realpath portability patches
+diff --git a/sunrpc/clnt_gen.c b/sunrpc/clnt_gen.c
+index 13ced8994e..b44357cd88 100644
+--- a/sunrpc/clnt_gen.c
 b/sunrpc/clnt_gen.c
+@@ -57,9 +57,13 @@ clnt_create (const char *hostname, u_lon
+ 
+   if (strcmp (proto, "unix") == 0)
+ {
+-  memset ((char *), 0, sizeof (sun));
+-  sun.sun_family = AF_UNIX;
+-  strcpy (sun.sun_path, hostname);
++  if (__sockaddr_un_set (, hostname) < 0)
++  {
++struct rpc_createerr *ce = _rpc_createerr ();
++ce->cf_stat = RPC_SYSTEMERROR;
++ce->cf_error.re_errno = errno;
++return NULL;
++  }
+   sock = RPC_ANYSOCK;
+   client = clntunix_create (, prog, vers, , 0, 0);
+   if (client == NULL)
diff --git a/meta/recipes-core/glibc/glibc/0002-CVE-2022-23219.patch 
b/meta/recipes-core/glibc/glibc/0002-CVE-2022-23219.patch
new file mode 100644
index 00..64e283e26a
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0002-CVE-2022-23219.patch
@@ -0,0 +1,89 @@
+From ef972a4c50014a16132b5c75571cfb6b30bef136 Mon Sep 17 00:00:00 2001
+From: Martin Sebor 
+Date: Mon, 17 Jan 2022 10:21:34 +0100
+Subject: [PATCH] sunrpc: Test case for clnt_create "unix" buffer overflow (bug
+ 22542)
+
+Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=ef972a4c50014a16132b5c75571cfb6b30bef136]
+CVE: CVE-2022-23219
+
+Reviewed-by: Siddhesh Poyarekar 
+Signed-off-by: Pgowda 
+---
+ sunrpc/Makefile   |  5 -
+ sunrpc/tst-bug22542.c | 44 +++
+ 2 files changed, 48 insertions(+), 1 deletion(-)
+ create mode 100644 sunrpc/tst-bug22542.c
+
+diff --git a/sunrpc/Makefile b/sunrpc/Makefile
+index 9a31fe48b9..183ef3dc55 100644
+--- a/sunrpc/Makefile
 b/sunrpc/Makefile
+@@ -65,7 +65,7 @@ shared-only-routines = $(routines)
+ endif
+ 
+ tests = tst-xdrmem tst-xdrmem2 test-rpcent tst-udp-error tst-udp-timeout \
+-  tst-udp-nonblocking tst-bug28768
++  tst-udp-nonblocking tst-bug22542 tst-bug28768
+ xtests := tst-getmyaddr
+ 
+ ifeq ($(have-thread-library),yes)
+@@ -111,6 +111,8 @@ $(objpfx)tst-udp-nonblocking: $(common-o
+ $(objpfx)tst-udp-garbage: \
+   $(common-objpfx)linkobj/libc.so $(shared-thread-library)
+ 
++$(objpfx)tst-bug22542: $(common-objpfx)linkobj/libc.so
++
+ else # !have-GLIBC_2.31
+ 
+ routines = $(routines-for-nss)
+diff --git a/sunrpc/tst-bug22542.c b/sunrpc/tst-bug22542.c
+new file mode 100644
+index 00..d6cd79787b
+--- /dev/null
 b/sunrpc/tst-bug22542.c
+@@ -0,0 +1,44 @@
++/* Test to verify that overlong hostname is rejected by clnt_create
++   and doesn't cause a buffer overflow (bug  22542).
++
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; yo

[OE-core] [hardknott][PATCH 1/2] glibc : Fix CVE-2022-23218

2022-01-20 Thread Pgowda
Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=e368b12f6c16b6888dda99ba641e999b9c9643c8]
Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=f545ad4928fa1f27a3075265182b38a4f939a5f7]

Signed-off-by: pgowda 
---
 .../glibc/glibc/0001-CVE-2022-23218.patch | 165 ++
 .../glibc/glibc/0002-CVE-2022-23218.patch | 126 +
 meta/recipes-core/glibc/glibc_2.33.bb |   2 +
 3 files changed, 293 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/0001-CVE-2022-23218.patch
 create mode 100644 meta/recipes-core/glibc/glibc/0002-CVE-2022-23218.patch

diff --git a/meta/recipes-core/glibc/glibc/0001-CVE-2022-23218.patch 
b/meta/recipes-core/glibc/glibc/0001-CVE-2022-23218.patch
new file mode 100644
index 00..2493ea5476
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0001-CVE-2022-23218.patch
@@ -0,0 +1,165 @@
+From e368b12f6c16b6888dda99ba641e999b9c9643c8 Mon Sep 17 00:00:00 2001
+From: Florian Weimer 
+Date: Mon, 17 Jan 2022 10:21:34 +0100
+Subject: [PATCH] socket: Add the __sockaddr_un_set function
+
+Upstream-Status: Backport 
[https://sourceware.org/git/?p=glibc.git;a=commit;h=e368b12f6c16b6888dda99ba641e999b9c9643c8]
+CVE: CVE-2022-23218
+
+Reviewed-by: Siddhesh Poyarekar 
+Signed-off-by: Pgowda 
+---
+ include/sys/un.h | 12 +++
+ socket/Makefile  |  6 +++-
+ socket/sockaddr_un_set.c | 41 
+ socket/tst-sockaddr_un_set.c | 62 
+ 4 files changed, 120 insertions(+), 1 deletion(-)
+ create mode 100644 socket/sockaddr_un_set.c
+ create mode 100644 socket/tst-sockaddr_un_set.c
+
+diff --git a/include/sys/un.h b/include/sys/un.h
+index bdbee99980..152afd9fc7 100644
+--- a/include/sys/un.h
 b/include/sys/un.h
+@@ -1 +1,13 @@
+ #include 
++
++#ifndef _ISOMAC
++
++/* Set ADDR->sun_family to AF_UNIX and ADDR->sun_path to PATHNAME.
++   Return 0 on success or -1 on failure (due to overlong PATHNAME).
++   The caller should always use sizeof (struct sockaddr_un) as the
++   socket address length, disregaring the length of PATHNAME.
++   Only concrete (non-abstract) pathnames are supported.  */
++int __sockaddr_un_set (struct sockaddr_un *addr, const char *pathname)
++  attribute_hidden;
++
++#endif /* _ISOMAC */
+diff --git a/socket/Makefile b/socket/Makefile
+index 39333e10ca..156eec6c85 100644
+--- a/socket/Makefile
 b/socket/Makefile
+@@ -29,7 +29,7 @@ headers  := sys/socket.h sys/un.h bits/so
+ routines := accept bind connect getpeername getsockname getsockopt\
+   listen recv recvfrom recvmsg send sendmsg sendto\
+   setsockopt shutdown socket socketpair isfdtype opensock \
+-  sockatmark accept4 recvmmsg sendmmsg
++  sockatmark accept4 recvmmsg sendmmsg sockaddr_un_set
+ 
+ tests := tst-accept4
+ 
+diff --git a/socket/sockaddr_un_set.c b/socket/sockaddr_un_set.c
+new file mode 100644
+index 00..0bd40dc34e
+--- /dev/null
 b/socket/sockaddr_un_set.c
+@@ -0,0 +1,41 @@
++/* Set the sun_path member of struct sockaddr_un.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library 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
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include 
++#include 
++#include 
++#include 
++
++int
++__sockaddr_un_set (struct sockaddr_un *addr, const char *pathname)
++{
++  size_t name_length = strlen (pathname);
++
++  /* The kernel supports names of exactly sizeof (addr->sun_path)
++ bytes, without a null terminator, but userspace does not; see the
++ SUN_LEN macro.  */
++  if (name_length >= sizeof (addr->sun_path))
++{
++  __set_errno (EINVAL); /* Error code used by the kernel.  */
++  return -1;
++}
++
++  addr->sun_family = AF_UNIX;
++  memcpy (addr->sun_path, pathname, name_length + 1);
++  return 0;
++}
+diff --git a/socket/tst-sockaddr_un_set.c b/socket/tst-sockaddr_un_set.c
+new file mode 100644
+index 00..29c2a81afd
+--- /dev/null
 b/socket/tst-sockaddr_un_set.c
+@@ -0,0 +1,62 @@
++/* Test the __sockaddr_un_set function.
++   Copyright (C) 2022 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it 

[OE-core] [hardknott][PATCH v2] Add ARM support for Neoverse N2 CPU

2022-01-10 Thread Pgowda
This patch backports the Arm support for Neoverse N2 CPU.

Upstream-Status: Backport
[https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=d7e8411f6a333d4054894ad3b23f23415a525230]

Signed-off-by: pgowda 
---
 meta/recipes-devtools/gcc/gcc-10.2.inc   | 1 +
 ...verse-n2-support.patch => 0038-arm-neoverse-n2-support.patch} | 0
 2 files changed, 1 insertion(+)
 rename meta/recipes-devtools/gcc/gcc/{0038-aarch64-neoverse-n2-support.patch 
=> 0038-arm-neoverse-n2-support.patch} (100%)

diff --git a/meta/recipes-devtools/gcc/gcc-10.2.inc 
b/meta/recipes-devtools/gcc/gcc-10.2.inc
index 656c43258c..e7e3395c55 100644
--- a/meta/recipes-devtools/gcc/gcc-10.2.inc
+++ b/meta/recipes-devtools/gcc/gcc-10.2.inc
@@ -74,6 +74,7 @@ SRC_URI = "\
file://0002-CVE-2021-35465.patch \
file://0003-CVE-2021-35465.patch \
file://0004-CVE-2021-35465.patch \
+   file://0038-arm-neoverse-n2-support.patch \
file://0039-arm64-neoverse-n2-support.patch \
file://0001-CVE-2021-42574.patch \
file://0002-CVE-2021-42574.patch \
diff --git 
a/meta/recipes-devtools/gcc/gcc/0038-aarch64-neoverse-n2-support.patch 
b/meta/recipes-devtools/gcc/gcc/0038-arm-neoverse-n2-support.patch
similarity index 100%
rename from meta/recipes-devtools/gcc/gcc/0038-aarch64-neoverse-n2-support.patch
rename to meta/recipes-devtools/gcc/gcc/0038-arm-neoverse-n2-support.patch
-- 
2.31.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#160342): 
https://lists.openembedded.org/g/openembedded-core/message/160342
Mute This Topic: https://lists.openembedded.org/mt/88320517/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [hardknott][PATCH v2] glibc: Backport fix for CVE-2021-43396

2022-01-10 Thread Pgowda
Backport the fix for CVE-2021-43396. It is disputed that this is a
security issue.

(From OE-Core rev: e8de9b01c6b305b2498c5f942397a49ae2af0cde)

Signed-off-by: pgowda 
---
 .../glibc/glibc/0031-CVE-2021-43396.patch | 182 ++
 meta/recipes-core/glibc/glibc_2.33.bb |   1 +
 2 files changed, 183 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/0031-CVE-2021-43396.patch

diff --git a/meta/recipes-core/glibc/glibc/0031-CVE-2021-43396.patch 
b/meta/recipes-core/glibc/glibc/0031-CVE-2021-43396.patch
new file mode 100644
index 00..72fd68b302
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0031-CVE-2021-43396.patch
@@ -0,0 +1,182 @@
+From ff012870b2c02a62598c04daa1e54632e020fd7d Mon Sep 17 00:00:00 2001
+From: Nikita Popov 
+Date: Tue, 2 Nov 2021 13:21:42 +0500
+Subject: [PATCH] gconv: Do not emit spurious NUL character in ISO-2022-JP-3
+ (bug 28524)
+
+Bugfix 27256 has introduced another issue:
+In conversion from ISO-2022-JP-3 encoding, it is possible
+to force iconv to emit extra NUL character on internal state reset.
+To do this, it is sufficient to feed iconv with escape sequence
+which switches active character set.
+The simplified check 'data->__statep->__count != ASCII_set'
+introduced by the aforementioned bugfix picks that case and
+behaves as if '\0' character has been queued thus emitting it.
+
+To eliminate this issue, these steps are taken:
+* Restore original condition
+'(data->__statep->__count & ~7) != ASCII_set'.
+It is necessary since bits 0-2 may contain
+number of buffered input characters.
+* Check that queued character is not NUL.
+Similar step is taken for main conversion loop.
+
+Bundled test case follows following logic:
+* Try to convert ISO-2022-JP-3 escape sequence
+switching active character set
+* Reset internal state by providing NULL as input buffer
+* Ensure that nothing has been converted.
+
+Signed-off-by: Nikita Popov 
+
+CVE: CVE-2021-43396
+Upstream-Status: Backport [ff012870b2c02a62598c04daa1e54632e020fd7d]
+---
+ iconvdata/Makefile|  5 +++-
+ iconvdata/bug-iconv15.c   | 60 +++
+ iconvdata/iso-2022-jp-3.c | 28 --
+ 3 files changed, 84 insertions(+), 9 deletions(-)
+ create mode 100644 iconvdata/bug-iconv15.c
+
+diff --git a/iconvdata/bug-iconv15.c b/iconvdata/bug-iconv15.c
+new file mode 100644
+--- /dev/null
 b/iconvdata/bug-iconv15.c
+@@ -0,0 +1,60 @@
++/* Bug 28524: Conversion from ISO-2022-JP-3 with iconv
++   may emit spurious NUL character on state reset.
++   Copyright (C) The GNU Toolchain Authors.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library 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
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include 
++#include 
++#include 
++
++static int
++do_test (void)
++{
++  char in[] = "\x1b(I";
++  char *inbuf = in;
++  size_t inleft = sizeof (in) - 1;
++  char out[1];
++  char *outbuf = out;
++  size_t outleft = sizeof (out);
++  iconv_t cd;
++
++  cd = iconv_open ("UTF8", "ISO-2022-JP-3");
++  TEST_VERIFY_EXIT (cd != (iconv_t) -1);
++
++  /* First call to iconv should alter internal state.
++ Now, JISX0201_Kana_set is selected and
++ state value != ASCII_set.  */
++  TEST_VERIFY (iconv (cd, , , , ) != (size_t) -1);
++
++  /* No bytes should have been added to
++ the output buffer at this point.  */
++  TEST_VERIFY (outbuf == out);
++  TEST_VERIFY (outleft == sizeof (out));
++
++  /* Second call shall emit spurious NUL character in unpatched glibc.  */
++  TEST_VERIFY (iconv (cd, NULL, NULL, , ) != (size_t) -1);
++
++  /* No characters are expected to be produced.  */
++  TEST_VERIFY (outbuf == out);
++  TEST_VERIFY (outleft == sizeof (out));
++
++  TEST_VERIFY_EXIT (iconv_close (cd) != -1);
++
++  return 0;
++}
++
++#include 
+diff --git a/iconvdata/iso-2022-jp-3.c b/iconvdata/iso-2022-jp-3.c
+--- a/iconvdata/iso-2022-jp-3.c
 b/iconvdata/iso-2022-jp-3.c
+@@ -1,5 +1,6 @@
+ /* Conversion module for ISO-2022-JP-3.
+Copyright (C) 1998-2021 Free Software Foundation, Inc.
++   Copyright (C) The GNU Toolchain Authors.
+This file is part of the GNU C Library.
+Contributed by Ulrich Drepper , 1998,
+and Bruno Haible , 2002.
+@@ -81,20 +82,31 @@ enum
+the output state to the initial state.  This has to be done during

Re: [OE-core] [hardknott][PATCH] AArch64 support for Arm's Neoverse N2 CPU

2022-01-06 Thread Pgowda
Hi Anuj,

Thanks very much for the information.

Regards,
Pgowda

On Thu, Jan 6, 2022 at 7:57 PM Mittal, Anuj  wrote:
>
> On Thu, 2022-01-06 at 16:11 +0530, pgowda cve wrote:
> > Hi,
> >
> > Gentle ping on this patch.
> >
>
> I will take this and rest of gcc patches in next week's merge request.
>
> Thanks,
>
> Anuj
>
> > Thanks,
> > Pgowda
> >
> > On Tue, Dec 21, 2021 at 4:11 PM pgowda  wrote:
> > >
> > > The patch backports the AArch64 support for Arm's Neoverse N2 CPU
> > > Upstream-Status: Backport
> > > [https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9428e9267435a62f
> > > 672e2ba42df46432c021a9cf]
> > >
> > > Signed-off-by: pgowda 
> > > ---
> > >  meta/recipes-devtools/gcc/gcc-10.2.inc|  1 +
> > >  .../gcc/0039-arm64-neoverse-n2-support.patch  | 60
> > > +++
> > >  2 files changed, 61 insertions(+)
> > >  create mode 100644 meta/recipes-devtools/gcc/gcc/0039-arm64-
> > > neoverse-n2-support.patch
> > >
> > > diff --git a/meta/recipes-devtools/gcc/gcc-10.2.inc b/meta/recipes-
> > > devtools/gcc/gcc-10.2.inc
> > > index 5626bf20f0..89158258d7 100644
> > > --- a/meta/recipes-devtools/gcc/gcc-10.2.inc
> > > +++ b/meta/recipes-devtools/gcc/gcc-10.2.inc
> > > @@ -74,6 +74,7 @@ SRC_URI = "\
> > > file://0002-CVE-2021-35465.patch \
> > > file://0003-CVE-2021-35465.patch \
> > > file://0004-CVE-2021-35465.patch \
> > > +   file://0039-arm64-neoverse-n2-support.patch \
> > >  "
> > >  SRC_URI[sha256sum] =
> > > "b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c"
> > >
> > > diff --git a/meta/recipes-devtools/gcc/gcc/0039-arm64-neoverse-n2-
> > > support.patch b/meta/recipes-devtools/gcc/gcc/0039-arm64-neoverse-
> > > n2-support.patch
> > > new file mode 100644
> > > index 00..b3e0f396bd
> > > --- /dev/null
> > > +++ b/meta/recipes-devtools/gcc/gcc/0039-arm64-neoverse-n2-
> > > support.patch
> > > @@ -0,0 +1,60 @@
> > > +From 9428e9267435a62f672e2ba42df46432c021a9cf Mon Sep 17 00:00:00
> > > 2001
> > > +From: Alex Coplan 
> > > +Date: Tue, 29 Sep 2020 17:09:09 +0100
> > > +Subject: [PATCH] aarch64: Add support for Neoverse N2 CPU
> > > +
> > > +This patch backports the AArch64 support for Arm's Neoverse N2 CPU
> > > to
> > > +GCC 10.
> > > +
> > > +gcc/ChangeLog:
> > > +
> > > +   * config/aarch64/aarch64-cores.def: Add Neoverse N2.
> > > +   * config/aarch64/aarch64-tune.md: Regenerate.
> > > +   * doc/invoke.texi: Document AArch64 support for Neoverse
> > > N2.
> > > +
> > > +Upstream-Status: Backport
> > > [https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9428e9267435a62f
> > > 672e2ba42df46432c021a9cf]
> > > +
> > > +Signed-off-by: pgowda 
> > > +---
> > > + gcc/config/aarch64/aarch64-cores.def | 3 +++
> > > + gcc/config/aarch64/aarch64-tune.md   | 2 +-
> > > + gcc/doc/invoke.texi  | 4 ++--
> > > + 3 files changed, 6 insertions(+), 3 deletions(-)
> > > +
> > > +diff --git a/gcc/config/aarch64/aarch64-cores.def
> > > b/gcc/config/aarch64/aarch64-cores.def
> > > +--- a/gcc/config/aarch64/aarch64-cores.def 2020-07-22
> > > 23:35:17.320384289 -0700
> > >  b/gcc/config/aarch64/aarch64-cores.def 2021-12-21
> > > 01:08:45.518472342 -0800
> > > +@@ -135,6 +135,9 @@ AARCH64_CORE("zeus", zeus, cortexa57, 8_
> > > + /* Qualcomm ('Q') cores. */
> > > + AARCH64_CORE("saphira", saphira,saphira,8_4A,
> > > AARCH64_FL_FOR_ARCH8_4 | AARCH64_FL_CRYPTO | AARCH64_FL_RCPC,
> > > saphira,   0x51, 0xC01, -1)
> > > +
> > > ++/* Armv8.5-A Architecture Processors.  */
> > > ++AARCH64_CORE("neoverse-n2", neoversen2, cortexa57, 8_5A,
> > > AARCH64_FL_FOR_ARCH8_5 | AARCH64_FL_I8MM | AARCH64_FL_BF16 |
> > > AARCH64_FL_F16 | AARCH64_FL_SVE | AARCH64_FL_SVE2 |
> > > AARCH64_FL_SVE2_BITPERM | AARCH64_FL_RNG | AARCH64_FL_MEMTAG,
> > > neoversen1, 0x41, 0xd49, -1)
> > > ++
> > > + /* ARMv8-A big.LITTLE implementations.  */
> > > +
> > > + AARCH64_CORE("cortex-a57.cortex-a53",  cortexa57cortexa53,
> > > cortexa53, 8A,  AARCH64_FL_FOR_ARCH8 | AARCH64_FL_CRC, cortexa57,
> > 

Re: [OE-core] [PATCH v3] gcc: Fix CVE-2021-42574 testcase

2022-01-06 Thread Pgowda
Hi,

Gentle ping on this patch.

The patch modifies the testcases in UTF-8 format to execute as expected.

Thanks,
Pgowda

On Sat, Dec 25, 2021 at 8:02 PM pgowda  wrote:
>
> Modify the testcases properly to generate expected output.
>
> Upstream-Status: Backport 
> [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=51c500269bf53749b107807d84271385fad35628]
> Upstream-Status: Backport 
> [https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=bef32d4a28595e933f24fef378cf052a30b674a7]
>
> Signed-off-by: pgowda 
> ---
>  .../gcc/gcc/0002-CVE-2021-42574.patch | 536 --
>  .../gcc/gcc/0004-CVE-2021-42574.patch |  20 +-
>  2 files changed, 258 insertions(+), 298 deletions(-)
>
> diff --git a/meta/recipes-devtools/gcc/gcc/0002-CVE-2021-42574.patch 
> b/meta/recipes-devtools/gcc/gcc/0002-CVE-2021-42574.patch
> index 9bad81d4d0..d40735621a 100644
> --- a/meta/recipes-devtools/gcc/gcc/0002-CVE-2021-42574.patch
> +++ b/meta/recipes-devtools/gcc/gcc/0002-CVE-2021-42574.patch
> @@ -142,9 +142,8 @@ Signed-off-by: Pgowda 
>   create mode 100644 gcc/testsuite/c-c++-common/Wbidi-chars-9.c
>
>  diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
> -index 8a4cd634f77..3976fc368db 100644
>  a/gcc/c-family/c.opt
> -+++ b/gcc/c-family/c.opt
> +--- a/gcc/c-family/c.opt   2021-12-24 20:36:18.424153360 -0800
>  b/gcc/c-family/c.opt   2021-12-24 20:52:31.835651314 -0800
>  @@ -370,6 +370,30 @@ Wbad-function-cast
>   C ObjC Var(warn_bad_function_cast) Warning
>   Warn about casting functions to incompatible types.
> @@ -177,9 +176,8 @@ index 8a4cd634f77..3976fc368db 100644
>   C ObjC C++ ObjC++ Var(warn_bool_compare) Warning LangEnabledBy(C ObjC C++ 
> ObjC++,Wall)
>   Warn about boolean expression compared with an integer value different from 
> true/false.
>  diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> -index 6070288856c..a22758d18ee 100644
>  a/gcc/doc/invoke.texi
> -+++ b/gcc/doc/invoke.texi
> +--- a/gcc/doc/invoke.texi  2021-12-24 20:36:21.264105609 -0800
>  b/gcc/doc/invoke.texi  2021-12-24 20:52:31.843651178 -0800
>  @@ -326,7 +326,9 @@ Objective-C and Objective-C++ Dialects}.
>   -Warith-conversion @gol
>   -Warray-bounds  -Warray-bounds=@var{n} @gol
> @@ -216,17 +214,15 @@ index 6070288856c..a22758d18ee 100644
>   @opindex Wno-bool-compare
>   @opindex Wbool-compare
>  diff --git a/gcc/testsuite/c-c++-common/Wbidi-chars-10.c 
> b/gcc/testsuite/c-c++-common/Wbidi-chars-10.c
> -new file mode 100644
> -index 000..34f5ac19271
>  /dev/null
> -+++ b/gcc/testsuite/c-c++-common/Wbidi-chars-10.c
> +--- a/gcc/testsuite/c-c++-common/Wbidi-chars-10.c  1969-12-31 
> 16:00:00.0 -0800
>  b/gcc/testsuite/c-c++-common/Wbidi-chars-10.c  2021-12-24 
> 20:53:10.051000540 -0800
>  @@ -0,0 +1,27 @@
>  +/* PR preprocessor/103026 */
>  +/* { dg-do compile } */
>  +/* { dg-options "-Wbidi-chars=unpaired" } */
>  +/* More nesting testing.  */
>  +
> -+/* RLEâ« LRI⦠PDF⬠PDIâ©*/
> ++/* RLE‫ LRI⁦ PDF‬ PDI⁩*/
>  +/* { dg-warning "unpaired" "" { target *-*-* } .-1 } */
>  +int LRE_\u202a_PDF_\u202c;
>  +int LRE_\u202a_PDF_\u202c_LRE_\u202a_PDF_\u202c;
> @@ -249,75 +245,69 @@ index 000..34f5ac19271
>  +int 
> RLI_\u2067_RLI_\u2067_RLI_\u2067_RLI_\u2067_FSI_\u2068_PDI_\u2069_PDI_\u2069_PDI_\u2069_PDI_\u2069;
>  +/* { dg-warning "unpaired" "" { target *-*-* } .-1 } */
>  diff --git a/gcc/testsuite/c-c++-common/Wbidi-chars-11.c 
> b/gcc/testsuite/c-c++-common/Wbidi-chars-11.c
> -new file mode 100644
> -index 000..270ce2368a9
>  /dev/null
> -+++ b/gcc/testsuite/c-c++-common/Wbidi-chars-11.c
> +--- a/gcc/testsuite/c-c++-common/Wbidi-chars-11.c  1969-12-31 
> 16:00:00.0 -0800
>  b/gcc/testsuite/c-c++-common/Wbidi-chars-11.c  2021-12-24 
> 20:53:10.562991821 -0800
>  @@ -0,0 +1,13 @@
>  +/* PR preprocessor/103026 */
>  +/* { dg-do compile } */
>  +/* { dg-options "-Wbidi-chars=unpaired" } */
>  +/* Test that we warn when mixing UCN and UTF-8.  */
>  +
> -+int LRE_âª_PDF_\u202c;
> ++int LRE_‪_PDF_\u202c;
>  +/* { dg-warning "mismatch" "" { target *-*-* } .-1 } */
> -+int LRE_\u202a_PDF_â¬_;
> ++int LRE_\u202a_PDF_‬_;
>  +/* { dg-warning "mismatch" "" { target *-*-* } .-1 } */
> -+const char *s1 = "LRE_âª_PDF_\u202c";
> ++const char *s1 = "LRE_‪_PDF_\u202c";
>  +/* { dg-warning "mismatch" "" { target *-*-* } .-1 } */
> -+const char *s2 = "LRE_\u202a_PDF_â¬";
> ++const char *s2 = "LRE_\u202a_PDF_‬";
>  +/* { dg-warning "mismatch" "" { target *-*-* }

Re: [OE-core] [hardknott][PATCH] AArch64 support for Arm's Neoverse N2 CPU

2022-01-06 Thread Pgowda
Hi,

Gentle ping on this patch.

Thanks,
Pgowda

On Tue, Dec 21, 2021 at 4:11 PM pgowda  wrote:
>
> The patch backports the AArch64 support for Arm's Neoverse N2 CPU
> Upstream-Status: Backport 
> [https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9428e9267435a62f672e2ba42df46432c021a9cf]
>
> Signed-off-by: pgowda 
> ---
>  meta/recipes-devtools/gcc/gcc-10.2.inc|  1 +
>  .../gcc/0039-arm64-neoverse-n2-support.patch  | 60 +++
>  2 files changed, 61 insertions(+)
>  create mode 100644 
> meta/recipes-devtools/gcc/gcc/0039-arm64-neoverse-n2-support.patch
>
> diff --git a/meta/recipes-devtools/gcc/gcc-10.2.inc 
> b/meta/recipes-devtools/gcc/gcc-10.2.inc
> index 5626bf20f0..89158258d7 100644
> --- a/meta/recipes-devtools/gcc/gcc-10.2.inc
> +++ b/meta/recipes-devtools/gcc/gcc-10.2.inc
> @@ -74,6 +74,7 @@ SRC_URI = "\
> file://0002-CVE-2021-35465.patch \
> file://0003-CVE-2021-35465.patch \
> file://0004-CVE-2021-35465.patch \
> +   file://0039-arm64-neoverse-n2-support.patch \
>  "
>  SRC_URI[sha256sum] = 
> "b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c"
>
> diff --git 
> a/meta/recipes-devtools/gcc/gcc/0039-arm64-neoverse-n2-support.patch 
> b/meta/recipes-devtools/gcc/gcc/0039-arm64-neoverse-n2-support.patch
> new file mode 100644
> index 00..b3e0f396bd
> --- /dev/null
> +++ b/meta/recipes-devtools/gcc/gcc/0039-arm64-neoverse-n2-support.patch
> @@ -0,0 +1,60 @@
> +From 9428e9267435a62f672e2ba42df46432c021a9cf Mon Sep 17 00:00:00 2001
> +From: Alex Coplan 
> +Date: Tue, 29 Sep 2020 17:09:09 +0100
> +Subject: [PATCH] aarch64: Add support for Neoverse N2 CPU
> +
> +This patch backports the AArch64 support for Arm's Neoverse N2 CPU to
> +GCC 10.
> +
> +gcc/ChangeLog:
> +
> +   * config/aarch64/aarch64-cores.def: Add Neoverse N2.
> +   * config/aarch64/aarch64-tune.md: Regenerate.
> +   * doc/invoke.texi: Document AArch64 support for Neoverse N2.
> +
> +Upstream-Status: Backport 
> [https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9428e9267435a62f672e2ba42df46432c021a9cf]
> +
> +Signed-off-by: pgowda 
> +---
> + gcc/config/aarch64/aarch64-cores.def | 3 +++
> + gcc/config/aarch64/aarch64-tune.md   | 2 +-
> + gcc/doc/invoke.texi  | 4 ++--
> + 3 files changed, 6 insertions(+), 3 deletions(-)
> +
> +diff --git a/gcc/config/aarch64/aarch64-cores.def 
> b/gcc/config/aarch64/aarch64-cores.def
> +--- a/gcc/config/aarch64/aarch64-cores.def 2020-07-22 23:35:17.320384289 
> -0700
>  b/gcc/config/aarch64/aarch64-cores.def 2021-12-21 01:08:45.518472342 
> -0800
> +@@ -135,6 +135,9 @@ AARCH64_CORE("zeus", zeus, cortexa57, 8_
> + /* Qualcomm ('Q') cores. */
> + AARCH64_CORE("saphira", saphira,saphira,8_4A,  
> AARCH64_FL_FOR_ARCH8_4 | AARCH64_FL_CRYPTO | AARCH64_FL_RCPC, saphira,   
> 0x51, 0xC01, -1)
> +
> ++/* Armv8.5-A Architecture Processors.  */
> ++AARCH64_CORE("neoverse-n2", neoversen2, cortexa57, 8_5A, 
> AARCH64_FL_FOR_ARCH8_5 | AARCH64_FL_I8MM | AARCH64_FL_BF16 | AARCH64_FL_F16 | 
> AARCH64_FL_SVE | AARCH64_FL_SVE2 | AARCH64_FL_SVE2_BITPERM | AARCH64_FL_RNG | 
> AARCH64_FL_MEMTAG, neoversen1, 0x41, 0xd49, -1)
> ++
> + /* ARMv8-A big.LITTLE implementations.  */
> +
> + AARCH64_CORE("cortex-a57.cortex-a53",  cortexa57cortexa53, cortexa53, 8A,  
> AARCH64_FL_FOR_ARCH8 | AARCH64_FL_CRC, cortexa57, 0x41, AARCH64_BIG_LITTLE 
> (0xd07, 0xd03), -1)
> +diff --git a/gcc/config/aarch64/aarch64-tune.md 
> b/gcc/config/aarch64/aarch64-tune.md
> +--- a/gcc/config/aarch64/aarch64-tune.md   2020-07-22 23:35:54.684795913 
> -0700
>  b/gcc/config/aarch64/aarch64-tune.md   2021-12-21 01:09:56.829252050 
> -0800
> +@@ -1,5 +1,5 @@
> + ;; -*- buffer-read-only: t -*-
> + ;; Generated automatically by gentune.sh from aarch64-cores.def
> + (define_attr "tune"
> +-  
> "cortexa34,cortexa35,cortexa53,cortexa57,cortexa72,cortexa73,thunderx,thunderxt88p1,thunderxt88,octeontx,octeontxt81,octeontxt83,thunderxt81,thunderxt83,emag,xgene1,falkor,qdf24xx,exynosm1,phecda,thunderx2t99p1,vulcan,thunderx2t99,cortexa55,cortexa75,cortexa76,cortexa76ae,cortexa77,cortexa65,cortexa65ae,ares,neoversen1,neoversee1,octeontx2,octeontx2t98,octeontx2t96,octeontx2t93,octeontx2f95,octeontx2f95n,octeontx2f95mm,tsv110,thunderx3t110,zeus,saphira,cortexa57cortexa53,cortexa72cortexa53,cortexa73cortexa35,cortexa73cortexa53,cortexa75cortexa55,cortexa76cortexa55"
> ++  
> "cortexa34,cortexa35,cortexa53,cortexa57,cortexa72,cortexa73,thunderx,thunderxt88p1,thunderxt88,octeontx,octeontxt81,octeontxt83,thunderxt81,thunderxt83,emag,xgene1,falko

Re: [OE-core] [hardknott][PATCH] Add support for Neoverse N2 CPU

2022-01-06 Thread Pgowda
Hi,

Gentle ping on this patch.

Thanks,
Pgowda

On Fri, Dec 24, 2021 at 11:16 AM Khem Raj  wrote:
>
> lgtm
>
> On Mon, Dec 20, 2021 at 10:00 PM Pgowda  wrote:
> >
> > This patch backports the AArch32 support for Arm's Neoverse N2 CPU.
> >
> > Upstream-Status: Backport
> > [https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=d7e8411f6a333d4054894ad3b23f23415a525230]
> >
> > Signed-off-by: pgowda 
> > ---
> >  meta/recipes-devtools/gcc/gcc-10.2.inc|  1 +
> >  .../0038-aarch64-neoverse-n2-support.patch| 88 +++
> >  2 files changed, 89 insertions(+)
> >  create mode 100644 
> > meta/recipes-devtools/gcc/gcc/0038-aarch64-neoverse-n2-support.patch
> >
> > diff --git a/meta/recipes-devtools/gcc/gcc-10.2.inc 
> > b/meta/recipes-devtools/gcc/gcc-10.2.inc
> > index 5626bf20f0..8fcc53df38 100644
> > --- a/meta/recipes-devtools/gcc/gcc-10.2.inc
> > +++ b/meta/recipes-devtools/gcc/gcc-10.2.inc
> > @@ -74,6 +74,7 @@ SRC_URI = "\
> > file://0002-CVE-2021-35465.patch \
> > file://0003-CVE-2021-35465.patch \
> > file://0004-CVE-2021-35465.patch \
> > +   file://0038-aarch64-neoverse-n2-support.patch \
> >  "
> >  SRC_URI[sha256sum] = 
> > "b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c"
> >
> > diff --git 
> > a/meta/recipes-devtools/gcc/gcc/0038-aarch64-neoverse-n2-support.patch 
> > b/meta/recipes-devtools/gcc/gcc/0038-aarch64-neoverse-n2-support.patch
> > new file mode 100644
> > index 00..3e42266b81
> > --- /dev/null
> > +++ b/meta/recipes-devtools/gcc/gcc/0038-aarch64-neoverse-n2-support.patch
> > @@ -0,0 +1,88 @@
> > +From d7e8411f6a333d4054894ad3b23f23415a525230 Mon Sep 17 00:00:00 2001
> > +From: Alex Coplan 
> > +Date: Fri, 2 Oct 2020 16:06:15 +0100
> > +Subject: [PATCH] arm: Add support for Neoverse N2 CPU
> > +
> > +This patch backports the AArch32 support for Arm's Neoverse N2 CPU to
> > +GCC 10.
> > +
> > +gcc/ChangeLog:
> > +
> > +   * config/arm/arm-cpus.in (neoverse-n2): New.
> > +   * config/arm/arm-tables.opt: Regenerate.
> > +   * config/arm/arm-tune.md: Regenerate.
> > +   * doc/invoke.texi: Document support for Neoverse N2.
> > +
> > +Upstream-Status: Backport 
> > [https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=d7e8411f6a333d4054894ad3b23f23415a525230]
> > +
> > +Signed-off-by: pgowda 
> > +---
> > + gcc/config/arm/arm-cpus.in| 12 
> > + gcc/config/arm/arm-tables.opt |  3 +++
> > + gcc/config/arm/arm-tune.md|  5 +++--
> > + gcc/doc/invoke.texi   |  6 +++---
> > + 4 files changed, 21 insertions(+), 5 deletions(-)
> > +
> > +diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in
> > +--- a/gcc/config/arm/arm-cpus.in   2021-12-20 20:24:59.912159845 -0800
> >  b/gcc/config/arm/arm-cpus.in   2021-12-20 21:00:04.417003845 -0800
> > +@@ -1481,6 +1481,18 @@ begin cpu cortex-a76.cortex-a55
> > +  costs cortex_a57
> > + end cpu cortex-a76.cortex-a55
> > +
> > ++# Armv8.5 A-profile Architecture Processors
> > ++begin cpu neoverse-n2
> > ++  cname neoversen2
> > ++  tune for cortex-a57
> > ++  tune flags LDSCHED
> > ++  architecture armv8.5-a+fp16+bf16+i8mm
> > ++  option crypto add FP_ARMv8 CRYPTO
> > ++  costs cortex_a57
> > ++  vendor 41
> > ++  part 0xd49
> > ++end cpu neoverse-n2
> > ++
> > + # V8 M-profile implementations.
> > + begin cpu cortex-m23
> > +  cname cortexm23
> > +diff --git a/gcc/config/arm/arm-tables.opt b/gcc/config/arm/arm-tables.opt
> > +--- a/gcc/config/arm/arm-tables.opt2020-07-22 23:35:54.688795958 -0700
> >  b/gcc/config/arm/arm-tables.opt2021-12-20 21:00:04.421003776 -0800
> > +@@ -253,6 +253,9 @@ EnumValue
> > + Enum(processor_type) String(cortex-m23) Value( TARGET_CPU_cortexm23)
> > +
> > + EnumValue
> > ++Enum(processor_type) String(neoverse-n2) Value( TARGET_CPU_neoversen2)
> > ++
> > ++EnumValue
> > + Enum(processor_type) String(cortex-m33) Value( TARGET_CPU_cortexm33)
> > +
> > + EnumValue
> > +diff --git a/gcc/config/arm/arm-tune.md b/gcc/config/arm/arm-tune.md
> > +--- a/gcc/config/arm/arm-tune.md   2020-07-22 23:35:54.684795913 -0700
> >  b/gcc/config/arm/arm-tune.md   2021-12-20 21:02:44.630260284 -0800
> > +@@ -46,6 +46,6 @@
> > +   cortexa73cortexa53,cortexa55,cortexa75,
> > +   cortexa76,cortexa76ae,cortexa77,
> > +   n

Re: [OE-core] [hardknott][PATCH] glibc: Backport fix for CVE-2021-43396

2022-01-06 Thread Pgowda
Hi,

Gentle ping on this patch.

Thanks,
Pgowda

On Thu, Dec 2, 2021 at 1:08 PM pgowda  wrote:
>
> Backport the fix for CVE-2021-43396. It is disputed that this is a
> security issue.
>
> (From OE-Core rev: e8de9b01c6b305b2498c5f942397a49ae2af0cde)
>
> Signed-off-by: pgowda 
> ---
>  .../glibc/glibc/0031-CVE-2021-43396.patch | 188 ++
>  meta/recipes-core/glibc/glibc_2.33.bb |   1 +
>  2 files changed, 189 insertions(+)
>  create mode 100644 meta/recipes-core/glibc/glibc/0031-CVE-2021-43396.patch
>
> diff --git a/meta/recipes-core/glibc/glibc/0031-CVE-2021-43396.patch 
> b/meta/recipes-core/glibc/glibc/0031-CVE-2021-43396.patch
> new file mode 100644
> index 00..179b0c559d
> --- /dev/null
> +++ b/meta/recipes-core/glibc/glibc/0031-CVE-2021-43396.patch
> @@ -0,0 +1,188 @@
> +From ff012870b2c02a62598c04daa1e54632e020fd7d Mon Sep 17 00:00:00 2001
> +From: Nikita Popov 
> +Date: Tue, 2 Nov 2021 13:21:42 +0500
> +Subject: [PATCH] gconv: Do not emit spurious NUL character in ISO-2022-JP-3
> + (bug 28524)
> +
> +Bugfix 27256 has introduced another issue:
> +In conversion from ISO-2022-JP-3 encoding, it is possible
> +to force iconv to emit extra NUL character on internal state reset.
> +To do this, it is sufficient to feed iconv with escape sequence
> +which switches active character set.
> +The simplified check 'data->__statep->__count != ASCII_set'
> +introduced by the aforementioned bugfix picks that case and
> +behaves as if '\0' character has been queued thus emitting it.
> +
> +To eliminate this issue, these steps are taken:
> +* Restore original condition
> +'(data->__statep->__count & ~7) != ASCII_set'.
> +It is necessary since bits 0-2 may contain
> +number of buffered input characters.
> +* Check that queued character is not NUL.
> +Similar step is taken for main conversion loop.
> +
> +Bundled test case follows following logic:
> +* Try to convert ISO-2022-JP-3 escape sequence
> +switching active character set
> +* Reset internal state by providing NULL as input buffer
> +* Ensure that nothing has been converted.
> +
> +Signed-off-by: Nikita Popov 
> +
> +CVE: CVE-2021-43396
> +Upstream-Status: Backport [ff012870b2c02a62598c04daa1e54632e020fd7d]
> +---
> + iconvdata/Makefile|  5 +++-
> + iconvdata/bug-iconv15.c   | 60 +++
> + iconvdata/iso-2022-jp-3.c | 28 --
> + 3 files changed, 84 insertions(+), 9 deletions(-)
> + create mode 100644 iconvdata/bug-iconv15.c
> +
> +diff --git a/iconvdata/Makefile b/iconvdata/Makefile
> +index c216f959df..d5507a048c 100644
> +--- a/iconvdata/Makefile
>  b/iconvdata/Makefile
> +@@ -1,4 +1,5 @@
> + # Copyright (C) 1997-2021 Free Software Foundation, Inc.
> ++# Copyright (C) The GNU Toolchain Authors.
> + # This file is part of the GNU C Library.
> +
> + # The GNU C Library is free software; you can redistribute it and/or
> +@@ -74,7 +75,7 @@ ifeq (yes,$(build-shared))
> + tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \
> +   tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7 bug-iconv8 bug-iconv9 \
> +   bug-iconv10 bug-iconv11 bug-iconv12 tst-iconv-big5-hkscs-to-2ucs4 \
> +-  bug-iconv13 bug-iconv14
> ++  bug-iconv13 bug-iconv14 bug-iconv15
> + ifeq ($(have-thread-library),yes)
> + tests += bug-iconv3
> + endif
> +@@ -327,6 +328,8 @@ $(objpfx)bug-iconv12.out: $(addprefix $(objpfx), 
> $(gconv-modules)) \
> + $(addprefix $(objpfx),$(modules.so))
> + $(objpfx)bug-iconv14.out: $(addprefix $(objpfx), $(gconv-modules)) \
> + $(addprefix $(objpfx),$(modules.so))
> ++$(objpfx)bug-iconv15.out: $(addprefix $(objpfx), $(gconv-modules)) \
> ++$(addprefix $(objpfx),$(modules.so))
> +
> + $(objpfx)iconv-test.out: run-iconv-test.sh \
> +$(addprefix $(objpfx), $(gconv-modules)) \
> +diff --git a/iconvdata/bug-iconv15.c b/iconvdata/bug-iconv15.c
> +new file mode 100644
> +index 00..cc04bd0313
> +--- /dev/null
>  b/iconvdata/bug-iconv15.c
> +@@ -0,0 +1,60 @@
> ++/* Bug 28524: Conversion from ISO-2022-JP-3 with iconv
> ++   may emit spurious NUL character on state reset.
> ++   Copyright (C) The GNU Toolchain Authors.
> ++   This file is part of the GNU C Library.
> ++
> ++   The GNU C Library is free software; you can redistribute it and/or
> ++   modify it under the terms of the GNU Lesser General Public
> ++   License as published by the Free Software Foundation; either
> ++   version 2.1 of the License, or (at your option) any later version.
> ++
> ++   The GNU C Library is distributed in the hope that it 

Re: [OE-core] [hardknott][PATCH] gcc: Fix CVE-2021-42574

2022-01-04 Thread Pgowda
Hi Khem Raj,

> Key is When git send-email asks for UTF-8 encoding for the patch then do not 
> enter “y” but just press
> Enter

Thanks for informing about the method to post UTF-8 format patches.

Posted the patch as per your suggestion at :-
https://lists.openembedded.org/g/openembedded-core/message/160175

Thanks,
Pgowda

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#160177): 
https://lists.openembedded.org/g/openembedded-core/message/160177
Mute This Topic: https://lists.openembedded.org/mt/88011740/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH v3] gcc: Fix CVE-2021-42574 testcase

2021-12-25 Thread Pgowda
Modify the testcases properly to generate expected output.

Upstream-Status: Backport 
[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=51c500269bf53749b107807d84271385fad35628]
Upstream-Status: Backport 
[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=bef32d4a28595e933f24fef378cf052a30b674a7]

Signed-off-by: pgowda 
---
 .../gcc/gcc/0002-CVE-2021-42574.patch | 536 --
 .../gcc/gcc/0004-CVE-2021-42574.patch |  20 +-
 2 files changed, 258 insertions(+), 298 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc/0002-CVE-2021-42574.patch 
b/meta/recipes-devtools/gcc/gcc/0002-CVE-2021-42574.patch
index 9bad81d4d0..d40735621a 100644
--- a/meta/recipes-devtools/gcc/gcc/0002-CVE-2021-42574.patch
+++ b/meta/recipes-devtools/gcc/gcc/0002-CVE-2021-42574.patch
@@ -142,9 +142,8 @@ Signed-off-by: Pgowda 
  create mode 100644 gcc/testsuite/c-c++-common/Wbidi-chars-9.c
 
 diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
-index 8a4cd634f77..3976fc368db 100644
 a/gcc/c-family/c.opt
-+++ b/gcc/c-family/c.opt
+--- a/gcc/c-family/c.opt   2021-12-24 20:36:18.424153360 -0800
 b/gcc/c-family/c.opt   2021-12-24 20:52:31.835651314 -0800
 @@ -370,6 +370,30 @@ Wbad-function-cast
  C ObjC Var(warn_bad_function_cast) Warning
  Warn about casting functions to incompatible types.
@@ -177,9 +176,8 @@ index 8a4cd634f77..3976fc368db 100644
  C ObjC C++ ObjC++ Var(warn_bool_compare) Warning LangEnabledBy(C ObjC C++ 
ObjC++,Wall)
  Warn about boolean expression compared with an integer value different from 
true/false.
 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
-index 6070288856c..a22758d18ee 100644
 a/gcc/doc/invoke.texi
-+++ b/gcc/doc/invoke.texi
+--- a/gcc/doc/invoke.texi  2021-12-24 20:36:21.264105609 -0800
 b/gcc/doc/invoke.texi  2021-12-24 20:52:31.843651178 -0800
 @@ -326,7 +326,9 @@ Objective-C and Objective-C++ Dialects}.
  -Warith-conversion @gol
  -Warray-bounds  -Warray-bounds=@var{n} @gol
@@ -216,17 +214,15 @@ index 6070288856c..a22758d18ee 100644
  @opindex Wno-bool-compare
  @opindex Wbool-compare
 diff --git a/gcc/testsuite/c-c++-common/Wbidi-chars-10.c 
b/gcc/testsuite/c-c++-common/Wbidi-chars-10.c
-new file mode 100644
-index 000..34f5ac19271
 /dev/null
-+++ b/gcc/testsuite/c-c++-common/Wbidi-chars-10.c
+--- a/gcc/testsuite/c-c++-common/Wbidi-chars-10.c  1969-12-31 
16:00:00.0 -0800
 b/gcc/testsuite/c-c++-common/Wbidi-chars-10.c  2021-12-24 
20:53:10.051000540 -0800
 @@ -0,0 +1,27 @@
 +/* PR preprocessor/103026 */
 +/* { dg-do compile } */
 +/* { dg-options "-Wbidi-chars=unpaired" } */
 +/* More nesting testing.  */
 +
-+/* RLEâ« LRI⦠PDF⬠PDIâ©*/
++/* RLE‫ LRI⁦ PDF‬ PDI⁩*/
 +/* { dg-warning "unpaired" "" { target *-*-* } .-1 } */
 +int LRE_\u202a_PDF_\u202c;
 +int LRE_\u202a_PDF_\u202c_LRE_\u202a_PDF_\u202c;
@@ -249,75 +245,69 @@ index 000..34f5ac19271
 +int 
RLI_\u2067_RLI_\u2067_RLI_\u2067_RLI_\u2067_FSI_\u2068_PDI_\u2069_PDI_\u2069_PDI_\u2069_PDI_\u2069;
 +/* { dg-warning "unpaired" "" { target *-*-* } .-1 } */
 diff --git a/gcc/testsuite/c-c++-common/Wbidi-chars-11.c 
b/gcc/testsuite/c-c++-common/Wbidi-chars-11.c
-new file mode 100644
-index 000..270ce2368a9
 /dev/null
-+++ b/gcc/testsuite/c-c++-common/Wbidi-chars-11.c
+--- a/gcc/testsuite/c-c++-common/Wbidi-chars-11.c  1969-12-31 
16:00:00.0 -0800
 b/gcc/testsuite/c-c++-common/Wbidi-chars-11.c  2021-12-24 
20:53:10.562991821 -0800
 @@ -0,0 +1,13 @@
 +/* PR preprocessor/103026 */
 +/* { dg-do compile } */
 +/* { dg-options "-Wbidi-chars=unpaired" } */
 +/* Test that we warn when mixing UCN and UTF-8.  */
 +
-+int LRE_âª_PDF_\u202c;
++int LRE_‪_PDF_\u202c;
 +/* { dg-warning "mismatch" "" { target *-*-* } .-1 } */
-+int LRE_\u202a_PDF_â¬_;
++int LRE_\u202a_PDF_‬_;
 +/* { dg-warning "mismatch" "" { target *-*-* } .-1 } */
-+const char *s1 = "LRE_âª_PDF_\u202c";
++const char *s1 = "LRE_‪_PDF_\u202c";
 +/* { dg-warning "mismatch" "" { target *-*-* } .-1 } */
-+const char *s2 = "LRE_\u202a_PDF_â¬";
++const char *s2 = "LRE_\u202a_PDF_‬";
 +/* { dg-warning "mismatch" "" { target *-*-* } .-1 } */
 diff --git a/gcc/testsuite/c-c++-common/Wbidi-chars-12.c 
b/gcc/testsuite/c-c++-common/Wbidi-chars-12.c
-new file mode 100644
-index 000..b07eec1da91
 /dev/null
-+++ b/gcc/testsuite/c-c++-common/Wbidi-chars-12.c
+--- a/gcc/testsuite/c-c++-common/Wbidi-chars-12.c  1969-12-31 
16:00:00.0 -0800
 b/gcc/testsuite/c-c++-common/Wbidi-chars-12.c  2021-12-24 
20:53:10.890986236 -0800
 @@ -0,0 +1,19 @@
 +/* PR preprocessor/103026 */
 +/* { dg-do compile { target { c || c++11 } } } */
 +/* { dg-options "-Wbidi-chars=any" } */
 +/* Test raw strings.  */
 +
-+const char *s1 = R"(a b c LRE⪠1 2 3 PDF⬠x y z)";
++co

[OE-core] [hardknott][PATCH] Binutils: CVE-2021-42574

2021-12-23 Thread Pgowda
Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=b3aa80b45c4f46029efeb204bb9f2d2c4278a0e5]

Signed-off-by: pgowda 
---
 .../binutils/binutils-2.36.inc|1 +
 .../binutils/0001-CVE-2021-42574.patch| 2006 +
 2 files changed, 2007 insertions(+)
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.36.inc 
b/meta/recipes-devtools/binutils/binutils-2.36.inc
index 7d0824e060..e4fdadc70a 100644
--- a/meta/recipes-devtools/binutils/binutils-2.36.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.36.inc
@@ -46,5 +46,6 @@ SRC_URI = "\
  file://0003-CVE-2021-20197.patch \
  file://0017-CVE-2021-3530.patch \
  file://0018-CVE-2021-3530.patch \
+ file://0001-CVE-2021-42574.patch \
 "
 S  = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch 
b/meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch
new file mode 100644
index 00..c93fd770b3
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch
@@ -0,0 +1,2006 @@
+From b3aa80b45c4f46029efeb204bb9f2d2c4278a0e5 Mon Sep 17 00:00:00 2001
+From: Nick Clifton 
+Date: Tue, 9 Nov 2021 13:25:42 +
+Subject: [PATCH] Add --unicode option to control how unicode characters are
+ handled by display tools.
+
+   * nm.c: Add --unicode option to control how unicode characters are
+   handled.
+   * objdump.c: Likewise.
+   * readelf.c: Likewise.
+   * strings.c: Likewise.
+   * binutils.texi: Document the new feature.
+   * NEWS: Document the new feature.
+   * testsuite/binutils-all/unicode.exp: New file.
+   * testsuite/binutils-all/nm.hex.unicode
+   * testsuite/binutils-all/strings.escape.unicode
+   * testsuite/binutils-all/objdump.highlight.unicode
+   * testsuite/binutils-all/readelf.invalid.unicode
+
+CVE: CVE-2021-42574
+Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=b3aa80b45c4f46029efeb204bb9f2d2c4278a0e5]
+
+Signed-off-by: pgowda 
+---
+ binutils/ChangeLog |  15 +
+ binutils/NEWS  |   9 +
+ binutils/doc/binutils.texi |  78 
+ binutils/nm.c  | 228 ++-
+ binutils/objdump.c | 235 ++--
+ binutils/readelf.c | 190 +-
+ binutils/strings.c | 757 ++---
+ 7 files changed, 1409 insertions(+), 103 deletions(-)
+
+diff --git a/binutils/ChangeLog b/binutils/ChangeLog
+--- a/binutils/ChangeLog   2021-12-23 03:23:38.425843662 -0800
 b/binutils/ChangeLog   2021-12-23 03:30:31.094968942 -0800
+@@ -1,3 +1,18 @@
++2021-11-09  Nick Clifton  
++
++  * nm.c: Add --unicode option to control how unicode characters are
++  handled.
++  * objdump.c: Likewise.
++  * readelf.c: Likewise.
++  * strings.c: Likewise.
++  * binutils.texi: Document the new feature.
++  * NEWS: Document the new feature.
++  * testsuite/binutils-all/unicode.exp: New file.
++  * testsuite/binutils-all/nm.hex.unicode
++  * testsuite/binutils-all/strings.escape.unicode
++  * testsuite/binutils-all/objdump.highlight.unicode
++  * testsuite/binutils-all/readelf.invalid.unicode
++
+ 2021-02-09  Alan Modra  
+ 
+   PR 27382
+diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi
+--- a/binutils/doc/binutils.texi   2021-12-23 03:23:38.441843395 -0800
 b/binutils/doc/binutils.texi   2021-12-23 03:30:31.094968942 -0800
+@@ -805,6 +805,7 @@ nm [@option{-A}|@option{-o}|@option{--pr
+[@option{-s}|@option{--print-armap}] [@option{-t} 
@var{radix}|@option{--radix=}@var{radix}]
+[@option{-u}|@option{--undefined-only}] [@option{-V}|@option{--version}]
+[@option{-X 32_64}] [@option{--defined-only}] [@option{--no-demangle}]
++   [@option{-U} @var{method}] [@option{--unicode=}@var{method}]
+[@option{--plugin} @var{name}]
+[@option{--no-recurse-limit}|@option{--recurse-limit}]]
+[@option{--size-sort}] [@option{--special-syms}]
+@@ -1114,6 +1115,21 @@ Use @var{radix} as the radix for printin
+ @cindex undefined symbols
+ Display only undefined symbols (those external to each object file).
+ 
++@item -U @var{[d|i|l|e|x|h]}
++@itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]}
++Controls the display of UTF-8 encoded mulibyte characters in strings.
++The default (@option{--unicode=default}) is to give them no special
++treatment.  The @option{--unicode=locale} option displays the sequence
++in the current locale, which may or may not support them.  The options
++@option{--unicode=hex} and @option{--unicode=invalid} display them as
++hex byte sequences enclosed by either angle brackets or curly braces.
++
++The @option{--unicode=escape} option displays them as escape sequences
++(@var{\u}) and the @option{--unicode=highli

Re: [OE-core] [PATCH] Binutils: CVE-2021-42574

2021-12-21 Thread Pgowda
Hi Richard,

> This fails to compile on mingw:
> https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/4502/steps/12/logs/stdio

Thanks for pointing out the issue and build error.

> I suspect we also need:
> https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=795588aec4f894206863c938bd6d716895886009

Updated the patch and tested on mingw and ran regression for
"qemux86-64" without any regressions.
https://lists.openembedded.org/g/openembedded-core/message/159941

Thanks,
Pgowda

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159942): 
https://lists.openembedded.org/g/openembedded-core/message/159942
Mute This Topic: https://lists.openembedded.org/mt/87853353/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH v2] Binutils: CVE-2021-42574

2021-12-21 Thread Pgowda
Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=b3aa80b45c4f46029efeb204bb9f2d2c4278a0e5]
Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=795588aec4f894206863c938bd6d716895886009]

Signed-off-by: pgowda 
---
 .../binutils/binutils-2.37.inc|2 +
 .../binutils/0001-CVE-2021-42574.patch| 2000 +
 .../binutils/0002-CVE-2021-42574.patch|   83 +
 3 files changed, 2085 insertions(+)
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0002-CVE-2021-42574.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.37.inc 
b/meta/recipes-devtools/binutils/binutils-2.37.inc
index fca4a80ad2..d03ec844d7 100644
--- a/meta/recipes-devtools/binutils/binutils-2.37.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.37.inc
@@ -33,5 +33,7 @@ SRC_URI = "\
  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 \
+ file://0001-CVE-2021-42574.patch \
+ file://0002-CVE-2021-42574.patch \
 "
 S  = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch 
b/meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch
new file mode 100644
index 00..1acfaf203c
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch
@@ -0,0 +1,2000 @@
+From b3aa80b45c4f46029efeb204bb9f2d2c4278a0e5 Mon Sep 17 00:00:00 2001
+From: Nick Clifton 
+Date: Tue, 9 Nov 2021 13:25:42 +
+Subject: [PATCH] Add --unicode option to control how unicode characters are
+ handled by display tools.
+
+   * nm.c: Add --unicode option to control how unicode characters are
+   handled.
+   * objdump.c: Likewise.
+   * readelf.c: Likewise.
+   * strings.c: Likewise.
+   * binutils.texi: Document the new feature.
+   * NEWS: Document the new feature.
+   * testsuite/binutils-all/unicode.exp: New file.
+   * testsuite/binutils-all/nm.hex.unicode
+   * testsuite/binutils-all/strings.escape.unicode
+   * testsuite/binutils-all/objdump.highlight.unicode
+   * testsuite/binutils-all/readelf.invalid.unicode
+
+CVE: CVE-2021-42574
+Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=b3aa80b45c4f46029efeb204bb9f2d2c4278a0e5]
+
+Signed-off-by: pgowda 
+---
+ binutils/ChangeLog |  15 +
+ binutils/NEWS  |   9 +
+ binutils/doc/binutils.texi |  78 
+ binutils/nm.c  | 228 ++-
+ binutils/objdump.c | 235 ++--
+ binutils/readelf.c | 190 +-
+ binutils/strings.c | 757 ++---
+ 7 files changed, 1409 insertions(+), 103 deletions(-)
+
+diff --git a/binutils/ChangeLog b/binutils/ChangeLog
+--- a/binutils/ChangeLog   2021-12-21 19:48:34.750142613 -0800
 b/binutils/ChangeLog   2021-12-21 19:50:19.452363292 -0800
+@@ -1,3 +1,18 @@
++2021-11-09  Nick Clifton  
++
++  * nm.c: Add --unicode option to control how unicode characters are
++  handled.
++  * objdump.c: Likewise.
++  * readelf.c: Likewise.
++  * strings.c: Likewise.
++  * binutils.texi: Document the new feature.
++  * NEWS: Document the new feature.
++  * testsuite/binutils-all/unicode.exp: New file.
++  * testsuite/binutils-all/nm.hex.unicode
++  * testsuite/binutils-all/strings.escape.unicode
++  * testsuite/binutils-all/objdump.highlight.unicode
++  * testsuite/binutils-all/readelf.invalid.unicode
++
+ 2021-07-16  Nick Clifton  
+ 
+   * po/sv.po: Updated Swedish translation.
+diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi
+--- a/binutils/doc/binutils.texi   2021-12-21 19:48:34.754142546 -0800
 b/binutils/doc/binutils.texi   2021-12-21 19:50:19.456363224 -0800
+@@ -812,6 +812,7 @@ nm [@option{-A}|@option{-o}|@option{--pr
+[@option{-s}|@option{--print-armap}]
+[@option{-t} @var{radix}|@option{--radix=}@var{radix}]
+[@option{-u}|@option{--undefined-only}]
++   [@option{-U} @var{method}] [@option{--unicode=}@var{method}]
+[@option{-V}|@option{--version}]
+[@option{-X 32_64}]
+[@option{--defined-only}]
+@@ -1132,6 +1133,21 @@ Use @var{radix} as the radix for printin
+ @cindex undefined symbols
+ Display only undefined symbols (those external to each object file).
+ 
++@item -U @var{[d|i|l|e|x|h]}
++@itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]}
++Controls the display of UTF-8 encoded mulibyte characters in strings.
++The default (@option{--unicode=default}) is to give them no special
++treatment.  The @option{--unicode=locale} option displays the sequence
++in the current locale, which may or may not suppor

[OE-core] [hardknott][PATCH] AArch64 support for Arm's Neoverse N2 CPU

2021-12-21 Thread Pgowda
The patch backports the AArch64 support for Arm's Neoverse N2 CPU
Upstream-Status: Backport 
[https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9428e9267435a62f672e2ba42df46432c021a9cf]

Signed-off-by: pgowda 
---
 meta/recipes-devtools/gcc/gcc-10.2.inc|  1 +
 .../gcc/0039-arm64-neoverse-n2-support.patch  | 60 +++
 2 files changed, 61 insertions(+)
 create mode 100644 
meta/recipes-devtools/gcc/gcc/0039-arm64-neoverse-n2-support.patch

diff --git a/meta/recipes-devtools/gcc/gcc-10.2.inc 
b/meta/recipes-devtools/gcc/gcc-10.2.inc
index 5626bf20f0..89158258d7 100644
--- a/meta/recipes-devtools/gcc/gcc-10.2.inc
+++ b/meta/recipes-devtools/gcc/gcc-10.2.inc
@@ -74,6 +74,7 @@ SRC_URI = "\
file://0002-CVE-2021-35465.patch \
file://0003-CVE-2021-35465.patch \
file://0004-CVE-2021-35465.patch \
+   file://0039-arm64-neoverse-n2-support.patch \
 "
 SRC_URI[sha256sum] = 
"b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c"
 
diff --git a/meta/recipes-devtools/gcc/gcc/0039-arm64-neoverse-n2-support.patch 
b/meta/recipes-devtools/gcc/gcc/0039-arm64-neoverse-n2-support.patch
new file mode 100644
index 00..b3e0f396bd
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/0039-arm64-neoverse-n2-support.patch
@@ -0,0 +1,60 @@
+From 9428e9267435a62f672e2ba42df46432c021a9cf Mon Sep 17 00:00:00 2001
+From: Alex Coplan 
+Date: Tue, 29 Sep 2020 17:09:09 +0100
+Subject: [PATCH] aarch64: Add support for Neoverse N2 CPU
+
+This patch backports the AArch64 support for Arm's Neoverse N2 CPU to
+GCC 10.
+
+gcc/ChangeLog:
+
+   * config/aarch64/aarch64-cores.def: Add Neoverse N2.
+   * config/aarch64/aarch64-tune.md: Regenerate.
+   * doc/invoke.texi: Document AArch64 support for Neoverse N2.
+
+Upstream-Status: Backport 
[https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9428e9267435a62f672e2ba42df46432c021a9cf]
+
+Signed-off-by: pgowda 
+---
+ gcc/config/aarch64/aarch64-cores.def | 3 +++
+ gcc/config/aarch64/aarch64-tune.md   | 2 +-
+ gcc/doc/invoke.texi  | 4 ++--
+ 3 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/gcc/config/aarch64/aarch64-cores.def 
b/gcc/config/aarch64/aarch64-cores.def
+--- a/gcc/config/aarch64/aarch64-cores.def 2020-07-22 23:35:17.320384289 
-0700
 b/gcc/config/aarch64/aarch64-cores.def 2021-12-21 01:08:45.518472342 
-0800
+@@ -135,6 +135,9 @@ AARCH64_CORE("zeus", zeus, cortexa57, 8_
+ /* Qualcomm ('Q') cores. */
+ AARCH64_CORE("saphira", saphira,saphira,8_4A,  
AARCH64_FL_FOR_ARCH8_4 | AARCH64_FL_CRYPTO | AARCH64_FL_RCPC, saphira,   0x51, 
0xC01, -1)
+ 
++/* Armv8.5-A Architecture Processors.  */
++AARCH64_CORE("neoverse-n2", neoversen2, cortexa57, 8_5A, 
AARCH64_FL_FOR_ARCH8_5 | AARCH64_FL_I8MM | AARCH64_FL_BF16 | AARCH64_FL_F16 | 
AARCH64_FL_SVE | AARCH64_FL_SVE2 | AARCH64_FL_SVE2_BITPERM | AARCH64_FL_RNG | 
AARCH64_FL_MEMTAG, neoversen1, 0x41, 0xd49, -1)
++
+ /* ARMv8-A big.LITTLE implementations.  */
+ 
+ AARCH64_CORE("cortex-a57.cortex-a53",  cortexa57cortexa53, cortexa53, 8A,  
AARCH64_FL_FOR_ARCH8 | AARCH64_FL_CRC, cortexa57, 0x41, AARCH64_BIG_LITTLE 
(0xd07, 0xd03), -1)
+diff --git a/gcc/config/aarch64/aarch64-tune.md 
b/gcc/config/aarch64/aarch64-tune.md
+--- a/gcc/config/aarch64/aarch64-tune.md   2020-07-22 23:35:54.684795913 
-0700
 b/gcc/config/aarch64/aarch64-tune.md   2021-12-21 01:09:56.829252050 
-0800
+@@ -1,5 +1,5 @@
+ ;; -*- buffer-read-only: t -*-
+ ;; Generated automatically by gentune.sh from aarch64-cores.def
+ (define_attr "tune"
+-  
"cortexa34,cortexa35,cortexa53,cortexa57,cortexa72,cortexa73,thunderx,thunderxt88p1,thunderxt88,octeontx,octeontxt81,octeontxt83,thunderxt81,thunderxt83,emag,xgene1,falkor,qdf24xx,exynosm1,phecda,thunderx2t99p1,vulcan,thunderx2t99,cortexa55,cortexa75,cortexa76,cortexa76ae,cortexa77,cortexa65,cortexa65ae,ares,neoversen1,neoversee1,octeontx2,octeontx2t98,octeontx2t96,octeontx2t93,octeontx2f95,octeontx2f95n,octeontx2f95mm,tsv110,thunderx3t110,zeus,saphira,cortexa57cortexa53,cortexa72cortexa53,cortexa73cortexa35,cortexa73cortexa53,cortexa75cortexa55,cortexa76cortexa55"
++  
"cortexa34,cortexa35,cortexa53,cortexa57,cortexa72,cortexa73,thunderx,thunderxt88p1,thunderxt88,octeontx,octeontxt81,octeontxt83,thunderxt81,thunderxt83,emag,xgene1,falkor,qdf24xx,exynosm1,phecda,thunderx2t99p1,vulcan,thunderx2t99,cortexa55,cortexa75,cortexa76,cortexa76ae,cortexa77,cortexa65,cortexa65ae,ares,neoversen1,neoversee1,octeontx2,octeontx2t98,octeontx2t96,octeontx2t93,octeontx2f95,octeontx2f95n,octeontx2f95mm,tsv110,thunderx3t110,zeus,neoversen2,saphira,cortexa57cortexa53,cortexa72cortexa53,cortexa73cortexa35,cortexa73cortexa53,cortexa75cortexa55,cortexa76cortexa55"
+   (const (symbol_ref "((enum attr_tune) aarch64_tune)")))
+diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
+--- a/gcc/doc/invoke.texi   

[OE-core] [hardknott][PATCH] Add support for Neoverse N2 CPU

2021-12-20 Thread Pgowda
This patch backports the AArch32 support for Arm's Neoverse N2 CPU.

Upstream-Status: Backport
[https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=d7e8411f6a333d4054894ad3b23f23415a525230]

Signed-off-by: pgowda 
---
 meta/recipes-devtools/gcc/gcc-10.2.inc|  1 +
 .../0038-aarch64-neoverse-n2-support.patch| 88 +++
 2 files changed, 89 insertions(+)
 create mode 100644 
meta/recipes-devtools/gcc/gcc/0038-aarch64-neoverse-n2-support.patch

diff --git a/meta/recipes-devtools/gcc/gcc-10.2.inc 
b/meta/recipes-devtools/gcc/gcc-10.2.inc
index 5626bf20f0..8fcc53df38 100644
--- a/meta/recipes-devtools/gcc/gcc-10.2.inc
+++ b/meta/recipes-devtools/gcc/gcc-10.2.inc
@@ -74,6 +74,7 @@ SRC_URI = "\
file://0002-CVE-2021-35465.patch \
file://0003-CVE-2021-35465.patch \
file://0004-CVE-2021-35465.patch \
+   file://0038-aarch64-neoverse-n2-support.patch \
 "
 SRC_URI[sha256sum] = 
"b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c"
 
diff --git 
a/meta/recipes-devtools/gcc/gcc/0038-aarch64-neoverse-n2-support.patch 
b/meta/recipes-devtools/gcc/gcc/0038-aarch64-neoverse-n2-support.patch
new file mode 100644
index 00..3e42266b81
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/0038-aarch64-neoverse-n2-support.patch
@@ -0,0 +1,88 @@
+From d7e8411f6a333d4054894ad3b23f23415a525230 Mon Sep 17 00:00:00 2001
+From: Alex Coplan 
+Date: Fri, 2 Oct 2020 16:06:15 +0100
+Subject: [PATCH] arm: Add support for Neoverse N2 CPU
+
+This patch backports the AArch32 support for Arm's Neoverse N2 CPU to
+GCC 10.
+
+gcc/ChangeLog:
+
+   * config/arm/arm-cpus.in (neoverse-n2): New.
+   * config/arm/arm-tables.opt: Regenerate.
+   * config/arm/arm-tune.md: Regenerate.
+   * doc/invoke.texi: Document support for Neoverse N2.
+
+Upstream-Status: Backport 
[https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=d7e8411f6a333d4054894ad3b23f23415a525230]
+
+Signed-off-by: pgowda 
+---
+ gcc/config/arm/arm-cpus.in| 12 
+ gcc/config/arm/arm-tables.opt |  3 +++
+ gcc/config/arm/arm-tune.md|  5 +++--
+ gcc/doc/invoke.texi   |  6 +++---
+ 4 files changed, 21 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in
+--- a/gcc/config/arm/arm-cpus.in   2021-12-20 20:24:59.912159845 -0800
 b/gcc/config/arm/arm-cpus.in   2021-12-20 21:00:04.417003845 -0800
+@@ -1481,6 +1481,18 @@ begin cpu cortex-a76.cortex-a55
+  costs cortex_a57
+ end cpu cortex-a76.cortex-a55
+ 
++# Armv8.5 A-profile Architecture Processors
++begin cpu neoverse-n2
++  cname neoversen2
++  tune for cortex-a57
++  tune flags LDSCHED
++  architecture armv8.5-a+fp16+bf16+i8mm
++  option crypto add FP_ARMv8 CRYPTO
++  costs cortex_a57
++  vendor 41
++  part 0xd49
++end cpu neoverse-n2
++
+ # V8 M-profile implementations.
+ begin cpu cortex-m23
+  cname cortexm23
+diff --git a/gcc/config/arm/arm-tables.opt b/gcc/config/arm/arm-tables.opt
+--- a/gcc/config/arm/arm-tables.opt2020-07-22 23:35:54.688795958 -0700
 b/gcc/config/arm/arm-tables.opt2021-12-20 21:00:04.421003776 -0800
+@@ -253,6 +253,9 @@ EnumValue
+ Enum(processor_type) String(cortex-m23) Value( TARGET_CPU_cortexm23)
+ 
+ EnumValue
++Enum(processor_type) String(neoverse-n2) Value( TARGET_CPU_neoversen2)
++
++EnumValue
+ Enum(processor_type) String(cortex-m33) Value( TARGET_CPU_cortexm33)
+ 
+ EnumValue
+diff --git a/gcc/config/arm/arm-tune.md b/gcc/config/arm/arm-tune.md
+--- a/gcc/config/arm/arm-tune.md   2020-07-22 23:35:54.684795913 -0700
 b/gcc/config/arm/arm-tune.md   2021-12-20 21:02:44.630260284 -0800
+@@ -46,6 +46,6 @@
+   cortexa73cortexa53,cortexa55,cortexa75,
+   cortexa76,cortexa76ae,cortexa77,
+   neoversen1,cortexa75cortexa55,cortexa76cortexa55,
+-  cortexm23,cortexm33,cortexm35p,
+-  cortexm55,cortexr52"
++  neoversen2,cortexm23,cortexm33,
++  cortexm35p,cortexm55,cortexr52"
+   (const (symbol_ref "((enum attr_tune) arm_tune)")))
+diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
+--- a/gcc/doc/invoke.texi  2021-12-20 20:24:59.916159782 -0800
 b/gcc/doc/invoke.texi  2021-12-20 21:03:41.337290704 -0800
+@@ -18857,9 +18857,9 @@ Permissible names are: @samp{arm7tdmi},
+ @samp{cortex-m35p}, @samp{cortex-m55},
+ @samp{cortex-m1.small-multiply}, @samp{cortex-m0.small-multiply},
+ @samp{cortex-m0plus.small-multiply}, @samp{exynos-m1}, @samp{marvell-pj4},
+-@samp{neoverse-n1}, @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2},
+-@samp{ep9312}, @samp{fa526}, @samp{fa626}, @samp{fa606te}, @samp{fa626te},
+-@samp{fmp626}, @samp{fa726te}, @samp{xgene1}.
++@samp{neoverse-n1}, @samp{neoverse-n2}, @samp{xscale}, @samp{iwmmxt},
++@samp{iwmmxt2}, @samp{ep9312}, @samp{fa526}, @samp{fa626}, @samp{fa606te},
++@samp{fa626te}, @samp{fmp626}, @samp{fa726te}, @samp{xgene1}.
+ 
+ Additionally, this option can specify that GCC should tune the performan

[OE-core] [PATCH] Binutils: CVE-2021-42574

2021-12-20 Thread Pgowda
Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=b3aa80b45c4f46029efeb204bb9f2d2c4278a0e5]

Signed-off-by: pgowda 
---
 .../binutils/binutils-2.37.inc|1 +
 .../binutils/0001-CVE-2021-42574.patch| 1998 +
 2 files changed, 1999 insertions(+)
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.37.inc 
b/meta/recipes-devtools/binutils/binutils-2.37.inc
index fca4a80ad2..043f7f8235 100644
--- a/meta/recipes-devtools/binutils/binutils-2.37.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.37.inc
@@ -33,5 +33,6 @@ SRC_URI = "\
  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 \
+ file://0001-CVE-2021-42574.patch \
 "
 S  = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch 
b/meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch
new file mode 100644
index 00..251740bf04
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0001-CVE-2021-42574.patch
@@ -0,0 +1,1998 @@
+From b3aa80b45c4f46029efeb204bb9f2d2c4278a0e5 Mon Sep 17 00:00:00 2001
+From: Nick Clifton 
+Date: Tue, 9 Nov 2021 13:25:42 +
+Subject: [PATCH] Add --unicode option to control how unicode characters are
+ handled by display tools.
+
+   * nm.c: Add --unicode option to control how unicode characters are
+   handled.
+   * objdump.c: Likewise.
+   * readelf.c: Likewise.
+   * strings.c: Likewise.
+   * binutils.texi: Document the new feature.
+   * NEWS: Document the new feature.
+   * testsuite/binutils-all/unicode.exp: New file.
+   * testsuite/binutils-all/nm.hex.unicode
+   * testsuite/binutils-all/strings.escape.unicode
+   * testsuite/binutils-all/objdump.highlight.unicode
+   * testsuite/binutils-all/readelf.invalid.unicode
+
+CVE: CVE-2021-42574
+Upstream-Status: Backport 
[https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=b3aa80b45c4f46029efeb204bb9f2d2c4278a0e5]
+
+Signed-off-by: pgowda 
+---
+ binutils/ChangeLog |  15 +
+ binutils/NEWS  |   9 +
+ binutils/doc/binutils.texi |  78 
+ binutils/nm.c  | 228 ++-
+ binutils/objdump.c | 235 ++--
+ binutils/readelf.c | 190 +-
+ binutils/strings.c | 757 ++---
+ 7 files changed, 1409 insertions(+), 103 deletions(-)
+
+diff --git a/binutils/ChangeLog b/binutils/ChangeLog
+--- a/binutils/ChangeLog   2021-12-19 19:00:27.038540406 -0800
 b/binutils/ChangeLog   2021-12-19 19:28:42.733565078 -0800
+@@ -1,3 +1,18 @@
++2021-11-09  Nick Clifton  
++
++  * nm.c: Add --unicode option to control how unicode characters are
++  handled.
++  * objdump.c: Likewise.
++  * readelf.c: Likewise.
++  * strings.c: Likewise.
++  * binutils.texi: Document the new feature.
++  * NEWS: Document the new feature.
++  * testsuite/binutils-all/unicode.exp: New file.
++  * testsuite/binutils-all/nm.hex.unicode
++  * testsuite/binutils-all/strings.escape.unicode
++  * testsuite/binutils-all/objdump.highlight.unicode
++  * testsuite/binutils-all/readelf.invalid.unicode
++
+ 2021-07-16  Nick Clifton  
+ 
+   * po/sv.po: Updated Swedish translation.
+diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi
+--- a/binutils/doc/binutils.texi   2021-12-19 19:00:27.042540338 -0800
 b/binutils/doc/binutils.texi   2021-12-19 19:27:56.526354667 -0800
+@@ -812,6 +812,7 @@ nm [@option{-A}|@option{-o}|@option{--pr
+[@option{-s}|@option{--print-armap}]
+[@option{-t} @var{radix}|@option{--radix=}@var{radix}]
+[@option{-u}|@option{--undefined-only}]
++   [@option{-U} @var{method}] [@option{--unicode=}@var{method}]
+[@option{-V}|@option{--version}]
+[@option{-X 32_64}]
+[@option{--defined-only}]
+@@ -1132,6 +1133,21 @@ Use @var{radix} as the radix for printin
+ @cindex undefined symbols
+ Display only undefined symbols (those external to each object file).
+ 
++@item -U @var{[d|i|l|e|x|h]}
++@itemx --unicode=@var{[default|invalid|locale|escape|hex|highlight]}
++Controls the display of UTF-8 encoded mulibyte characters in strings.
++The default (@option{--unicode=default}) is to give them no special
++treatment.  The @option{--unicode=locale} option displays the sequence
++in the current locale, which may or may not support them.  The options
++@option{--unicode=hex} and @option{--unicode=invalid} display them as
++hex byte sequences enclosed by either angle brackets or curly braces.
++
++The @option{--unicode=escape} option displays them as escape sequences
++(@var{\u}) and the @option{--unicode=highlight} option displays
++them

Re: [OE-core] [PATCH] gcc: Fix CVE-2021-42574

2021-12-14 Thread Pgowda
Hi,

> this is adding a new warning to help mitigate the problem, this is not
> a gcc CVE per se.
> so perhaps backporting to older branches makes sense, this looks ok

The patch "0001-CVE-2021-42574.patch" is a dependency patch required
for these 3 CVE patches.
It adds 2 MACRO definitions that are present in the CVE patches.
We can just implement those macros and drop the complete patch which
is quite large.
Please let me know if we keep the patches as is or just implement the
macros to make patch smaller?

Thanks,
pgowda

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159711): 
https://lists.openembedded.org/g/openembedded-core/message/159711
Mute This Topic: https://lists.openembedded.org/mt/87718531/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] Build libstd-rs in release mode to compile mozjs

2021-12-05 Thread Pgowda
When mozjs in firefox is built with DEBUG_BUILD = "1"
in local.conf, it will fail with the following error:
   rustc-1.56.0-src/vendor/compiler_builtins/src/int/specialized_div_rem
/asymmetric.rs:57:
   more undefined references to `core::panicking::panic' follow

Switch to building libstd-rs in "release" mode as that works
around the issue and builds mozjs successfully. This is a
work-around that can be used until the root cause of the debug
build error is resolved.

Signed-off-by: pgowda 
---
 meta/recipes-devtools/rust/libstd-rs.inc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-devtools/rust/libstd-rs.inc 
b/meta/recipes-devtools/rust/libstd-rs.inc
index 987956344a..96eaa2bdc0 100644
--- a/meta/recipes-devtools/rust/libstd-rs.inc
+++ b/meta/recipes-devtools/rust/libstd-rs.inc
@@ -19,9 +19,12 @@ RUSTFLAGS += "-L ${STAGING_LIBDIR} -C 
link-arg=-Wl,-soname,libstd.so"
 
 S = "${RUSTSRC}/src/libstd"
 
+CARGO_BUILD_FLAGS:append = "${@' --release' if d.getVar('DEBUG_BUILD') == '1' 
else ''}"
+
 CARGO_FEATURES ?= "panic-unwind backtrace"
 CARGO_BUILD_FLAGS += "--features '${CARGO_FEATURES}'"
 CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
+BUILD_DIR = "release"
 
 do_compile:prepend () {
 export CARGO_TARGET_DIR="${B}"
-- 
2.31.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#159205): 
https://lists.openembedded.org/g/openembedded-core/message/159205
Mute This Topic: https://lists.openembedded.org/mt/87534858/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [hardknott][PATCH] glibc: Backport fix for CVE-2021-43396

2021-12-01 Thread Pgowda
Backport the fix for CVE-2021-43396. It is disputed that this is a
security issue.

(From OE-Core rev: e8de9b01c6b305b2498c5f942397a49ae2af0cde)

Signed-off-by: pgowda 
---
 .../glibc/glibc/0031-CVE-2021-43396.patch | 188 ++
 meta/recipes-core/glibc/glibc_2.33.bb |   1 +
 2 files changed, 189 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/0031-CVE-2021-43396.patch

diff --git a/meta/recipes-core/glibc/glibc/0031-CVE-2021-43396.patch 
b/meta/recipes-core/glibc/glibc/0031-CVE-2021-43396.patch
new file mode 100644
index 00..179b0c559d
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0031-CVE-2021-43396.patch
@@ -0,0 +1,188 @@
+From ff012870b2c02a62598c04daa1e54632e020fd7d Mon Sep 17 00:00:00 2001
+From: Nikita Popov 
+Date: Tue, 2 Nov 2021 13:21:42 +0500
+Subject: [PATCH] gconv: Do not emit spurious NUL character in ISO-2022-JP-3
+ (bug 28524)
+
+Bugfix 27256 has introduced another issue:
+In conversion from ISO-2022-JP-3 encoding, it is possible
+to force iconv to emit extra NUL character on internal state reset.
+To do this, it is sufficient to feed iconv with escape sequence
+which switches active character set.
+The simplified check 'data->__statep->__count != ASCII_set'
+introduced by the aforementioned bugfix picks that case and
+behaves as if '\0' character has been queued thus emitting it.
+
+To eliminate this issue, these steps are taken:
+* Restore original condition
+'(data->__statep->__count & ~7) != ASCII_set'.
+It is necessary since bits 0-2 may contain
+number of buffered input characters.
+* Check that queued character is not NUL.
+Similar step is taken for main conversion loop.
+
+Bundled test case follows following logic:
+* Try to convert ISO-2022-JP-3 escape sequence
+switching active character set
+* Reset internal state by providing NULL as input buffer
+* Ensure that nothing has been converted.
+
+Signed-off-by: Nikita Popov 
+
+CVE: CVE-2021-43396
+Upstream-Status: Backport [ff012870b2c02a62598c04daa1e54632e020fd7d]
+---
+ iconvdata/Makefile|  5 +++-
+ iconvdata/bug-iconv15.c   | 60 +++
+ iconvdata/iso-2022-jp-3.c | 28 --
+ 3 files changed, 84 insertions(+), 9 deletions(-)
+ create mode 100644 iconvdata/bug-iconv15.c
+
+diff --git a/iconvdata/Makefile b/iconvdata/Makefile
+index c216f959df..d5507a048c 100644
+--- a/iconvdata/Makefile
 b/iconvdata/Makefile
+@@ -1,4 +1,5 @@
+ # Copyright (C) 1997-2021 Free Software Foundation, Inc.
++# Copyright (C) The GNU Toolchain Authors.
+ # This file is part of the GNU C Library.
+ 
+ # The GNU C Library is free software; you can redistribute it and/or
+@@ -74,7 +75,7 @@ ifeq (yes,$(build-shared))
+ tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \
+   tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7 bug-iconv8 bug-iconv9 \
+   bug-iconv10 bug-iconv11 bug-iconv12 tst-iconv-big5-hkscs-to-2ucs4 \
+-  bug-iconv13 bug-iconv14
++  bug-iconv13 bug-iconv14 bug-iconv15
+ ifeq ($(have-thread-library),yes)
+ tests += bug-iconv3
+ endif
+@@ -327,6 +328,8 @@ $(objpfx)bug-iconv12.out: $(addprefix $(objpfx), 
$(gconv-modules)) \
+ $(addprefix $(objpfx),$(modules.so))
+ $(objpfx)bug-iconv14.out: $(addprefix $(objpfx), $(gconv-modules)) \
+ $(addprefix $(objpfx),$(modules.so))
++$(objpfx)bug-iconv15.out: $(addprefix $(objpfx), $(gconv-modules)) \
++$(addprefix $(objpfx),$(modules.so))
+ 
+ $(objpfx)iconv-test.out: run-iconv-test.sh \
+$(addprefix $(objpfx), $(gconv-modules)) \
+diff --git a/iconvdata/bug-iconv15.c b/iconvdata/bug-iconv15.c
+new file mode 100644
+index 00..cc04bd0313
+--- /dev/null
 b/iconvdata/bug-iconv15.c
+@@ -0,0 +1,60 @@
++/* Bug 28524: Conversion from ISO-2022-JP-3 with iconv
++   may emit spurious NUL character on state reset.
++   Copyright (C) The GNU Toolchain Authors.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library 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
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <https://www.gnu.org/licenses/>.  */
++
++#include 
++#include 
++#include 
++
++static int
++do_test (void)
++{
++  char in[] = "\x1b(I";
++  char *inbuf = in;
++  size_t inleft = sizeof (in) - 1;
++  char out[1];
++  char *outbuf = out;
++  size_t outleft = sizeof 

Re: [OE-core] [hardknott][PATCH] gcc: Fix CVE-2021-35465

2021-11-18 Thread Pgowda
Hi,

Gentle ping on this patch.

Thanks,
pgowda

On Mon, Nov 15, 2021 at 5:44 PM Pgowda  wrote:
>
> source : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102035
>
> Upstream-Status: 
> Backport[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=3929bca9ca95de9d35e82ae8828b188029e3eb70]
> Upstream-Status: 
> Backport[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=574e7950bd6b34e9e2cacce18c802b45505d1d0a]
> Upstream-Status: 
> Backport[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=30461cf8dba3d3adb15a125e4da48800eb2b9b8f]
> Upstream-Status: 
> Backport[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=809330ab8450261e05919b472783bf15e4b000f7]
>
> Signed-off-by: Pgowda 
> ---
>  meta/recipes-devtools/gcc/gcc-10.2.inc|   4 +
>  .../gcc/gcc/0001-CVE-2021-35465.patch | 138 
>  .../gcc/gcc/0002-CVE-2021-35465.patch |  40 +++
>  .../gcc/gcc/0003-CVE-2021-35465.patch | 103 ++
>  .../gcc/gcc/0004-CVE-2021-35465.patch | 304 ++
>  5 files changed, 589 insertions(+)
>  create mode 100644 meta/recipes-devtools/gcc/gcc/0001-CVE-2021-35465.patch
>  create mode 100644 meta/recipes-devtools/gcc/gcc/0002-CVE-2021-35465.patch
>  create mode 100644 meta/recipes-devtools/gcc/gcc/0003-CVE-2021-35465.patch
>  create mode 100644 meta/recipes-devtools/gcc/gcc/0004-CVE-2021-35465.patch
>
> diff --git a/meta/recipes-devtools/gcc/gcc-10.2.inc 
> b/meta/recipes-devtools/gcc/gcc-10.2.inc
> index c0cd8b31d5..248e002106 100644
> --- a/meta/recipes-devtools/gcc/gcc-10.2.inc
> +++ b/meta/recipes-devtools/gcc/gcc-10.2.inc
> @@ -70,6 +70,10 @@ SRC_URI = "\
> file://0003-aarch64-Mitigate-SLS-for-BLR-instruction.patch \
> file://0001-aarch64-Fix-up-__aarch64_cas16_acq_rel-fallback.patch 
> \
> file://0001-libatomic-libgomp-libitc-Fix-bootstrap-PR70454.patch \
> +   file://0001-CVE-2021-35465.patch \
> +   file://0002-CVE-2021-35465.patch \
> +   file://0003-CVE-2021-35465.patch \
> +   file://0004-CVE-2021-35465.patch \
>  "
>  SRC_URI[sha256sum] = 
> "b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c"
>
> diff --git a/meta/recipes-devtools/gcc/gcc/0001-CVE-2021-35465.patch 
> b/meta/recipes-devtools/gcc/gcc/0001-CVE-2021-35465.patch
> new file mode 100644
> index 00..b9bca49dd8
> --- /dev/null
> +++ b/meta/recipes-devtools/gcc/gcc/0001-CVE-2021-35465.patch
> @@ -0,0 +1,138 @@
> +From 3929bca9ca95de9d35e82ae8828b188029e3eb70 Mon Sep 17 00:00:00 2001
> +From: Richard Earnshaw 
> +Date: Fri, 11 Jun 2021 16:02:05 +0100
> +Subject: [PATCH] arm: Add command-line option for enabling CVE-2021-35465
> + mitigation [PR102035]
> +
> +Add a new option, -mfix-cmse-cve-2021-35465 and document it.  Enable it
> +automatically for cortex-m33, cortex-m35p and cortex-m55.
> +
> +gcc:
> +   PR target/102035
> +   * config/arm/arm.opt (mfix-cmse-cve-2021-35465): New option.
> +   * doc/invoke.texi (Arm Options): Document it.
> +   * config/arm/arm-cpus.in (quirk_vlldm): New feature bit.
> +   (ALL_QUIRKS): Add quirk_vlldm.
> +   (cortex-m33): Add quirk_vlldm.
> +   (cortex-m35p, cortex-m55): Likewise.
> +   * config/arm/arm.c (arm_option_override): Enable fix_vlldm if
> +   targetting an affected CPU and not explicitly controlled on
> +   the command line.
> +
> +CVE: CVE-2021-35465
> +Upstream-Status: 
> Backport[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=3929bca9ca95de9d35e82ae8828b188029e3eb70]
> +Signed-off-by: Pgowda 
> +
> +---
> + gcc/config/arm/arm-cpus.in | 9 +++--
> + gcc/config/arm/arm.c   | 9 +
> + gcc/config/arm/arm.opt | 4 
> + gcc/doc/invoke.texi| 9 +
> + 4 files changed, 29 insertions(+), 2 deletions(-)
> +
> +diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
> +--- a/gcc/config/arm/arm.c 2020-07-22 23:35:17.344384552 -0700
>  b/gcc/config/arm/arm.c 2021-11-11 20:16:19.761241867 -0800
> +@@ -3595,6 +3595,15 @@ arm_option_override (void)
> +   fix_cm3_ldrd = 0;
> + }
> +
> ++  /* Enable fix_vlldm by default if required.  */
> ++  if (fix_vlldm == 2)
> ++{
> ++  if (bitmap_bit_p (arm_active_target.isa, isa_bit_quirk_vlldm))
> ++  fix_vlldm = 1;
> ++  else
> ++  fix_vlldm = 0;
> ++}
> ++
> +   /* Hot/Cold partitioning is not currently supported, since we can't
> +  handle literal pool placement in that case.  */
> +   if (flag_reorder_blocks_and_partition)
> +diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in
> +--- a/gcc/config/arm/arm-cpus.in   2020-07-22 23:35:17.340384509 -0700
>  b/gcc/config/arm/arm

Re: [OE-core] [hardknott][PATCH v2] rust-cross: Replace TARGET_ARCH with TUNE_PKGARCH

2021-11-18 Thread Pgowda
Hi,

Gentle ping on this patch.

Thanks,
pgowda

On Mon, Nov 15, 2021 at 7:33 PM Pgowda  wrote:
>
> rust-cross-* imported from meta-rust has incorrect signatures,
> depending on MACHINEOVERRIDES making it effectively MACHINE_ARCH
> as shown by sstate-diff-machines.sh:
>
> openembedded-core/scripts/sstate-diff-machines.sh --tmpdir=tmp-glibc \
> --machines="qemuarm64 qemuarm64copy" --targets=rust-cross-aarch64-glibc \
> --analyze
>
>  === Comparing signatures for task do_configure.sigdata between
>  qemuarm64 and qemuarm64copy ===
> ERROR: gcc-runtime different signature for task do_configure.sigdata
> between qemuarm64 and qemuarm64copy
> NOTE: Starting bitbake server...
> Hash for dependent task gcc/gcc-runtime_11.2.bb:do_prepare_recipe_sysroot
> changed from
> da4ebf1b272cb73153145a0a95e6438d2955ae2d36f84db10f6880b2781ec331 to
> 47a0ebb7a88c9f896fb9dbce269f575ab8a6faabb2b9e62d164be6e71c5e4e40
> Unable to find matching sigdata for
> openembedded-core/meta/recipes-devtools/gcc/gcc-runtime_11.2.bb:
> do_prepare_recipe_sysroot with hashes
> da4ebf1b272cb73153145a0a95e6438d2955ae2d36f84db10f6880b2781ec331 or
> 47a0ebb7a88c9f896fb9dbce269f575ab8a6faabb2b9e62d164be6e71c5e4e40
>
> The following patch takes TUNE_PKGARCH into consideration instead
> of TARGET_ARCH and results in signatures as expected.
>
> [YOCTO #14613]
>
> Signed-off-by: Pgowda 
> ---
>  meta/recipes-devtools/rust/rust-cross.inc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-devtools/rust/rust-cross.inc 
> b/meta/recipes-devtools/rust/rust-cross.inc
> index bb625f4240..a77f7d5122 100644
> --- a/meta/recipes-devtools/rust/rust-cross.inc
> +++ b/meta/recipes-devtools/rust/rust-cross.inc
> @@ -34,7 +34,7 @@ DEPENDS += "virtual/${TARGET_PREFIX}gcc 
> virtual/${TARGET_PREFIX}compilerlibs vir
>  DEPENDS += "rust-native"
>
>  PROVIDES = "virtual/${TARGET_PREFIX}rust"
> -PN = "rust-cross-${TARGET_ARCH}-${TCLIBC}"
> +PN = "rust-cross-${TUNE_PKGARCH}-${TCLIBC}"
>
>  # In the cross compilation case, rustc doesn't seem to get the rpath quite
>  # right. It manages to include '../../lib/${TARGET_PREFIX}', but doesn't
> --
> 2.31.1
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#158478): 
https://lists.openembedded.org/g/openembedded-core/message/158478
Mute This Topic: https://lists.openembedded.org/mt/87069441/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [hardknott][PATCH v2] rust-cross: Replace TARGET_ARCH with TUNE_PKGARCH

2021-11-15 Thread Pgowda
Hi Anuj,

I'm sorry regarding the patch subject.
The patch is for the master branch. However, the same issue exists for
other branches as well.
I will check the comments from others and will post the patch to the
Hardknott branch once it's approved in the master branch.

Thanks,
Pgowda

On Tue, Nov 16, 2021 at 8:01 AM Mittal, Anuj  wrote:
>
> This doesn't look hardknott related. Is this for master?
>
> Thanks,
>
> Anuj
>
> On Mon, 2021-11-15 at 06:03 -0800, Pgowda wrote:
> > rust-cross-* imported from meta-rust has incorrect signatures,
> > depending on MACHINEOVERRIDES making it effectively MACHINE_ARCH
> > as shown by sstate-diff-machines.sh:
> >
> > openembedded-core/scripts/sstate-diff-machines.sh --tmpdir=tmp-glibc
> > \
> > --machines="qemuarm64 qemuarm64copy" --targets=rust-cross-aarch64-
> > glibc \
> > --analyze
> >
> >  === Comparing signatures for task do_configure.sigdata between
> >  qemuarm64 and qemuarm64copy ===
> > ERROR: gcc-runtime different signature for task do_configure.sigdata
> > between qemuarm64 and qemuarm64copy
> > NOTE: Starting bitbake server...
> > Hash for dependent task gcc/gcc-
> > runtime_11.2.bb:do_prepare_recipe_sysroot
> > changed from
> > da4ebf1b272cb73153145a0a95e6438d2955ae2d36f84db10f6880b2781ec331 to
> > 47a0ebb7a88c9f896fb9dbce269f575ab8a6faabb2b9e62d164be6e71c5e4e40
> > Unable to find matching sigdata for
> > openembedded-core/meta/recipes-devtools/gcc/gcc-runtime_11.2.bb:
> > do_prepare_recipe_sysroot with hashes
> > da4ebf1b272cb73153145a0a95e6438d2955ae2d36f84db10f6880b2781ec331 or
> > 47a0ebb7a88c9f896fb9dbce269f575ab8a6faabb2b9e62d164be6e71c5e4e40
> >
> > The following patch takes TUNE_PKGARCH into consideration instead
> > of TARGET_ARCH and results in signatures as expected.
> >
> > [YOCTO #14613]
> >
> > Signed-off-by: Pgowda 
> > ---
> >  meta/recipes-devtools/rust/rust-cross.inc | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-devtools/rust/rust-cross.inc
> > b/meta/recipes-devtools/rust/rust-cross.inc
> > index bb625f4240..a77f7d5122 100644
> > --- a/meta/recipes-devtools/rust/rust-cross.inc
> > +++ b/meta/recipes-devtools/rust/rust-cross.inc
> > @@ -34,7 +34,7 @@ DEPENDS += "virtual/${TARGET_PREFIX}gcc
> > virtual/${TARGET_PREFIX}compilerlibs vir
> >  DEPENDS += "rust-native"
> >
> >  PROVIDES = "virtual/${TARGET_PREFIX}rust"
> > -PN = "rust-cross-${TARGET_ARCH}-${TCLIBC}"
> > +PN = "rust-cross-${TUNE_PKGARCH}-${TCLIBC}"
> >
> >  # In the cross compilation case, rustc doesn't seem to get the rpath
> > quite
> >  # right. It manages to include '../../lib/${TARGET_PREFIX}', but
> > doesn't
> >
> > 
> >
>

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#158338): 
https://lists.openembedded.org/g/openembedded-core/message/158338
Mute This Topic: https://lists.openembedded.org/mt/87069441/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [hardknott][PATCH v2] rust-cross: Replace TARGET_ARCH with TUNE_PKGARCH

2021-11-15 Thread Pgowda
rust-cross-* imported from meta-rust has incorrect signatures,
depending on MACHINEOVERRIDES making it effectively MACHINE_ARCH
as shown by sstate-diff-machines.sh:

openembedded-core/scripts/sstate-diff-machines.sh --tmpdir=tmp-glibc \
--machines="qemuarm64 qemuarm64copy" --targets=rust-cross-aarch64-glibc \
--analyze

 === Comparing signatures for task do_configure.sigdata between
 qemuarm64 and qemuarm64copy ===
ERROR: gcc-runtime different signature for task do_configure.sigdata
between qemuarm64 and qemuarm64copy
NOTE: Starting bitbake server...
Hash for dependent task gcc/gcc-runtime_11.2.bb:do_prepare_recipe_sysroot
changed from
da4ebf1b272cb73153145a0a95e6438d2955ae2d36f84db10f6880b2781ec331 to
47a0ebb7a88c9f896fb9dbce269f575ab8a6faabb2b9e62d164be6e71c5e4e40
Unable to find matching sigdata for
openembedded-core/meta/recipes-devtools/gcc/gcc-runtime_11.2.bb:
do_prepare_recipe_sysroot with hashes
da4ebf1b272cb73153145a0a95e6438d2955ae2d36f84db10f6880b2781ec331 or
47a0ebb7a88c9f896fb9dbce269f575ab8a6faabb2b9e62d164be6e71c5e4e40

The following patch takes TUNE_PKGARCH into consideration instead
of TARGET_ARCH and results in signatures as expected.

[YOCTO #14613]

Signed-off-by: Pgowda 
---
 meta/recipes-devtools/rust/rust-cross.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/rust/rust-cross.inc 
b/meta/recipes-devtools/rust/rust-cross.inc
index bb625f4240..a77f7d5122 100644
--- a/meta/recipes-devtools/rust/rust-cross.inc
+++ b/meta/recipes-devtools/rust/rust-cross.inc
@@ -34,7 +34,7 @@ DEPENDS += "virtual/${TARGET_PREFIX}gcc 
virtual/${TARGET_PREFIX}compilerlibs vir
 DEPENDS += "rust-native"
 
 PROVIDES = "virtual/${TARGET_PREFIX}rust"
-PN = "rust-cross-${TARGET_ARCH}-${TCLIBC}"
+PN = "rust-cross-${TUNE_PKGARCH}-${TCLIBC}"
 
 # In the cross compilation case, rustc doesn't seem to get the rpath quite
 # right. It manages to include '../../lib/${TARGET_PREFIX}', but doesn't
-- 
2.31.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#158292): 
https://lists.openembedded.org/g/openembedded-core/message/158292
Mute This Topic: https://lists.openembedded.org/mt/87069441/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [PATCH] Fix Bug-14613

2021-11-15 Thread Pgowda
Source:- https://bugzilla.yoctoproject.org/show_bug.cgi?id=14613

Adds TUNE_PKGARCH to PN so that it picks correct TUNE_FEATURES.

Signed-off-by: Pgowda 
---
 meta/recipes-devtools/rust/rust-cross.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/rust/rust-cross.inc 
b/meta/recipes-devtools/rust/rust-cross.inc
index bb625f4240..30c92ed395 100644
--- a/meta/recipes-devtools/rust/rust-cross.inc
+++ b/meta/recipes-devtools/rust/rust-cross.inc
@@ -34,7 +34,7 @@ DEPENDS += "virtual/${TARGET_PREFIX}gcc 
virtual/${TARGET_PREFIX}compilerlibs vir
 DEPENDS += "rust-native"
 
 PROVIDES = "virtual/${TARGET_PREFIX}rust"
-PN = "rust-cross-${TARGET_ARCH}-${TCLIBC}"
+PN = "rust-cross-${TARGET_ARCH}-${TCLIBC}-${TUNE_PKGARCH}"
 
 # In the cross compilation case, rustc doesn't seem to get the rpath quite
 # right. It manages to include '../../lib/${TARGET_PREFIX}', but doesn't
-- 
2.31.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#158285): 
https://lists.openembedded.org/g/openembedded-core/message/158285
Mute This Topic: https://lists.openembedded.org/mt/87068220/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [hardknott][PATCH] gcc: Fix CVE-2021-35465

2021-11-15 Thread Pgowda
source : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102035

Upstream-Status: 
Backport[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=3929bca9ca95de9d35e82ae8828b188029e3eb70]
Upstream-Status: 
Backport[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=574e7950bd6b34e9e2cacce18c802b45505d1d0a]
Upstream-Status: 
Backport[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=30461cf8dba3d3adb15a125e4da48800eb2b9b8f]
Upstream-Status: 
Backport[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=809330ab8450261e05919b472783bf15e4b000f7]

Signed-off-by: Pgowda 
---
 meta/recipes-devtools/gcc/gcc-10.2.inc|   4 +
 .../gcc/gcc/0001-CVE-2021-35465.patch | 138 
 .../gcc/gcc/0002-CVE-2021-35465.patch |  40 +++
 .../gcc/gcc/0003-CVE-2021-35465.patch | 103 ++
 .../gcc/gcc/0004-CVE-2021-35465.patch | 304 ++
 5 files changed, 589 insertions(+)
 create mode 100644 meta/recipes-devtools/gcc/gcc/0001-CVE-2021-35465.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc/0002-CVE-2021-35465.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc/0003-CVE-2021-35465.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc/0004-CVE-2021-35465.patch

diff --git a/meta/recipes-devtools/gcc/gcc-10.2.inc 
b/meta/recipes-devtools/gcc/gcc-10.2.inc
index c0cd8b31d5..248e002106 100644
--- a/meta/recipes-devtools/gcc/gcc-10.2.inc
+++ b/meta/recipes-devtools/gcc/gcc-10.2.inc
@@ -70,6 +70,10 @@ SRC_URI = "\
file://0003-aarch64-Mitigate-SLS-for-BLR-instruction.patch \
file://0001-aarch64-Fix-up-__aarch64_cas16_acq_rel-fallback.patch \
file://0001-libatomic-libgomp-libitc-Fix-bootstrap-PR70454.patch \
+   file://0001-CVE-2021-35465.patch \
+   file://0002-CVE-2021-35465.patch \
+   file://0003-CVE-2021-35465.patch \
+   file://0004-CVE-2021-35465.patch \
 "
 SRC_URI[sha256sum] = 
"b8dd4368bb9c7f0b98188317ee0254dd8cc99d1e3a18d0ff146c855fe16c1d8c"
 
diff --git a/meta/recipes-devtools/gcc/gcc/0001-CVE-2021-35465.patch 
b/meta/recipes-devtools/gcc/gcc/0001-CVE-2021-35465.patch
new file mode 100644
index 00..b9bca49dd8
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/0001-CVE-2021-35465.patch
@@ -0,0 +1,138 @@
+From 3929bca9ca95de9d35e82ae8828b188029e3eb70 Mon Sep 17 00:00:00 2001
+From: Richard Earnshaw 
+Date: Fri, 11 Jun 2021 16:02:05 +0100
+Subject: [PATCH] arm: Add command-line option for enabling CVE-2021-35465
+ mitigation [PR102035]
+
+Add a new option, -mfix-cmse-cve-2021-35465 and document it.  Enable it
+automatically for cortex-m33, cortex-m35p and cortex-m55.
+
+gcc:
+   PR target/102035
+   * config/arm/arm.opt (mfix-cmse-cve-2021-35465): New option.
+   * doc/invoke.texi (Arm Options): Document it.
+   * config/arm/arm-cpus.in (quirk_vlldm): New feature bit.
+   (ALL_QUIRKS): Add quirk_vlldm.
+   (cortex-m33): Add quirk_vlldm.
+   (cortex-m35p, cortex-m55): Likewise.
+   * config/arm/arm.c (arm_option_override): Enable fix_vlldm if
+   targetting an affected CPU and not explicitly controlled on
+   the command line.
+
+CVE: CVE-2021-35465
+Upstream-Status: 
Backport[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=3929bca9ca95de9d35e82ae8828b188029e3eb70]
+Signed-off-by: Pgowda 
+
+---
+ gcc/config/arm/arm-cpus.in | 9 +++--
+ gcc/config/arm/arm.c   | 9 +
+ gcc/config/arm/arm.opt | 4 
+ gcc/doc/invoke.texi| 9 +
+ 4 files changed, 29 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
+--- a/gcc/config/arm/arm.c 2020-07-22 23:35:17.344384552 -0700
 b/gcc/config/arm/arm.c 2021-11-11 20:16:19.761241867 -0800
+@@ -3595,6 +3595,15 @@ arm_option_override (void)
+   fix_cm3_ldrd = 0;
+ }
+ 
++  /* Enable fix_vlldm by default if required.  */
++  if (fix_vlldm == 2)
++{
++  if (bitmap_bit_p (arm_active_target.isa, isa_bit_quirk_vlldm))
++  fix_vlldm = 1;
++  else
++  fix_vlldm = 0;
++}
++
+   /* Hot/Cold partitioning is not currently supported, since we can't
+  handle literal pool placement in that case.  */
+   if (flag_reorder_blocks_and_partition)
+diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in
+--- a/gcc/config/arm/arm-cpus.in   2020-07-22 23:35:17.340384509 -0700
 b/gcc/config/arm/arm-cpus.in   2021-11-11 20:17:01.364573561 -0800
+@@ -190,6 +190,9 @@ define feature quirk_armv6kz
+ # Cortex-M3 LDRD quirk.
+ define feature quirk_cm3_ldrd
+ 
++# v8-m/v8.1-m VLLDM errata.
++define feature quirk_vlldm
++
+ # Don't use .cpu assembly directive
+ define feature quirk_no_asmcpu
+ 
+@@ -314,7 +317,7 @@ define fgroup DOTPROD  NEON dotprod
+ # architectures.
+ # xscale isn't really a 'quirk', but it isn't an architecture either and we
+ # need to ignore it for matching purposes.
+-define fgroup ALL_QUIRKS   quirk_no_volatile_ce quirk_armv6kz quirk_cm3_ldrd 
xscale quirk_no_asmcpu
++defi

[OE-core] [PATCH] gcc: Fix CVE-2021-35465

2021-11-15 Thread Pgowda
source : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102035

Upstream-Status: 
Backport[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=3929bca9ca95de9d35e82ae8828b188029e3eb70]
Upstream-Status: 
Backport[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=574e7950bd6b34e9e2cacce18c802b45505d1d0a]
Upstream-Status: 
Backport[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=30461cf8dba3d3adb15a125e4da48800eb2b9b8f]
Upstream-Status: 
Backport[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=809330ab8450261e05919b472783bf15e4b000f7]

Signed-off-by: Pgowda 
---
 meta/recipes-devtools/gcc/gcc-11.2.inc|   4 +
 .../gcc/gcc/0001-CVE-2021-35465.patch | 138 
 .../gcc/gcc/0002-CVE-2021-35465.patch |  39 +++
 .../gcc/gcc/0003-CVE-2021-35465.patch | 103 ++
 .../gcc/gcc/0004-CVE-2021-35465.patch | 304 ++
 5 files changed, 588 insertions(+)
 create mode 100644 meta/recipes-devtools/gcc/gcc/0001-CVE-2021-35465.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc/0002-CVE-2021-35465.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc/0003-CVE-2021-35465.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc/0004-CVE-2021-35465.patch

diff --git a/meta/recipes-devtools/gcc/gcc-11.2.inc 
b/meta/recipes-devtools/gcc/gcc-11.2.inc
index f06c1a891b..baced2a400 100644
--- a/meta/recipes-devtools/gcc/gcc-11.2.inc
+++ b/meta/recipes-devtools/gcc/gcc-11.2.inc
@@ -62,6 +62,10 @@ SRC_URI = "\
file://0037-libatomic-Do-not-enforce-march-on-aarch64.patch \
file://0041-apply-debug-prefix-maps-before-checksumming-DIEs.patch \

file://0006-If-CXXFLAGS-contains-something-unsupported-by-the-bu.patch \
+   file://0001-CVE-2021-35465.patch \
+   file://0002-CVE-2021-35465.patch \
+   file://0003-CVE-2021-35465.patch \
+   file://0004-CVE-2021-35465.patch \
 "
 SRC_URI[sha256sum] = 
"d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b"
 
diff --git a/meta/recipes-devtools/gcc/gcc/0001-CVE-2021-35465.patch 
b/meta/recipes-devtools/gcc/gcc/0001-CVE-2021-35465.patch
new file mode 100644
index 00..6b1d4e3fce
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/0001-CVE-2021-35465.patch
@@ -0,0 +1,138 @@
+From 3929bca9ca95de9d35e82ae8828b188029e3eb70 Mon Sep 17 00:00:00 2001
+From: Richard Earnshaw 
+Date: Fri, 11 Jun 2021 16:02:05 +0100
+Subject: [PATCH] arm: Add command-line option for enabling CVE-2021-35465
+ mitigation [PR102035]
+
+Add a new option, -mfix-cmse-cve-2021-35465 and document it.  Enable it
+automatically for cortex-m33, cortex-m35p and cortex-m55.
+
+gcc:
+   PR target/102035
+   * config/arm/arm.opt (mfix-cmse-cve-2021-35465): New option.
+   * doc/invoke.texi (Arm Options): Document it.
+   * config/arm/arm-cpus.in (quirk_vlldm): New feature bit.
+   (ALL_QUIRKS): Add quirk_vlldm.
+   (cortex-m33): Add quirk_vlldm.
+   (cortex-m35p, cortex-m55): Likewise.
+   * config/arm/arm.c (arm_option_override): Enable fix_vlldm if
+   targetting an affected CPU and not explicitly controlled on
+   the command line.
+
+CVE: CVE-2021-35465
+Upstream-Status: 
Backport[https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=3929bca9ca95de9d35e82ae8828b188029e3eb70]
+Signed-off-by: Pgowda 
+
+---
+ gcc/config/arm/arm-cpus.in | 9 +++--
+ gcc/config/arm/arm.c   | 9 +
+ gcc/config/arm/arm.opt | 4 
+ gcc/doc/invoke.texi| 9 +
+ 4 files changed, 29 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
+--- a/gcc/config/arm/arm.c 2021-11-15 02:13:11.100579812 -0800
 b/gcc/config/arm/arm.c 2021-11-15 02:17:36.988237692 -0800
+@@ -3610,6 +3610,15 @@ arm_option_override (void)
+   fix_cm3_ldrd = 0;
+ }
+ 
++  /* Enable fix_vlldm by default if required.  */
++  if (fix_vlldm == 2)
++{
++  if (bitmap_bit_p (arm_active_target.isa, isa_bit_quirk_vlldm))
++  fix_vlldm = 1;
++  else
++  fix_vlldm = 0;
++}
++
+   /* Hot/Cold partitioning is not currently supported, since we can't
+  handle literal pool placement in that case.  */
+   if (flag_reorder_blocks_and_partition)
+diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in
+--- a/gcc/config/arm/arm-cpus.in   2021-11-15 02:13:11.104579747 -0800
 b/gcc/config/arm/arm-cpus.in   2021-11-15 02:17:36.984237757 -0800
+@@ -186,6 +186,9 @@ define feature quirk_armv6kz
+ # Cortex-M3 LDRD quirk.
+ define feature quirk_cm3_ldrd
+ 
++# v8-m/v8.1-m VLLDM errata.
++define feature quirk_vlldm
++
+ # Don't use .cpu assembly directive
+ define feature quirk_no_asmcpu
+ 
+@@ -322,7 +325,7 @@ define implied vfp_base MVE MVE_FP ALL_F
+ # architectures.
+ # xscale isn't really a 'quirk', but it isn't an architecture either and we
+ # need to ignore it for matching purposes.
+-define fgroup ALL_QUIRKS   quirk_no_volatile_ce quirk_armv6kz quirk_cm3_ldrd 
xscale quirk_no_asmcpu
++defi

Re: [PATCH v3] Re: [OE-core] [PATCH v2 2/3] Rust cross testing file

2021-11-01 Thread Pgowda
Hi Alexandre,

>> There are still issues with that series and I replied the following a
>> https://lists.openembedded.org/g/openembedded-core/message/156655

I had a detailed investigation on the cryptic errors which was
mentioned in the build.
Those are the tests that are supposed to FAIL in the rust testsuite.
The current patch provides the framework to run the rust testsuite
from rust sources.
It does not modify the test case or results and hence is unable to
deal with failures
from rust source.

Hence, we see the final message as "command failed" at the end of testsuite run
due to some test case failures from rust source.
Can you please let me know how to deal with this?
Is there a way we can provide these failures as expected or ignore them?

Thanks,
Pgowda

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#157736): 
https://lists.openembedded.org/g/openembedded-core/message/157736
Mute This Topic: https://lists.openembedded.org/mt/86459542/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [OE-core] [hardknott][PATCH v2] binutils: Fix CVE-2021-3530

2021-10-28 Thread Pgowda
>> Did you mean CVE-2021-3530 here and in the patches below as well?

Should I have it in the commit message or in the patches?

Thanks,
Naveen

On Thu, Oct 28, 2021 at 3:32 PM Mittal, Anuj  wrote:
>
> On Thu, 2021-10-28 at 02:58 -0700, Pgowda wrote:
> > CVE: CVE-2015-3530
>
> Did you mean CVE-2021-3530 here and in the patches below as well?
>
> Thanks,
>
> Anuj
>
> > Upstream-Status:
> > Backport[https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=25162c795b1a2becf936bb3581d86a307ea491eb
> > ]
> > Upstream-Status:
> > Backport[https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=999566402e3
> > ]
> >
> > Signed-off-by: Pgowda 
> > ---
> >  .../binutils/binutils-2.36.inc|   2 +
> >  .../binutils/0017-CVE-2021-3530.patch | 102
> > ++
> >  .../binutils/0018-CVE-2021-3530.patch |  64 +++
> >  3 files changed, 168 insertions(+)
> >  create mode 100644 meta/recipes-devtools/binutils/binutils/0017-CVE-
> > 2021-3530.patch
> >  create mode 100644 meta/recipes-devtools/binutils/binutils/0018-CVE-
> > 2021-3530.patch
> >
> > diff --git a/meta/recipes-devtools/binutils/binutils-2.36.inc
> > b/meta/recipes-devtools/binutils/binutils-2.36.inc
> > index 9d770db5a8..7d0824e060 100644
> > --- a/meta/recipes-devtools/binutils/binutils-2.36.inc
> > +++ b/meta/recipes-devtools/binutils/binutils-2.36.inc
> > @@ -44,5 +44,7 @@ SRC_URI = "\
> >   file://0001-CVE-2021-20197.patch \
> >   file://0002-CVE-2021-20197.patch \
> >   file://0003-CVE-2021-20197.patch \
> > + file://0017-CVE-2021-3530.patch \
> > + file://0018-CVE-2021-3530.patch \
> >  "
> >  S  = "${WORKDIR}/git"
> > diff --git a/meta/recipes-devtools/binutils/binutils/0017-CVE-2021-
> > 3530.patch b/meta/recipes-devtools/binutils/binutils/0017-CVE-2021-
> > 3530.patch
> > new file mode 100644
> > index 00..3eba99132b
> > --- /dev/null
> > +++ b/meta/recipes-devtools/binutils/binutils/0017-CVE-2021-
> > 3530.patch
> > @@ -0,0 +1,102 @@
> > +From 25162c795b1a2becf936bb3581d86a307ea491eb Mon Sep 17 00:00:00
> > 2001
> > +From: Nick Clifton 
> > +Date: Thu, 15 Jul 2021 16:51:56 +0100
> > +Subject: [PATCH] Fix a stack exhaustion problem in the Rust
> > demangling code in
> > + the libiberty library.
> > +
> > +   PR 99935
> > +   * rust-demangle.c: Add recursion limit.
> > +
> > +CVE: CVE-2015-3530
> > +Upstream-Status:
> > Backport[https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=25162c795b1a2becf936bb3581d86a307ea491eb
> > ]
> > +Signed-off-by: Pgowda 
> > +
> > +---
> > + libiberty/ChangeLog   |  5 +
> > + libiberty/rust-demangle.c | 31 +--
> > + 2 files changed, 30 insertions(+), 6 deletions(-)
> > +
> > +diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
> > +index bc1b35b97c4..8e39fd28eba 100644
> > +--- a/libiberty/ChangeLog
> >  b/libiberty/ChangeLog
> > +@@ -1,3 +1,8 @@
> > ++2021-07-15  Nick Clifton  
> > ++
> > ++  PR 99935
> > ++  * rust-demangle.c: Add recursion limit.
> > ++
> > + 2021-01-04  Martin Liska  
> > +
> > +   * strverscmp.c: Convert to utf8 from iso8859.
> > +diff --git a/libiberty/rust-demangle.c b/libiberty/rust-demangle.c
> > +index 449941b56dc..df09b7b8fdd 100644
> > +--- a/libiberty/rust-demangle.c
> >  b/libiberty/rust-demangle.c
> > +@@ -74,6 +74,12 @@ struct rust_demangler
> > +   /* Rust mangling version, with legacy mangling being -1. */
> > +   int version;
> > +
> > ++  /* Recursion depth.  */
> > ++  uint recursion;
> > ++  /* Maximum number of times demangle_path may be called
> > recursively.  */
> > ++#define RUST_MAX_RECURSION_COUNT  1024
> > ++#define RUST_NO_RECURSION_LIMIT   ((uint) -1)
> > ++
> > +   uint64_t bound_lifetime_depth;
> > + };
> > +
> > +@@ -671,6 +677,15 @@ demangle_path (struct rust_demangler *rd
> > +   if (rdm->errored)
> > + return;
> > +
> > ++  if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
> > ++{
> > ++  ++ rdm->recursion;
> > ++  if (rdm->recursion > RUST_MAX_RECURSION_COUNT)
> > ++  /* FIXME: There ought to be a way to report
> > ++ that the recursion limit has been reached.  */
> > ++  goto fail_return;
> > ++}
> > ++
> > +   switch (tag = next (rdm))
> > + {
> > +   

Re: [OE-core] [hardknott][PATCH] binutils: Fix CVE-2021-3530

2021-10-28 Thread Pgowda
Hi Anuj,

Thanks for checking the patch and providing your comments.

>> This needs a CVE tag, your Signed-off-by and Upstream-Status.
Done.

>> Also, it looks like this will break MinGW builds and would also need:
Added.

Will check for the CVE tags and other indentations properly.
Please find the modified patch posted at following link:-
https://lists.openembedded.org/g/openembedded-core/message/157582

Thanks,
Pgowda

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#157583): 
https://lists.openembedded.org/g/openembedded-core/message/157583
Mute This Topic: https://lists.openembedded.org/mt/86624481/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[OE-core] [hardknott][PATCH v2] binutils: Fix CVE-2021-3530

2021-10-28 Thread Pgowda
CVE: CVE-2015-3530
Upstream-Status: 
Backport[https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=25162c795b1a2becf936bb3581d86a307ea491eb]
Upstream-Status: 
Backport[https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=999566402e3]

Signed-off-by: Pgowda 
---
 .../binutils/binutils-2.36.inc|   2 +
 .../binutils/0017-CVE-2021-3530.patch | 102 ++
 .../binutils/0018-CVE-2021-3530.patch |  64 +++
 3 files changed, 168 insertions(+)
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0017-CVE-2021-3530.patch
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0018-CVE-2021-3530.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.36.inc 
b/meta/recipes-devtools/binutils/binutils-2.36.inc
index 9d770db5a8..7d0824e060 100644
--- a/meta/recipes-devtools/binutils/binutils-2.36.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.36.inc
@@ -44,5 +44,7 @@ SRC_URI = "\
  file://0001-CVE-2021-20197.patch \
  file://0002-CVE-2021-20197.patch \
  file://0003-CVE-2021-20197.patch \
+ file://0017-CVE-2021-3530.patch \
+ file://0018-CVE-2021-3530.patch \
 "
 S  = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0017-CVE-2021-3530.patch 
b/meta/recipes-devtools/binutils/binutils/0017-CVE-2021-3530.patch
new file mode 100644
index 00..3eba99132b
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0017-CVE-2021-3530.patch
@@ -0,0 +1,102 @@
+From 25162c795b1a2becf936bb3581d86a307ea491eb Mon Sep 17 00:00:00 2001
+From: Nick Clifton 
+Date: Thu, 15 Jul 2021 16:51:56 +0100
+Subject: [PATCH] Fix a stack exhaustion problem in the Rust demangling code in
+ the libiberty library.
+
+   PR 99935
+   * rust-demangle.c: Add recursion limit.
+
+CVE: CVE-2015-3530
+Upstream-Status: 
Backport[https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=25162c795b1a2becf936bb3581d86a307ea491eb]
+Signed-off-by: Pgowda 
+
+---
+ libiberty/ChangeLog   |  5 +
+ libiberty/rust-demangle.c | 31 +--
+ 2 files changed, 30 insertions(+), 6 deletions(-)
+
+diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
+index bc1b35b97c4..8e39fd28eba 100644
+--- a/libiberty/ChangeLog
 b/libiberty/ChangeLog
+@@ -1,3 +1,8 @@
++2021-07-15  Nick Clifton  
++
++  PR 99935
++  * rust-demangle.c: Add recursion limit.
++
+ 2021-01-04  Martin Liska  
+ 
+   * strverscmp.c: Convert to utf8 from iso8859.
+diff --git a/libiberty/rust-demangle.c b/libiberty/rust-demangle.c
+index 449941b56dc..df09b7b8fdd 100644
+--- a/libiberty/rust-demangle.c
 b/libiberty/rust-demangle.c
+@@ -74,6 +74,12 @@ struct rust_demangler
+   /* Rust mangling version, with legacy mangling being -1. */
+   int version;
+ 
++  /* Recursion depth.  */
++  uint recursion;
++  /* Maximum number of times demangle_path may be called recursively.  */
++#define RUST_MAX_RECURSION_COUNT  1024
++#define RUST_NO_RECURSION_LIMIT   ((uint) -1)
++
+   uint64_t bound_lifetime_depth;
+ };
+ 
+@@ -671,6 +677,15 @@ demangle_path (struct rust_demangler *rd
+   if (rdm->errored)
+ return;
+ 
++  if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
++{
++  ++ rdm->recursion;
++  if (rdm->recursion > RUST_MAX_RECURSION_COUNT)
++  /* FIXME: There ought to be a way to report
++ that the recursion limit has been reached.  */
++  goto fail_return;
++}
++
+   switch (tag = next (rdm))
+ {
+ case 'C':
+@@ -688,10 +703,7 @@ demangle_path (struct rust_demangler *rd
+ case 'N':
+   ns = next (rdm);
+   if (!ISLOWER (ns) && !ISUPPER (ns))
+-{
+-  rdm->errored = 1;
+-  return;
+-}
++  goto fail_return;
+ 
+   demangle_path (rdm, in_value);
+ 
+@@ -776,9 +788,15 @@ demangle_path (struct rust_demangler *rd
+ }
+   break;
+ default:
+-  rdm->errored = 1;
+-  return;
++  goto fail_return;
+ }
++  goto pass_return;
++
++ fail_return:
++  rdm->errored = 1;
++ pass_return:
++  if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
++-- rdm->recursion;
+ }
+ 
+ static void
+@@ -1317,6 +1335,7 @@ rust_demangle_callback (const char *mang
+   rdm.skipping_printing = 0;
+   rdm.verbose = (options & DMGL_VERBOSE) != 0;
+   rdm.version = 0;
++  rdm.recursion = (options & DMGL_NO_RECURSE_LIMIT) ? RUST_NO_RECURSION_LIMIT 
: 0;
+   rdm.bound_lifetime_depth = 0;
+ 
+   /* Rust symbols always start with _R (v0) or _ZN (legacy). */
diff --git a/meta/recipes-devtools/binutils/binutils/0018-CVE-2021-3530.patch 
b/meta/recipes-devtools/binutils/binutils/0018-CVE-2021-3530.patch
new file mode 100644
index 00..857ac5b3d0
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0018-CVE-2021-3530.patch
@@ -0,0 +1,64 @@
+From 999566402e3d7c69032bbf47e28b44fc0926fe62 Mon Sep 17 00:00:00 2001
+From: Christopher Wellons 
+Date: Sun, 18 Jul 2021 16:57:19 -0400
+S

[OE-core] [hardknott][PATCH] binutils: Fix CVE-2021-3530

2021-10-27 Thread Pgowda
Backport from binutils-2_37

Signed-off-by: Pgowda 
---
 .../binutils/binutils-2.36.inc|  1 +
 .../binutils/0017-CVE-2021-3530.patch | 97 +++
 2 files changed, 98 insertions(+)
 create mode 100644 
meta/recipes-devtools/binutils/binutils/0017-CVE-2021-3530.patch

diff --git a/meta/recipes-devtools/binutils/binutils-2.36.inc 
b/meta/recipes-devtools/binutils/binutils-2.36.inc
index 9d770db5a8..981692e457 100644
--- a/meta/recipes-devtools/binutils/binutils-2.36.inc
+++ b/meta/recipes-devtools/binutils/binutils-2.36.inc
@@ -44,5 +44,6 @@ SRC_URI = "\
  file://0001-CVE-2021-20197.patch \
  file://0002-CVE-2021-20197.patch \
  file://0003-CVE-2021-20197.patch \
+ file://0017-CVE-2021-3530.patch \
 "
 S  = "${WORKDIR}/git"
diff --git a/meta/recipes-devtools/binutils/binutils/0017-CVE-2021-3530.patch 
b/meta/recipes-devtools/binutils/binutils/0017-CVE-2021-3530.patch
new file mode 100644
index 00..f1934aa600
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0017-CVE-2021-3530.patch
@@ -0,0 +1,97 @@
+From 25162c795b1a2becf936bb3581d86a307ea491eb Mon Sep 17 00:00:00 2001
+From: Nick Clifton 
+Date: Thu, 15 Jul 2021 16:51:56 +0100
+Subject: [PATCH] Fix a stack exhaustion problem in the Rust demangling code in
+ the libiberty library.
+
+   PR 99935
+   * rust-demangle.c: Add recursion limit.
+---
+ libiberty/ChangeLog   |  5 +
+ libiberty/rust-demangle.c | 31 +--
+ 2 files changed, 30 insertions(+), 6 deletions(-)
+
+diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
+index bc1b35b97c4..8e39fd28eba 100644
+--- a/libiberty/ChangeLog
 b/libiberty/ChangeLog
+@@ -1,3 +1,8 @@
++2021-07-15  Nick Clifton  
++
++  PR 99935
++  * rust-demangle.c: Add recursion limit.
++
+ 2021-01-04  Martin Liska  
+ 
+   * strverscmp.c: Convert to utf8 from iso8859.
+diff --git a/libiberty/rust-demangle.c b/libiberty/rust-demangle.c
+index 449941b56dc..df09b7b8fdd 100644
+--- a/libiberty/rust-demangle.c
 b/libiberty/rust-demangle.c
+@@ -74,6 +74,12 @@ struct rust_demangler
+   /* Rust mangling version, with legacy mangling being -1. */
+   int version;
+ 
++  /* Recursion depth.  */
++  uint recursion;
++  /* Maximum number of times demangle_path may be called recursively.  */
++#define RUST_MAX_RECURSION_COUNT  1024
++#define RUST_NO_RECURSION_LIMIT   ((uint) -1)
++
+   uint64_t bound_lifetime_depth;
+ };
+ 
+@@ -671,6 +677,15 @@ demangle_path (struct rust_demangler *rd
+   if (rdm->errored)
+ return;
+ 
++  if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
++{
++  ++ rdm->recursion;
++  if (rdm->recursion > RUST_MAX_RECURSION_COUNT)
++  /* FIXME: There ought to be a way to report
++ that the recursion limit has been reached.  */
++  goto fail_return;
++}
++
+   switch (tag = next (rdm))
+ {
+ case 'C':
+@@ -688,10 +703,7 @@ demangle_path (struct rust_demangler *rd
+ case 'N':
+   ns = next (rdm);
+   if (!ISLOWER (ns) && !ISUPPER (ns))
+-{
+-  rdm->errored = 1;
+-  return;
+-}
++  goto fail_return;
+ 
+   demangle_path (rdm, in_value);
+ 
+@@ -776,9 +788,15 @@ demangle_path (struct rust_demangler *rd
+ }
+   break;
+ default:
+-  rdm->errored = 1;
+-  return;
++  goto fail_return;
+ }
++  goto pass_return;
++
++ fail_return:
++  rdm->errored = 1;
++ pass_return:
++  if (rdm->recursion != RUST_NO_RECURSION_LIMIT)
++-- rdm->recursion;
+ }
+ 
+ static void
+@@ -1317,6 +1335,7 @@ rust_demangle_callback (const char *mang
+   rdm.skipping_printing = 0;
+   rdm.verbose = (options & DMGL_VERBOSE) != 0;
+   rdm.version = 0;
++  rdm.recursion = (options & DMGL_NO_RECURSE_LIMIT) ? RUST_NO_RECURSION_LIMIT 
: 0;
+   rdm.bound_lifetime_depth = 0;
+ 
+   /* Rust symbols always start with _R (v0) or _ZN (legacy). */
-- 
2.31.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#157510): 
https://lists.openembedded.org/g/openembedded-core/message/157510
Mute This Topic: https://lists.openembedded.org/mt/86624481/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



  1   2   >