Closed Bug 1352236 Opened 7 years ago Closed 7 years ago

Build error on other architectures: value not declared in scope

Categories

(Core :: JavaScript Engine, defect)

45 Branch
Other
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: cgrobertson, Assigned: cgrobertson)

Details

Attachments

(1 file)

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).
Severity: blocker → normal
Component: General → JavaScript Engine
Product: Firefox → Core
Attachment #8853147 - Flags: review?(luke)
Attachment #8853147 - Flags: review?(luke) → review+
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)
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
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
https://hg.mozilla.org/mozilla-central/rev/18e8f6994472
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: