Closed Bug 1551041 Opened 2 years ago Closed 1 year ago

Fails to build with GCC < 4.3 on big-endian architectures


(NSS :: Libraries, defect, P1)



(Not tracked)



(Reporter: jbeich, Assigned: jbeich)





(1 file)

If __has_builtin returns 0 on big-endian the following may happen:

crypto_primitives.c:31:17: error: use of undeclared identifier 'SHA_MASK8'
t1 = ((t1 & SHA_MASK8) << 8) | ((t1 >> 8) & SHA_MASK8);
crypto_primitives.c:31:49: error: use of undeclared identifier 'SHA_MASK8'
t1 = ((t1 & SHA_MASK8) << 8) | ((t1 >> 8) & SHA_MASK8);
crypto_primitives.c:32:17: error: use of undeclared identifier 'SHA_MASK16'
t1 = ((t1 & SHA_MASK16) << 16) | ((t1 >> 16) & SHA_MASK16);
crypto_primitives.c:32:52: error: use of undeclared identifier 'SHA_MASK16'
t1 = ((t1 & SHA_MASK16) << 16) | ((t1 >> 16) & SHA_MASK16);

Found on FreeBSD powerpc64 which defaults to GCC 4.2. See Also has build log.

Attached patch fixSplinter Review
Attachment #9064282 - Flags: review?(mt)
No longer blocks: 1536734
Regressed by: 1536734

i can confirm that the patch fixes the build on OpenBSD/macppc using gcc 4.2.1

Jan, are you going to need a 3.44 dot release for FreeBSD for this?

Assignee: nobody → jbeich
Priority: -- → P1

(In reply to J.C. Jones [:jcj] (he/him) from comment #3)
No as big-endian architectures with modern GCC are not affected. FreeBSD powerpc64 uses GCC 8 and system NSS when building Firefox. Carrying the fix downstream until 3.45 or unrelated 3.44.1 would be fine. As ESR68 will require 3.44 and ESR60 prolonged 3.36.* in the past there's high probability 3.44.1 may happen for other reasons. So, let's put the fix on that bandwagon instead.

In short, backport to NSS_3_44_BRANCH but don't bother releasing 3.44.1 just for this bug.

Martin, do any PkgSrc platforms use GCC < 4.3 by default? Which version is used on NetBSD sparc64 and powerpc?

Flags: needinfo?(martin)

Pkgsrc forces at least gcc 6.1 for firefox nowadays

Flags: needinfo?(martin)

(In reply to Martin Husemann from comment #6)
What version is used to build standalone/system NSS i.e., devel/nss package?

Flags: needinfo?(martin)

Indeed that might be build using the users default compiler settings (but on some OS we force pkgsrc gcc, which liklely is a new enough version nowadays).
No supported NetBSD release uses a compiler old enough for this issue (4.8.x is the oldest), but I can not clearly rule out strange user setups running into the issue. My guess is they are not very likely to exist in big counts in reality though.

Flags: needinfo?(martin)

I landed this on trunk (3.45). Do you need this for 3.44? I can do that, but I don't know if the above discussion indicates that you don't need it.

Flags: needinfo?(jbeich)
Target Milestone: --- → 3.45
Attachment #9064282 - Flags: review?(mt) → review+

(In reply to Martin Thomson [:mt:] from comment #9)

Do you need this for 3.44?

Yes. Please, backport to NSS_3_44_BRANCH.

Flags: needinfo?(jbeich) → needinfo?(mt)

3.44 backport:

It'll be there as a ridelong for the next point release.

Flags: needinfo?(mt)
Closed: 1 year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.