--- /dev/null
+From d7841abe8efdefbfdb8e97f6a1ac4eb33afffdab Mon Sep 17 00:00:00 2001
+From: Moritz Rosenthal <moritz.rosenthal@kernelconcepts.de>
+Date: Thu, 9 Mar 2023 07:37:57 +0100
+Subject: [PATCH] fix build with gcc 10
+
+---
+ scripts/dtc/dtc-lexer.l | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
+index fd825ebba6..24af549977 100644
+--- a/scripts/dtc/dtc-lexer.l
++++ b/scripts/dtc/dtc-lexer.l
+@@ -38,7 +38,6 @@ LINECOMMENT "//".*\n
+ #include "srcpos.h"
+ #include "dtc-parser.tab.h"
+
+-YYLTYPE yylloc;
+ extern bool treesource_error;
+
+ /* CAUTION: this will stop working if we ever use yyless() or yyunput() */
--- /dev/null
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-fix-build-with-gcc-10.patch"
+
--- /dev/null
+From 1a1f98c89d2679953bfdcb31a3abc7eebb05ea7a Mon Sep 17 00:00:00 2001
+From: Moritz Rosenthal <moritz.rosenthal@kernelconcepts.de>
+Date: Thu, 9 Mar 2023 09:53:30 +0100
+Subject: [PATCH] fix build with gcc 10
+
+---
+ scripts/dtc/dtc-lexer.l | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
+index fd825ebba6..24af549977 100644
+--- a/scripts/dtc/dtc-lexer.l
++++ b/scripts/dtc/dtc-lexer.l
+@@ -38,7 +38,6 @@ LINECOMMENT "//".*\n
+ #include "srcpos.h"
+ #include "dtc-parser.tab.h"
+
+-YYLTYPE yylloc;
+ extern bool treesource_error;
+
+ /* CAUTION: this will stop working if we ever use yyless() or yyunput() */
--- /dev/null
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-fix-build-with-gcc-10.patch"
+
--- /dev/null
+From 34e5783dbf286857a7ca0bac3b868a0a7c0f501c Mon Sep 17 00:00:00 2001
+From: Moritz Rosenthal <moritz.rosenthal@kernelconcepts.de>
+Date: Thu, 9 Mar 2023 07:47:37 +0100
+Subject: [PATCH] fix build with gcc 10
+
+---
+ gold/descriptors.cc | 1 +
+ gold/errors.h | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/gold/descriptors.cc b/gold/descriptors.cc
+index b00087d40a9..352d91fe9e9 100644
+--- a/gold/descriptors.cc
++++ b/gold/descriptors.cc
+@@ -26,6 +26,7 @@
+ #include <cstdio>
+ #include <cstring>
+ #include <fcntl.h>
++#include <string>
+ #include <unistd.h>
+
+ #include "debug.h"
+diff --git a/gold/errors.h b/gold/errors.h
+index ebb7e5fb60a..de2c96df85c 100644
+--- a/gold/errors.h
++++ b/gold/errors.h
+@@ -24,6 +24,7 @@
+ #define GOLD_ERRORS_H
+
+ #include <cstdarg>
++#include <string>
+
+ #include "gold-threads.h"
+
--- /dev/null
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-fix-build-with-gcc-10.patch"
+
--- /dev/null
+From c6a12bc0a4f925928770fe9cc95edd4537f54add Mon Sep 17 00:00:00 2001
+From: Moritz Rosenthal <moritz.rosenthal@kernelconcepts.de>
+Date: Wed, 8 Mar 2023 18:54:35 +0100
+Subject: [PATCH] fix build with gcc 10
+
+---
+ binutils/coffdump.c | 2 --
+ binutils/srconv.c | 2 --
+ binutils/sysdump.c | 2 --
+ gold/descriptors.cc | 1 +
+ gold/errors.h | 1 +
+ 5 files changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/binutils/coffdump.c b/binutils/coffdump.c
+index 13f885ce327..fb0310c780a 100644
+--- a/binutils/coffdump.c
++++ b/binutils/coffdump.c
+@@ -456,8 +456,6 @@ coff_dump (struct coff_ofile *ptr)
+ dump_coff_section (ptr->sections + i);
+ }
+
+-char * program_name;
+-
+ static void
+ show_usage (FILE *file, int status)
+ {
+diff --git a/binutils/srconv.c b/binutils/srconv.c
+index f89d99841d6..866288ebaaf 100644
+--- a/binutils/srconv.c
++++ b/binutils/srconv.c
+@@ -1687,8 +1687,6 @@ prescan (struct coff_ofile *otree)
+ }
+ }
+
+-char *program_name;
+-
+ ATTRIBUTE_NORETURN static void
+ show_usage (FILE *ffile, int status)
+ {
+diff --git a/binutils/sysdump.c b/binutils/sysdump.c
+index be026f8f17c..478caa79a4c 100644
+--- a/binutils/sysdump.c
++++ b/binutils/sysdump.c
+@@ -633,8 +633,6 @@ module (void)
+ }
+ }
+
+-char *program_name;
+-
+ ATTRIBUTE_NORETURN static void
+ show_usage (FILE *ffile, int status)
+ {
+diff --git a/gold/descriptors.cc b/gold/descriptors.cc
+index b00087d40a9..352d91fe9e9 100644
+--- a/gold/descriptors.cc
++++ b/gold/descriptors.cc
+@@ -26,6 +26,7 @@
+ #include <cstdio>
+ #include <cstring>
+ #include <fcntl.h>
++#include <string>
+ #include <unistd.h>
+
+ #include "debug.h"
+diff --git a/gold/errors.h b/gold/errors.h
+index ebb7e5fb60a..de2c96df85c 100644
+--- a/gold/errors.h
++++ b/gold/errors.h
+@@ -24,6 +24,7 @@
+ #define GOLD_ERRORS_H
+
+ #include <cstdarg>
++#include <string>
+
+ #include "gold-threads.h"
+
+--
+2.30.2
+
--- /dev/null
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-fix-build-with-gcc-10.patch"
+
--- /dev/null
+From b42023691a0bc09251e3dfff42e143245a2bac3f Mon Sep 17 00:00:00 2001
+From: Moritz Rosenthal <moritz.rosenthal@kernelconcepts.de>
+Date: Wed, 8 Mar 2023 18:32:24 +0100
+Subject: [PATCH] fix build with gcc 10
+
+---
+ pseudo_ipc.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pseudo_ipc.h b/pseudo_ipc.h
+index 46277bc..a4261ac 100644
+--- a/pseudo_ipc.h
++++ b/pseudo_ipc.h
+@@ -40,7 +40,7 @@ typedef struct {
+ char path[];
+ } pseudo_msg_t;
+
+-enum {
++typedef enum {
+ PSA_EXEC = 1,
+ PSA_WRITE = (PSA_EXEC << 1),
+ PSA_READ = (PSA_WRITE << 1),
+--
+2.30.2
+
--- /dev/null
+From 61ddb3ea2c3e70da977710f1ed30ff3a6c6142f8 Mon Sep 17 00:00:00 2001
+From: Seebs <seebs@seebs.net>
+Date: Thu, 1 Aug 2019 12:20:04 -0500
+Subject: [PATCH 1/2] handle O_NOFOLLOW in flags for open/openat
+
+Did you know that, similar to AT_SYMLINK_NOFOLLOW, there's
+an O_NOFOLLOW available in flags for open/openat?
+
+I didn't.
+
+(cherry picked from commit 097ca3e245200c4a4333964af59a106c42ff3bca)
+---
+ ChangeLog.txt | 3 +++
+ ports/linux/wrapfuncs.in | 12 ++++++------
+ 2 files changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/ChangeLog.txt b/ChangeLog.txt
+index 60666e5..93253aa 100644
+--- a/ChangeLog.txt
++++ b/ChangeLog.txt
+@@ -1,3 +1,6 @@
++2019-08-01:
++ * (seebs) Pass flags|O_NOFOLLOW on when resolving paths with openat.
++
+ 2019-04-10:
+ * (seebs) Experimental workaround for special non-blocking open
+ case.
+diff --git a/ports/linux/wrapfuncs.in b/ports/linux/wrapfuncs.in
+index a129eba..4cdbc9c 100644
+--- a/ports/linux/wrapfuncs.in
++++ b/ports/linux/wrapfuncs.in
+@@ -1,12 +1,12 @@
+-int open(const char *path, int flags, ...{mode_t mode}); /* flags=0 */
++int open(const char *path, int flags, ...{mode_t mode}); /* flags=flags|O_NOFOLLOW */
+ char *get_current_dir_name(void);
+ int __xstat(int ver, const char *path, struct stat *buf);
+ int __lxstat(int ver, const char *path, struct stat *buf); /* flags=AT_SYMLINK_NOFOLLOW */
+ int __fxstat(int ver, int fd, struct stat *buf);
+ int lchown(const char *path, uid_t owner, gid_t group); /* flags=AT_SYMLINK_NOFOLLOW */
+ int __fxstatat(int ver, int dirfd, const char *path, struct stat *buf, int flags);
+-int openat(int dirfd, const char *path, int flags, ...{mode_t mode}); /* flags=0 */
+-int __openat_2(int dirfd, const char *path, int flags); /* flags=0 */
++int openat(int dirfd, const char *path, int flags, ...{mode_t mode}); /* flags=flags|O_NOFOLLOW */
++int __openat_2(int dirfd, const char *path, int flags); /* flags=flags|O_NOFOLLOW */
+ int mknod(const char *path, mode_t mode, dev_t dev); /* real_func=pseudo_mknod */
+ int mknodat(int dirfd, const char *path, mode_t mode, dev_t dev); /* real_func=pseudo_mknodat */
+ int __xmknod(int ver, const char *path, mode_t mode, dev_t *dev); /* flags=AT_SYMLINK_NOFOLLOW */
+@@ -15,9 +15,9 @@ int fcntl(int fd, int cmd, ...{struct flock *lock});
+ # just so we know the inums of symlinks
+ char *canonicalize_file_name(const char *filename);
+ int eaccess(const char *path, int mode);
+-int open64(const char *path, int flags, ...{mode_t mode}); /* flags=0 */
+-int openat64(int dirfd, const char *path, int flags, ...{mode_t mode}); /* flags=0 */
+-int __openat64_2(int dirfd, const char *path, int flags); /* flags=0 */
++int open64(const char *path, int flags, ...{mode_t mode}); /* flags=flags|O_NOFOLLOW */
++int openat64(int dirfd, const char *path, int flags, ...{mode_t mode}); /* flags=flags|O_NOFOLLOW */
++int __openat64_2(int dirfd, const char *path, int flags); /* flags=flags|O_NOFOLLOW */
+ int creat64(const char *path, mode_t mode);
+ int stat(const char *path, struct stat *buf); /* real_func=pseudo_stat */
+ int lstat(const char *path, struct stat *buf); /* real_func=pseudo_lstat, flags=AT_SYMLINK_NOFOLLOW */
+--
+2.30.2
+
--- /dev/null
+From 003198d71dc69cafb6a4542f39cf88d6987bdce2 Mon Sep 17 00:00:00 2001
+From: Seebs <seebs@seebs.net>
+Date: Fri, 2 Aug 2019 12:29:04 -0500
+Subject: [PATCH 2/2] use *correct* flags for open/openat, also apply them for
+ related stat
+
+When statting a file that we may or may not be opening with O_NOFOLLOW,
+we should use lstat (or AT_SYMLINK_NOFOLLOW) to try to get information
+about the right file.
+
+Also when we want to check whether a bit is set, we should use & rather
+than |. I am an experienced programmer and know the difference between
+those.
+
+(cherry picked from commit 060058bb29f70b244e685b3c704eb0641b736f73)
+---
+ ChangeLog.txt | 4 ++++
+ ports/linux/guts/openat.c | 26 ++++++++++++++++++++------
+ ports/linux/wrapfuncs.in | 12 ++++++------
+ 3 files changed, 30 insertions(+), 12 deletions(-)
+
+diff --git a/ChangeLog.txt b/ChangeLog.txt
+index 93253aa..e83e30d 100644
+--- a/ChangeLog.txt
++++ b/ChangeLog.txt
+@@ -1,3 +1,7 @@
++2019-08-02:
++ * (seebs) Pass flags & O_NOFOLLOW, also use that to influence
++ stat types. Note. &. Not |.
++
+ 2019-08-01:
+ * (seebs) Pass flags|O_NOFOLLOW on when resolving paths with openat.
+
+diff --git a/ports/linux/guts/openat.c b/ports/linux/guts/openat.c
+index cc6b118..f1a8162 100644
+--- a/ports/linux/guts/openat.c
++++ b/ports/linux/guts/openat.c
+@@ -53,9 +53,13 @@
+ if (flags & O_CREAT) {
+ save_errno = errno;
+ #ifdef PSEUDO_NO_REAL_AT_FUNCTIONS
+- rc = real___xstat64(_STAT_VER, path, &buf);
++ if (flags & O_NOFOLLOW) {
++ rc = real___lxstat64(_STAT_VER, path, &buf);
++ } else {
++ rc = real___xstat64(_STAT_VER, path, &buf);
++ }
+ #else
+- rc = real___fxstatat64(_STAT_VER, dirfd, path, &buf, 0);
++ rc = real___fxstatat64(_STAT_VER, dirfd, path, &buf, (flags & O_NOFOLLOW) ? AT_SYMLINK_NOFOLLOW : 0);
+ #endif
+ existed = (rc != -1);
+ if (!existed)
+@@ -70,9 +74,13 @@
+ if (!(flags & O_NONBLOCK) && ((flags & (O_WRONLY | O_RDONLY | O_RDWR)) != O_RDWR)) {
+ save_errno = errno;
+ #ifdef PSEUDO_NO_REAL_AT_FUNCTIONS
+- rc = real___xstat64(_STAT_VER, path, &buf);
++ if (flags & O_NOFOLLOW) {
++ rc = real___lxstat64(_STAT_VER, path, &buf);
++ } else {
++ rc = real___xstat64(_STAT_VER, path, &buf);
++ }
+ #else
+- rc = real___fxstatat64(_STAT_VER, dirfd, path, &buf, 0);
++ rc = real___fxstatat64(_STAT_VER, dirfd, path, &buf, (flags & O_NOFOLLOW) ? AT_SYMLINK_NOFOLLOW : 0);
+ #endif
+ if (rc != -1 && S_ISFIFO(buf.st_mode)) {
+ overly_magic_nonblocking = 1;
+@@ -124,11 +132,17 @@
+ }
+ #endif
+ #ifdef PSEUDO_NO_REAL_AT_FUNCTIONS
+- stat_rc = real___xstat64(_STAT_VER, path, &buf);
++ if (flags & O_NOFOLLOW) {
++ stat_rc = real___lxstat64(_STAT_VER, path, &buf);
++ } else {
++ stat_rc = real___xstat64(_STAT_VER, path, &buf);
++ }
+ #else
+- stat_rc = real___fxstatat64(_STAT_VER, dirfd, path, &buf, 0);
++ stat_rc = real___fxstatat64(_STAT_VER, dirfd, path, &buf, (flags & O_NOFOLLOW) ? AT_SYMLINK_NOFOLLOW : 0);
+ #endif
+
++ pseudo_debug(PDBGF_FILE, "openat(path %s), flags %o, stat rc %d, stat mode %o\n",
++ path, flags, stat_rc, buf.st_mode);
+ if (stat_rc != -1) {
+ buf.st_mode = PSEUDO_DB_MODE(buf.st_mode, mode);
+ if (!existed) {
+diff --git a/ports/linux/wrapfuncs.in b/ports/linux/wrapfuncs.in
+index 4cdbc9c..c5ea7c3 100644
+--- a/ports/linux/wrapfuncs.in
++++ b/ports/linux/wrapfuncs.in
+@@ -1,12 +1,12 @@
+-int open(const char *path, int flags, ...{mode_t mode}); /* flags=flags|O_NOFOLLOW */
++int open(const char *path, int flags, ...{mode_t mode}); /* flags=flags&O_NOFOLLOW */
+ char *get_current_dir_name(void);
+ int __xstat(int ver, const char *path, struct stat *buf);
+ int __lxstat(int ver, const char *path, struct stat *buf); /* flags=AT_SYMLINK_NOFOLLOW */
+ int __fxstat(int ver, int fd, struct stat *buf);
+ int lchown(const char *path, uid_t owner, gid_t group); /* flags=AT_SYMLINK_NOFOLLOW */
+ int __fxstatat(int ver, int dirfd, const char *path, struct stat *buf, int flags);
+-int openat(int dirfd, const char *path, int flags, ...{mode_t mode}); /* flags=flags|O_NOFOLLOW */
+-int __openat_2(int dirfd, const char *path, int flags); /* flags=flags|O_NOFOLLOW */
++int openat(int dirfd, const char *path, int flags, ...{mode_t mode}); /* flags=flags&O_NOFOLLOW */
++int __openat_2(int dirfd, const char *path, int flags); /* flags=flags&O_NOFOLLOW */
+ int mknod(const char *path, mode_t mode, dev_t dev); /* real_func=pseudo_mknod */
+ int mknodat(int dirfd, const char *path, mode_t mode, dev_t dev); /* real_func=pseudo_mknodat */
+ int __xmknod(int ver, const char *path, mode_t mode, dev_t *dev); /* flags=AT_SYMLINK_NOFOLLOW */
+@@ -15,9 +15,9 @@ int fcntl(int fd, int cmd, ...{struct flock *lock});
+ # just so we know the inums of symlinks
+ char *canonicalize_file_name(const char *filename);
+ int eaccess(const char *path, int mode);
+-int open64(const char *path, int flags, ...{mode_t mode}); /* flags=flags|O_NOFOLLOW */
+-int openat64(int dirfd, const char *path, int flags, ...{mode_t mode}); /* flags=flags|O_NOFOLLOW */
+-int __openat64_2(int dirfd, const char *path, int flags); /* flags=flags|O_NOFOLLOW */
++int open64(const char *path, int flags, ...{mode_t mode}); /* flags=flags&O_NOFOLLOW */
++int openat64(int dirfd, const char *path, int flags, ...{mode_t mode}); /* flags=flags&O_NOFOLLOW */
++int __openat64_2(int dirfd, const char *path, int flags); /* flags=flags&O_NOFOLLOW */
+ int creat64(const char *path, mode_t mode);
+ int stat(const char *path, struct stat *buf); /* real_func=pseudo_stat */
+ int lstat(const char *path, struct stat *buf); /* real_func=pseudo_lstat, flags=AT_SYMLINK_NOFOLLOW */
+--
+2.30.2
+
--- /dev/null
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-fix-build-with-gcc-10.patch \
+ file://0001-handle-O_NOFOLLOW-in-flags-for-open-openat.patch \
+ file://0002-use-correct-flags-for-open-openat-also-apply-them-fo.patch \
+"
+
--- /dev/null
+From 0c531b0c6dbc6423478682a9cd85d37fa6ca95b4 Mon Sep 17 00:00:00 2001
+From: Moritz Rosenthal <moritz.rosenthal@kernelconcepts.de>
+Date: Thu, 9 Mar 2023 10:32:58 +0100
+Subject: [PATCH] fix build with gcc 10
+
+---
+ squashfs-tools/mksquashfs.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/squashfs-tools/mksquashfs.h b/squashfs-tools/mksquashfs.h
+index 55708a3..cd84bfd 100644
+--- a/squashfs-tools/mksquashfs.h
++++ b/squashfs-tools/mksquashfs.h
+@@ -133,7 +133,7 @@ struct append_file {
+ #define BLOCK_OFFSET 2
+
+ extern struct cache *reader_buffer, *fragment_buffer, *reserve_cache;
+-struct cache *bwriter_buffer, *fwriter_buffer;
++extern struct cache *bwriter_buffer, *fwriter_buffer;
+ extern struct queue *to_reader, *to_deflate, *to_writer, *from_writer,
+ *to_frag, *locked_fragment, *to_process_frag;
+ extern struct append_file **file_mapping;
--- /dev/null
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-fix-build-with-gcc-10.patch;striplevel=2"
+
--- /dev/null
+From 4601d5e11be878bfc5fbdfe0bf1f578f099a05f0 Mon Sep 17 00:00:00 2001
+From: Moritz Rosenthal <moritz.rosenthal@kernelconcepts.de>
+Date: Thu, 9 Mar 2023 11:23:00 +0100
+Subject: [PATCH] fix build with gcc 10
+
+---
+ com32/lib/getopt.c | 2 --
+ mk/com32.mk | 1 +
+ mk/efi.mk | 2 +-
+ mk/elf.mk | 1 +
+ mk/embedded.mk | 1 +
+ mk/lib.mk | 1 +
+ 6 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/com32/lib/getopt.c b/com32/lib/getopt.c
+index 806735d..4313f1a 100644
+--- a/com32/lib/getopt.c
++++ b/com32/lib/getopt.c
+@@ -8,8 +8,6 @@
+ #include <unistd.h>
+ #include <string.h>
+
+-char *optarg;
+-int optind, opterr, optopt;
+ static struct getopt_private_state {
+ const char *optptr;
+ const char *last_optstring;
+diff --git a/mk/com32.mk b/mk/com32.mk
+index 9a3b19d..8a5121e 100644
+--- a/mk/com32.mk
++++ b/mk/com32.mk
+@@ -47,6 +47,7 @@ GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0)
+ GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0)
+ GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0)
+ GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0)
++GCCOPT += $(call gcc_ok,-fcommon)
+
+ ifndef EFI_BUILD
+ GCCOPT += -mregparm=3 -DREGPARM=3
+diff --git a/mk/efi.mk b/mk/efi.mk
+index f097ad2..a082bad 100644
+--- a/mk/efi.mk
++++ b/mk/efi.mk
+@@ -7,7 +7,7 @@ core = $(topdir)/core
+ # Set up architecture specifics; for cross compilation, set ARCH as apt
+ # gnuefi sets up architecture specifics in ia32 or x86_64 sub directories
+ # set up the LIBDIR and EFIINC for building for the appropriate architecture
+-GCCOPT := $(call gcc_ok,-fno-stack-protector,)
++GCCOPT := $(call gcc_ok,-fno-stack-protector,) $(call gcc_ok,-fcommon)
+ EFIINC = $(objdir)/include/efi
+ LIBDIR = $(objdir)/lib
+
+diff --git a/mk/elf.mk b/mk/elf.mk
+index 12d1077..7660d1b 100644
+--- a/mk/elf.mk
++++ b/mk/elf.mk
+@@ -42,6 +42,7 @@ GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0)
+ GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0)
+ GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0)
+ GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0)
++GCCOPT += $(call gcc_ok,-fcommon)
+
+ com32 = $(topdir)/com32
+ core = $(topdir)/core
+diff --git a/mk/embedded.mk b/mk/embedded.mk
+index 1614d8b..9445dd5 100644
+--- a/mk/embedded.mk
++++ b/mk/embedded.mk
+@@ -52,6 +52,7 @@ GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0)
+ GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0)
+ GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0)
+ GCCOPT += $(call gcc_ok,-fvisibility=hidden)
++GCCOPT += $(call gcc_ok,-fcommon)
+
+ LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc)
+
+diff --git a/mk/lib.mk b/mk/lib.mk
+index ceb95bd..b102d9a 100644
+--- a/mk/lib.mk
++++ b/mk/lib.mk
+@@ -28,6 +28,7 @@ GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0)
+ GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0)
+ GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0)
+ GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0)
++GCCOPT += $(call gcc_ok,-fcommon)
+
+ INCLUDE = -I$(SRC)
+ STRIP = strip --strip-all -R .comment -R .note
+--
+2.30.2
+
--- /dev/null
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-fix-build-with-gcc-10.patch"
+
--- /dev/null
+From 6e917d2001f439b445e45963a1677311a1c6beb3 Mon Sep 17 00:00:00 2001
+From: Vojtech Trefny <vtrefny@redhat.com>
+Date: Fri, 10 Aug 2018 09:53:36 +0200
+Subject: [PATCH] Use python interpreter explicitly when running
+ boilerplate_generator.py
+
+We can't rely on the shebang, because /usr/bin/python may not be
+available on all systems. It's better to use python executable path
+discovered by the AM_PYTHON_PATH autoconf macro.
+
+(cherry picked from commit 55a92e5c36794242441b7f2a89235cc94af9ff3f)
+---
+ src/lib/plugin_apis/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/lib/plugin_apis/Makefile.am b/src/lib/plugin_apis/Makefile.am
+index 720169ab..f9037a2c 100644
+--- a/src/lib/plugin_apis/Makefile.am
++++ b/src/lib/plugin_apis/Makefile.am
+@@ -5,7 +5,7 @@ HEADER_FILES := $(patsubst %.api,%.h,${API_FILES})
+ all-local: generate_boilerplate
+
+ %.c %.h: %.api ${srcdir}/../../../scripts/boilerplate_generator.py
+- ${srcdir}/../../../scripts/boilerplate_generator.py $*.api ./ ${skip_patterns}
++ ${PYTHON} ${srcdir}/../../../scripts/boilerplate_generator.py $*.api ./ ${skip_patterns}
+
+ generate_boilerplate: ${SOURCE_FILES} ${HEADER_FILES}
+
--- /dev/null
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-Use-python-interpreter-explicitly-when-running-boile.patch"
+
--- /dev/null
+From 30f279fc6e6943064e9115a52ed9816311191c43 Mon Sep 17 00:00:00 2001
+From: Moritz Rosenthal <moritz.rosenthal@kernelconcepts.de>
+Date: Thu, 9 Mar 2023 07:28:28 +0100
+Subject: [PATCH] fix for run with python 3.9
+
+---
+ xcbgen/align.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/xcbgen/align.py b/xcbgen/align.py
+index d4c12ee..386af89 100644
+--- a/xcbgen/align.py
++++ b/xcbgen/align.py
+@@ -2,7 +2,7 @@
+ This module contains helper classes for alignment arithmetic and checks
+ '''
+
+-from fractions import gcd
++from math import gcd
+
+ class Alignment(object):
+
--- /dev/null
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-fix-for-run-with-python-3.9.patch"
+
--- /dev/null
+From 22cd1118a8e080647adda1144185ef74f73316ac Mon Sep 17 00:00:00 2001
+From: Moritz Rosenthal <moritz.rosenthal@kernelconcepts.de>
+Date: Wed, 8 Mar 2023 18:42:55 +0100
+Subject: [PATCH] fix build with gcc 10
+
+---
+ dtc-lexer.l | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/dtc-lexer.l b/dtc-lexer.l
+index 615b7ec..d3694d6 100644
+--- a/dtc-lexer.l
++++ b/dtc-lexer.l
+@@ -38,7 +38,6 @@ LINECOMMENT "//".*\n
+ #include "srcpos.h"
+ #include "dtc-parser.tab.h"
+
+-YYLTYPE yylloc;
+ extern bool treesource_error;
+
+ /* CAUTION: this will stop working if we ever use yyless() or yyunput() */
--- /dev/null
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-fix-build-with-gcc-10.patch"
+
--- /dev/null
+From 22930570d780342b813ae30a016f27dba3490ea8 Mon Sep 17 00:00:00 2001
+From: Moritz Rosenthal <moritz.rosenthal@kernelconcepts.de>
+Date: Thu, 9 Mar 2023 09:50:08 +0100
+Subject: [PATCH] fix build with gcc 10
+
+---
+ scripts/dtc/dtc-lexer.l | 1 -
+ scripts/dtc/dtc-lexer.lex.c_shipped | 1 -
+ 2 files changed, 2 deletions(-)
+
+diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
+index fd825ebba69c..24af54997758 100644
+--- a/scripts/dtc/dtc-lexer.l
++++ b/scripts/dtc/dtc-lexer.l
+@@ -38,7 +38,6 @@ LINECOMMENT "//".*\n
+ #include "srcpos.h"
+ #include "dtc-parser.tab.h"
+
+-YYLTYPE yylloc;
+ extern bool treesource_error;
+
+ /* CAUTION: this will stop working if we ever use yyless() or yyunput() */
+diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped
+index 64c243772398..9db3a409c507 100644
+--- a/scripts/dtc/dtc-lexer.lex.c_shipped
++++ b/scripts/dtc/dtc-lexer.lex.c_shipped
+@@ -631,7 +631,6 @@ char *yytext;
+ #include "srcpos.h"
+ #include "dtc-parser.tab.h"
+
+-YYLTYPE yylloc;
+ extern bool treesource_error;
+
+ /* CAUTION: this will stop working if we ever use yyless() or yyunput() */
+--
+2.30.2
+
--- /dev/null
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-fix-build-with-gcc-10.patch"
+
--- /dev/null
+From e3c0dd8d5c3c7e6e9bdbef56577e7c15533c0f15 Mon Sep 17 00:00:00 2001
+From: Moritz Rosenthal <moritz.rosenthal@kernelconcepts.de>
+Date: Wed, 8 Mar 2023 18:25:18 +0100
+Subject: [PATCH] fix build with gcc 10
+
+---
+ src/parseopt.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/parseopt.c b/src/parseopt.c
+index a7b504f..1f6b561 100644
+--- a/src/parseopt.c
++++ b/src/parseopt.c
+@@ -255,8 +255,6 @@ print_option_descr (const char *descr, size_t lmargin, size_t rmargin)
+ }
+ \f
+ char *parseopt_program_name;
+-char *parseopt_program_doc;
+-char *parseopt_program_args;
+ const char *program_bug_address = "<" PACKAGE_BUGREPORT ">";
+ void (*parseopt_help_hook) (FILE *stream);
+ \f
--- /dev/null
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://0001-fix-build-with-gcc-10.patch"
+