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

WIP: Fix VLC build process #2673

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

woot000
Copy link
Contributor

@woot000 woot000 commented May 9, 2024

This PR attempts to fix the currently broken VLC build process. Some notable changes include switching from Qt 5 to Qt 6, switching from fxc2 to efxc, building abseil-cpp (new requirement of protobuf), building freetype, harfbuzz, and libpng for Qt 6, and building openjpeg2, fontconfig, libass, libogg, and ffmpeg 6.1 for VLC.

Much of the changes are based directly off of VLC's contrib build scripts.

Submitting as a draft because only 64-bit gcc compilation completes sucessfully. There are some problems that need to be addressed before this PR should be merged:

  • 32-bit compilation (both clang32 and mingw32) is broken due to an error in qtdeclarative:
FAILED: src/quick/.qsb/scenegraph/shaders_ng/32bitcolortext.frag.qsb C:/m/build/qtdeclarative-git/build-32bit/src/quick/.qsb/scenegraph/shaders_ng/32bitcolortext.frag.qsb 
C:\Windows\system32\cmd.exe /C "cd /D C:\m\build\qtdeclarative-git\build-32bit\src\quick && C:\m\local32\bin\qsb.exe --glsl 100es,120,150 --hlsl 50 --msl 12 -b -c -O -s -o C:/m/build/qtdeclarative-git/build-32bit/src/quick/.qsb/scenegraph/shaders_ng/32bitcolortext.frag.qsb C:/m/build/qtdeclarative-git/src/quick/scenegraph/shaders_ng/32bitcolortext.frag"

(also for some reason qtdeclarative builds with only one job in 32-bit even though more than one is specified???)

  • 64-bit Clang compilation is broken due to an error in protobuf:
ld.lld: error: undefined symbol: __start_pb_defaults
>>> referenced by libprotobuf.a(generated_message_util.cc.o):(.refptr.__start_pb_defaults)

ld.lld: error: undefined symbol: __stop_pb_defaults
>>> referenced by libprotobuf.a(generated_message_util.cc.o):(.refptr.__stop_pb_defaults)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

I'm not sure what the cause of this error is or how to go about fixing it. I assume this error stems from the recent implementation of clang32/64 in the suite, though that's just a hunch.

  • Qt 6 compilation fails if ccache is enabled, reporting unknown option -- t partway through compilation. ccache works for all non-Qt dependencies (including VLC proper), so it is enabled for those projects.

@woot000
Copy link
Contributor Author

woot000 commented Jul 28, 2024

Update: The build process is still not completely fixed, only MINGW64 compilation outputs a working VLC.

MINGW32 compiles a broken version of VLC, outputting *** stack smashing detected *** terminated in the mintty terminal when attempting to run it. The 32-bit version of qtdeclarative still outputs an error like this:

[24/1727] Generating .qsb/scenegraph/shaders_ng/8bittextmask_a.frag.qsb
FAILED: src/quick/.qsb/scenegraph/shaders_ng/8bittextmask_a.frag.qsb C:/mabsvlc/build/qtdeclarative-git/build-32bit/src/quick/.qsb/scenegraph/shaders_ng/8bittextmask_a.frag.qsb 
C:\WINDOWS\system32\cmd.exe /C "cd /D C:\mabsvlc\build\qtdeclarative-git\build-32bit\src\quick && C:\mabsvlc\local32\bin\qsb.exe --glsl 100es,120,150 --hlsl 50 --msl 12 -b -c -O -s -o C:/mabsvlc/build/qtdeclarative-git/build-32bit/src/quick/.qsb/scenegraph/shaders_ng/8bittextmask_a.frag.qsb C:/mabsvlc/build/qtdeclarative-git/src/quick/scenegraph/shaders_ng/8bittextmask_a.frag"

...but compilation manages to finish anyway, but at a glacial speed due to ninja limiting the build process to one core after the failed step. I suspect the reason MINGW32 VLC doesn't work is because of this strange behavior, not sure how to deal with it.

CLANG32 and CLANG64 compilation now both fail at building qtshadertools, with undefined symbol errors:

