Code Monkey home page Code Monkey logo

Comments (14)

Martchus avatar Martchus commented on June 3, 2024

I never tried the combination opengl/static so it might be broken. Since I don't need it, I currently won't put much effort in it. However, the combination no-openql/static should work. Hard to tell why it is failing in your case without the log. Note that compiling static version requires having all dependencies available as static libs (including dependencies of dependencies).

Since you don't use my packages, it would be required to have the exact command line you're using.

from pkgbuilds.

DeadSix27 avatar DeadSix27 commented on June 3, 2024

Here's the whole configure line for no-openssl, I will post the error for it when it finished compiling:
I also do have all the dependencies and their dependencies compiled in this toolchain. (I think)
At least I followed the rabbit hole until everything compiled fine and did not complain. (except qt5..)

Configuring 'qt5' with:  -static -xplatform mingw-w64-g++ -optimized-qmake -verbose -opensource -confirm-license -force-pkg-config -force-debug-info -system-zlib -system-libpng -system-libjpeg -system-freetype -system-pcre -no-fontconfig -dbus-linked -no-glib -no-icu -no-harfbuzz -iconv -release -nomake examples -make tools -hostprefix /workdir/xcompilers/mingw-w64-x86_64 -hostdatadir /workdir/xcompilers/mingw-w64-x86_64/lib/qt -hostbindir /workdir/xcompilers/mingw-w64-x86_64/lib/qt/bin -prefix /workdir/xcompilers/mingw-w64-x86_64 -bindir /workdir/xcompilers/mingw-w64-x86_64/bin -archdatadir /workdir/xcompilers/mingw-w64-x86_64/lib/qt -datadir /workdir/xcompilers/mingw-w64-x86_64/share/qt -docdir /workdir/xcompilers/mingw-w64-x86_64/share/doc/qt -examplesdir /workdir/xcompilers/mingw-w64-x86_64/share/qt/examples -headerdir /workdir/xcompilers/mingw-w64-x86_64/include/qt -libdir /workdir/xcompilers/mingw-w64-x86_64/lib -plugindir /workdir/xcompilers/mingw-w64-x86_64/lib/qt/plugins -sysconfdir /workdir/xcompilers/mingw-w64-x86_64/etc -translationdir /workdir/xcompilers/mingw-w64-x86_64/share/qt/translations -device-option CROSS_COMPILE=x86_64-w64-mingw32- -device-option CROSS_COMPILE_CFLAGS=-fpch-preprocess -no-opengl -no-openssl -no-direct2d -I//workdir/xcompilers/mingw-w64-x86_64/x86_64-w64-mingw32/include/freetype2 -I//workdir/xcompilers/mingw-w64-x86_64/x86_64-w64-mingw32/include/dbus-1.0 -I//workdir/xcompilers/mingw-w64-x86_64/x86_64-w64-mingw32/lib/dbus-1.0/include

from pkgbuilds.

Martchus avatar Martchus commented on June 3, 2024

So the log for combination no-openql/static would still be required to help you.

BTW: In the other log it fails to link against opengl. Not sure why.

from pkgbuilds.

DeadSix27 avatar DeadSix27 commented on June 3, 2024

@Martchus Takes about 1-2 hours to try 1 config line :/ compiles slow...

However I got it to successfully compile with:
-no-opengl -no-direct2d -nomake examples -nomake tools -skip tools -skip declarative
declarative and tools fail, as well as direct2d and opengl.
I will give you a full log of various combination by the end of the day probably.. (like i said, it takes ages to compile...) currently trying out whether I can use the successful build and don't even need d2d/tools/opengl

from pkgbuilds.

DeadSix27 avatar DeadSix27 commented on June 3, 2024

@Martchus PS:
http://paste.ubuntu.com/24306306/
Tried using it, seems to lack some -l'flags' somewhere, not sure why or how to fix that without making a post-install patch to all pc files or something.. which seems to be the wrong attempt..

from pkgbuilds.

DeadSix27 avatar DeadSix27 commented on June 3, 2024

@Martchus Okay i went through a lot of tests and got it to compile static, with:

-no-opengl -no-direct2d -nomake examples -nomake tools -skip tools -skip declarative
And I ran into the issue that my pc files are broken, e.g:

Note, I use only 2 patches of you now, I am currently trying to find out if one of them actually fixes the broken pc files

If you wonder what is broken, it for some reason wants -lQt5Core'd' (debug I guess)
Even though I compiled -release only..
Also broken is the private/public Libs,
Public only has Libs: -L${libdir} -lQt5Cored
while that should have all the libs private has, (manually giving all those libs to Libs:, makes my test qt program compile)

