RESOLVED FIXED 222860
[WPE] Reenable -fvisibility=hidden and -fvisibility-inlines-hidden
https://bugs.webkit.org/show_bug.cgi?id=222860
Summary [WPE] Reenable -fvisibility=hidden and -fvisibility-inlines-hidden
Michael Catanzaro
Reported 2021-03-06 06:33:44 PST
This is a follow-up from bug #181916. We should just need to add this to OptionsWPE.cmake: set(CMAKE_C_VISIBILITY_PRESET hidden) set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) But first we need to add more exports until it builds. E.g. the entire QtWPE API is not exported.
Attachments
Patch (1.31 KB, patch)
2021-10-07 10:17 PDT, Michael Catanzaro
no flags
Patch (12.64 KB, patch)
2021-10-08 07:16 PDT, Philippe Normand
ews-feeder: commit-queue-
Patch (5.60 KB, patch)
2021-10-15 03:20 PDT, Carlos Garcia Campos
don.olmstead: review+
Patch for landing (6.75 KB, patch)
2021-10-20 02:42 PDT, Carlos Garcia Campos
ews-feeder: commit-queue-
Patch for landing (7.70 KB, patch)
2021-10-20 05:34 PDT, Carlos Garcia Campos
no flags
Philippe Normand
Comment 1 2021-03-09 12:15:20 PST
WDYT Adrian?
Michael Catanzaro
Comment 2 2021-10-01 13:37:16 PDT
In https://bugs.webkit.org/show_bug.cgi?id=181916#c58 Carlos Lopez found that -fvisibility=hidden resulted in a major performance improvement for GTK. I would expect similar improvement for WPE. WPE used to use -fvisibility=hidden until I removed it stupidly in r224642. I assumed it was redundant with using a linker version script, but in fact we really want both. Sorry about that.
Michael Catanzaro
Comment 3 2021-10-07 10:16:16 PDT
(In reply to Michael Catanzaro from comment #0) > But first we need to add more exports until it builds. E.g. the entire QtWPE > API is not exported. I'm not sure that's true anymore, I see some classes are exported now. Anyway, I failed to build QtWPE due to bug #231369. The rest of WPE build successfully. Let's see if the EWS is happy.
Michael Catanzaro
Comment 4 2021-10-07 10:17:17 PDT
Michael Catanzaro
Comment 5 2021-10-07 10:53:38 PDT
Comment on attachment 440506 [details] Patch Looks like the QtWPE API does indeed need more work.
Philippe Normand
Comment 6 2021-10-07 13:38:46 PDT
Naive build fix: http://sprunge.us/pYbFZg
Michael Catanzaro
Comment 7 2021-10-07 13:55:36 PDT
(In reply to Philippe Normand from comment #6) > Naive build fix: http://sprunge.us/pYbFZg Cool, thanks. Except WPEQtViewLoadRequest.h is public API, so we can't use WebKit internals there. That will break the public headers since WKDeclarationSpecifiers.h is not installed. Looks like we should use Q_DECL_EXPORT there.
Michael Catanzaro
Comment 8 2021-10-07 13:58:38 PDT
(In reply to Michael Catanzaro from comment #7) > Except WPEQtViewLoadRequest.h is public API, so we can't use WebKit > internals there. That will break the public headers since > WKDeclarationSpecifiers.h is not installed. Looks like we should use > Q_DECL_EXPORT there. Wait, WPEQtView.h is public too, of course, so we should use Q_DECL_EXPORT there too. But that header is actually already using GRefPtr.h. How is that possible? GRefPtr.h is not a public header and should not be installed, but WPEQtView.h is installed. ?????????
Philippe Normand
Comment 9 2021-10-08 06:59:07 PDT
(In reply to Michael Catanzaro from comment #7) > (In reply to Philippe Normand from comment #6) > > Naive build fix: http://sprunge.us/pYbFZg > > Cool, thanks. > > Except WPEQtViewLoadRequest.h is public API, so we can't use WebKit > internals there. That will break the public headers since > WKDeclarationSpecifiers.h is not installed. Looks like we should use > Q_DECL_EXPORT there. Good point! (In reply to Michael Catanzaro from comment #8) > (In reply to Michael Catanzaro from comment #7) > > Except WPEQtViewLoadRequest.h is public API, so we can't use WebKit > > internals there. That will break the public headers since > > WKDeclarationSpecifiers.h is not installed. Looks like we should use > > Q_DECL_EXPORT there. > > Wait, WPEQtView.h is public too, of course, so we should use Q_DECL_EXPORT > there too. But that header is actually already using GRefPtr.h. How is that > possible? GRefPtr.h is not a public header and should not be installed, but > WPEQtView.h is installed. ????????? I think that means no one tried to use this API. The couple folks I heard from were using the QML modules, not the C++ API.
Philippe Normand
Comment 10 2021-10-08 07:16:31 PDT
Michael Catanzaro
Comment 11 2021-10-08 07:30:46 PDT
Comment on attachment 440603 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=440603&action=review > Source/cmake/OptionsWPE.cmake:151 > +set(CMAKE_C_VISIBILITY_PRESET hidden) > +set(CMAKE_CXX_VISIBILITY_PRESET hidden) > +set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) Let's land this in two steps: (1) Everything except this portion of the diff, r=me (2) This part, in a second commit. That way, we don't have to revert (1) if it turns out there is some problem caused by (2).
Philippe Normand
Comment 12 2021-10-08 07:38:58 PDT
Alright, I'll fork in a separate bug!
Philippe Normand
Comment 13 2021-10-08 07:44:11 PDT
(In reply to Philippe Normand from comment #12) > Alright, I'll fork in a separate bug! https://bugs.webkit.org/show_bug.cgi?id=231430
Michael Catanzaro
Comment 14 2021-10-08 12:09:59 PDT
So only remaining problem is we need to export WebKit::TextChecker::setContinuousSpellCheckingEnabled for WKTR, but for some reason this breaks the iOS build. It might be doing some sort of check to ensure that all exported symbols correspond to something in a public header, which is pretty strict. Proposal: let's create and export WKTextCheckerSetContinuousSpellCheckingEnabled instead. It already exists on GTK, and we can easily add a WPE version.
Michael Catanzaro
Comment 15 2021-10-08 13:35:51 PDT
(In reply to Michael Catanzaro from comment #14) > Proposal: let's create and export > WKTextCheckerSetContinuousSpellCheckingEnabled instead. It already exists on > GTK, and we can easily add a WPE version. Bug #231446
EWS
Comment 16 2021-10-10 14:28:49 PDT
Committed r283878 (242755@main): <https://commits.webkit.org/242755@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 440506 [details].
WebKit Commit Bot
Comment 17 2021-10-14 05:28:01 PDT
Re-opened since this is blocked by bug 231735
Carlos Garcia Campos
Comment 18 2021-10-15 03:20:30 PDT
Carlos Garcia Campos
Comment 19 2021-10-15 04:03:35 PDT
I ran speedometer after and before this patch: score before: 118 score after: 139
Michael Catanzaro
Comment 20 2021-10-15 08:11:24 PDT
Comment on attachment 441358 [details] Patch This needs to be reviewed by Don. I suspect he's not going to like this because WEBKIT_FRAMEWORKS ought to be handling this.
Carlos Garcia Campos
Comment 21 2021-10-16 02:05:46 PDT
(In reply to Michael Catanzaro from comment #20) > Comment on attachment 441358 [details] > Patch > > This needs to be reviewed by Don. I suspect he's not going to like this > because WEBKIT_FRAMEWORKS ought to be handling this. I did my best, but I don't understand CMake, I tried to use frameworks everywhere, but for some reason WebKitTestRunner_FRAMEWORKS didn't work, so I added JavaScriptCore directly to LIBRARIES since for WPE it's always built as object in this patch.
Carlos Garcia Campos
Comment 22 2021-10-19 02:47:13 PDT
(In reply to Michael Catanzaro from comment #20) > Comment on attachment 441358 [details] > Patch > > This needs to be reviewed by Don. I suspect he's not going to like this > because WEBKIT_FRAMEWORKS ought to be handling this. Don? Could you review this, please?
Don Olmstead
Comment 23 2021-10-19 10:32:21 PDT
Comment on attachment 441358 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=441358&action=review LGTM with a couple potential nits. > Source/WebKit/PlatformWPE.cmake:451 > + $<TARGET_PROPERTY:JavaScriptCore,INCLUDE_DIRECTORIES> I feel like you'd want something more specific for this. This means its getting ALL include directories from JavaScriptCore. > Tools/WebKitTestRunner/PlatformWPE.cmake:30 > + $<TARGET_OBJECTS:JavaScriptCore> > + $<TARGET_OBJECTS:bmalloc> I'm surprised these are needed since WebKitTestRunner uses _FRAMEWORKS can you maybe double check this? > Tools/WebKitTestRunner/PlatformWPE.cmake:40 > + $<TARGET_OBJECTS:JavaScriptCore> > + $<TARGET_OBJECTS:bmalloc> This one isn't surprising as the InjectedBundle stuff didn't get the _FRAMEWORKS treatment.
Carlos Garcia Campos
Comment 24 2021-10-20 01:37:50 PDT
(In reply to Don Olmstead from comment #23) > Comment on attachment 441358 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=441358&action=review > > LGTM with a couple potential nits. > > > Source/WebKit/PlatformWPE.cmake:451 > > + $<TARGET_PROPERTY:JavaScriptCore,INCLUDE_DIRECTORIES> > > I feel like you'd want something more specific for this. This means its > getting ALL include directories from JavaScriptCore. I copy-pasted :-P I'll try to use something more specific. > > Tools/WebKitTestRunner/PlatformWPE.cmake:30 > > + $<TARGET_OBJECTS:JavaScriptCore> > > + $<TARGET_OBJECTS:bmalloc> > > I'm surprised these are needed since WebKitTestRunner uses _FRAMEWORKS can > you maybe double check this? Yes, I tried everything and the only thing that worked was manually adding the libraries. I don't understand why. > > Tools/WebKitTestRunner/PlatformWPE.cmake:40 > > + $<TARGET_OBJECTS:JavaScriptCore> > > + $<TARGET_OBJECTS:bmalloc> > > This one isn't surprising as the InjectedBundle stuff didn't get the > _FRAMEWORKS treatment.
Carlos Garcia Campos
Comment 25 2021-10-20 02:42:33 PDT
Created attachment 441862 [details] Patch for landing
Carlos Garcia Campos
Comment 26 2021-10-20 02:46:46 PDT
I managed to use FRAMEWORKS for WTR, it was indeed already used, but for some reason I had to remove WebKit and WebCoreTestSupport, I guess they aren't actually needed because they are already in TestRunnerShared lib
Carlos Garcia Campos
Comment 27 2021-10-20 05:34:31 PDT
Created attachment 441871 [details] Patch for landing
Carlos Garcia Campos
Comment 28 2021-10-20 06:14:34 PDT
Note You need to log in before you can comment on or make changes to this bug.