Missing symbols when building standalone SpiderMonkey 60 with Clang
Categories
(Core :: JavaScript Engine, defect, P2)
Tracking
()
People
(Reporter: lantw44, Assigned: ptomato)
References
(Blocks 1 open bug)
Details
Attachments
(11 files, 4 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
patch
|
Details | Diff | Splinter Review | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-esr68+
|
Details |
(deleted),
text/x-phabricator-request
|
Details | |
(deleted),
patch
|
RyanVM
:
approval-mozilla-esr68+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
RyanVM
:
approval-mozilla-esr68+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
RyanVM
:
approval-mozilla-esr68+
|
Details | Diff | Splinter Review |
Updated•7 years ago
|
Comment 4•7 years ago
|
||
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
Assignee | ||
Comment 8•7 years ago
|
||
Comment 9•7 years ago
|
||
Comment 10•7 years ago
|
||
Reporter | ||
Comment 11•6 years ago
|
||
Reporter | ||
Comment 12•6 years ago
|
||
Comment 13•6 years ago
|
||
Comment 14•6 years ago
|
||
Comment 15•6 years ago
|
||
Comment 16•6 years ago
|
||
(In reply to Steve Fink [:sfink] [:s:] from comment #15)
class JS_PUBLIC_API JSAtom;
(as in, just remove the parentheses) it seems to be happy.
Parentheses need to be removed because of the later change https://bugzilla.mozilla.org/show_bug.cgi?id=1508065 that fixed application of clang-format. Using Gjs 1.55.4 with SpiderMonkey 60.1.0 including this patch, fine so far.
Comment 17•6 years ago
|
||
Hm. Ok, not so happy. That was enough to compile one sample file, but there are many other declarations that clang gets unhappy about because the visibility doesn't match. Sadly, it does not report where they are.
Assignee | ||
Comment 18•6 years ago
|
||
Is there any testing or compiler-warning-squashing I can do to move this patch along? I'm afraid I didn't understand what the compiler was complaining about.
Reporter | ||
Comment 19•5 years ago
|
||
Sorry for the late reply. This is the updated patch which doesn't have unnecessary parentheses.
Assignee | ||
Comment 20•5 years ago
|
||
These need to be marked as public API, otherwise they are hidden by
default, and the symbols of instantiated template types using them will
not be exported when compiling with Clang.
The MFBT header forward-declares JSContext and JSObject, and since it is
included before any JSAPI headers, the visibility annotation needs to be
placed there as well.
Assignee | ||
Comment 21•5 years ago
|
||
I made a new version of the above patch that applies to master, it seems that the forward declarations of JSContext and JSObject in mfbt/RecordReplay.h are the first place those symbols are defined, which was causing the above mentioned compiler errors. Another option discussed with tcampbell would be to use void* in that header instead of forward declaring the symbols.
Assignee | ||
Comment 22•5 years ago
|
||
Well, this is no good: https://treeherder.mozilla.org/#/jobs?repo=try&revision=c15341de04f50212595892d3c070432ad1bb731f&selectedJob=265199191
I guess something else that includes RecordReplay.h also forward-declares the symbols somewhere, but not a file that gets built in the SpiderMonkey-only build so I didn't catch it when building locally... I could move RecordReplay.h to use void* but presumably the build would still fail when the other unknown forward-declaration later encounters the forward declarations in TypeDecls.h.
Any advice?
Assignee | ||
Comment 23•5 years ago
|
||
Assignee | ||
Comment 24•5 years ago
|
||
Have the public interface just use void* pointers so that we don't have to
worry about symbol visibility.
Depends on D46744
Updated•5 years ago
|
Assignee | ||
Comment 25•5 years ago
|
||
Here's my latest attempt at fixing this. What I've done is just put JS_PUBLIC_API
in front of every public API forward-declaration inside TypeDecls.h, and then everywhere else each of these declarations is forward-declared (including broken GCC guards). This seems to work except in RecordReplay.h, so I changed the API to use void*
there, in the second patch.
Try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=19a179eb34a93bf3a5b924bf71efc03bc59eef0a
Comment 26•5 years ago
|
||
Hm. The pragma goop is pretty verbose. I wonder if this is an argument for "never forward-declare any JS types yourself, always #include js/TypeDecls.h even if you only need one type." But I'm going to defer to Waldo on that, since I feel like he's dealt with our #include hairball more.
Assignee | ||
Comment 27•5 years ago
|
||
Have the public interface just use void* pointers so that we don't have to
worry about symbol visibility.
(Includes some reformatting of a macro because clang-format required it)
Assignee | ||
Comment 28•5 years ago
|
||
This macro makes any forward declarations unnecessarily verbose, and the
build system uses Clang by default anyway, except in the hazard analysis
which already specified -Wno-attributes.
Depends on D49097
Assignee | ||
Comment 29•5 years ago
|
||
Depends on D49098
Assignee | ||
Comment 30•5 years ago
|
||
As discussed on IRC a couple of weeks ago, here is a revised patchset that removes JS_BROKEN_GCC_ATTRIBUTE_WARNING
altogether. I didn't add -Wno-attributes
to the pkg-config file after all, since after bug 1539036 we now suppress compiler warnings in installed header files for embedders.
Does this still need some sort of thing in the main Firefox configure script that will add -Wno-attributes
when building Firefox with GCC?
Try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=336d9a9ecb72f28382d806c5bd35a7c5174bdd8c
Updated•5 years ago
|
Assignee | ||
Comment 31•5 years ago
|
||
This suppresses the warning for GCC builds that was previously suppressed
by the JS_BROKEN_GCC_ATTRIBUTE_WARNING macro.
Depends on D49099
Assignee | ||
Comment 32•5 years ago
|
||
Added the warning suppression for GCC builds; here's a try run that should include all of the builds that have specified FORCE_GCC: https://treeherder.mozilla.org/#/jobs?repo=try&revision=190a911e2b606f537d00092bdf05b26004260c69
Assignee | ||
Comment 33•5 years ago
|
||
Waldo, sfink: Any reservations about these four patches, or can I request checkin?
Assignee | ||
Comment 34•5 years ago
|
||
This has nothing to do with the bug, but it was driving me up the wall.
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Comment 35•5 years ago
|
||
(In reply to Philip Chimento [:ptomato] from comment #33)
Waldo, sfink: Any reservations about these four patches, or can I request checkin?
I'm happy with them.
Assignee | ||
Updated•5 years ago
|
Comment 36•5 years ago
|
||
Please rebase your patch:
Details: We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again. applying /tmp/tmpoz6Hav mfbt/RecordReplay.cpp Hunk #1 FAILED at 25. 1 out of 1 hunk FAILED -- saving rejects to file mfbt/RecordReplay.cpp.rej abort: patch command failed: exited with status 256
Assignee | ||
Comment 37•5 years ago
|
||
OK, rebased everything. Also note that D50269 depends on the other four patches even though Phabricator doesn't seem to think so.
I can't seem to add checkin-needed back again?
Comment 38•5 years ago
|
||
The "checkin-needed" tag was removed from Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1546667
You should have a "Checkin-needed" tag on Phabricator.
Tried again to land, but got this:
On Sun, October 27, 2019, 9:15 PM GMT+2, by ccoroiu@mozilla.com.
Revisions: D50269 diff 182272
Details: We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again. applying /tmp/tmpf4FJxV mfbt/RecordReplay.cpp Hunk #1 FAILED at 25. 1 out of 1 hunk FAILED -- saving rejects to file mfbt/RecordReplay.cpp.rej abort: patch command failed: exited with status 256
There are 6 patches on this bug, which are the other four?
Updated•5 years ago
|
Assignee | ||
Comment 39•5 years ago
|
||
I thought I had already abandoned the obsolete patch and it was still showing up for some reason, but it turns out I hadn't, or possibly had but hadn't pressed submit yet. There should now be only five patches, all marked checkin-needed in Phabricator, and I've also tried to add the appropriate dependencies to D50269. I hope it works now.
Assignee | ||
Updated•5 years ago
|
Comment 40•5 years ago
|
||
Still having some issues, D50269 is blocked for landing (Depends on multiple open parents)
Comment 41•5 years ago
|
||
Something went wrong in the hg history. I manually removed extra parents in phabricator and then pushed myself with Lando.
Comment 42•5 years ago
|
||
Assignee | ||
Comment 43•5 years ago
|
||
Thanks. I'm not sure what went wrong there. I'll try to use a git checkout in the future since it seems I can't wrap my head around hg.
Now that it's landed I'll go ahead and request esr68 uplift for this.
Assignee | ||
Comment 44•5 years ago
|
||
Comment on attachment 9100781 [details]
Bug 1426865 - Don't forward-declare JSContext and JSObject in RecordReplay. r=sfink
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: Affects embedders building standalone SpiderMonkey with Clang. Without these patches, an incomplete library is built.
- User impact if declined: SpiderMonkey embedders will need to apply these patches themselves in order to use standalone SpiderMonkey with Clang.
- Fix Landed on Version: 72
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): I believe the risk is low because any unforeseen regressions would show up at compile time, not at run time.
- String or UUID changes made by this patch: None
Assignee | ||
Updated•5 years ago
|
Comment 45•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9f67a98b5632
https://hg.mozilla.org/mozilla-central/rev/01c0d41a024b
https://hg.mozilla.org/mozilla-central/rev/0ae96da6fdb2
https://hg.mozilla.org/mozilla-central/rev/104b2ee49a39
https://hg.mozilla.org/mozilla-central/rev/48201e9f3338
Comment 46•5 years ago
|
||
Comment on attachment 9100781 [details]
Bug 1426865 - Don't forward-declare JSContext and JSObject in RecordReplay. r=sfink
This needs rebasing for ESR68. Not sure about the others. Please double-check and re-request approval.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 47•5 years ago
|
||
Assignee | ||
Comment 48•5 years ago
|
||
Assignee | ||
Comment 49•5 years ago
|
||
ESR Uplift Approval Request
- If this is not a sec:{high,crit} bug, please state case for ESR consideration: I've uploaded patches manually for the three revisions that didn't apply cleanly to ESR68. D49230 applies cleanly, and D50269 doesn't need backporting. See previous uplift request in this bug for rationale.
- User impact if declined:
- Fix Landed on Version:
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky):
- String or UUID changes made by this patch:
Assignee | ||
Updated•5 years ago
|
Comment 50•5 years ago
|
||
Comment on attachment 9101172 [details]
Bug 1426865 - Add -Wno-attributes to GCC builds. r?sfink,jwalden
SM embedding improvements which don't affect Firefox. Approved for 68.3esr.
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 51•5 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-esr68/rev/76b74f9a0b12
https://hg.mozilla.org/releases/mozilla-esr68/rev/5f56908fcf73
https://hg.mozilla.org/releases/mozilla-esr68/rev/41d19cabb26a
https://hg.mozilla.org/releases/mozilla-esr68/rev/f1900e751bab
Description
•