Skip to contentSkip to conversation

libbsd: Fix conflict error when enable multilib.

PATCH In review [email protected] 2 participants 3 messages Apr 30, 2024 – Jun 19, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 libbsd: Fix conflict error when enable multilib.

From: Lei Maohui <[email protected]>

- Fix the conflict error by oe_multilib_header. The conflict error is as the following:
Error: Transaction test error:
file /usr/include/bsd/sys/cdefs.h conflicts between attempted installs of libbsd-dev-0.12.1-r0.core2_64 and lib32-libbsd-dev-0.12.1-r0.core2_32

The difference of bsd/sys/cdefs.h between libbsd-dev and lib32-libbsd-dev is as following:

/* Define the ABI for the current system. */
-#define LIBBSD_SYS_TIME_BITS 64
+#define LIBBSD_SYS_TIME_BITS 32
#define LIBBSD_SYS_HAS_TIME64 1

- After oe_multilib_header on cdefs.h, the path of cdefs-64.h and cdefs-32.h in cdefs.h need to be corrected for overlay-mode. Please reference to https://man.archlinux.org/man/libbsd.7 for details. @@ -12,19 +12,19 @@
#ifdef _MIPS_SIM

#if _MIPS_SIM == _ABIO32
-#include <bsd/sys/cdefs-32.h>
+#include <sys/cdefs-32.h>
#elif _MIPS_SIM == _ABIN32
-#include <bsd/sys/cdefs-n32.h>
+#include <sys/cdefs-n32.h>
#else
#error "Unknown _MIPS_SIM"
#endif

#else /* _MIPS_SIM is not defined */
-#include <bsd/sys/cdefs-32.h>
+#include <sys/cdefs-32.h>
#endif

#elif __WORDSIZE == 64
-#include <bsd/sys/cdefs-64.h>
+#include <sys/cdefs-64.h>
#else
#error "Unknown __WORDSIZE detected"
#endif /* matches #if __WORDSIZE == 32 */

---
 meta/recipes-support/libbsd/libbsd_0.12.2.bb | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
meta/recipes-support/libbsd/libbsd_0.12.2.bb +9 -1
index 7d5e88f293..1791d97dfd 100644
@@ -40,8 +40,16 @@ SRC_URI = "https://libbsd.freedesktop.org/releases/${BPN}-${PV}.tar.xz"
 
 SRC_URI[sha256sum] = "b88cc9163d0c652aaf39a99991d974ddba1c3a9711db8f1b5838af2a14731014"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig multilib_header
 
 DEPENDS += "libmd"
 
+do_install:append () {
+   oe_multilib_header bsd/sys/cdefs.h
+   # It hasn't been tested when libbsd is used in 'namespaced headers' mode according to
+   # https://man.archlinux.org/man/libbsd.7.
+   sed -i 's:#include <bsd/sys/cdefs:#include <sys/cdefs:g' ${D}${includedir}/bsd/sys/cdefs.h
+}
+
+
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.34.1
#1 lore raw
Quoted 65 lines · leimaohui via lists.openembedded.org

From: Lei Maohui <[email protected]>

- Fix the conflict error by oe_multilib_header. The conflict error is as the following:
Error: Transaction test error:
  file /usr/include/bsd/sys/cdefs.h conflicts between attempted installs of libbsd-dev-0.12.1-r0.core2_64 and lib32-libbsd-dev-0.12.1-r0.core2_32

The difference of bsd/sys/cdefs.h between libbsd-dev and lib32-libbsd-dev is as following:

 /* Define the ABI for the current system. */
 -#define LIBBSD_SYS_TIME_BITS 64
 +#define LIBBSD_SYS_TIME_BITS 32
 #define LIBBSD_SYS_HAS_TIME64 1

- After oe_multilib_header on cdefs.h, the path of cdefs-64.h and cdefs-32.h in cdefs.h need to be corrected for overlay-mode. Please reference to https://man.archlinux.org/man/libbsd.7 for details. @@ -12,19 +12,19 @@
 #ifdef _MIPS_SIM

 #if _MIPS_SIM == _ABIO32

(quoted diff) +1 -1
-#include <bsd/sys/cdefs-32.h>
+#include <sys/cdefs-32.h>

 #elif _MIPS_SIM == _ABIN32

(quoted diff) +1 -1
-#include <bsd/sys/cdefs-n32.h>
+#include <sys/cdefs-n32.h>

 #else
 #error "Unknown _MIPS_SIM"
 #endif

 #else /* _MIPS_SIM is not defined */

(quoted diff) +1 -1
-#include <bsd/sys/cdefs-32.h>
+#include <sys/cdefs-32.h>

 #endif

 #elif __WORDSIZE == 64

(quoted diff) +1 -1
-#include <bsd/sys/cdefs-64.h>
+#include <sys/cdefs-64.h>

 #else
 #error "Unknown __WORDSIZE detected"
 #endif /* matches #if __WORDSIZE == 32 */

---
 meta/recipes-support/libbsd/libbsd_0.12.2.bb | 10 +++++++++-

 1 file changed, 9 insertions(+), 1 deletion(-)
meta/recipes-support/libbsd/libbsd_0.12.2.bb +0 -0
index 7d5e88f293..1791d97dfd 100644
@@ -40,8 +40,16 @@ SRC_URI = "https://libbsd.freedesktop.org/releases/${BPN}-${PV}.tar.xz"


 SRC_URI[sha256sum] = "b88cc9163d0c652aaf39a99991d974ddba1c3a9711db8f1b5838af2a14731014"

