]> code.ossystems Code Review - meta-freescale.git/commitdiff
gpp-aioptool: add -fcommon to fix build with gcc10
authorTing Liu <ting.liu@nxp.com>
Wed, 16 Dec 2020 02:39:05 +0000 (10:39 +0800)
committerOtavio Salvador <otavio@ossystems.com.br>
Wed, 16 Dec 2020 11:40:52 +0000 (08:40 -0300)
Fix:
| ...ld: src/aiop_logger.o:(.bss+0x0): multiple definition of `_debug_flag'; src/aiop_tool.o:(.bss+0x0): first defined here
| ...ld: src/aiop_logger.o:(.bss+0x2): multiple definition of `_verbose_flag'; src/aiop_tool.o:(.bss+0x2): first defined here

Signed-off-by: Ting Liu <ting.liu@nxp.com>
recipes-dpaa2/gpp-aioptool/gpp-aioptool/0001-add-fcommon-to-fix-gcc-10-build-issue.patch [new file with mode: 0644]
recipes-dpaa2/gpp-aioptool/gpp-aioptool_git.bb

diff --git a/recipes-dpaa2/gpp-aioptool/gpp-aioptool/0001-add-fcommon-to-fix-gcc-10-build-issue.patch b/recipes-dpaa2/gpp-aioptool/gpp-aioptool/0001-add-fcommon-to-fix-gcc-10-build-issue.patch
new file mode 100644 (file)
index 0000000..6b69e7f
--- /dev/null
@@ -0,0 +1,36 @@
+From e506c4ea7e576e713fa64569b6784bdc22b3205f Mon Sep 17 00:00:00 2001
+From: Ting Liu <ting.liu@nxp.com>
+Date: Fri, 9 Oct 2020 13:13:13 +0530
+Subject: [PATCH] add -fcommon to fix gcc 10 build issue
+
+Fix:
+| ...ld: src/aiop_logger.o:(.bss+0x0): multiple definition of `_debug_flag'; src/aiop_tool.o:(.bss+0x0): first defined here
+| ...ld: src/aiop_logger.o:(.bss+0x2): multiple definition of `_verbose_flag'; src/aiop_tool.o:(.bss+0x2): first defined here
+
+Reference: https://gcc.gnu.org/gcc-10/porting_to.html
+As a workaround, legacy C code where all tentative definitions should be
+placed into a common block can be compiled with -fcommon.
+
+Upstream-Status: Pending
+
+Signed-off-by: Ting Liu <ting.liu@nxp.com>
+---
+ Makefile             | 2 +-
+ 1 files changed, 1 insertion(+), 1 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index f10dda2..f568788 100644
+--- a/Makefile
++++ b/Makefile
+@@ -23,7 +23,7 @@ BINDIR       = bin
+ # FLAGS
+-CFLAGS = -Wall
++CFLAGS = -Wall -fcommon
+ #CFLAGS += -g -O0   # Enable for Debugging
+ CFLAGS += -I$(top_builddir)/include
+ CFLAGS += -I$(top_builddir)/src
+-- 
+2.17.1
+
index a9c3180f510a52a15a8a3a289564cbf9335ddeb8..1e60c534c729b304b4286d60d0137cd91c8955b9 100644 (file)
@@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=386a6287daa6504b7e7e5014ddfb3987"
 
 SRC_URI = "git://source.codeaurora.org/external/qoriq/qoriq-components/gpp-aioptool;nobranch=1 \
     file://0001-remove-libio.h.patch \
+    file://0001-add-fcommon-to-fix-gcc-10-build-issue.patch \
 "
 SRCREV = "6ead470dde043f3ca67f1ba19b313dd64ec199e1"