prefix=/ffm/test/workdir/xcompilers/mingw-w64-x86_64
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include/qt

host_bins=${prefix}/bin
qt_config=accessibility release c++11 concurrent static stl

Name: Qt5 Core
Description: Qt Core module
Version: 5.8.0
Libs: -L${libdir} -lQt5Cored 
Libs.private: -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmpr -lwinmm -lz -lpcre16  
Cflags: -I${includedir}/QtCore -I${includedir}

from pkgbuilds.

Martchus avatar Martchus commented on June 3, 2024

while that should have all the libs private has

No, public should only have libs used in the public interface. When linking against static version, use the pkg-config option --static to get all dependencies.

If you wonder what is broken, it for some reason wants -lQt5Core'd' (debug I guess)

Yes, the d stands for debug. I use Martchus/qtbase@995313e to get rid of the 'd'. The commit message also contains an explanation.

Note that patches all of my patches for qtbase are managed under https://github.com/Martchus/qtbase/tree/5.8.0-mingw-w64. There are also forks of other Qt repos on my GitHub which also contain patches (eg. qtdeclarative).

Note, I use only 2 patches of you now

Not very helpful since I still don't know which ones.

i went through a lot of tests and got it to compile static

So how did you fix the linker errors which occured on the first attempt?

from pkgbuilds.

DeadSix27 avatar DeadSix27 commented on June 3, 2024
  • The programs that require qt5 never use --static unfortunately, a lot of things don't, don't ask me why..
  • I applied the debug suffix patch, but see bottom of this reply.
  • I fully patched qtdeclarative using your patches before, yet it fails to compile, I will retry that once I get a working compilation without that going, which I didn't yet...
  • The list of patches I use are at the bottom of this reply.
  • Which linker errors?

Latest failing compilation:

Configuration line:

-opensource -force-pkg-config -confirm-license -c++std c++11 -xplatform win32-g++ -device-option CROSS_COMPILE=x86_64-w64-mingw32- -no-use-gold-linker -release -static -hostprefix /ffm/test/workdir/xcompilers/mingw-w64-x86_64 -hostdatadir /ffm/test/workdir/xcompilers/mingw-w64-x86_64/lib/qt -hostbindir /ffm/test/workdir/xcompilers/mingw-w64-x86_64/bin -prefix /ffm/test/workdir/xcompilers/mingw-w64-x86_64 -bindir /ffm/test/workdir/xcompilers/mingw-w64-x86_64/bin -archdatadir /ffm/test/workdir/xcompilers/mingw-w64-x86_64/lib/qt -datadir /ffm/test/workdir/xcompilers/mingw-w64-x86_64/share/qt -docdir /ffm/test/workdir/xcompilers/mingw-w64-x86_64/share/doc/qt -examplesdir /ffm/test/workdir/xcompilers/mingw-w64-x86_64/share/qt/examples -headerdir /ffm/test/workdir/xcompilers/mingw-w64-x86_64/include/qt -libdir /ffm/test/workdir/xcompilers/mingw-w64-x86_64/lib -plugindir /ffm/test/workdir/xcompilers/mingw-w64-x86_64/lib/qt/plugins -sysconfdir /ffm/test/workdir/xcompilers/mingw-w64-x86_64/etc -translationdir /ffm/test/workdir/xcompilers/mingw-w64-x86_64/share/qt/translations -no-icu -opengl desktop -no-glib -accessibility -nomake examples -nomake tests -system-zlib -system-libjpeg -no-pch -no-dbus -no-direct2d -no-openssl

List of patches as of the latest try:

('https://gist.github.com/DeadSix27/e42b67b1deee11dbcc6213e79441799d','p1','qtbase'),
('https://raw.githubusercontent.com/mxe/mxe/master/src/qtwinextras-1.patch','p1','qtwinextras'),
('https://raw.githubusercontent.com/mxe/mxe/master/src/qtactiveqt-1.patch','p1','qtactiveqt'),		
('https://raw.githubusercontent.com/Martchus/PKGBUILDs/master/qt5-base/mingw-w64-static/0005-Make-sure-.pc-files-are-installed-correctly.patch'         ,'p1','qtbase'),
('https://raw.githubusercontent.com/Martchus/PKGBUILDs/master/qt5-base/mingw-w64-static/0007-Prevent-debug-library-names-in-pkg-config-files.patch'     ,'p1','qtbase'),
('https://raw.githubusercontent.com/Martchus/PKGBUILDs/master/qt5-base/mingw-w64-static/0012-Fix-linking-against-static-pcre.patch'                     ,'p1','qtbase'),
('https://raw.githubusercontent.com/Martchus/PKGBUILDs/master/qt5-base/mingw-w64-static/0020-Use-.dll.a-as-import-lib-extension.patch'                  ,'p1','qtbase'),
('https://raw.githubusercontent.com/Martchus/PKGBUILDs/master/qt5-base/mingw-w64-static/0030-Prevent-qmake-from-messing-static-lib-dependencies.patch'  ,'p1','qtbase'),

