diff mbox series

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

Message ID 20220806153651.4013424-1-giulio.benetti@benettiengineering.com
State Changes Requested
Headers show
Series package/libnss: fix build failure due to missing missing libnspr in link list | expand

Commit Message

Giulio Benetti Aug. 6, 2022, 3:36 p.m. UTC
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/

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
 package/libnss/libnss.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Thomas Petazzoni Aug. 6, 2022, 10:21 p.m. UTC | #1
On Sat,  6 Aug 2022 17:36:51 +0200
Giulio Benetti <giulio.benetti@benettiengineering.com> wrote:

> 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/
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>

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
Giulio Benetti Aug. 8, 2022, 11:34 p.m. UTC | #2
Hi Thomas,

On 07/08/22 00:21, Thomas Petazzoni via buildroot wrote:
> Subject:
> Re: [Buildroot] [PATCH] package/libnss: fix build failure due to missing 
> missing libnspr in link list
> From:
> Thomas Petazzoni via buildroot <buildroot@buildroot.org>
> Date:
> 07/08/22, 00:21
> 
> To:
> Giulio Benetti <giulio.benetti@benettiengineering.com>
> CC:
> Joseph Kogut <joseph.kogut@gmail.com>, buildroot@buildroot.org
> 
> 
> On Sat,  6 Aug 2022 17:36:51 +0200
> Giulio Benetti<giulio.benetti@benettiengineering.com>  wrote:
> 
>> 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/
>>
>> Signed-off-by: Giulio Benetti<giulio.benetti@benettiengineering.com>
> 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.

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

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

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

Yes

> 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
diff mbox series

Patch

diff --git a/package/libnss/libnss.mk b/package/libnss/libnss.mk
index 4283ef520f..bc878adc35 100644
--- a/package/libnss/libnss.mk
+++ b/package/libnss/libnss.mk
@@ -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