Skip to contentSkip to conversation

ucarp: fix build error with gcc-10

PATCH Superseded Chen Qi 2 participants 6 messages Sep 24, 2020 1 message not in the archive

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

PATCH v2 1/1 ucarp: fix build error with gcc-10

Add a patch to remove the useless '__packed' variable to avoid multiple definition error with gcc10.

---
 ...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
meta-cgl-common/recipes-cgl/ucarp/ucarp/0001-ip_carp.h-remove-unused-__packed.patch new file +31 -0
new file mode 100644
index 0000000..496c20d
@@ -0,0 +1,31 @@
+From ad33498ac86fe2df0a100d17aa54ca8c30920d8b Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+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 <[email protected]>
+---
+ 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
+
meta-cgl-common/recipes-cgl/ucarp/ucarp_1.5.2.bb +1 -0
index d17baa0..c6fa901 100644
@@ -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 \
Signature · 1 line
2.17.1
#1 lore raw
Quoted 4 lines · Chen Qi

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))

Quoted 62 lines
---
 ...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
meta-cgl-common/recipes-cgl/ucarp/ucarp/0001-ip_carp.h-remove-unused-__packed.patch new file +31 -0
new file mode 100644
index 0000000..496c20d
@@ -0,0 +1,31 @@
+From ad33498ac86fe2df0a100d17aa54ca8c30920d8b Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+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 <[email protected]>
+---
+ 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
+
meta-cgl-common/recipes-cgl/ucarp/ucarp_1.5.2.bb +1 -1
index d17baa0..c6fa901 100644
@@ -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

author
#2 lore raw
Quoted 6 lines · Khem Raj
Quoted 3 lines · Chen Qi

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.

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

Quoted 62 lines
Quoted 62 lines
---
  ...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

meta-cgl-common/recipes-cgl/ucarp/ucarp/0001-ip_carp.h-remove-unused-__packed.patch new file +31 -0
new file mode 100644
index 0000000..496c20d
@@ -0,0 +1,31 @@
+From ad33498ac86fe2df0a100d17aa54ca8c30920d8b Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+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 <[email protected]>
+---
+ 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
+
meta-cgl-common/recipes-cgl/ucarp/ucarp_1.5.2.bb +1 -1
index d17baa0..c6fa901 100644
@@ -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

#3 lore raw
Quoted 6 lines · ChenQi
Quoted 4 lines · Khem Raj
Quoted 3 lines · Chen Qi

Add a patch to remove the useless '__packed' variable to avoid multiple definition error with gcc10.

Quoted 7 lines
Quoted 2 lines

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.

Quoted 69 lines

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

Quoted 62 lines
Quoted 62 lines
---
  ...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

meta-cgl-common/recipes-cgl/ucarp/ucarp/0001-ip_carp.h-remove-unused-__packed.patch new file +31 -0
new file mode 100644
index 0000000..496c20d
@@ -0,0 +1,31 @@
+From ad33498ac86fe2df0a100d17aa54ca8c30920d8b Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+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 <[email protected]>
+---
+ 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
+
meta-cgl-common/recipes-cgl/ucarp/ucarp_1.5.2.bb +1 -1
index d17baa0..c6fa901 100644
@@ -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

author
#4 lore raw
Quoted 12 lines · Khem Raj
Quoted 11 lines · ChenQi
Quoted 6 lines · Khem Raj
Quoted 3 lines · Chen Qi

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.

Quoted 6 lines

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

Quoted 69 lines
Quoted 69 lines

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

Quoted 62 lines
Quoted 62 lines
---
   ...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

meta-cgl-common/recipes-cgl/ucarp/ucarp/0001-ip_carp.h-remove-unused-__packed.patch new file +31 -0
new file mode 100644
index 0000000..496c20d
@@ -0,0 +1,31 @@
+From ad33498ac86fe2df0a100d17aa54ca8c30920d8b Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+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 <[email protected]>
+---
+ 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
+
meta-cgl-common/recipes-cgl/ucarp/ucarp_1.5.2.bb +1 -1
index d17baa0..c6fa901 100644
@@ -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

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#6 lore raw
Quoted 8 lines · Chen Qi
Quoted 6 lines · Khem Raj
Quoted 3 lines · Chen Qi

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))

Forgot to mention, I also tested with '__attribute__((packed))', the build succeeded.

Adrian, Alexandru and Joe, I'll send out V3 with this change. You can choose V2 or V3 as you like.

Regards,
Chen Qi

Quoted 80 lines

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.

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

Quoted 68 lines
Quoted 68 lines
---
  ...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

meta-cgl-common/recipes-cgl/ucarp/ucarp/0001-ip_carp.h-remove-unused-__packed.patch +0 -0

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

meta-cgl-common/recipes-cgl/ucarp/ucarp/0001-ip_carp.h-remove-unused-__packed.patch +31 -0
@@ -0,0 +1,31 @@
+From ad33498ac86fe2df0a100d17aa54ca8c30920d8b Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+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 <[email protected]>
+---
+ 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
+
meta-cgl-common/recipes-cgl/ucarp/ucarp_1.5.2.bb +0 -0
index d17baa0..c6fa901 100644
@@ -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 \
Signature · 1 line
2.17.1