Error:

x86_64-w64-mingw32-g++ -Wl,--gc-sections -Wl,-s -Wl,-subsystem,console -o ../../../bin/idc.exe .obj/release/main.o .obj/release/idc_plugin_import.o  -L/ffm/test/workdir/x86_64/qt-everywhere-opensource-src-5.8.0/qtbase/lib /ffm/test/workdir/x86_64/qt-everywhere-opensource-src-5.8.0/qtbase/lib/libQt5Gui.a -lcomdlg32 -lqtlibpng -lqtharfbuzz /ffm/test/workdir/x86_64/qt-everywhere-opensource-src-5.8.0/qtbase/lib/libQt5Core.a -lws2_32 -lkernel32 -lmpr -lpcre16 -L/ffm/test/workdir/x86_64/qt-everywhere-opensource-src-5.8.0/qtbase/plugins/platforms /ffm/test/workdir/x86_64/qt-everywhere-opensource-src-5.8.0/qtbase/plugins/platforms/libqwindows.a -ldwmapi -lole32 -lwinspool -limm32 -lwinmm -loleaut32 -luuid -lshlwapi -lshell32 -ladvapi32 -lQt5EventDispatcherSupport -lQt5AccessibilitySupport -lQt5FontDatabaseSupport -lQt5ThemeSupport -lqtfreetype -L/ffm/test/workdir/x86_64/qt-everywhere-opensource-src-5.8.0/qtimageformats/plugins/imageformats /ffm/test/workdir/x86_64/qt-everywhere-opensource-src-5.8.0/qtimageformats/plugins/imageformats/libqicns.a /ffm/test/workdir/x86_64/qt-everywhere-opensource-src-5.8.0/qtimageformats/plugins/imageformats/libqtga.a /ffm/test/workdir/x86_64/qt-everywhere-opensource-src-5.8.0/qtimageformats/plugins/imageformats/libqtiff.a -lz /ffm/test/workdir/x86_64/qt-everywhere-opensource-src-5.8.0/qtimageformats/plugins/imageformats/libqwbmp.a /ffm/test/workdir/x86_64/qt-everywhere-opensource-src-5.8.0/qtimageformats/plugins/imageformats/libqwebp.a -L/ffm/test/workdir/x86_64/qt-everywhere-opensource-src-5.8.0/qtbase/plugins/imageformats /ffm/test/workdir/x86_64/qt-everywhere-opensource-src-5.8.0/qtbase/plugins/imageformats/libqgif.a /ffm/test/workdir/x86_64/qt-everywhere-opensource-src-5.8.0/qtbase/plugins/imageformats/libqico.a /ffm/test/workdir/x86_64/qt-everywhere-opensource-src-5.8.0/qtbase/plugins/imageformats/libqjpeg.a -lglu32 -lopengl32 -lgdi32 -luser32 -lQt5Gui -lQt5Core -ljpeg 
x86_64-w64-mingw32-g++: error: /ffm/test/workdir/x86_64/qt-everywhere-opensource-src-5.8.0/qtimageformats/plugins/imageformats/libqwebp.a: No such file or directory
Makefile.Release:62: recipe for target '../../../bin/idc.exe' failed

from pkgbuilds.

Martchus avatar Martchus commented on June 3, 2024

Which linker errors?

I was referring to errors like undefined reference to pcre16_exec'` in http://paste.ubuntu.com/24306306.

In the last error you're not using my mingw-w64 profile. Obviously libqwebp.a can not be found. This plugin is part of the image format plugins (the package mingw-w64-qt5-imageformats in my case). Not sure why it is required in your case (my mingw-w64-qt5-activeqt builds without it). But do you really need the ActiveX module? If not, just don't build it.

don't ask me why

