Skip to contentSkip to conversation

inetutils: Fix build with -fno-common

PATCH New Khem Raj 1 participant 4 messages Aug 5, 2020

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/4 inetutils: Fix build with -fno-common

Fixes errors like

telnetd/state.c:69: multiple definition of `not42'; utility.o:/usr/src/debug/inetutils/1.9.4-r0/build/telnetd/../../inetutils-1.9.4/telnetd/utility.c:66: first defined here | clang-11: error: linker command failed with exit code 1 (use -v to see invocation)

---
 ...-multiple-definitions-of-errcatch-an.patch | 58 +++++++++++++++++++
 .../inetutils/inetutils_1.9.4.bb              |  1 +
 2 files changed, 59 insertions(+)
 create mode 100644 meta/recipes-connectivity/inetutils/inetutils/0001-ftpd-telnetd-Fix-multiple-definitions-of-errcatch-an.patch
meta/recipes-connectivity/inetutils/inetutils/0001-ftpd-telnetd-Fix-multiple-definitions-of-errcatch-an.patch new file +58 -0
new file mode 100644
index 0000000000..49d319f59d
@@ -0,0 +1,58 @@
+From 7d39930468e272c740b0eed3c7e5b7fb3abf29e8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 5 Aug 2020 10:36:22 -0700
+Subject: [PATCH] ftpd,telnetd: Fix multiple definitions of errcatch and not42
+
+This helps fix build failures when -fno-common option is used
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ ftpd/extern.h     | 2 +-
+ ftpd/ftpcmd.c     | 1 +
+ telnetd/utility.c | 2 +-
+ 3 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/ftpd/extern.h b/ftpd/extern.h
+index ab33cf3..91dbbee 100644
+--- a/ftpd/extern.h
++++ b/ftpd/extern.h
+@@ -90,7 +90,7 @@ extern void user (const char *);
+ extern char *sgetsave (const char *);
+ 
+ /* Exported from ftpd.c.  */
+-jmp_buf errcatch;
++extern jmp_buf errcatch;
+ extern struct sockaddr_storage data_dest;
+ extern socklen_t data_dest_len;
+ extern struct sockaddr_storage his_addr;
+diff --git a/ftpd/ftpcmd.c b/ftpd/ftpcmd.c
+index beb1f06..d272e9d 100644
+--- a/ftpd/ftpcmd.c
++++ b/ftpd/ftpcmd.c
+@@ -106,6 +106,7 @@
+ #endif
+ 
+ off_t restart_point;
++jmp_buf errcatch;
+ 
+ static char cbuf[512];           /* Command Buffer.  */
+ static char *fromname;
+diff --git a/telnetd/utility.c b/telnetd/utility.c
+index e7ffb8e..46bf91e 100644
+--- a/telnetd/utility.c
++++ b/telnetd/utility.c
+@@ -63,7 +63,7 @@ static int ncc;
+ static char ptyibuf[BUFSIZ], *ptyip;
+ static int pcc;
+ 
+-int not42;
++extern int not42;
+ 
+ static int
+ readstream (int p, char *ibuf, int bufsize)
+-- 
+2.28.0
+
meta/recipes-connectivity/inetutils/inetutils_1.9.4.bb +1 -0
index cc9410b94e..adf6d4414e 100644
@@ -23,6 +23,7 @@ SRC_URI = "${GNU_MIRROR}/inetutils/inetutils-${PV}.tar.gz \
            file://inetutils-only-check-pam_appl.h-when-pam-enabled.patch \
            file://0001-rcp-fix-to-work-with-large-files.patch \
            file://fix-buffer-fortify-tfpt.patch \
+           file://0001-ftpd-telnetd-Fix-multiple-definitions-of-errcatch-an.patch \
 "
 
 SRC_URI[md5sum] = "04852c26c47cc8c6b825f2b74f191f52"
Signature · 1 line
2.28.0
author
#1 lore raw

PATCH 2/4 libomxil: Use -fcommon compiler option

This ensures that when compiler defaults become -fno-common it still keeps compiling

---
 meta/recipes-multimedia/libomxil/libomxil_0.9.3.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-multimedia/libomxil/libomxil_0.9.3.bb +2 -0
index 271c2a30a3..2061c280e4 100644
@@ -26,6 +26,8 @@ EXTRA_OECONF += "--disable-doc --disable-Werror"
 
 PROVIDES += "virtual/libomxil"
 
+CFLAGS += "-fcommon"
+
 #
 # The .so files under ${libdir}/bellagio are not intended to be versioned and symlinked.
 # Make sure they get packaged in the main package.
Signature · 1 line
2.28.0
author
#2 lore raw

PATCH 3/4 kexec-tools: Fix build with -fno-common

In reply to Khem Raj
---
 ...0001-kexec-Fix-build-with-fno-common.patch | 43 +++++++++++++++++++
 .../kexec/kexec-tools_2.0.20.bb               |  1 +
 2 files changed, 44 insertions(+)
 create mode 100644 meta/recipes-kernel/kexec/kexec-tools/0001-kexec-Fix-build-with-fno-common.patch
meta/recipes-kernel/kexec/kexec-tools/0001-kexec-Fix-build-with-fno-common.patch new file +43 -0
new file mode 100644
index 0000000000..355053363e
@@ -0,0 +1,43 @@
+From c5fec6d6368b4103557deb710150119dca438544 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Wed, 5 Aug 2020 10:46:39 -0700
+Subject: [PATCH] kexec: Fix build with -fno-common
+
+Ensure that my_debug is not doubly defined
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ kexec/arch/ppc64/kexec-elf-ppc64.c | 2 --
+ kexec/fs2dt.h                      | 2 +-
+ 2 files changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/kexec/arch/ppc64/kexec-elf-ppc64.c b/kexec/arch/ppc64/kexec-elf-ppc64.c
+index 3510b70..695b8b0 100644
+--- a/kexec/arch/ppc64/kexec-elf-ppc64.c
++++ b/kexec/arch/ppc64/kexec-elf-ppc64.c
+@@ -44,8 +44,6 @@
+ uint64_t initrd_base, initrd_size;
+ unsigned char reuse_initrd = 0;
+ const char *ramdisk;
+-/* Used for enabling printing message from purgatory code */
+-int my_debug = 0;
+ 
+ int elf_ppc64_probe(const char *buf, off_t len)
+ {
+diff --git a/kexec/fs2dt.h b/kexec/fs2dt.h
+index 7633273..fe24931 100644
+--- a/kexec/fs2dt.h
++++ b/kexec/fs2dt.h
+@@ -30,7 +30,7 @@ extern struct bootblock bb[1];
+ 
+ /* Used for enabling printing message from purgatory code
+  * Only has implemented for PPC64 */
+-int my_debug;
++extern int my_debug;
+ extern int dt_no_old_root;
+ 
+ void reserve(unsigned long long where, unsigned long long length);
+-- 
+2.28.0
+
meta/recipes-kernel/kexec/kexec-tools_2.0.20.bb +1 -0
index 871b36440f..1e81ecc2c7 100644
@@ -20,6 +20,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz
            file://0005-Disable-PIE-during-link.patch \
            file://0006-kexec-arm-undefine-__NR_kexec_file_load-for-arm.patch \
            file://0007-kexec-un-break-the-build-on-32-bit-x86.patch \
+           file://0001-kexec-Fix-build-with-fno-common.patch \
            "
 
 SRC_URI[md5sum] = "46724b67f32501c5d3e778161347cad9"
Signature · 1 line
2.28.0
author
#3 lore raw

PATCH 4/4 distcc: Fix build with -fno-common

In reply to Khem Raj
---
 meta/recipes-devtools/distcc/distcc_3.3.3.bb  |  1 +
 ...cc-10-which-defaults-to-fno-common-c.patch | 34 +++++++++++++++++++
 2 files changed, 35 insertions(+)
 create mode 100644 meta/recipes-devtools/distcc/files/0001-Fix-build-with-gcc-10-which-defaults-to-fno-common-c.patch
meta/recipes-devtools/distcc/distcc_3.3.3.bb +1 -0
index c52f136be8..d92b9c3046 100644
@@ -17,6 +17,7 @@ RRECOMMENDS_${PN}-server = "avahi-daemon"
 SRC_URI = "git://github.com/distcc/distcc.git \
            file://fix-gnome.patch \
            file://separatebuilddir.patch \
+           file://0001-Fix-build-with-gcc-10-which-defaults-to-fno-common-c.patch \
            file://default \
            file://distcc \
            file://distcc.service"
meta/recipes-devtools/distcc/files/0001-Fix-build-with-gcc-10-which-defaults-to-fno-common-c.patch new file +34 -0
new file mode 100644
index 0000000000..86c07c11f8
@@ -0,0 +1,34 @@
+From 98530865795300008fe06bb647a6fc2dddfc7967 Mon Sep 17 00:00:00 2001
+From: Romain Geissler <[email protected]>
+Date: Mon, 27 Jan 2020 09:28:43 +0000
+Subject: [PATCH] Fix build with gcc 10 which defaults to -fno-common (cf
+ https://gcc.gnu.org/gcc-10/porting_to.html)
+
+This fixes the following link error I see when I use the latest gcc 10
+git branch:
+/opt/1A/toolchain/x86_64-v20.0.7/lib/gcc/x86_64-1a-linux-gnu/10.0.1/../../../../x86_64-1a-linux-gnu/bin/ld: src/serve.o:(.bss+0x0): multiple definition of `stats_text'; src/prefork.o:(.bss+0x0): first defined here
+/opt/1A/toolchain/x86_64-v20.0.7/lib/gcc/x86_64-1a-linux-gnu/10.0.1/../../../../x86_64-1a-linux-gnu/bin/ld: src/stats.o:(.data+0x20): multiple definition of `stats_text'; src/prefork.o:(.bss+0x0): first defined here
+collect2: error: ld returned 1 exit status
+
+Upstream-Status: Backport [https://github.com/distcc/distcc/pull/373]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/stats.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/stats.h b/src/stats.h
+index 9bde285..74d4690 100644
+--- a/src/stats.h
++++ b/src/stats.h
+@@ -33,7 +33,7 @@ enum stats_e { STATS_TCP_ACCEPT, STATS_REJ_BAD_REQ, STATS_REJ_OVERLOAD,
+                 STATS_COMPILE_OK, STATS_COMPILE_ERROR, STATS_COMPILE_TIMEOUT,
+                 STATS_CLI_DISCONN, STATS_OTHER, STATS_ENUM_MAX };
+ 
+-const char *stats_text[20];
++extern const char *stats_text[20];
+ 
+ int  dcc_stats_init(void);
+ void dcc_stats_init_kid(void);
+-- 
+2.28.0
+
Signature · 1 line
2.28.0