[1/1] Linking CXX executable bin\qsb.exe
FAILED: bin/qsb.exe 
C:\WINDOWS\system32\cmd.exe /C "cd . && C:\mabsvlc\msys64\clang32\bin\clang++.exe -D_FORTIFY_SOURCE=2 -fstack-protector-strong -mtune=generic -O2 -pipe -D__USE_MINGW_ANSI_STDIO=1 -DNDEBUG -O3 -D_FORTIFY_SOURCE=2 -fstack-protector-strong -mtune=generic -O2 -pipe -D__USE_MINGW_ANSI_STDIO=1 -static-libgcc --start-no-unused-arguments -static-libstdc++ --end-no-unused-arguments    -Wl,--gc-sections tools/qsb/CMakeFiles/qsb.dir/qsb_autogen/mocs_compilation.cpp.obj tools/qsb/CMakeFiles/qsb.dir/qsb_resource.rc.obj tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj tools/qsb/CMakeFiles/qsb.dir/qsb_longpath.rc.obj -o bin\qsb.exe -Wl,--out-implib,tools\qsb\libqsb.dll.a -Wl,--major-image-version,0,--minor-image-version,0  C:/mabsvlc/local32/lib/objects-Release/Gui_resources_1/.qt/rcc/qrc_gui_shaders_init.cpp.obj  C:/mabsvlc/local32/share/qt6/plugins/imageformats/objects-Release/QGifPlugin_init/QGifPlugin_init.cpp.obj  C:/mabsvlc/local32/share/qt6/plugins/imageformats/objects-Release/QICOPlugin_init/QICOPlugin_init.cpp.obj  C:/mabsvlc/local32/share/qt6/plugins/imageformats/objects-Release/QJpegPlugin_init/QJpegPlugin_init.cpp.obj  C:/mabsvlc/local32/lib/objects-Release/QWindowsIntegrationPlugin_resources_1/.qt/rcc/qrc_openglblacklists_init.cpp.obj  C:/mabsvlc/local32/lib/objects-Release/QWindowsIntegrationPlugin_resources_2/.qt/rcc/qrc_cursors_init.cpp.obj  C:/mabsvlc/local32/share/qt6/plugins/platforms/objects-Release/QWindowsIntegrationPlugin_init/QWindowsIntegrationPlugin_init.cpp.obj  C:/mabsvlc/local32/lib/libQt6Core.a  lib/libQt6ShaderTools.a  C:/mabsvlc/local32/lib/libQt6Gui.a  C:/mabsvlc/local32/share/qt6/plugins/imageformats/libqgif.a  C:/mabsvlc/local32/share/qt6/plugins/imageformats/libqico.a  C:/mabsvlc/local32/share/qt6/plugins/imageformats/libqjpeg.a  C:/mabsvlc/local32/share/qt6/plugins/platforms/libqwindows.a  C:/mabsvlc/local32/lib/libQt6OpenGL.a  C:/mabsvlc/local32/lib/libQt6Gui.a  C:/mabsvlc/local32/share/qt6/plugins/imageformats/libqgif.a  C:/mabsvlc/local32/share/qt6/plugins/imageformats/libqico.a  C:/mabsvlc/local32/share/qt6/plugins/imageformats/libqjpeg.a  C:/mabsvlc/local32/share/qt6/plugins/platforms/libqwindows.a  C:/mabsvlc/local32/lib/libQt6OpenGL.a  -ld3d11  -ldxgi  -ldxguid  -luxtheme  C:/mabsvlc/local32/lib/libpng.a  C:/mabsvlc/local32/lib/libharfbuzz.a  -ld2d1  -ldwrite  C:/mabsvlc/msys64/clang32/lib/libjpeg.a  -ldwmapi  -lgdi32  -limm32  -loleaut32  -lsetupapi  -lshlwapi  -lwinspool  -lwtsapi32  -lcomdlg32  -ld3d9  C:/mabsvlc/local32/lib/libQt6Core.a  C:/mabsvlc/msys64/clang32/lib/libz.a  -lmpr  -luserenv  -ladvapi32  -lauthz  -lkernel32  -lnetapi32  -lole32  -lshell32  -luser32  -luuid  -lversion  -lwinmm  -lws2_32  C:/mabsvlc/msys64/clang32/lib/libb2.a  C:/mabsvlc/msys64/clang32/lib/libpcre2-16.a  lib/libQt6BundledSpirv_Cross.a  lib/libQt6BundledGlslang_Glslang.a  lib/libQt6BundledGlslang_Spirv.a  lib/libQt6BundledGlslang_Osdependent.a  lib/libQt6BundledGlslang_Oglcompiler.a  -pthread  -lmingwthrd  -lmingwthrd  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
ld.lld: error: undefined symbol: QCoreApplication::QCoreApplication(int&, char**, int)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)

ld.lld: error: undefined symbol: QCommandLineParser::QCommandLineParser()
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)

ld.lld: error: undefined symbol: _qVersion
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)

ld.lld: error: undefined symbol: QString::asprintf(char const*, ...)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)

ld.lld: error: undefined symbol: QCommandLineParser::setApplicationDescription(QString const&)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)

ld.lld: error: undefined symbol: QString::fromLatin1(QByteArrayView)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced 31 more times

ld.lld: error: undefined symbol: QCoreApplication::setApplicationVersion(QString const&)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)

ld.lld: error: undefined symbol: QCommandLineParser::addHelpOption()
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)

ld.lld: error: undefined symbol: QCommandLineOption::~QCommandLineOption()
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced 23 more times

ld.lld: error: undefined symbol: QCommandLineParser::addVersionOption()
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)

ld.lld: error: undefined symbol: QMetaObject::tr(char const*, char const*, int) const
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced 36 more times

ld.lld: error: undefined symbol: QCommandLineParser::addPositionalArgument(QString const&, QString const&, QString const&)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)

ld.lld: error: undefined symbol: QString::fromUtf8(QByteArrayView)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced 915 more times

ld.lld: error: undefined symbol: QArrayData::allocate(QArrayData**, int, int, int, QArrayData::AllocationOption)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced 64 more times

ld.lld: error: undefined symbol: QCommandLineOption::QCommandLineOption(QList<QString> const&, QString const&, QString const&, QString const&)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced 9 more times

ld.lld: error: undefined symbol: QCommandLineParser::addOption(QCommandLineOption const&)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced 21 more times

ld.lld: error: undefined symbol: QCommandLineOption::QCommandLineOption(QString const&, QString const&, QString const&, QString const&)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced 9 more times

ld.lld: error: undefined symbol: QCommandLineParser::process(QCoreApplication const&)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)

ld.lld: error: undefined symbol: QCommandLineParser::positionalArguments() const
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)

ld.lld: error: undefined symbol: QCommandLineParser::isSet(QCommandLineOption const&) const
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)
>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)

>>> referenced by tools/qsb/CMakeFiles/qsb.dir/qsb.cpp.obj:(_main)

>>> referenced 29 more times

Not sure why this error is occurring, Qt6 is being linked. I think I'll wait and see if this issue solves itself, I'm not sure where I'd begin to investigate.

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

Successfully merging this pull request may close these issues.

1 participant