Skip to contentSkip to conversation

binutils: Fix packaging of bfd-plugins

PATCH In review [email protected] 3 participants 7 messages Sep 19, 2024 – Sep 20, 2024 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/2 binutils: Fix packaging of bfd-plugins

From: Harish Sadineni <[email protected]>

Fixes the follwing error while building nativesdk-binutils with i686-mingw32 as SDKMACHINE:
ERROR: nativesdk-binutils-2.43.1-r0 do_package: QA Issue: nativesdk-binutils: Files/directories were installed but not shipped in any package:
/usr/local/oe-sdk-hardcoded-buildpath/sysroots/i686-w64-mingw32/usr/lib/bfd-plugins /usr/local/oe-sdk-hardcoded-buildpath/sysroots/i686-w64-mingw32/usr/lib/bfd-plugins/libdep.dll

---
 meta/recipes-devtools/binutils/binutils_2.43.1.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/binutils/binutils_2.43.1.bb +1 -0
index 2cce40f1ef..eb7c16cbc4 100644
@@ -72,5 +72,6 @@ SRC_URI:append:class-nativesdk =  " file://0003-binutils-nativesdk-Search-for-al
 
 USE_ALTERNATIVES_FOR:class-nativesdk = ""
 FILES:${PN}:append:class-nativesdk = " ${bindir}"
+FILES:${PN}:append:class-nativesdk = " ${libdir}/bfd-plugins"
 
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.43.0
#1 lore raw

PATCH v5 2/2 nativesdk-packagegroup-sdk-host: Add missing perl modules to RDEPENDS

From: Harish Sadineni <[email protected]>

In SDK, missing perl modules causes 'x86_64-pokysdk-linux-gp-display-html --help' to abort with below errors..
- Can't locate bignum.pm in @INC (you may need to install the feature module).
- Can't locate Math/BigInt.pm in @INC (you may need to install the Math::BigInt module)

By adding the following perl modules to RDEPENDS fixes the above errors:
nativesdk-perl-module-bignum
nativesdk-perl-module-bigint nativesdk-perl-module-math-bigint

---
 meta/recipes-devtools/binutils/binutils_2.43.1.bb | 4 ++++
 1 file changed, 4 insertions(+)
meta/recipes-devtools/binutils/binutils_2.43.1.bb +4 -0
index eb7c16cbc4..44cd17bc78 100644
@@ -73,5 +73,9 @@ SRC_URI:append:class-nativesdk =  " file://0003-binutils-nativesdk-Search-for-al
 USE_ALTERNATIVES_FOR:class-nativesdk = ""
 FILES:${PN}:append:class-nativesdk = " ${bindir}"
 FILES:${PN}:append:class-nativesdk = " ${libdir}/bfd-plugins"
+RDEPENDS:gprofng:class-nativesdk = " nativesdk-perl-module-bignum \
+                                     nativesdk-perl-module-bigint \
+                                     nativesdk-perl-module-math-bigint \
+"
 
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.43.0
#2 lore raw

Re: [OE-core] [PATCH v5 2/2] nativesdk-packagegroup-sdk-host: Add missing perl modules to RDEPENDS

Quoted 11 lines · Harish via lists.openembedded.org

From: Harish Sadineni <[email protected]>

In SDK, missing perl modules causes 'x86_64-pokysdk-linux-gp-display-html --help' to abort with below errors..
  - Can't locate bignum.pm in @INC (you may need to install the feature module).
  - Can't locate Math/BigInt.pm in @INC (you may need to install the Math::BigInt module)

By adding the following perl modules to RDEPENDS fixes the above errors:
  nativesdk-perl-module-bignum
  nativesdk-perl-module-bigint nativesdk-perl-module-math-bigint

Quoted 4 lines

---
 meta/recipes-devtools/binutils/binutils_2.43.1.bb | 4 ++++

 1 file changed, 4 insertions(+)

You've updated the commit to do what is needed whic is great, thanks.

Unfortunately the shortlog is now incorrect though. It should now read:

"binutils: Add missing perl modules to RDEPENDS for nativsdk variant"

The patch also fails to apply as I can't take 1/2 for other reasons as discussed. I'm going to tweak the patch locally for testing though on this occasion.

Cheers,

Richard

#3 lore raw
In reply to [email protected]
Quoted 18 lines · Harish via lists.openembedded.org

From: Harish Sadineni <[email protected]>

