Skip to contentSkip to conversation

rxvt-unicode: Do not use throw specifications

PATCH New Khem Raj 1 participant 4 messages Feb 27, 2021

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/4 rxvt-unicode: Do not use throw specifications

Fixes build with -std=c++17

| ../../rxvt-unicode-9.22/src/../libev/ev++.h:379:46: error: ISO C++17 does not allow dynamic exception specifications
|   379 |     default_loop (unsigned int flags = AUTO) throw (bad_loop)
|       |                                              ^~~~~
---
 ...emove-deprecated-throw-specification.patch | 30 +++++++++++++++++++
 .../rxvt-unicode/rxvt-unicode_9.22.bb         |  4 ++-
 2 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-sato/rxvt-unicode/rxvt-unicode/0001-libev-remove-deprecated-throw-specification.patch
meta/recipes-sato/rxvt-unicode/rxvt-unicode/0001-libev-remove-deprecated-throw-specification.patch new file +30 -0
new file mode 100644
index 0000000000..f10dca09d6
@@ -0,0 +1,30 @@
+From 9a8f1d73e7b7e183768a8379ef32429a84f0e5c2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 26 Feb 2021 18:11:56 -0800
+Subject: [PATCH] libev: remove deprecated throw specification
+
+removes the throw specifications that are deprecated since C++11:
+warning: dynamic exception specifications are deprecated in C++11 [-Wdeprecated]
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ libev/ev++.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libev/ev++.h b/libev/ev++.h
+index 4f0a36a..85ddf44 100644
+--- a/libev/ev++.h
++++ b/libev/ev++.h
+@@ -376,7 +376,7 @@ namespace ev {
+ 
+   struct default_loop : loop_ref
+   {
+-    default_loop (unsigned int flags = AUTO) throw (bad_loop)
++    default_loop (unsigned int flags = AUTO)
+ #if EV_MULTIPLICITY
+     : loop_ref (ev_default_loop (flags))
+ #endif
+-- 
+2.30.1
+
meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.22.bb +3 -1
index bfa8a614df..283e8d7751 100644
@@ -4,5 +4,7 @@ LICENSE = "GPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
                     file://src/main.C;beginline=1;endline=31;md5=d3600d7ee1062667fcd1193fbe6485f6"
 
-SRC_URI[md5sum] = "93782dec27494eb079467dacf6e48185"
+SRC_URI += "file://0001-libev-remove-deprecated-throw-specification.patch"
+
 SRC_URI[sha256sum] = "e94628e9bcfa0adb1115d83649f898d6edb4baced44f5d5b769c2eeb8b95addd"
+
Signature · 1 line
2.30.1
author
#1 lore raw

PATCH 2/4 llvm: Fix build with c++17

Fixes
/benchmark_register.h:17:30: error: 'numeric_limits' is not a member of 'std'
| static const T kmax = std::numeric_limits<T>::max();
| ^~~~~~~~~~~~~~

---
 .../llvm/0001-nfc-Fix-missing-include.patch   | 26 +++++++++++++++++++
 meta/recipes-devtools/llvm/llvm_git.bb        |  1 +
 2 files changed, 27 insertions(+)
 create mode 100644 meta/recipes-devtools/llvm/llvm/0001-nfc-Fix-missing-include.patch
meta/recipes-devtools/llvm/llvm/0001-nfc-Fix-missing-include.patch new file +26 -0
new file mode 100644
index 0000000000..f6dee77ab2
@@ -0,0 +1,26 @@
+From 3b7e611bd58ba842470d17374c550e14bceca5c7 Mon Sep 17 00:00:00 2001
+From: serge-sans-paille <[email protected]>
+Date: Tue, 10 Nov 2020 14:55:25 +0100
+Subject: [PATCH] [nfc] Fix missing include
+
+Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/b498303066a63a203d24f739b2d2e0e56dca70d1]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ llvm/utils/benchmark/src/benchmark_register.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/llvm/utils/benchmark/src/benchmark_register.h b/llvm/utils/benchmark/src/benchmark_register.h
+index 0705e219f2fa..4caa5ad4da07 100644
+--- a/llvm/utils/benchmark/src/benchmark_register.h
++++ b/llvm/utils/benchmark/src/benchmark_register.h
+@@ -1,6 +1,7 @@
+ #ifndef BENCHMARK_REGISTER_H
+ #define BENCHMARK_REGISTER_H
+ 
++#include <limits>
+ #include <vector>
+ 
+ #include "check.h"
+-- 
+2.30.1
+
meta/recipes-devtools/llvm/llvm_git.bb +1 -0
index 86def0878c..db6694339c 100644
@@ -34,6 +34,7 @@ SRC_URI = "git://github.com/llvm/llvm-project.git;branch=${BRANCH} \
            file://0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch;striplevel=2 \
            file://0007-llvm-allow-env-override-of-exe-path.patch;striplevel=2 \
            file://0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch;striplevel=2 \
+           file://0001-nfc-Fix-missing-include.patch;striplevel=2 \
            "
 
 UPSTREAM_CHECK_GITTAGREGEX = "llvmorg-(?P<pver>\d+(\.\d+)+)"
Signature · 1 line
2.30.1
author
#2 lore raw

PATCH 3/4 dtc: Fix array-bounds error

In reply to Khem Raj

Fixes

| libfdt/libfdt.h:251:28: error: array subscript 'struct fdt_header[0]' is partly outside array bounds of 'unsigned char[4]' [-Werror=array-bounds]
|   251 |                 fdth->name = cpu_to_fdt32(val); \
|       |                 ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
---
 .../dtc/0001-fdtdump-Fix-gcc11-warning.patch  | 35 +++++++++++++++++++
 meta/recipes-kernel/dtc/dtc_1.6.0.bb          |  2 ++
 2 files changed, 37 insertions(+)
 create mode 100644 meta/recipes-kernel/dtc/dtc/0001-fdtdump-Fix-gcc11-warning.patch
meta/recipes-kernel/dtc/dtc/0001-fdtdump-Fix-gcc11-warning.patch new file +35 -0
new file mode 100644
index 0000000000..ec825cbf7b
@@ -0,0 +1,35 @@
+From 4827e0db6c4f7dea7f4094f49d3bb48ef6dfdc2d Mon Sep 17 00:00:00 2001
+From: David Gibson <[email protected]>
+Date: Wed, 6 Jan 2021 14:52:26 +1100
+Subject: [PATCH] fdtdump: Fix gcc11 warning
+
+In one place, fdtdump abuses fdt_set_magic(), passing it just a small char
+array instead of the full fdt header it expects.  That's relying on the
+fact that in fact fdt_set_magic() will only actually access the first 4
+bytes of the buffer.
+
+This trips a new warning in GCC 11 - and it's entirely possible it was
+always UB.  So, don't do that.
+
+Upstream-Status: Backport [https://git.kernel.org/pub/scm/utils/dtc/dtc.git/patch/?id=ca16a723fa9dde9c5da80dba567f48715000e77c]
+Signed-off-by: David Gibson <[email protected]>
+---
+ fdtdump.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fdtdump.c b/fdtdump.c
+index 9613bef..d9fb374 100644
+--- a/fdtdump.c
++++ b/fdtdump.c
+@@ -217,7 +217,7 @@ int main(int argc, char *argv[])
+ 		char *p = buf;
+ 		char *endp = buf + len;
+ 
+-		fdt_set_magic(smagic, FDT_MAGIC);
++		fdt32_st(smagic, FDT_MAGIC);
+ 
+ 		/* poor man's memmem */
+ 		while ((endp - p) >= FDT_MAGIC_SIZE) {
+-- 
+2.30.1
+
meta/recipes-kernel/dtc/dtc_1.6.0.bb +2 -0
index 92df70d9fc..a407137859 100644
@@ -5,6 +5,8 @@ LIC_FILES_CHKSUM = "file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
 
 SRCREV = "2525da3dba9beceb96651dc2986581871dbeca30"
 
+SRC_URI += "file://0001-fdtdump-Fix-gcc11-warning.patch"
+
 S = "${WORKDIR}/git"
 
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.30.1
author
#3 lore raw

PATCH 4/4 kea: Fix configure test error with gcc11

In reply to Khem Raj

Since the test program fails to compile, configure thinks compiler is not having thread support and bails out

---
 ...01-ax_cpp11.m4-Include-memory-header.patch | 29 +++++++++++++++++++
 .../kea/files/0001-include-limits.h.patch     | 29 +++++++++++++++++++
 meta/recipes-connectivity/kea/kea_1.8.2.bb    |  2 ++
 3 files changed, 60 insertions(+)
 create mode 100644 meta/recipes-connectivity/kea/files/0001-ax_cpp11.m4-Include-memory-header.patch
 create mode 100644 meta/recipes-connectivity/kea/files/0001-include-limits.h.patch
meta/recipes-connectivity/kea/files/0001-ax_cpp11.m4-Include-memory-header.patch new file +29 -0
new file mode 100644
index 0000000000..f7f98c4d6e
@@ -0,0 +1,29 @@
+From 5314a4815006e3a42f3ce265d1597db700cdb784 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 26 Feb 2021 23:14:20 -0800
+Subject: [PATCH] ax_cpp11.m4: Include <memory> header
+
+This is needed for std::shared_ptr
+GCC-11 throws errors if header is not included
+
+Upstream-Status: Submitted [https://github.com/isc-projects/kea/pull/120]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ m4macros/ax_cpp11.m4 | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/m4macros/ax_cpp11.m4 b/m4macros/ax_cpp11.m4
+index 6176728..6b14a84 100644
+--- a/m4macros/ax_cpp11.m4
++++ b/m4macros/ax_cpp11.m4
+@@ -182,6 +182,7 @@ for retry in "none" "--std=c++11" "--std=c++0x" "--std=c++1x" "fail"; do
+ 	AC_COMPILE_IFELSE(
+ 		[AC_LANG_PROGRAM(
+ 			[#include <thread>
++			 #include <memory>
+ 			 std::shared_ptr<std::thread> th;],
+ 			[th.reset(new std::thread([[]]() { return; }));
+ 			 th->join();])],
+-- 
+2.30.1
+
meta/recipes-connectivity/kea/files/0001-include-limits.h.patch new file +29 -0
new file mode 100644
index 0000000000..4bb76e2344
@@ -0,0 +1,29 @@
+From 7bca122e15bbe98c7b8da851ef3e1cf9a714afd9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 26 Feb 2021 23:31:15 -0800
+Subject: [PATCH] include limits.h
+
+Fixes build with gcc11
+backend_selector.cc:61:35: error: 'numeric_limits' is not a member of 'std'
+
+Upstream-Status: Submitted [https://github.com/isc-projects/kea/pull/120]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/lib/exceptions/exceptions.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/lib/exceptions/exceptions.h b/src/lib/exceptions/exceptions.h
+index f5368c8..494ec69 100644
+--- a/src/lib/exceptions/exceptions.h
++++ b/src/lib/exceptions/exceptions.h
+@@ -7,6 +7,7 @@
+ #ifndef EXCEPTIONS_H
+ #define EXCEPTIONS_H 1
+ 
++#include <limits>
+ #include <stdexcept>
+ #include <string>
+ #include <sstream>
+-- 
+2.30.1
+
meta/recipes-connectivity/kea/kea_1.8.2.bb +2 -0
index 3dc4f6af70..fe10d90620 100644
@@ -18,6 +18,8 @@ SRC_URI = "http://ftp.isc.org/isc/kea/${PV}/${BP}.tar.gz \
            file://fix-multilib-conflict.patch \
            file://fix_pid_keactrl.patch \
            file://0001-src-lib-log-logger_unittest_support.cc-do-not-write-.patch \
+           file://0001-ax_cpp11.m4-Include-memory-header.patch \
+           file://0001-include-limits.h.patch \
            "
 SRC_URI[sha256sum] = "486ca7abedb9d6fdf8e4344ad8688d1171f2ef0f5506d118988aadeae80a1d39"
 
Signature · 1 line
2.30.1