Maybe linking against static Qt is not supported by that particular application then. Note that using static Qt might require some extra work (eg. linking against the required static plugins, ensuring resources aren't dropped, ...).

from pkgbuilds.

DeadSix27 avatar DeadSix27 commented on June 3, 2024

About the linker errors:
I think that was the same issue, the program not using --static in pkgconfig thus ofc the pcre lib isnt added to LD causing those undefined references. But i honestly can't remember anymore.

I further reduced the patches required (see bottom)
Compiles fine, however as you and I stated in the previous posts, it fails linking in the final product because of the shared/static pcfile stuff.
I wonder if I can patch the product using it... either way that program exists with statically linked qt5 too so it must be possible.. idk how tho. Ill further look into it.
Maybe I just derped and didn't see a static option somewhere.. very likely (Qt stuff was always stressing to deal with..)
EDIT: you know.. something like.. --enable-static-qt........

On a side note, same configuration line as before, but as I mentioned less patches.

('[that gist patch from before].','p1','qtbase'),
('https://raw.githubusercontent.com/mxe/mxe/master/src/qtwinextras-1.patch','p1','qtwinextras'),
('https://raw.githubusercontent.com/mxe/mxe/master/src/qtactiveqt-1.patch','p1','qtactiveqt'),		
('https://raw.githubusercontent.com/Martchus/PKGBUILDs/master/qt5-base/mingw-w64-static/0005-Make-sure-.pc-files-are-installed-correctly.patch'         ,'p1','qtbase'),
('https://raw.githubusercontent.com/Martchus/PKGBUILDs/master/qt5-base/mingw-w64-static/0007-Prevent-debug-library-names-in-pkg-config-files.patch'     ,'p1','qtbase'),
('https://raw.githubusercontent.com/Martchus/PKGBUILDs/master/qt5-base/mingw-w64-static/0012-Fix-linking-against-static-pcre.patch'                     ,'p1','qtbase'),

EDIT2

About the other issues with qt5 itself, I do not need ActiveX, I can just disable it ye..
Nor do I even know what declarative is, probably won't need it either.
BUT I do need OpenGL or Angle, either of them

from pkgbuilds.

DeadSix27 avatar DeadSix27 commented on June 3, 2024

Martchus The above patchlist is the final one, beside that I only added -make tools
But theres still one think I can not get to compile Qt5PlatformSupport, any how to compile that? theres no configuration line for it..

EDIT: That seems to get ignored but is needed by another program:

libqwindows.a(qwindowsbackingstore.o):qwindowsbackingstore.cpp:(.text+0x195): undefined reference to `QWindowsNativeImage::~QWindowsNativeImage()'
libqwindows.a(qwindowsbackingstore.o):qwindowsbackingstore.cpp:(.text+0x2c7): undefined reference to `QWindowsNativeImage::QWindowsNativeImage(int, int, QImage::Format)'
libqwindows.a(qwindowsbackingstore.o):qwindowsbackingstore.cpp:(.text+0x2f7): undefined reference to `QWindowsNativeImage::~QWindowsNativeImage()'
libqwindows.a(qwindowsbackingstore.o):qwindowsbackingstore.cpp:(.text+0x4f3): undefined reference to `QWindowsNativeImage::systemFormat()'
libqwindows.a(qwindowscontext.o):qwindowscontext.cpp:(.text+0x27f7): undefined reference to `QWindowsGuiEventDispatcher::windowsMessageName(unsigned int)'
libqwindows.a(qwindowscontext.o):qwindowscontext.cpp:(.text$_ZN15QWindowsContext11windowsProcEP6HWND__jN9QtWindows16WindowsEventTypeEyxPx[_ZN15QWindowsContext11windowsProcEP6HWND__jN9QtWindows16WindowsEventT                                                                                                  ypeEyxPx]+0x870): undefined reference to `QWindowsGuiEventDispatcher::windowsMessageName(unsigned int)'
libqwindows.a(qwindowsintegration.o):qwindowsintegration.cpp:(.text+0xd6): undefined reference to `QWindowsFontDatabase::QWindowsFontDatabase()'

from pkgbuilds.

Martchus avatar Martchus commented on June 3, 2024

That seems to get ignored but is needed by another program

Of course, because building the static library itself does not involve linking and hence can not cause linker errors. Linking is done when building the final application where likely a linker flag for a library is missing.

Note that the concerning library is a plugin. I'm not sure pkg-config for building Qt applications but linking against static plugins might not work out-of-the-box with it.

BTW:

  • What is the application you want to build?
  • What do you need ANGLE for when not for Qt Quick (part of qtdeclarative repo)?

from pkgbuilds.

DeadSix27 avatar DeadSix27 commented on June 3, 2024

@Martchus turns out Qt5PlatformSupport was modulized into a few other libraries, adding them to build process as well as some other windows libs made the program compile fine, also OpenGL desktop compiles too, so no need for ANGLE ?

from pkgbuilds.

Martchus avatar Martchus commented on June 3, 2024

Have a look at http://doc.qt.io/qt-5/windows-requirements.html and https://wiki.qt.io/Qt_5_on_Windows_ANGLE_and_OpenGL for more info about ANGLE.

Since you managed to build, I suppose I can close the ticket.

from pkgbuilds.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.