RJVB / lnxports

A "local port repository" for use with MacPorts on Linux, overriding ports from the main repository.
4 stars 1 forks source link

nss build failure: `drbg.c: error: 'arg' declared as an array with a negative size` #19

Closed barracuda156 closed 1 month ago

barracuda156 commented 2 months ago
/usr/bin/clang -Os -std=c99 -Wl,-R,/opt/local/lib -Wl,-rpath,/opt/local/lib -o Output.OBJD/Linux_SINGLE_SHLIB/drbg.o -c -std=c99 -Os -fPIC   -pipe -ffunction-sections -fdata-sections -DHAVE_STRERROR -DLINUX -Dlinux -Wall  -Qunused-arguments    -DNSS_NO_GCC48 -DXP_UNIX -DXP_UNIX -UDEBUG -DNDEBUG -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -DSDB_MEASURE_USE_TEMP_DIR -D_REENTRANT -DSHLIB_SUFFIX=\"so\" -DSHLIB_PREFIX=\"lib\" -DSHLIB_VERSION=\"3\" -DSOFTOKEN_SHLIB_VERSION=\"3\" -DRIJNDAEL_INCLUDE_TABLES -UDEBUG -DNDEBUG -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -DSDB_MEASURE_USE_TEMP_DIR -D_REENTRANT -DNSS_DISABLE_AVX2 -DNSS_DISABLE_SSE3 -DNSS_NO_INIT_SUPPORT -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -DFREEBL_NO_DEPEND -DFREEBL_LOWHASH -DKRML_VERIFIED_UINT128 -DMP_API_COMPATIBLE -I/opt/local/include/nspr -I../../../dist/Output.OBJD/include -I../../../dist/public/nss -I../../../dist/private/nss -Impi -Iecl -Iverified -Iverified/internal -Iverified/karamel/include -Iverified/karamel/krmllib/dist/minimal -Ideprecated  drbg.c
drbg.c:615:5: error: 'arg' declared as an array with a negative size
    PR_STATIC_ASSERT(sizeof(size_t) <= 4);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/nspr/prtypes.h:556:42: note: expanded from macro 'PR_STATIC_ASSERT'
    extern void pr_static_assert(int arg[(condition) ? 1 : -1])
                                         ^~~~~~~~~~~~~~~~~~~~
1 error generated.
make[4]: *** [../../coreconf/rules.mk:292: Output.OBJD/Linux_SINGLE_SHLIB/drbg.o] Error 1
make[4]: Leaving directory '/opt/local/var/macports/build/_home_svacchanda_lnxports_net_nss/nss/work/nss-3.92/nss/lib/freebl'
make[3]: *** [Makefile:710: freebl_FREEBL_BUILD_SINGLE_SHLIB] Error 2
make[3]: Leaving directory '/opt/local/var/macports/build/_home_svacchanda_lnxports_net_nss/nss/work/nss-3.92/nss/lib/freebl'
make[2]: *** [../coreconf/rules.mk:44: freebl] Error 2
make[2]: Leaving directory '/opt/local/var/macports/build/_home_svacchanda_lnxports_net_nss/nss/work/nss-3.92/nss/lib'
make[1]: *** [coreconf/rules.mk:44: lib] Error 2
make[1]: Leaving directory '/opt/local/var/macports/build/_home_svacchanda_lnxports_net_nss/nss/work/nss-3.92/nss'
make: *** [manifest.mn:21: all] Error 2

Perhaps an upstream bug? I can open an issue with them.

RJVB commented 2 months ago

On Friday September 06 2024 07:40:20 Sergey Fedorov wrote:

Perhaps an upstream bug? I can open an issue with them.

Looks like it, though I see I updated port:nspr just after port:nss and since no ABI was broken I didn't try to build nss anew.

You could try the current version of port:nss, or merge the current one from MacPorts to see if that solves anything.

FWIW, it seems that the specificity of these two ports in LinuxPorts is that nspr is installed to $prefix/lib and not in a subdir. I can't remember what reason I had to do that, possibly just to avoid having to add another rpath component to all dependents.

barracuda156 commented 2 months ago

@RJVB There are two similar reported cases: https://bugzilla.mozilla.org/show_bug.cgi?id=483135 https://bugzilla.mozilla.org/show_bug.cgi?id=747371

From that it seems something might have built for 32-bit, god knows why. I can check that tomorrow.

RJVB commented 1 month ago

On Friday September 06 2024 07:40:20 Sergey Fedorov wrote:

drbg.c:615:5: error: 'arg' declared as an array with a negative size PR_STATIC_ASSERT(sizeof(size_t) <= 4); ^~~~~~~~~ /opt/local/include/nspr/prtypes.h:556:42: note: expanded from macro 'PR_STATIC_ASSERT' extern void pr_static_assert(int arg[(condition) ? 1 : -1]) ^~~~~~~~

Perhaps an upstream bug? I can open an issue with them.

This in fact looks like a requirement that the size_t type be no more than 4 bytes long. Which is probably not appropriate for an OS called pine64 running on a riscv64 platform.