Best way to build MuseScore 2.1 as debug - reduce-relocation error failure only in debug not release
I want to look at modifying some of Musescore for a personal project. Because my eventual target (Raspberry Pi 3B) does not have later QT's, I decided to build QT 5.8 from source on x64 Linux (not Pi, yet), but am having issues getting Musescore to build against it for debug.
I have a QT 5.8 version built that seems to work (at least a non-Musescore project I have builds and runs fine). I also built qtcreator and it seems to work. I have been trying to build MuseScore and hitting some issues, and have narrowed them down but not completely. I am using the instructions here to try to get MuseScore into qtcreator.
I am building 2.1 as I understand the current master is unstable.
If I build using just "make" I can get it to build. That defaults to a release build at the target "release". "make release" also builds correctly. The resulting image will run just fine (in place, I have not tried to install; musescore from a distro is not on this system at all).
The instructions for method two (at the above link) suggest using "installdebug" as a target. If I try that (from the command line or qtcreator), it fails. It also fails with "make debug". The failure is as follows:
In file included from /usr/include/QtCore/QtCore:4:0, from /usr/include/QtGui/QtGuiDepends:3, from /usr/include/QtGui/QtGui:3, from all.h:32: /usr/include/QtCore/qglobal.h:1097:4: error: #error "You must build your code with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC (-fPIE is not enough)." # error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\ ^
I have tried tracking down everything I can find, and it all looks like the cmake setup should be using -fPIC as appropriate. From what I read the reduce-relocations is the appropriate way to build qt.
And Musescore does correctly compile (presumably with -fPIC) in release, just not debug mode. I've tried running with trace and cannot find the issue (I am relatively new to linux and cmake and make).
Clearly I'd prefer a debug build if I'm going to try changing it. And since 2.1 is considered fairly stable I would have thought it would build properly, so this may be related to my qt build. Or maybe 2.1 doesn't build "debug"? I have too many "new" things to consider being at fault.
Anyone have any idea what I may be missing?
Maybe more to the point, in 2.1, should a debug build actually work with qt built with reduce-relocaiton (and potentially a 5.8 build of qt)?
My testing is on Linux, 64 bit, Ubuntu 16.04.01 LTS desktop, running in a HyperV VM.
Is there a better way to get MuseScore in qtcreator? I tried method one on the latest qtcreator, and made no progress at all, there's no prompt as the doc indicates, forcing it into the cmake command line just does nothing when built. I've never used qtcreator on a cmake project so I am not sure what to expect, maybe 5.8 is different from what the doc was written for in option 1.
Oh... for a .pro project file. :)
Any help appreciated.