Re: Build error with freebl: prtypes.h:556:38: error: size of array ‘arg’ is negative

Paul Menzel pmenzel+libreoffice at molgen.mpg.de
Thu Jul 22 10:10:19 UTC 2021


Dear Michael,


Thank you for your reply.


Am 21.07.21 um 14:45 schrieb Michael Stahl:
> On 20/07/2021 22.48, Paul Menzel wrote:
>> $ make
>> […]
>> In file included from ../../../dist/out/include/prerror.h:9,
>>                   from drbg.c:9:
>> drbg.c: In function ‘RNG_RandomUpdate’:
>> ../../../dist/out/include/prtypes.h:556:38: error: size of array ‘arg’  is negative
>>    556 |     extern void pr_static_assert(int arg[(condition) ? 1 : -1])
>>        |                                      ^~~ drbg.c:609:5: note: in expansion of macro ‘PR_STATIC_ASSERT’
>>    609 |     PR_STATIC_ASSERT(sizeof(size_t) <= 4);
>>        |     ^~~~~~~~~~~~~~~~
> 
> this is using the wrong branch...
> 
> in external/nss/ExternalProject_nss.mk there are these lines:
> 
>>         $(if $(filter ANDROID FREEBSD LINUX MACOSX,$(OS)),$(if 
>> $(filter X86_64,$(CPUNAME)),USE_64=1)) \
>>         $(if $(filter AARCH64,$(CPUNAME)),USE_64=1 CPU_ARCH=aarch64) \
> 
> you probably need to add your CPU to the 1st one, or possibly even add 
> one similar to the 2nd one, although it's not clear to me why setting 
> CPU_ARCH is necessary in that case.

That did the trick.

diff --git a/external/nss/ExternalProject_nss.mk 
b/external/nss/ExternalProject_nss.mk
index 81e5dfb45d3e..b0c4ae9f7c97 100644
--- a/external/nss/ExternalProject_nss.mk
+++ b/external/nss/ExternalProject_nss.mk
@@ -52,6 +52,7 @@ $(call gb_ExternalProject_get_state_target,nss,build): \
         $(call gb_ExternalProject_run,build,\
                 $(if $(filter ANDROID FREEBSD LINUX MACOSX,$(OS)),$(if 
$(filter X86_64,$(CPUNAME)),USE_64=1)) \
                 $(if $(filter AARCH64,$(CPUNAME)),USE_64=1 
CPU_ARCH=aarch64) \
+               $(if $(filter POWERPC64,$(CPUNAME)),USE_64=1 
CPU_ARCH=ppc64le) \
                 $(if $(filter MACOSX,$(OS)),\
                         MACOS_SDK_DIR=$(MACOSX_SDK_PATH) \
                         NSS_USE_SYSTEM_SQLITE=1) \

As I am not crosscompiling I am wondering, why this needs to be done.

Is LibreOffice using it’s own build script? I built upstream NSS with 
NSPR – I think all the components – with `make nss_build_all` without 
any problems.


Kind regards,

Paul


More information about the LibreOffice mailing list