Closed Bug 1836781 Opened 1 year ago Closed 1 year ago

nss-3.90 fails to link on aarch64-linux

Categories

(NSS :: Build, defect)

3.89
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: herrtimson, Assigned: anna.weine)

References

Details

Attachments

(2 files)

Attached file build.log.gz

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0

Steps to reproduce:

hi, I downloaded fresh nss-3.90 source tarball, unpacked it and compiled it on aarch64-linux with gcc-12.2.0 (also fails with gcc-11, gcc-10)

Actual results:

the build fails to link with many undefined references:

/usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Linux4.19_aarch64_aarch64-unknown-linux-gnu-gcc_glibc_PTH_64_OPT.OBJ/Linux_SINGLE_SHLIB/Hacl_Curve25519_64.o: in function point_double': Hacl_Curve25519_64.c:(.text.point_double+0x34): undefined reference tofadd'
/usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_double+0x48): undefined reference to fsub' /usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_double+0x58): undefined reference tofsqr2'
/usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_double+0x8c): undefined reference to fsub' /usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_double+0xa0): undefined reference tofmul_scalar'
/usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_double+0xb0): undefined reference to fadd' /usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_double+0xd4): undefined reference tofmul2'
/usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Linux4.19_aarch64_aarch64-unknown-linux-gnu-gcc_glibc_PTH_64_OPT.OBJ/Linux_SINGLE_SHLIB/Hacl_Curve25519_64.o: in function point_add_and_double': Hacl_Curve25519_64.c:(.text.point_add_and_double+0x48): undefined reference tofadd'
/usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_add_and_double+0x58): undefined reference to fsub' /usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_add_and_double+0x6c): undefined reference tofadd'
/usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_add_and_double+0x7c): undefined reference to fsub' /usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_add_and_double+0x90): undefined reference tofmul2'
/usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_add_and_double+0xa0): undefined reference to fadd' /usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_add_and_double+0xb0): undefined reference tofsub'
/usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_add_and_double+0xc0): undefined reference to fsqr2' /usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_add_and_double+0xd0): undefined reference tofsqr2'
/usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_add_and_double+0x100): undefined reference to fsub' /usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_add_and_double+0x114): undefined reference tofmul_scalar'
/usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_add_and_double+0x124): undefined reference to fadd' /usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_add_and_double+0x138): undefined reference tofmul2'
/usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Hacl_Curve25519_64.c:(.text.point_add_and_double+0x164): undefined reference to fmul' /usr/lib/gcc/aarch64-unknown-linux-gnu/10/../../../../aarch64-unknown-linux-gnu/bin/ld: Linux4.19_aarch64_aarch64-unknown-linux-gnu-gcc_glibc_PTH_64_OPT.OBJ/Linux_SINGLE_SHLIB/Hacl_Curve25519_64.o: in functionHacl_Curve25519_64_scalarmult':

Expected results:

compile should have build me a nice set of nss-3.90 libs and binaries

the full build.log is attached

p.s: I can't select nss-3.90 branch yet for version

gcc gives these warnings when compiling Hacl_Curve25519_64.c

aarch64-unknown-linux-gnu-gcc -o Linux4.19_aarch64_aarch64-unknown-linux-gnu-gcc_glibc_PTH_64_OPT.OBJ/Linux_SINGLE_SHLIB/Hacl_Curve25519_64.o -c -std=c99 -fPIC -pipe -ffunction-sections -fdata-sections -DHAVE_STRERROR -DLINUX -Dlinux -Wall -Wshadow -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 -DSEED_ONLY_DEV_URANDOM -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -DNSS_USE_64 -DFREEBL_NO_DEPEND -DFREEBL_LOWHASH -DUSE_HW_AES -DUSE_HW_SHA1 -DUSE_HW_SHA2 -DHAVE_INT128_SUPPORT -DHACL_CAN_COMPILE_INLINE_ASM -DMP_API_COMPATIBLE -I../../dist/Linux4.19_aarch64_aarch64-unknown-linux-gnu-gcc_glibc_PTH_64_OPT.OBJ/include -I../../dist/public/nss -I../../dist/private/nss -I../../dist/Linux4.19_aarch64_aarch64-unknown-linux-gnu-gcc_glibc_PTH_64_OPT.OBJ/include/dbm -Impi -Iecl -Iverified -Iverified/internal -Iverified/karamel/include -Iverified/karamel/krmllib/dist/minimal -Ideprecated -O2 -pipe -I/usr/include/nspr verified/Hacl_Curve25519_64.c
verified/Hacl_Curve25519_64.c: In function ‘add_scalar0’:
verified/Hacl_Curve25519_64.c:34:5: warning: implicit declaration of function ‘add_scalar’; did you mean ‘add_scalar0’? [-Wimplicit-function-declaration]
34 | add_scalar(out, f1, f2);
| ^~~~~~~~~~
| add_scalar0
verified/Hacl_Curve25519_64.c: In function ‘fadd0’:
verified/Hacl_Curve25519_64.c:44:5: warning: implicit declaration of function ‘fadd’; did you mean ‘fadd0’? [-Wimplicit-function-declaration]
44 | fadd(out, f1, f2);
| ^~~~
| fadd0
verified/Hacl_Curve25519_64.c: In function ‘fsub0’:
verified/Hacl_Curve25519_64.c:54:5: warning: implicit declaration of function ‘fsub’; did you mean ‘fsub0’? [-Wimplicit-function-declaration]
54 | fsub(out, f1, f2);
| ^~~~
| fsub0
verified/Hacl_Curve25519_64.c: In function ‘fmul0’:
verified/Hacl_Curve25519_64.c:64:5: warning: implicit declaration of function ‘fmul’; did you mean ‘fmul0’? [-Wimplicit-function-declaration]
64 | fmul(out, f1, f2, tmp);
| ^~~~
| fmul0
verified/Hacl_Curve25519_64.c: In function ‘fmul20’:
verified/Hacl_Curve25519_64.c:74:5: warning: implicit declaration of function ‘fmul2’; did you mean ‘fmul20’? [-Wimplicit-function-declaration]
74 | fmul2(out, f1, f2, tmp);
| ^~~~~
| fmul20
verified/Hacl_Curve25519_64.c: In function ‘fmul_scalar0’:
verified/Hacl_Curve25519_64.c:84:5: warning: implicit declaration of function ‘fmul_scalar’; did you mean ‘fmul_scalar0’? [-Wimplicit-function-declaration]
84 | fmul_scalar(out, f1, f2);
| ^~~~~~~~~~~
| fmul_scalar0
verified/Hacl_Curve25519_64.c: In function ‘fsqr0’:
verified/Hacl_Curve25519_64.c:94:5: warning: implicit declaration of function ‘fsqr’; did you mean ‘fsqr0’? [-Wimplicit-function-declaration]
94 | fsqr(out, f1, tmp);
| ^~~~
| fsqr0
verified/Hacl_Curve25519_64.c: In function ‘fsqr20’:
verified/Hacl_Curve25519_64.c:104:5: warning: implicit declaration of function ‘fsqr2’; did you mean ‘fsqr20’? [-Wimplicit-function-declaration]
104 | fsqr2(out, f, tmp);
| ^~~~~
| fsqr20
verified/Hacl_Curve25519_64.c: In function ‘cswap20’:
verified/Hacl_Curve25519_64.c:114:5: warning: implicit declaration of function ‘cswap2’; did you mean ‘cswap20’? [-Wimplicit-function-declaration]
114 | cswap2(bit, p1, p2);
| ^~~~~~
| cswap20

Assignee: nobody → nkulatova

Hello, thanks for the report.
Let me take a look on what's going on.

Hello, did you try to build with build.sh/gyp or with the Makefile ?

Flags: needinfo?(herrtimson)

I'm on gentoo, I believe they use make for compiling:

make -j4 -C coreconf CC=aarch64-unknown-linux-gnu-gcc USE_64=1

nss-3.89.1 is compiling

Flags: needinfo?(herrtimson)

Could you try to run using build.sh?

Flags: needinfo?(herrtimson)

Additionally, could I ask you to check whether the following modification solves the problem?

(To apply on the /nss_dir/nss/lib/freebl/Makefile file)

571c571,573
<         SUPPORTS_VALE_CURVE25519 = 1
---
>         ifeq ($(CPU_ARCH),x86_64)
>             SUPPORTS_VALE_CURVE25519 = 1
>         endif
Attachment #9337484 - Attachment description: WIP: Bug 1836781 - Disabling ASM C25519 for A but X86_64 → Bug 1836781 - Disabling ASM C25519 for A but X86_64

the attached patch fixes the issue for me, I'm happy to test it again if needed

Flags: needinfo?(herrtimson)

Thanks a lot for your help!

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Duplicate of this bug: 1885749
Blocks: 1905160
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: