Closed Bug 1551041 Opened 5 months ago Closed 5 months ago

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

Categories

(NSS :: Libraries, defect, P1)

3.44
Other
FreeBSD
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jbeich, Assigned: jbeich)

References

(Regression)

Details

Attachments

(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
Status: NEW → ASSIGNED
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)

https://hg.mozilla.org/projects/nss/rev/370a9e85f216f5f4ff277995a997c5c9b23a819f

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: https://hg.mozilla.org/projects/nss/rev/b8d286f3f6dd720e39e94c7b558192602e021829

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

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