Skip to contentSkip to conversation

package/libnss: fix build failure due to missing missing libnspr in link list

PATCH In review Giulio Benetti 2 participants 3 messages Aug 6, 2022 – Aug 8, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libnss: fix build failure due to missing missing libnspr in link list

FREEBL_NO_DEPEND is usually set to 1 and this means that:

```
build libfreebl3.so with no NSPR and libnssutil3.so dependencies by
default
```

But PR_SetError() and other PR_*() APIs are contained right in NSPR(libnspr) that we already build and it's a libnss dependency, so let's make libnss to link with libnspr by default by setting FREEBL_NO_DEPEND to 0.

Fixes:
http://autobuild.buildroot.net/results/c5b440bae5cd6dc6d5f1a632a6b5950b32d13f66/

---
 package/libnss/libnss.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/libnss/libnss.mk +2 -1
index 4283ef520f..bc878adc35 100644
@@ -57,7 +57,8 @@ LIBNSS_BUILD_VARS = \
 	OS_ARCH="Linux" \
 	OS_RELEASE="2.6" \
 	OS_TEST=$(BR2_PACKAGE_LIBNSS_ARCH) \
-	NSS_ENABLE_WERROR=0
+	NSS_ENABLE_WERROR=0 \
+	FREEBL_NO_DEPEND=0
 
 ifeq ($(BR2_POWERPC_CPU_HAS_ALTIVEC),)
 # Disable Altivec if not supported
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 10 lines · On Sat, 6 Aug 2022 17:36:51 +0200 Giulio Benetti…

FREEBL_NO_DEPEND is usually set to 1 and this means that:

```
build libfreebl3.so with no NSPR and libnssutil3.so dependencies by
default
```

But PR_SetError() and other PR_*() APIs are contained right in NSPR(libnspr) that we already build and it's a libnss dependency, so let's make libnss to link with libnspr by default by setting FREEBL_NO_DEPEND to 0.

Quoted 4 lines

Fixes:
http://autobuild.buildroot.net/results/c5b440bae5cd6dc6d5f1a632a6b5950b32d13f66/

Thanks for the debugging, but I have to say I am not convinced by the explanation. Why is FREEBL_NO_DEPEND=1 the default if it doesn't work? Why was it working before, and what broke it?

Setting or not setting FREEBL_NO_DEPEND has impact in a lot of parts of the libnss code, I don't think we should do this lightly.

Could you research more when this broke (i.e which version bump in Buildroot), and then which commit in NSS causes this breakage? I don't want to blindly set this obscure variable.

Has this issue been reported upstream?

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Hi Thomas,

Quoted 26 lines · Thomas Petazzoni via buildroot

Subject:
Re: [Buildroot] [PATCH] package/libnss: fix build failure due to missing missing libnspr in link list From:
Thomas Petazzoni via buildroot <[email protected]>
Date:
07/08/22, 00:21

To:
Giulio Benetti <[email protected]> CC:
Joseph Kogut <[email protected]>, [email protected]

Quoted 10 lines · On Sat, 6 Aug 2022 17:36:51 +0200 Giulio…

FREEBL_NO_DEPEND is usually set to 1 and this means that:

```
build libfreebl3.so with no NSPR and libnssutil3.so dependencies by
default
```

But PR_SetError() and other PR_*() APIs are contained right in NSPR(libnspr) that we already build and it's a libnss dependency, so let's make libnss to link with libnspr by default by setting FREEBL_NO_DEPEND to 0.

Quoted 7 lines
Quoted 4 lines

Fixes:
http://autobuild.buildroot.net/results/c5b440bae5cd6dc6d5f1a632a6b5950b32d13f66/

Thanks for the debugging, but I have to say I am not convinced by the explanation. Why is FREEBL_NO_DEPEND=1 the default if it doesn't work? Why was it working before, and what broke it?

Yes, you're right. I'm going back to previous versions and I've found this bug affects back to libnss 3.72 and still have to try older ones. This is to find if it is something libnss related or something else in the environemnt.

This bug didn't show up always with every version bump.

Quoted 2 lines

Setting or not setting FREEBL_NO_DEPEND has impact in a lot of parts of the libnss code, I don't think we should do this lightly.

Yes, totally. I've realized only now that every call to PR_*() and PORT_*() API would end up to abort(). So I've misinterpreted the meaning of FREEBL_NO_DEPEND. It seemed like it implemented part of libnspr locally but that's not true at all.

Quoted 2 lines

Could you research more when this broke (i.e which version bump in Buildroot), and then which commit in NSS causes this breakage?

I'm doing like that and I'm back to 3.72, I'll keep rolling back. Since Autobuilders didn't show up the problem before 3.77 I suspect that the cause can be not due to libnss itself, but external, or more likely libnss doesn't handle something external that is "too new". So I keep on digging. It's a pity they have chosen to go for gyp instead of other build system, this complicates things a lot since actual Makefile is not linear at all. Anyway I don't see alternatives.

Quoted 2 lines

I don't
want to blindly set this obscure variable.

Yes

Quoted 1 line

Has this issue been reported upstream?

Still not. But usually I fix the problem and only later I report the issue(Bug - xxxxx) with the patch fixing it.

Best regards

Signature · 6 lines
Giulio Benetti
Benetti Engineering sas
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot