Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-qt/qtscript LTO build fix #32

Closed
pchome opened this issue Oct 9, 2017 · 6 comments
Closed

dev-qt/qtscript LTO build fix #32

pchome opened this issue Oct 9, 2017 · 6 comments

Comments

@pchome
Copy link
Contributor

pchome commented Oct 9, 2017

Based on https://bugs.webkit.org/show_bug.cgi?id=56088

--- a/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.h 2017-10-09 14:40:55.050363361 +0300
+++ b/src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.h 2017-10-09 14:45:50.271354448 +0300
@@ -316,7 +316,7 @@
     EncodedJSValue JIT_STUB cti_op_to_primitive(STUB_ARGS_DECLARATION);
     EncodedJSValue JIT_STUB cti_op_typeof(STUB_ARGS_DECLARATION);
     EncodedJSValue JIT_STUB cti_op_urshift(STUB_ARGS_DECLARATION);
-    EncodedJSValue JIT_STUB cti_vm_throw(STUB_ARGS_DECLARATION);
+    EncodedJSValue JIT_STUB cti_vm_throw(STUB_ARGS_DECLARATION) __attribute__((used));
     EncodedJSValue JIT_STUB cti_to_object(STUB_ARGS_DECLARATION);
     JSObject* JIT_STUB cti_op_construct_JSConstruct(STUB_ARGS_DECLARATION);
     JSObject* JIT_STUB cti_op_new_array(STUB_ARGS_DECLARATION);

I don't tested it further but at least it builds w/ this patch in /etc/portage/patches/dev-qt/qtscript/

@pchome
Copy link
Contributor Author

pchome commented Oct 9, 2017

Ok, I played a little with Qt-5.9.2 today and finally it full LTOed for me.

Here the installed packages list:

$ eix -I --only-names dev-qt/*
dev-qt/designer
dev-qt/linguist-tools
dev-qt/qdbus
dev-qt/qtchooser
dev-qt/qtconcurrent
dev-qt/qtcore
dev-qt/qtdbus
dev-qt/qtdeclarative
dev-qt/qtgraphicaleffects
dev-qt/qtgui
dev-qt/qtimageformats
dev-qt/qtlockedfile
dev-qt/qtmultimedia
dev-qt/qtnetwork
dev-qt/qtopengl
dev-qt/qtpaths
dev-qt/qtprintsupport
dev-qt/qtquickcontrols
dev-qt/qtquickcontrols2
dev-qt/qtscript
dev-qt/qtsingleapplication
dev-qt/qtsql
dev-qt/qtsvg
dev-qt/qttest
dev-qt/qtwayland
dev-qt/qtwidgets
dev-qt/qtx11extras
dev-qt/qtxml
dev-qt/qtxmlpatterns

Notes:

  • some packages affected by strip problem so I tested STRIP_MASK="*.a" env var on them and this trick fixes build (dev-qt/qtdeclarative used by dev-qt/linguist-tools and dev-qt/qtgui used by dev-qt/qtwayland).
    It's like FEATURES="${FEATURES} nostrip" but only *.a files remain unstripped after installation (checked) + ( https://forums.gentoo.org/viewtopic-p-8124664-highlight-stripmask.html?sid=348bc8f7ccf9d0798f0366ff43423f01#8124664 ).
  • dev-qt/qtscript patched
  • dev-qt/qtwidgets build problem w/ USE=gtk ( https://archives.gentoo.org/gentoo-user/message/f84142041a4c836698411687db50a053 )
  • dev-qt/qtcore *FLAGS ignored while cmake/* directory make process which leads to no-LTO objects linking w/ -flto later. While all *FLAGS redefined there the EXTRA_CXXFLAGS and EXTRA_LFLAGS not used and still available:
    CXXFLAGS = $(EXTRA_CXXFLAGS) $(CONFIG_CXXFLAGS) $(CPPFLAGS)
    LFLAGS = $(EXTRA_LFLAGS) $(CONFIG_LFLAGS)
    So adding them to env did the trick:
    EXTRA_CXXFLAGS="${CXXFLAGS}"
    EXTRA_LFLAGS="${LDFLAGS}"
  • dev-qt/qtcore w/ STRIP_MASK="*.a" as it contains *.a files, but seems still not required by currently installed packages.

FYI

@InBetweenNames
Copy link
Owner

While I'm not convinced that the lack of a strip plugin is a problem as of yet, I do find this very encouraging. It sounds like a couple more upstream patches would get all of Qt built using LTO. Nicely done! I'll leave this issue open for more discussion on this.

@pchome
Copy link
Contributor Author

pchome commented Oct 11, 2017

dev-qt/designer is one more package I need to rebuild w/ STRIP_MASK="*.a" for kde-plasma/kwin-5.11.0::kde
So I decided to add STRIP_MASK="*.a" in my make.conf and the only package.env redefinitions left is:

dev-qt/qtcore +extra-flags-var
net-misc/openssh -lto
media-sound/pulseaudio +cv-linker-pipe

done:
$ grep flto /var/db/pkg/*/*/CFLAGS | wc -l
340
todo:
$ grep -v flto /var/db/pkg/*/*/CFLAGS | wc -l
687

InBetweenNames added a commit that referenced this issue Oct 21, 2017
Increment ltoize version number for qtscript patch

Package-Manager: Portage-2.3.12, Repoman-2.3.3
@InBetweenNames
Copy link
Owner

With the info here, I was able to reproduce this. Only two exceptions (not listed here): qtwebkit and qtwebengine.

@InBetweenNames
Copy link
Owner

qtscript LTO fix works on 5.11.2, it has been re-enabled in master.

InBetweenNames added a commit that referenced this issue Oct 28, 2018
This reverts commit 368af73.

The qtscript patch causes crashes in kwin.  Needs more investigating.

Address #32

Signed-off-by: Shane Peelar <[email protected]>
@InBetweenNames
Copy link
Owner

Had to revert the LTO fix again -- it was causing crashes in kwin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants