diff mbox series

[v2] libbsd: Fix conflict error when enable multilib.

Message ID 20240418012247.490545-1-leimaohui@fujitsu.com
State New
Headers show
Series [v2] libbsd: Fix conflict error when enable multilib. | expand

Commit Message

Maohui Lei (Fujitsu) April 18, 2024, 1:22 a.m. UTC
From: Lei Maohui <leimaohui@fujitsu.com>

- 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

- The path of cdefs-64.h and cdefs-32.h in cdefs.h is not correct for libbsd after enable oe_multilib_header on cdefs.h. It is necessary to fix the path.

Signed-off-by: Lei Maohui <leimaohui@fujitsu.com>
---
 meta/recipes-support/libbsd/libbsd_0.12.2.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Alexander Kanavin April 18, 2024, 5:32 a.m. UTC | #1
On Thu, 18 Apr 2024 at 03:23, leimaohui via lists.openembedded.org
<leimaohui=fujitsu.com@lists.openembedded.org> wrote:
> - The path of cdefs-64.h and cdefs-32.h in cdefs.h is not correct for libbsd after enable oe_multilib_header on cdefs.h. It is necessary to fix the path.
> +do_install:append () {
> +       oe_multilib_header bsd/sys/cdefs.h
> +       sed -i 's:#include <bsd/sys/cdefs:#include <sys/cdefs:g' ${D}${includedir}/bsd/sys/cdefs.h

Can you explain a bit more? Why and how is it not correct? Why isn't a
similar fix needed in other uses of oe_multilib_header?

Alex
Maohui Lei (Fujitsu) April 19, 2024, 1:15 a.m. UTC | #2
Hi, Alex

> Can you explain a bit more? Why and how is it not correct? Why isn't a similar fix
> needed in other uses of oe_multilib_header?

Reference to https://man.archlinux.org/man/libbsd.7, by default, libbsd is built in an overlay mode, the includes in this case should be the usual system ones, such as <unistd.h> without namespaced with bsd/.
It seems that libbsd is special.

Best regards
Lei


> -----Original Message-----
> From: Alexander Kanavin <alex.kanavin@gmail.com>
> Sent: Thursday, April 18, 2024 1:33 PM
> To: Lei, Maohui <leimaohui@fujitsu.com>
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core][PATCH v2] libbsd: Fix conflict error when enable multilib.
> 
> On Thu, 18 Apr 2024 at 03:23, leimaohui via lists.openembedded.org
> <leimaohui=fujitsu.com@lists.openembedded.org> wrote:
> > - The path of cdefs-64.h and cdefs-32.h in cdefs.h is not correct for libbsd after
> enable oe_multilib_header on cdefs.h. It is necessary to fix the path.
> > +do_install:append () {
> > +       oe_multilib_header bsd/sys/cdefs.h
> > +       sed -i 's:#include <bsd/sys/cdefs:#include <sys/cdefs:g'
> > +${D}${includedir}/bsd/sys/cdefs.h
> 
> Can you explain a bit more? Why and how is it not correct? Why isn't a similar fix
> needed in other uses of oe_multilib_header?
> 
> Alex
Maohui Lei (Fujitsu) April 24, 2024, 2:08 a.m. UTC | #3
Ping



> -----Original Message-----
> From: openembedded-core@lists.openembedded.org
> <openembedded-core@lists.openembedded.org> On Behalf Of leimaohui via
> lists.openembedded.org
> Sent: Friday, April 19, 2024 9:16 AM
> To: Alexander Kanavin <alex.kanavin@gmail.com>
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core][PATCH v2] libbsd: Fix conflict error when enable multilib.
> 
> Hi, Alex
> 
> > Can you explain a bit more? Why and how is it not correct? Why isn't a
> > similar fix needed in other uses of oe_multilib_header?
> 
> Reference to https://man.archlinux.org/man/libbsd.7, by default, libbsd is built
> in an overlay mode, the includes in this case should be the usual system ones,
> such as <unistd.h> without namespaced with bsd/.
> It seems that libbsd is special.
> 
> Best regards
> Lei
> 
> 
> > -----Original Message-----
> > From: Alexander Kanavin <alex.kanavin@gmail.com>
> > Sent: Thursday, April 18, 2024 1:33 PM
> > To: Lei, Maohui <leimaohui@fujitsu.com>
> > Cc: openembedded-core@lists.openembedded.org
> > Subject: Re: [OE-core][PATCH v2] libbsd: Fix conflict error when enable multilib.
> >
> > On Thu, 18 Apr 2024 at 03:23, leimaohui via lists.openembedded.org
> > <leimaohui=fujitsu.com@lists.openembedded.org> wrote:
> > > - The path of cdefs-64.h and cdefs-32.h in cdefs.h is not correct
> > > for libbsd after
> > enable oe_multilib_header on cdefs.h. It is necessary to fix the path.
> > > +do_install:append () {
> > > +       oe_multilib_header bsd/sys/cdefs.h
> > > +       sed -i 's:#include <bsd/sys/cdefs:#include <sys/cdefs:g'
> > > +${D}${includedir}/bsd/sys/cdefs.h
> >
> > Can you explain a bit more? Why and how is it not correct? Why isn't a
> > similar fix needed in other uses of oe_multilib_header?
> >
> > Alex
Alexander Kanavin April 24, 2024, 8:38 a.m. UTC | #4
It would help if you show the actual content that is being fixed. E.g.
the problematic line in the header:
- before the fixing
- after being processed with oe_multilib_header
- after being fixed with sed.

Otherwise I still don't quite understand what is happening.

Alex

On Wed, 24 Apr 2024 at 04:08, Maohui Lei (Fujitsu)
<leimaohui@fujitsu.com> wrote:
>
> Ping
>
>
>
> > -----Original Message-----
> > From: openembedded-core@lists.openembedded.org
> > <openembedded-core@lists.openembedded.org> On Behalf Of leimaohui via
> > lists.openembedded.org
> > Sent: Friday, April 19, 2024 9:16 AM
> > To: Alexander Kanavin <alex.kanavin@gmail.com>
> > Cc: openembedded-core@lists.openembedded.org
> > Subject: Re: [OE-core][PATCH v2] libbsd: Fix conflict error when enable multilib.
> >
> > Hi, Alex
> >
> > > Can you explain a bit more? Why and how is it not correct? Why isn't a
> > > similar fix needed in other uses of oe_multilib_header?
> >
> > Reference to https://man.archlinux.org/man/libbsd.7, by default, libbsd is built
> > in an overlay mode, the includes in this case should be the usual system ones,
> > such as <unistd.h> without namespaced with bsd/.
> > It seems that libbsd is special.
> >
> > Best regards
> > Lei
> >
> >
> > > -----Original Message-----
> > > From: Alexander Kanavin <alex.kanavin@gmail.com>
> > > Sent: Thursday, April 18, 2024 1:33 PM
> > > To: Lei, Maohui <leimaohui@fujitsu.com>
> > > Cc: openembedded-core@lists.openembedded.org
> > > Subject: Re: [OE-core][PATCH v2] libbsd: Fix conflict error when enable multilib.
> > >
> > > On Thu, 18 Apr 2024 at 03:23, leimaohui via lists.openembedded.org
> > > <leimaohui=fujitsu.com@lists.openembedded.org> wrote:
> > > > - The path of cdefs-64.h and cdefs-32.h in cdefs.h is not correct
> > > > for libbsd after
> > > enable oe_multilib_header on cdefs.h. It is necessary to fix the path.
> > > > +do_install:append () {
> > > > +       oe_multilib_header bsd/sys/cdefs.h
> > > > +       sed -i 's:#include <bsd/sys/cdefs:#include <sys/cdefs:g'
> > > > +${D}${includedir}/bsd/sys/cdefs.h
> > >
> > > Can you explain a bit more? Why and how is it not correct? Why isn't a
> > > similar fix needed in other uses of oe_multilib_header?
> > >
> > > Alex
Maohui Lei (Fujitsu) April 25, 2024, 5:54 a.m. UTC | #5
Hi, Alex


> It would help if you show the actual content that is being fixed. E.g.
> the problematic line in the header:
> - before the fixing
> - after being processed with oe_multilib_header
> - after being fixed with sed.

I have submitted the v3 patch with above content. Please have a look. 


Best regards
Lei



> -----Original Message-----
> From: openembedded-core@lists.openembedded.org
> <openembedded-core@lists.openembedded.org> On Behalf Of Alexander
> Kanavin
> Sent: Wednesday, April 24, 2024 4:38 PM
> To: Lei, Maohui <leimaohui@fujitsu.com>
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core][PATCH v2] libbsd: Fix conflict error when enable multilib.
> 
> It would help if you show the actual content that is being fixed. E.g.
> the problematic line in the header:
> - before the fixing
> - after being processed with oe_multilib_header
> - after being fixed with sed.
> 
> Otherwise I still don't quite understand what is happening.
> 
> Alex
> 
> On Wed, 24 Apr 2024 at 04:08, Maohui Lei (Fujitsu) <leimaohui@fujitsu.com>
> wrote:
> >
> > Ping
> >
> >
> >
> > > -----Original Message-----
> > > From: openembedded-core@lists.openembedded.org
> > > <openembedded-core@lists.openembedded.org> On Behalf Of leimaohui
> > > via lists.openembedded.org
> > > Sent: Friday, April 19, 2024 9:16 AM
> > > To: Alexander Kanavin <alex.kanavin@gmail.com>
> > > Cc: openembedded-core@lists.openembedded.org
> > > Subject: Re: [OE-core][PATCH v2] libbsd: Fix conflict error when enable
> multilib.
> > >
> > > Hi, Alex
> > >
> > > > Can you explain a bit more? Why and how is it not correct? Why
> > > > isn't a similar fix needed in other uses of oe_multilib_header?
> > >
> > > Reference to https://man.archlinux.org/man/libbsd.7, by default,
> > > libbsd is built in an overlay mode, the includes in this case should
> > > be the usual system ones, such as <unistd.h> without namespaced with bsd/.
> > > It seems that libbsd is special.
> > >
> > > Best regards
> > > Lei
> > >
> > >
> > > > -----Original Message-----
> > > > From: Alexander Kanavin <alex.kanavin@gmail.com>
> > > > Sent: Thursday, April 18, 2024 1:33 PM
> > > > To: Lei, Maohui <leimaohui@fujitsu.com>
> > > > Cc: openembedded-core@lists.openembedded.org
> > > > Subject: Re: [OE-core][PATCH v2] libbsd: Fix conflict error when enable
> multilib.
> > > >
> > > > On Thu, 18 Apr 2024 at 03:23, leimaohui via lists.openembedded.org
> > > > <leimaohui=fujitsu.com@lists.openembedded.org> wrote:
> > > > > - The path of cdefs-64.h and cdefs-32.h in cdefs.h is not
> > > > > correct for libbsd after
> > > > enable oe_multilib_header on cdefs.h. It is necessary to fix the path.
> > > > > +do_install:append () {
> > > > > +       oe_multilib_header bsd/sys/cdefs.h
> > > > > +       sed -i 's:#include <bsd/sys/cdefs:#include <sys/cdefs:g'
> > > > > +${D}${includedir}/bsd/sys/cdefs.h
> > > >
> > > > Can you explain a bit more? Why and how is it not correct? Why
> > > > isn't a similar fix needed in other uses of oe_multilib_header?
> > > >
> > > > Alex
diff mbox series

Patch

diff --git a/meta/recipes-support/libbsd/libbsd_0.12.2.bb b/meta/recipes-support/libbsd/libbsd_0.12.2.bb
index 7d5e88f293..e1fc7d9b3c 100644
--- a/meta/recipes-support/libbsd/libbsd_0.12.2.bb
+++ b/meta/recipes-support/libbsd/libbsd_0.12.2.bb
@@ -40,8 +40,14 @@  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
+       sed -i 's:#include <bsd/sys/cdefs:#include <sys/cdefs:g' ${D}${includedir}/bsd/sys/cdefs.h
+}
+
+
 BBCLASSEXTEND = "native nativesdk"