aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-kernel/linux/files/0001-Use-Os-to-compile-broadcom-tg3.c.patch29
-rw-r--r--meta/recipes-kernel/linux/linux-yocto_5.10.bb2
2 files changed, 30 insertions, 1 deletions
diff --git a/meta/recipes-kernel/linux/files/0001-Use-Os-to-compile-broadcom-tg3.c.patch b/meta/recipes-kernel/linux/files/0001-Use-Os-to-compile-broadcom-tg3.c.patch
new file mode 100644
index 00000000000..9584efae163
--- /dev/null
+++ b/meta/recipes-kernel/linux/files/0001-Use-Os-to-compile-broadcom-tg3.c.patch
@@ -0,0 +1,29 @@
+From b510256cda566e0eda4e1cc9ccbeae2de2a4539e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 7 Mar 2021 13:00:37 -0800
+Subject: [PATCH] Use -Os to compile broadcom/tg3.c
+
+Workaround for GCC 11 bug
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ drivers/net/ethernet/broadcom/tg3.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
+index 5143cdd0eeca..6737bcd9b154 100644
+--- a/drivers/net/ethernet/broadcom/tg3.c
++++ b/drivers/net/ethernet/broadcom/tg3.c
+@@ -21,6 +21,9 @@
+ * notice is accompanying it.
+ */
+
++#if __GNUC__ >= 11
++#pragma GCC optimize ("Os")
++#endif
+
+ #include <linux/module.h>
+ #include <linux/moduleparam.h>
+--
+2.30.1
+
diff --git a/meta/recipes-kernel/linux/linux-yocto_5.10.bb b/meta/recipes-kernel/linux/linux-yocto_5.10.bb
index d40fa7eafe6..542503078cb 100644
--- a/meta/recipes-kernel/linux/linux-yocto_5.10.bb
+++ b/meta/recipes-kernel/linux/linux-yocto_5.10.bb
@@ -28,7 +28,7 @@ SRCREV_meta ?= "67e74d52f2aaa17ca7041032714368ea81bc8823"
SRC_URI = "git://git.yoctoproject.org/linux-yocto.git;name=machine;branch=${KBRANCH}; \
git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.10;destsuffix=${KMETA}"
-
+SRC_URI += "file://0001-Use-Os-to-compile-broadcom-tg3.c.patch"
LIC_FILES_CHKSUM = "file://COPYING;md5=6bc538ed5bd9a7fc9398086aedcd7e46"
LINUX_VERSION ?= "5.10.19"