Fixes the follwing error while building nativesdk-binutils with i686-mingw32 as SDKMACHINE:
ERROR: nativesdk-binutils-2.43.1-r0 do_package: QA Issue: nativesdk-binutils: Files/directories were installed but not shipped in any package:
   /usr/local/oe-sdk-hardcoded-buildpath/sysroots/i686-w64-mingw32/usr/lib/bfd-plugins /usr/local/oe-sdk-hardcoded-buildpath/sysroots/i686-w64-mingw32/usr/lib/bfd-plugins/libdep.dll

---
 meta/recipes-devtools/binutils/binutils_2.43.1.bb | 1 +

 1 file changed, 1 insertion(+)
meta/recipes-devtools/binutils/binutils_2.43.1.bb +0 -0
index 2cce40f1ef..eb7c16cbc4 100644
@@ -72,5 +72,6 @@ SRC_URI:append:class-nativesdk =  " file://0003-binutils-nativesdk-Search-for-al
Quoted 6 lines


 USE_ALTERNATIVES_FOR:class-nativesdk = "" FILES:${PN}:append:class-nativesdk = " ${bindir}" +FILES:${PN}:append:class-nativesdk = " ${libdir}/bfd-plugins"
 BBCLASSEXTEND = "native nativesdk"

I ended up digging into this a lot more. I was able to reproduce the failure locally but that implies the autobuilder isn't testing this combination. According to the configuration, it should be so I'm a bit puzzled why the autobuilder doesn't see it.

The autobuilder config for this is here:

https://git.yoctoproject.org/yocto-autobuilder-helper/tree/config.json#n1362

Resulting in a build such as this:

https://valkyrie.yoctoproject.org/#/builders/7/builds/162

I would like to understand why automated testing isn't catching this.

Getting back to the patch, I noticed that bintutils.inc already does:

 FILES:${PN} = " \
        ${bindir}/${TARGET_PREFIX}* \
        ${libdir}/lib*.so.* \
        ${libdir}/bfd-plugins/lib*.so \

...

and the issue is that it uses .so and the recipe is generating a .dll file.

I'd note that bitbake.conf has:

SOLIBS = ".so.*"
SOLIBS:darwin = ".dylib"

SOLIBSDEV = ".so"
# Due to the ordering of PACKAGES and the naming of the dev symlinks on darwin,

 # we can't make the symlinks end up in the -dev packages easily at this point. This hack
 # at least means builds aren't completely broken and symlinks don't take up much space.
 SOLIBSDEV:darwin = ".dylibbroken"

with the intent of being able to abstract out dylib/so/dll references. I'm wondering if we should add:

SOLIBS:mingw32 = ".dll"
SOLIBSDEV:mingw32 = ".dll"

which would then let us change the binutils.inc entry to:

${libdir}/bfd-plugins/lib*${SOLIBSDEV}

In testing this I found it breaks zstd and zlib since those always generate .so files even on mingw. I've hardcoded SOLIBS and SOLIBSDEV in the bbappends in mingw to counteract that:

https://git.yoctoproject.org/meta-mingw/commit/?id=db1f53f73e95499a5f0b0edc45dd9cc9718d3c8a

I think these changes should combine to fix the underlying problem and also make it easier to fix things like this in future.

They probably need wider testing though.

Cheers,

Richard

#4 lore raw

In general, we don't really support any nativesdk- recipes in MinGW; it's pretty difficult to get recipes working for MinGW in general, so we are pretty focused on just providing the cross-compiler utilities so that the SDK can be used to compile for your target device, and less so to provide utilities for running on Windows proper. A lot of recipes are pretty much impossible to compile as nativesdk- (e.g. Python).

In general, my recommendation would be to use the MinGW SDK to provide the cross compiler, and if you want additional tools in your Windows environment, use something like msys2 to provide them (or compile your own versions). IMHO, this a much more maintainable long term solution, since I don't think it's going to be particularly easy to allow arbitrary recipes to be compiled as nativesdk- for MinGW, and msys2/mingw has already solved this problem anyway.

Quoted 95 lines · Richard Purdie
Quoted 18 lines · Harish via lists.openembedded.org

From: Harish Sadineni <[email protected]>

Fixes the follwing error while building nativesdk-binutils with i686-mingw32 as SDKMACHINE:
ERROR: nativesdk-binutils-2.43.1-r0 do_package: QA Issue: nativesdk-binutils: Files/directories were installed but not shipped in any package:

   /usr/local/oe-sdk-hardcoded-buildpath/sysroots/i686-w64-mingw32/usr/lib/bfd-plugins
   /usr/local/oe-sdk-hardcoded-buildpath/sysroots/i686-w64-mingw32/usr/lib/bfd-plugins/libdep.dll
---
 meta/recipes-devtools/binutils/binutils_2.43.1.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/binutils/binutils_2.43.1.bb +0 -0
index 2cce40f1ef..eb7c16cbc4 100644

meta/recipes-devtools/binutils/binutils_2.43.1.bb SRC_URI:append:class-nativesdk = " file://0003-binutils-nativesdk-Search-for-al · line 77

Quoted 6 lines
meta/recipes-devtools/binutils/binutils_2.43.1.bb +1 -0
@@ -72,5 +72,6 @@ SRC_URI:append:class-nativesdk =  " file://0003-binutils-nativesdk-Search-for-al
 
 USE_ALTERNATIVES_FOR:class-nativesdk = ""
 FILES:${PN}:append:class-nativesdk = " ${bindir}"
+FILES:${PN}:append:class-nativesdk = " ${libdir}/bfd-plugins"
 
 BBCLASSEXTEND = "native nativesdk"

I ended up digging into this a lot more. I was able to reproduce the failure locally but that implies the autobuilder isn't testing this combination. According to the configuration, it should be so I'm a bit puzzled why the autobuilder doesn't see it.

The autobuilder config for this is here:

https://git.yoctoproject.org/yocto-autobuilder-helper/tree/config.json#n1362

Resulting in a build such as this:

https://valkyrie.yoctoproject.org/#/builders/7/builds/162

I would like to understand why automated testing isn't catching this.

Getting back to the patch, I noticed that bintutils.inc already does:

 FILES:${PN} = " \
        ${bindir}/${TARGET_PREFIX}* \
        ${libdir}/lib*.so.* \
        ${libdir}/bfd-plugins/lib*.so \

...

and the issue is that it uses .so and the recipe is generating a .dll file.

I'd note that bitbake.conf has:

SOLIBS = ".so.*"
SOLIBS:darwin = ".dylib"

SOLIBSDEV = ".so"
# Due to the ordering of PACKAGES and the naming of the dev symlinks on darwin,

 # we can't make the symlinks end up in the -dev packages easily at this point. This hack
 # at least means builds aren't completely broken and symlinks don't take up much space.
 SOLIBSDEV:darwin = ".dylibbroken"

with the intent of being able to abstract out dylib/so/dll references. I'm wondering if we should add:

SOLIBS:mingw32 = ".dll"
SOLIBSDEV:mingw32 = ".dll"

which would then let us change the binutils.inc entry to:

${libdir}/bfd-plugins/lib*${SOLIBSDEV}

In testing this I found it breaks zstd and zlib since those always generate .so files even on mingw. I've hardcoded SOLIBS and SOLIBSDEV in the bbappends in mingw to counteract that:

https://git.yoctoproject.org/meta-mingw/commit/?id=db1f53f73e95499a5f0b0edc45dd9cc9718d3c8a

I think these changes should combine to fix the underlying problem and also make it easier to fix things like this in future.

They probably need wider testing though.

Cheers,

Richard

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

#6 lore raw
Quoted 33 lines · Richard Purdie via lists.openembedded.org
Quoted 18 lines · Harish via lists.openembedded.org

From: Harish Sadineni <[email protected]>

Fixes the follwing error while building nativesdk-binutils with i686-mingw32 as SDKMACHINE:
ERROR: nativesdk-binutils-2.43.1-r0 do_package: QA Issue: nativesdk-binutils: Files/directories were installed but not shipped in any package:
   /usr/local/oe-sdk-hardcoded-buildpath/sysroots/i686-w64-mingw32/usr/lib/bfd-plugins /usr/local/oe-sdk-hardcoded-buildpath/sysroots/i686-w64-mingw32/usr/lib/bfd-plugins/libdep.dll

---
 meta/recipes-devtools/binutils/binutils_2.43.1.bb | 1 +

 1 file changed, 1 insertion(+)
meta/recipes-devtools/binutils/binutils_2.43.1.bb +0 -0
index 2cce40f1ef..eb7c16cbc4 100644
@@ -72,5 +72,6 @@ SRC_URI:append:class-nativesdk =  " file://0003-binutils-nativesdk-Search-for-al
Quoted 6 lines


 USE_ALTERNATIVES_FOR:class-nativesdk = "" FILES:${PN}:append:class-nativesdk = " ${bindir}" +FILES:${PN}:append:class-nativesdk = " ${libdir}/bfd-plugins"
 BBCLASSEXTEND = "native nativesdk"