meta/recipes-support/libbsd/libbsd_0.12.2.bb +1 -1
-inherit autotools pkgconfig
+inherit autotools pkgconfig multilib_header


 DEPENDS += "libmd"

meta/recipes-support/libbsd/libbsd_0.12.2.bb +8 -0
+do_install:append () {
+   oe_multilib_header bsd/sys/cdefs.h
+   # It hasn't been tested when libbsd is used in 'namespaced headers' mode according to
+   # https://man.archlinux.org/man/libbsd.7.
+   sed -i 's:#include <bsd/sys/cdefs:#include <sys/cdefs:g' ${D}${includedir}/bsd/sys/cdefs.h
+}
+
+
Quoted 1 line

 BBCLASSEXTEND = "native nativesdk"

Firstly, I know several of us are not convinced this is the right thing to do. We've not been able to easily describe why we're uneasy about it. We did do some wider testing with this patch and it causes several errors in meta-openembedeed:

https://errors.yoctoproject.org/Errors/Build/186567/

so we can't merge something with this approach.

We really do need to stick with the way upstream use their code.

Cheers,

Richard

#2 lore raw

Hi,

It really took so long time to test this patch. ^^
It seems that no matter how to change the header file, there are always different failures. I'll try to ask this issue in upstream of libbsd. Thank you very much.

Best regards
Lei

Quoted 103 lines

-----Original Message-----
From: Richard Purdie <[email protected]>
Sent: Tuesday, June 11, 2024 5:24 PM
To: Lei, Maohui <[email protected]>; [email protected]
Subject: Re: [OE-core][PATCH v4][PATCH] libbsd: Fix conflict error when enable multilib.

Quoted 3 lines · leimaohui via lists.openembedded.org

From: Lei Maohui <[email protected]>

- Fix the conflict error by oe_multilib_header. The conflict error is as the

following:

Quoted 6 lines

Error: Transaction test error:
  file /usr/include/bsd/sys/cdefs.h conflicts between attempted installs of libbsd-dev-0.12.1-r0.core2_64 and lib32-libbsd-dev-0.12.1-r0.core2_32

The difference of bsd/sys/cdefs.h between libbsd-dev and lib32-libbsd-dev

is as following:

Quoted 7 lines

 /* Define the ABI for the current system. */
 -#define LIBBSD_SYS_TIME_BITS 64
 +#define LIBBSD_SYS_TIME_BITS 32
 #define LIBBSD_SYS_HAS_TIME64 1

- After oe_multilib_header on cdefs.h, the path of cdefs-64.h and cdefs-32.h

in cdefs.h need to be corrected for overlay-mode. Please reference to
https://man.archlinux.org/man/libbsd.7 for details.

meta/recipes-support/libbsd/libbsd_0.12.2.bb SRC_URI =

Quoted 36 lines

  @@ -12,19 +12,19 @@
 #ifdef _MIPS_SIM

 #if _MIPS_SIM == _ABIO32

(quoted diff) +1 -1
-#include <bsd/sys/cdefs-32.h>
+#include <sys/cdefs-32.h>

 #elif _MIPS_SIM == _ABIN32

(quoted diff) +1 -1
-#include <bsd/sys/cdefs-n32.h>
+#include <sys/cdefs-n32.h>

 #else
 #error "Unknown _MIPS_SIM"
 #endif

 #else /* _MIPS_SIM is not defined */

(quoted diff) +1 -1
-#include <bsd/sys/cdefs-32.h>
+#include <sys/cdefs-32.h>

 #endif

 #elif __WORDSIZE == 64

(quoted diff) +1 -1
-#include <bsd/sys/cdefs-64.h>
+#include <sys/cdefs-64.h>

 #else
 #error "Unknown __WORDSIZE detected"
 #endif /* matches #if __WORDSIZE == 32 */

---
 meta/recipes-support/libbsd/libbsd_0.12.2.bb | 10 +++++++++-

 1 file changed, 9 insertions(+), 1 deletion(-)
meta/recipes-support/libbsd/libbsd_0.12.2.bb +0 -0
index 7d5e88f293..1791d97dfd 100644
@@ -40,8 +40,16 @@ SRC_URI =

"https://libbsd.freedesktop.org/releases/${BPN}-${PV}.tar.xz"

Quoted 2 lines

 SRC_URI[sha256sum] =

"b88cc9163d0c652aaf39a99991d974ddba1c3a9711db8f1b5838af2a147310 14"

Quoted 15 lines
meta/recipes-support/libbsd/libbsd_0.12.2.bb +1 -1
-inherit autotools pkgconfig
+inherit autotools pkgconfig multilib_header

 DEPENDS += "libmd"

meta/recipes-support/libbsd/libbsd_0.12.2.bb +9 -0
+do_install:append () {
+   oe_multilib_header bsd/sys/cdefs.h
+   # It hasn't been tested when libbsd is used in 'namespaced
+headers' mode according to
+   # https://man.archlinux.org/man/libbsd.7.
+   sed -i 's:#include <bsd/sys/cdefs:#include <sys/cdefs:g'
+${D}${includedir}/bsd/sys/cdefs.h }
+
+
Quoted 1 line

 BBCLASSEXTEND = "native nativesdk"

Firstly, I know several of us are not convinced this is the right thing to do. We've not been able to easily describe why we're uneasy about it. We did do some wider testing with this patch and it causes several errors in meta-openembedeed:

https://errors.yoctoproject.org/Errors/Build/186567/

so we can't merge something with this approach.

We really do need to stick with the way upstream use their code.

Cheers,

Richard