Build error on other architectures: value not declared in scope

RESOLVED FIXED in Firefox 55

Status

()

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: cgrobertson, Assigned: cgrobertson)

Tracking

45 Branch
mozilla55
Other
Linux
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
Created attachment 8853147 [details] [diff] [review]
Suggested patch: firefox-glibc-getrandom.patch

Building Firefox 52.0.0 ESR on ppc64le and s390x architectures causes compiler error compiling js/src/jsmath.cpp:

[ 3174s] /home/abuild/rpmbuild/BUILD/mozilla/js/src/jsmath.cpp: In function 'uint64_t js::GenerateRandomSeed()':
[ 3174s] /home/abuild/rpmbuild/BUILD/mozilla/js/src/jsmath.cpp:82:25: error: 'GETRANDOM_NR' was not declared in this scope
[ 3174s]  #  define SYS_getrandom GETRANDOM_NR
[ 3174s]                          ^
[ 3174s] /home/abuild/rpmbuild/BUILD/mozilla/js/src/jsmath.cpp:728:23: note: in expansion of macro 'SYS_getrandom'
[ 3174s]      int ret = syscall(SYS_getrandom, &seed, sizeof(seed), GRND_NONBLOCK);
[ 3174s]                        ^
[ 3175s] /home/abuild/rpmbuild/BUILD/mozilla/config/rules.mk:951: recipe for target 'jsmath.o' failed
[ 3175s] make[5]: *** [jsmath.o] Error 1

When looking at the code it shows 'GETRANDOM_NR' is only declared for x86_64, i386, and arm procs. We have a case where we build against the older GLIBC (v2.19) which does not define 'SYS_getrandom' so this code fails to build.

See bug 995069.

I have attached a suggested patch (which works for us).

Updated

2 years ago
Severity: blocker → normal
Component: General → JavaScript Engine
Product: Firefox → Core

Updated

2 years ago
Attachment #8853147 - Flags: review?(luke)

Updated

2 years ago
Attachment #8853147 - Flags: review?(luke) → review+

Comment 1

2 years ago
This probably needs help to land - Luke, does this need a trypush? If yes, can you do one, if no, can you set checkin-needed? Thanks!
Flags: needinfo?(luke)

Comment 2

2 years ago
This shouldn't affect any tier-1 builds, so I think it's ready to check in.
Flags: needinfo?(luke)
Whiteboard: checkin-needed
Assignee: nobody → cgrobertson

Comment 3

2 years ago
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/18e8f6994472
Work around missing GETRANDOM_NR when building against older versions of glibc. r=luke
Whiteboard: checkin-needed

Comment 4

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/18e8f6994472
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.