I ended up digging into this a lot more. I was able to reproduce the failure locally but that implies the autobuilder isn't testing this combination. According to the configuration, it should be so I'm a bit puzzled why the autobuilder doesn't see it.

The autobuilder config for this is here:

Quoted 7 lines

https://git.yoctoproject.org/yocto-autobuilder-helper/tree/config.json#n1362

Resulting in a build such as this:

https://valkyrie.yoctoproject.org/#/builders/7/builds/162

I would like to understand why automated testing isn't catching this.

Just to complete things on this topic, I realised the issue. We build binutils-cross-canadian-* for mingw but nativesdk-bintuils isn't that useful in general on mingw and isn't built. I'd be curious if you are actually using it.

Cheers,

Richard

#7 lore raw
Quoted 4 lines
Quoted 4 lines

Just to complete things on this topic, I realised the issue. We build binutils-cross-canadian-* for mingw but nativesdk-bintuils isn't that useful in general on mingw and isn't built. I'd be curious if you are actually using it.

Although we are not using it, Alexandre Belloni encountered this issue and suggested that my patches might be the cause.
https://autobuilder.yoctoproject.org/typhoon/#/builders/89/builds/8798/steps/12/logs/stdio

After reviewing it, I found that my patches were not responsible, but I am still interested in resolving the issue. That's why I submitted a patch to fix it.

Thanks,
Harish
________________________________
From: Richard Purdie <[email protected]>
Sent: Friday, September 20, 2024 2:19 AM
To: Sadineni, Harish <[email protected]>; [email protected] <[email protected]>
Cc: Gowda, Naveen <[email protected]>; Kokkonda, Sundeep <[email protected]>; Joshua Watt <[email protected]>; MacLeod, Randy <[email protected]>
Subject: Re: [OE-core] [PATCH v5 1/2] binutils: Fix packaging of bfd-plugins

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Quoted 33 lines · Richard Purdie via lists.openembedded.org
Quoted 18 lines · Harish via lists.openembedded.org

From: Harish Sadineni <[email protected]>

Fixes the follwing error while building nativesdk-binutils with i686-mingw32 as SDKMACHINE:
ERROR: nativesdk-binutils-2.43.1-r0 do_package: QA Issue: nativesdk-binutils: Files/directories were installed but not shipped in any package:

   /usr/local/oe-sdk-hardcoded-buildpath/sysroots/i686-w64-mingw32/usr/lib/bfd-plugins
   /usr/local/oe-sdk-hardcoded-buildpath/sysroots/i686-w64-mingw32/usr/lib/bfd-plugins/libdep.dll
---
 meta/recipes-devtools/binutils/binutils_2.43.1.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/binutils/binutils_2.43.1.bb +0 -0
index 2cce40f1ef..eb7c16cbc4 100644

meta/recipes-devtools/binutils/binutils_2.43.1.bb SRC_URI:append:class-nativesdk = " file://0003-binutils-nativesdk-Search-for-al · line 77

Quoted 6 lines
meta/recipes-devtools/binutils/binutils_2.43.1.bb +1 -0
@@ -72,5 +72,6 @@ SRC_URI:append:class-nativesdk =  " file://0003-binutils-nativesdk-Search-for-al
 
 USE_ALTERNATIVES_FOR:class-nativesdk = ""
 FILES:${PN}:append:class-nativesdk = " ${bindir}"
+FILES:${PN}:append:class-nativesdk = " ${libdir}/bfd-plugins"
 
 BBCLASSEXTEND = "native nativesdk"

I ended up digging into this a lot more. I was able to reproduce the failure locally but that implies the autobuilder isn't testing this combination. According to the configuration, it should be so I'm a bit puzzled why the autobuilder doesn't see it.

The autobuilder config for this is here:

Quoted 7 lines

https://git.yoctoproject.org/yocto-autobuilder-helper/tree/config.json#n1362

Resulting in a build such as this:

https://valkyrie.yoctoproject.org/#/builders/7/builds/162

I would like to understand why automated testing isn't catching this.

Just to complete things on this topic, I realised the issue. We build binutils-cross-canadian-* for mingw but nativesdk-bintuils isn't that useful in general on mingw and isn't built. I'd be curious if you are actually using it.

Cheers,

Richard