Closed Bug 1459739 Opened 6 years ago Closed 6 years ago

"make" build fails on armv6/armv7 due to missing FStar.o

Categories

(NSS :: Libraries, defect)

3.37
ARM
Unspecified
defect
Not set
normal

Tracking

(firefox-esr52 unaffected, firefox-esr60 unaffected, firefox60 unaffected, firefox61 unaffected, firefox62 unaffected)

RESOLVED FIXED
Tracking Status
firefox-esr52 --- unaffected
firefox-esr60 --- unaffected
firefox60 --- unaffected
firefox61 --- unaffected
firefox62 --- unaffected

People

(Reporter: jbeich, Assigned: glandium)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

$ cc -v
FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)
Target: armv6-unknown-freebsd11.1-gnueabihf
Thread model: posix
InstalledDir: /usr/bin

cd objdir ; sh 'nss/cmd/shlibsign/.'/sign.sh 'nss/cmd/shlibsign/../../../dist/objdir' \
'nss/cmd/shlibsign/objdir' FreeBSD \
'nss/cmd/shlibsign/../../../dist/objdir/lib' 'nss/cmd/shlibsign/../../../dist/objdir/lib/libsoftokn3.so'
nss/cmd/shlibsign/objdir/shlibsign -v -i nss/cmd/shlibsign/../../../dist/objdir/lib/libsoftokn3.so
C_Initialize failed: 0x00000030, CKR_DEVICE_ERROR                    
NSPR error code: -5977: Failure to load dynamic library
Initiailzing softoken failed: 0x00000030, CKR_DEVICE_ERROR                    
NSPR error code: -5977: Failure to load dynamic library
moduleSpec configdir='' certPrefix='' keyPrefix='' secmod='' flags=noCertDB, noModDB
gmake[3]: *** [Makefile:92: ../../../dist/objdir/lib/libsoftokn3.chk] Error 1

dist/objdir/lib/libfreeblpriv3.so: undefined reference to `FStar_UInt128_logor'
dist/objdir/lib/libfreeblpriv3.so: undefined reference to `FStar_UInt128_uint64_to_uint128'
dist/objdir/lib/libfreeblpriv3.so: undefined reference to `FStar_UInt128_shift_right'
dist/objdir/lib/libfreeblpriv3.so: undefined reference to `FStar_UInt128_shift_left'
dist/objdir/lib/libfreeblpriv3.so: undefined reference to `FStar_UInt128_uint128_to_uint64'
dist/objdir/lib/libfreeblpriv3.so: undefined reference to `FStar_UInt128_logand'
dist/objdir/lib/libfreeblpriv3.so: undefined reference to `FStar_UInt128_add_mod'

build logs:
armv6 - https://ptpb.pw/9A1w
armv7 - https://ptpb.pw/a4lY
Comment on attachment 8973854 [details] [diff] [review]
Add missing file

Review of attachment 8973854 [details] [diff] [review]:
-----------------------------------------------------------------

::: lib/freebl/Makefile
@@ +539,5 @@
>  else
>      # All non intel architectures get the generic 32 bit implementation (slow!)
>      ECL_SRCS += curve25519_32.c
> +ifndef NSS_DISABLE_CHACHAPOLY
> +        VERIFIED_SRCS += FStar.c

Ugh, looks like I didn't touch the makefiles here. We always need FStar.c now. So I suggest to remove the FStar.c above and add VERIFIED_SRCS += FStar.c below the if block.
Attachment #8973854 - Flags: review?(franziskuskiefer)
Assignee: nobody → jbeich
(In reply to Franziskus Kiefer [:fkiefer or :franziskus] from comment #2)
> We always need FStar.c now.

Is that actually true? NSS builds fine on powerpc64el and s390x without it.
I have the same failure on OpenBSD/sparc64:

cd OpenBSD6.3_64_OPT.OBJ ; sh '/usr/obj/ports/nss-3.37/nss-3.37/nss/cmd/shlibsign/.'/sign.sh '/usr/obj/ports/nss-3.37/nss-3.37/nss/cmd/shlibsign/../../../dist/OpenBSD6.3_64_OPT.OBJ' \
'/usr/obj/ports/nss-3.37/nss-3.37/nss/cmd/shlibsign/OpenBSD6.3_64_OPT.OBJ' OpenBSD \
'/usr/local/lib' '/usr/obj/ports/nss-3.37/nss-3.37/nss/cmd/shlibsign/../../../dist/OpenBSD6.3_64_OPT.OBJ/lib/libsoftokn3.so.52.0'
/usr/obj/ports/nss-3.37/nss-3.37/nss/cmd/shlibsign/OpenBSD6.3_64_OPT.OBJ/shlibsign -v -i /usr/obj/ports/nss-3.37/nss-3.37/nss/cmd/shlibsign/../../../dist/OpenBSD6.3_64_OPT.OBJ/lib/libsoftokn3.so.52.0
shlibsign:/usr/obj/ports/nss-3.37/nss-3.37/nss/cmd/shlibsign/../../../dist/OpenBSD6.3_64_OPT.OBJ/lib/libfreebl3.so.52.0: undefined symbol 'FStar_UInt128_logand'
shlibsign:/usr/obj/ports/nss-3.37/nss-3.37/nss/cmd/shlibsign/../../../dist/OpenBSD6.3_64_OPT.OBJ/lib/libfreebl3.so.52.0: undefined symbol 'FStar_UInt128_shift_right'

etcetc...
(In reply to Franziskus Kiefer [:fkiefer or :franziskus] from comment #2)
> 
> Ugh, looks like I didn't touch the makefiles here. We always need FStar.c
> now. So I suggest to remove the FStar.c above and add VERIFIED_SRCS +=
> FStar.c below the if block.

That fixes the build for me on OpenBSD/sparc64.
Comment on attachment 8973854 [details] [diff] [review]
Add missing file

FStar_* functions are only used from Hacl_Poly1305_64.c, Hacl_Poly1305_32.c, and Hacl_Curve25519.c.

FStar.c is already added when Hacl_Curve25519.c is added, which leaves the cases where Hacl_Poly1305_64.c or Hacl_Poly1305_32.c are, which is when NSS_DISABLE_CHACHAPOLY is not set. That's exactly what the patch does. If I were a NSS peer, I'd r+ this, with a nit on the formatting.
Attachment #8973854 - Flags: review?(franziskuskiefer)
Actually, FStar.c functions are *not* used when KRML_NOUINT128 is not set, that is, when HAVE_INT128_SUPPORT is.
Attachment #8973854 - Flags: review?(franziskuskiefer)
Assignee: jbeich → mh+mozilla
Attachment #8973854 - Attachment is obsolete: true
Attachment #8981028 - Flags: review?(franziskuskiefer)
Comment on attachment 8981028 [details] [diff] [review]
Build FStar.c when not building with int128 support

Review of attachment 8981028 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks.
Attachment #8981028 - Flags: review?(franziskuskiefer) → review+
https://hg.mozilla.org/projects/nss/rev/3d3e34bb75172462c7b4bbe7bd5e3e47ed65e464
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.38
Is this something that distros will patch on their own if we don't backport the fix to 3.37?
Flags: needinfo?(jbeich)
Thanks, calling this fix-optional for 61 then. If we find ourselves spinning another 3.37 release this cycle, it would be a good ride-along to take. Otherwise, we can let it go out with 3.38.
Flags: needinfo?(jbeich)
(rephrasing) After bug 1295937 Firefox no longer uses "make" to build bundled NSS, so this issue only affects standalone builds.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: