Re: [meta-cgl][PATCH V2] ucarp: fix build error with gcc-10


Chen Qi
 

On 09/24/2020 02:13 PM, Khem Raj wrote:
On Wed, Sep 23, 2020 at 11:08 PM ChenQi <Qi.Chen@windriver.com> wrote:
On 09/24/2020 01:43 PM, Khem Raj wrote:
On Wed, Sep 23, 2020 at 8:38 PM Chen Qi <Qi.Chen@windriver.com> wrote:
Add a patch to remove the useless '__packed' variable to avoid
multiple definition error with gcc10.
I wonder if the intention is to mark this structure as packed struct
then it should be replaced with __attribute__((packed))
It's possible, but I didn't look at the logic and I don't want to.
Anyway, the variable never had any effect. So I figure it's safe to
remove it, and this will not change any behavior.
certain compilers do allow __packed keyword and it might be
intentional too. If its removed then
the bug will become even more subtler, therefore. if we want to change
the code then its perhaps
better to confirm it with upstream before applying patch. Otherwise
apply usual -fcommon workaround.
Thanks for this info.
I'll send out V3 to use '__attribute__((packed))__'.

Best Regards,
Chen Qi


Unfortunately, the codes are really old, and I cannot find a place to
send the patch, not to mention to confirm this with its author :(

Regards,
Chen Qi

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
...001-ip_carp.h-remove-unused-__packed.patch | 31 +++++++++++++++++++
.../recipes-cgl/ucarp/ucarp_1.5.2.bb | 1 +
2 files changed, 32 insertions(+)
create mode 100644 meta-cgl-common/recipes-cgl/ucarp/ucarp/0001-ip_carp.h-remove-unused-__packed.patch

diff --git a/meta-cgl-common/recipes-cgl/ucarp/ucarp/0001-ip_carp.h-remove-unused-__packed.patch b/meta-cgl-common/recipes-cgl/ucarp/ucarp/0001-ip_carp.h-remove-unused-__packed.patch
new file mode 100644
index 0000000..496c20d
--- /dev/null
+++ b/meta-cgl-common/recipes-cgl/ucarp/ucarp/0001-ip_carp.h-remove-unused-__packed.patch
@@ -0,0 +1,31 @@
+From ad33498ac86fe2df0a100d17aa54ca8c30920d8b Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Thu, 24 Sep 2020 11:30:08 +0800
+Subject: [PATCH] ip_carp.h: remove unused __packed
+
+This variable is useless and it's causing multiple definition
+error with gcc10, thus removing it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/ip_carp.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/ip_carp.h b/src/ip_carp.h
+index 9504a8e..9dcf8cc 100644
+--- a/src/ip_carp.h
++++ b/src/ip_carp.h
+@@ -70,7 +70,7 @@ struct carp_header {
+ u_int16_t carp_cksum;
+ u_int32_t carp_counter[2];
+ unsigned char carp_md[20]; /* SHA1 HMAC */
+-} __packed;
++};
+
+ #define CARP_DFLTTL 255
+
+--
+2.17.1
+
diff --git a/meta-cgl-common/recipes-cgl/ucarp/ucarp_1.5.2.bb b/meta-cgl-common/recipes-cgl/ucarp/ucarp_1.5.2.bb
index d17baa0..c6fa901 100644
--- a/meta-cgl-common/recipes-cgl/ucarp/ucarp_1.5.2.bb
+++ b/meta-cgl-common/recipes-cgl/ucarp/ucarp_1.5.2.bb
@@ -17,6 +17,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=278a886e91f2f6c983ffdf040130cdc6"
SRC_URI = "http://download.pureftpd.org/pub/ucarp/${BPN}-${PV}.tar.gz \
file://ucarp-configure-sha1.patch \
file://ucarp-configure-snprintf.patch \
+ file://0001-ip_carp.h-remove-unused-__packed.patch \
file://ucarp.init \
file://vip-001.conf.example \
file://vip-common.conf \
--
2.17.1


Join yocto@lists.yoctoproject.org to automatically receive all group messages.