Closed kbloom closed 2 months ago
I'm really interested in testing whether newer versions of QT can fix issue #15285, but if I can't build against newer versions of Qt, then I can't test it.
Also, I'm generally interested in having my apps run on Qt 6.7 or later, because if my Wayland compositor crashes and restarts, Qt 6.7 apps can survive that and keep running.
https://github.com/musescore/MuseScore/issues/15285#issuecomment-2206877590 has some relevant information about building against Qt 6.7. I'm not sure if any of that helps with this linker issue, and I haven't tried to figure out how to translate that from Nix to non-Nix yet.
As far as I can see, those patches have already been applied (well, a variation).
That's quite a cryptic error, it doesn't ring a bell to me. I entered it into Google and found this, which looks very similar: https://gitlab.manjaro.org/applications/calamares/-/issues/87
One of the links there suggests that position independent code needs to be enabled. However instead of using the solution from there, I would suggest using the -fPIC compiler option, in our SetupBuildEnvironment.cmake file.
I wonder though why this would necessary for your system and apparently not for some other people. Maybe -fPIC is on by default on most compilers and not on yours somehow?
That did it! Thanks.
However instead of using the solution from there, I would suggest using the -fPIC compiler option, in our SetupBuildEnvironment.cmake file.
I did some further research about this, and it turns out that I wasn't right here; using the target property in CMake, or setting CMAKE_POSITION_INDEPENDENT_CODE
globally, seems actually the preferred way.
Confirmed on Slackware64-current. I'm awaiting a new release to upgrade from 4.3x
Just checked the Musescore ARCH Linux PKGBUILD
build() {
cmake -S MuseScore -B build -G Ninja \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_C_FLAGS_RELEASE="$CFLAGS" \
-DCMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_SKIP_RPATH=ON \
-DMUSESCORE_APP_BUILD_MODE=release \
-DMUSESCORE_BUILD_CONFIGURATION=app \
-DMUSESCORE_REVISION=$(git rev-parse --short=7 HEAD) \
-DMUE_BUILD_UNIT_TESTS=OFF \
-DMUE_COMPILE_USE_SYSTEM_FLAC=ON \
-DMUE_COMPILE_USE_SYSTEM_FREETYPE=ON \
-DMUE_COMPILE_USE_SYSTEM_HARFBUZZ=ON \
-DMUE_COMPILE_USE_SYSTEM_OPUS=ON \
-DMUE_COMPILE_USE_SYSTEM_OPUSENC=ON \
-DMUE_COMPILE_USE_SYSTEM_TINYXML=ON \
-DMUE_ENABLE_FILE_ASSOCIATION=ON \
-DMUE_INSTALL_SOUNDFONT=ON \
-Wno-dev
cmake --build build
}
Probably it makes sense to add the CMAKE_POSITION_INDEPENDENT_CODE=ON
persistently in CMakeLists.txt?
It might, but I'm not sure how desirable it is to set such options in CMakeLists, because obviously it removes the possibility to set a value on the command line, which may be the purpose of such CMake options.
Also, it would be great if we could find a bit more precisely why this would be necessary, and why for us and not for other projects, etc..
Issue type
Other type of issue
Description with steps to reproduce
I'm trying to build Musescore 4.4.0 branch (commit 341aa511357688c581b7cf40b6e7ff6ad0fd703e) against my system Qt 6.7.2 on Manjaro linux.
To build, I ran
./ninja_build.sh
The build is failing with
Any idea what's wrong?
Supporting files, videos and screenshots
None
What is the latest version of MuseScore Studio where this issue is present?
Git 4.4.0 branch
Regression
I was unable to check
Operating system
Manjaro Linux
Additional context
No response
Checklist