pedrolcl / drumstick

Drumstick Qt/C++ MIDI libraries (Mirror)
https://sourceforge.net/projects/drumstick/
GNU General Public License v3.0
12 stars 3 forks source link

Cannot compile with USE_QT=6: undefned references to BackendManager #12

Closed michaellass closed 1 year ago

michaellass commented 1 year ago

I'm struggling to compile this on Arch Linux against Qt6. As soon as I run cmake with -DUSE_QT=6, make VERBOSE=1 fails with the following errors:

[ 38%] Linking CXX shared library libmp_svoxeas.so
cd /home/bevan/git/multiplatform-sonivoxeas/libsvoxeas && /usr/bin/cmake -E cmake_link_script CMakeFiles/mp_svoxeas.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -shared -Wl,-soname,libmp_svoxeas.so.2 -o libmp_svoxeas.so.2.1.0 CMakeFiles/mp_svoxeas.dir/mp_svoxeas_autogen/mocs_compilation.cpp.o CMakeFiles/mp_svoxeas.dir/programsettings.cpp.o CMakeFiles/mp_svoxeas.dir/synthcontroller.cpp.o CMakeFiles/mp_svoxeas.dir/synthrenderer.cpp.o CMakeFiles/mp_svoxeas.dir/filewrapper.cpp.o  /usr/lib/libsonivox.so.3.6.12.0 /usr/lib/libQt6Multimedia.so.6.5.1 /usr/lib/libdrumstick-rt.so.2.7.2 /usr/lib/libQt6Gui.so.6.5.1 /usr/lib/libGLX.so /usr/lib/libOpenGL.so /usr/lib/libQt6Network.so.6.5.1 /usr/lib/libQt6Core.so.6.5.1 
/usr/bin/ld: CMakeFiles/mp_svoxeas.dir/synthrenderer.cpp.o: warning: relocation against `_ZN9drumstick2rt9MIDIInput10midiNoteOnEiii' in read-only section `.text'
/usr/bin/ld: CMakeFiles/mp_svoxeas.dir/synthrenderer.cpp.o: in function `SynthRenderer::SynthRenderer(QObject*)':
synthrenderer.cpp:(.text+0x6a): undefined reference to `drumstick::rt::BackendManager::BackendManager()'
/usr/bin/ld: synthrenderer.cpp:(.text+0x11b): undefined reference to `drumstick::rt::BackendManager::~BackendManager()'
/usr/bin/ld: CMakeFiles/mp_svoxeas.dir/synthrenderer.cpp.o: in function `SynthRenderer::~SynthRenderer()':
synthrenderer.cpp:(.text+0xccb): undefined reference to `drumstick::rt::BackendManager::~BackendManager()'
/usr/bin/ld: CMakeFiles/mp_svoxeas.dir/synthrenderer.cpp.o: in function `SynthRenderer::setMidiDriver(QString)':
synthrenderer.cpp:(.text+0x15ec): undefined reference to `drumstick::rt::BackendManager::inputBackendByName(QString)'
/usr/bin/ld: synthrenderer.cpp:(.text+0x162b): undefined reference to `drumstick::rt::MIDIInput::midiNoteOn(int, int, int)'
/usr/bin/ld: CMakeFiles/mp_svoxeas.dir/synthrenderer.cpp.o: relocation R_X86_64_PC32 against undefined protected symbol `_ZN9drumstick2rt9MIDIInput10midiNoteOnEiii' can not be used when making a shared object
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libsvoxeas/CMakeFiles/mp_svoxeas.dir/build.make:169: libsvoxeas/libmp_svoxeas.so.2.1.0] Error 1

Interestingly, version 2.0.0 with d2c95011c90ebacd168b74becf6c1ac83054f910 backported fails with the same error. In January, this built without problems on Arch. So I have a feeling that it could be related to the update to Qt 6.5.1. In January, this was still 6.4.1.

Do you have any idea what could cause this?

pedrolcl commented 1 year ago

The error messages are all at link time, and all of them about linking against /usr/lib/libdrumstick-rt.so.2.7.2 so my guess is that this drumstick component presents some compatibility problems. I would recompile drumstick. But if you prefer to diagnose the problem, I would propose to see what the following commands say:

$ ldd /usr/lib/libdrumstick-rt.so

$ nm -D /usr/lib/libdrumstick-rt.so | grep _ZN9drumstick2rt9MIDIInput10midiNoteOnEiii 0000000000005d60 T _ZN9drumstick2rt9MIDIInput10midiNoteOnEiii

$ nm -CD /usr/lib/libdrumstick-rt.so | grep "drumstick::rt::MIDIInput::midiNoteOn(int, int, int)" 0000000000005d60 T drumstick::rt::MIDIInput::midiNoteOn(int, int, int)

The last error "relocation R_X86_64_PC32 against undefined protected symbol _ZN9drumstick2rt9MIDIInput10midiNoteOnEiii' can not be used when making a shared object" is complaining about missing -fPIC when building drumstick.

You really need to rebuild drumstick.

michaellass commented 1 year ago

I tried rebuilding drumstick and also tried varying C(XX)FLAGS and LDFLAGS because the defaults might have changed on Arch Linux over the last months. Unfortunately, that did not help. I also tried installing the Arch Linux drumstick package that was up-to-date in January and that did not change things either. I'm sure that multiplatform-sonivoxeas successfully linked against exactly those files at that time.

Here's the output of the commands:

ldd /usr/lib/libdrumstick-rt.so
    linux-vdso.so.1 (0x00007fff02d8f000)
    libQt6Core.so.6 => /usr/lib/libQt6Core.so.6 (0x00007f6ed8000000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f6ed7c00000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f6ed8645000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00007f6ed7a16000)
    libicui18n.so.72 => /usr/lib/libicui18n.so.72 (0x00007f6ed7600000)
    libicuuc.so.72 => /usr/lib/libicuuc.so.72 (0x00007f6ed7200000)
    libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007f6ed7eb6000)
    libz.so.1 => /usr/lib/libz.so.1 (0x00007f6ed8629000)
    libsystemd.so.0 => /usr/lib/libsystemd.so.0 (0x00007f6ed7518000)
    libdouble-conversion.so.3 => /usr/lib/libdouble-conversion.so.3 (0x00007f6ed8613000)
    libb2.so.1 => /usr/lib/libb2.so.1 (0x00007f6ed85f5000)
    libpcre2-16.so.0 => /usr/lib/libpcre2-16.so.0 (0x00007f6ed7988000)
    libcrypto.so.3 => /usr/lib/libcrypto.so.3 (0x00007f6ed6c00000)
    libzstd.so.1 => /usr/lib/libzstd.so.1 (0x00007f6ed7445000)
    libm.so.6 => /usr/lib/libm.so.6 (0x00007f6ed7113000)
    /usr/lib64/ld-linux-x86-64.so.2 (0x00007f6ed86b7000)
    libicudata.so.72 => /usr/lib/libicudata.so.72 (0x00007f6ed4e00000)
    libpcre2-8.so.0 => /usr/lib/libpcre2-8.so.0 (0x00007f6ed4d65000)
    libcap.so.2 => /usr/lib/libcap.so.2 (0x00007f6ed85e5000)
    libgcrypt.so.20 => /usr/lib/libgcrypt.so.20 (0x00007f6ed4c1d000)
    liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f6ed85b2000)
    liblz4.so.1 => /usr/lib/liblz4.so.1 (0x00007f6ed8590000)
    libgomp.so.1 => /usr/lib/libgomp.so.1 (0x00007f6ed7937000)
    libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x00007f6ed7e90000)
nm -D /usr/lib/libdrumstick-rt.so | grep _ZN9drumstick2rt9MIDIInput10midiNoteOnEiii
0000000000004e70 T _ZN9drumstick2rt9MIDIInput10midiNoteOnEiii
nm -CD /usr/lib/libdrumstick-rt.so | grep "drumstick::rt::MIDIInput::midiNoteOn(int, int, int)"
0000000000004e70 T drumstick::rt::MIDIInput::midiNoteOn(int, int, int)

I also tried running the failing command manually and removing all references to external libraries. Interestingly, this does not change anything in the output:

/usr/bin/c++ -fPIC -shared -Wl,-soname,libmp_svoxeas.so.2 -o libmp_svoxeas.so.2.1.0 CMakeFiles/mp_svoxeas.dir/mp_svoxeas_autogen/mocs_compilation.cpp.o CMakeFiles/mp_svoxeas.dir/programsettings.cpp.o CMakeFiles/mp_svoxeas.dir/synthcontroller.cpp.o CMakeFiles/mp_svoxeas.dir/synthrenderer.cpp.o CMakeFiles/mp_svoxeas.dir/filewrapper.cpp.o
/usr/bin/ld: CMakeFiles/mp_svoxeas.dir/synthrenderer.cpp.o: warning: relocation against `_ZN9drumstick2rt9MIDIInput10midiNoteOnEiii' in read-only section `.text'
/usr/bin/ld: CMakeFiles/mp_svoxeas.dir/synthrenderer.cpp.o: in function `SynthRenderer::SynthRenderer(QObject*)':
synthrenderer.cpp:(.text+0x6a): undefined reference to `drumstick::rt::BackendManager::BackendManager()'
/usr/bin/ld: synthrenderer.cpp:(.text+0x11b): undefined reference to `drumstick::rt::BackendManager::~BackendManager()'
/usr/bin/ld: CMakeFiles/mp_svoxeas.dir/synthrenderer.cpp.o: in function `SynthRenderer::~SynthRenderer()':
synthrenderer.cpp:(.text+0xccb): undefined reference to `drumstick::rt::BackendManager::~BackendManager()'
/usr/bin/ld: CMakeFiles/mp_svoxeas.dir/synthrenderer.cpp.o: in function `SynthRenderer::setMidiDriver(QString)':
synthrenderer.cpp:(.text+0x15ec): undefined reference to `drumstick::rt::BackendManager::inputBackendByName(QString)'
/usr/bin/ld: synthrenderer.cpp:(.text+0x162b): undefined reference to `drumstick::rt::MIDIInput::midiNoteOn(int, int, int)'
/usr/bin/ld: CMakeFiles/mp_svoxeas.dir/synthrenderer.cpp.o: relocation R_X86_64_PC32 against undefined protected symbol `_ZN9drumstick2rt9MIDIInput10midiNoteOnEiii' can not be used when making a shared object
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status

This lets me think that it is not related to drumstick but something internal to this project.

I'll try to reproduce this with older Qt and/or GCC versions to narrow down the problem. But this may take some time.

michaellass commented 1 year ago

I forgot to mention this explicitly: Compiling with -DUSE_QT=5 still works without errors. However, this is no viable option on Arch because of the resulting mixture of Qt5 and Qt6 which causes mp_guisynth to error on startup.

pedrolcl commented 1 year ago

This lets me think that it is not related to drumstick but something internal to this project.

And you say this merely because your intuition, or because you have some proof or evidence of a smoking gun? Can you build in your system and the same environment another similar program like VMPK or dmidiplayer to compare results?

I am unable to see the problem from the excerpts that you posted. In a few weeks I may be able to try to build a Flatpak or AppImage, just to prove that it is viable.

Meanwhile, please post:

At this point we may need to ask somebody else for help: @dvzrv can you take a look, please?

michaellass commented 1 year ago

This lets me think that it is not related to drumstick but something internal to this project.

And you say this merely because your intuition, or because you have some proof or evidence of a smoking gun? Can you build in your system and the same environment another similar program like VMPK or dmidiplayer to compare results?

Trying to build other similar projects is a great idea. I tried building VMPK and it fails with very similar issues. In fact, just trying to build Arch's official vmpk package from https://gitlab.archlinux.org/archlinux/packaging/packages/vmpk fails with:

/usr/bin/ld: CMakeFiles/vmpk.dir/vpiano.cpp.o: in function `VPiano::updateNoteNames(bool)':
vpiano.cpp:(.text+0x9768): undefined reference to `drumstick::widgets::PianoKeybd::useCustomNoteNames(QStringList const&)'

At this point, this is something I can report to the Arch Linux people.

As shown by the ldd output above, Arch's libdrumstick is linked against Qt6. This is why I am trying to build this project against Qt6 as well. However, rebuilding drumstick using Arch's package sources will link it to Qt5. Based on that Qt5-build of drumstick, multiplatform-sonivoxeas can be built against Qt5 as well and the resulting binaries work without issues. And building the VMPK package against that version works as well.

For completeness:

Meanwhile, please post:

* How/where do you configure, build and install Drumstick, especially the cmake arguments like [CMAKE_PREFIX_PATH](https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html), and relevant environment variables.

drumstick is available as an Arch Linux package. It is built as shown here: https://gitlab.archlinux.org/archlinux/packaging/packages/drumstick/-/blob/main/PKGBUILD#L21

By default, packages are built with the following C(XX)/LDFLAGS: https://gitlab.archlinux.org/archlinux/packaging/packages/pacman/-/blob/main/makepkg.conf#L41

But as stated above, building drumstick with these commands leads to libraries linked differently to what is distributed by Arch's repositories right now.

* The same about configure/build multiplatform-sonivoxeas.

Just cmake -DUSE_QT=6 and make with no specific environment:

% env|grep FLAGS
MAKEFLAGS=-j16
% env|grep CMAKE
* A full log of configuration and build processes for both projects, using [CMAKE_VERBOSE_MAKEFILE](https://cmake.org/cmake/help/latest/variable/CMAKE_VERBOSE_MAKEFILE.html).

I'll skip these full logs as this looks like an Arch packaging issue with drumstick right now. I will report this in the Arch Linux bug tracker and post updates here.

pedrolcl commented 1 year ago

As shown by the ldd output above, Arch's libdrumstick is linked against Qt6. This is why I am trying to build this project against Qt6 as well. However, rebuilding drumstick using Arch's package sources will link it to Qt5. Based on that Qt5-build of drumstick, multiplatform-sonivoxeas can be built against Qt5 as well and the resulting binaries work without issues. And building the VMPK package against that version works as well.

Arch Drumstick recipe do not enable the options USE_QT=6 or USE_QT=5. So, it builds with whatever Qt version that finds, and it is interesting that the chosen one is Qt5. Try to build Drumstick with USE_QT=6 explicitly, and if it fails that would mean that your Qt6 installation is incomplete or corrupted.

On the other hand, if you can build Drumstick with Qt6 successfully, you may try to install it to an alternate prefix, for instance with CMAKE_INSTALL_PREFIX="${HOME}/Drumstick". Then, you can build applications using CMAKE_PREFIX_PATH="${HOME}/Drumstick" and see what happens.

michaellass commented 1 year ago

As shown by the ldd output above, Arch's libdrumstick is linked against Qt6. This is why I am trying to build this project against Qt6 as well. However, rebuilding drumstick using Arch's package sources will link it to Qt5. Based on that Qt5-build of drumstick, multiplatform-sonivoxeas can be built against Qt5 as well and the resulting binaries work without issues. And building the VMPK package against that version works as well.

Arch Drumstick recipe do not enable the options USE_QT=6 or USE_QT=5. So, it builds with whatever Qt version that finds, and it is interesting that the chosen one is Qt5. Try to build Drumstick with USE_QT=6 explicitly, and if it fails that would mean that your Qt6 installation is incomplete or corrupted.

You are right, my conclusion here was premature. As far as I know, the official Arch packages are built in clean chroot environments where only the packages specified as dependency are installed. Hence, the official package will build against Qt6 as there is no Qt5 installed in that chroot.

I attempted to build drumstick in such a clean chroot. It tried to build against Qt6 and failed with very similar errors as did VMPK and multiplatform-sonivoxeas. So I reported a bug downstream: https://bugs.archlinux.org/task/78797

pedrolcl commented 1 year ago

In any other distro only one development package can be installed for each major version of the same library. You may have all runtime libraries of Qt5 and Qt6 installed at once, but not all the headers and development libraries (the libs with a .so suffix and no version number). I've added the USE_QT option to the CMake buildsystems of many of my programs as requested by some other Arch users, but looks like it is not enough. I'm not an Arch user, and this problem desn't hit any other distro. At this point, I'm not sure how/what I can do.

dvzrv commented 1 year ago

@pedrolcl hm, could this be an issue with gcc > 13 and/or glibc >= 2.37?

The current drumstick package (2.7.2-1) has been built against this:

{
  "builddate": 1664706837,
  "builddir": "/build",
  "buildenv": [
    "!distcc",
    "color",
    "!ccache",
    "check",
    "!sign"
  ],
  "buildtool": "devtools",
  "buildtoolver": "20220621-1-any",
  "format_": 2,
  "installed": [
    "acl-2.3.1-2-x86_64",
    "alsa-card-profiles-1:0.3.58-1-x86_64",
    "alsa-lib-1.2.7.2-1-x86_64",
    "alsa-topology-conf-1.2.5.1-1-any",
    "alsa-ucm-conf-1.2.7.2-1-any",
    "aom-3.5.0-1-x86_64",
    "archlinux-keyring-20220927-1-any",
    "argon2-20190702-4-x86_64",
    "attr-2.5.1-2-x86_64",
    "audit-3.0.8-1-x86_64",
    "autoconf-2.71-1-any",
    "automake-1.16.5-1-any",
    "avahi-0.8+22+gfd482a7-3-x86_64",
    "bash-5.1.016-1-x86_64",
    "binutils-2.39-3-x86_64",
    "bison-3.8.2-4-x86_64",
    "bluez-libs-5.65-3-x86_64",
    "brotli-1.0.9-8-x86_64",
    "bzip2-1.0.8-4-x86_64",
    "ca-certificates-20220905-1-any",
    "ca-certificates-mozilla-3.83-1-x86_64",
    "ca-certificates-utils-20220905-1-any",
    "cairo-1.17.6-2-x86_64",
    "cmake-3.24.2-1-x86_64",
    "coreutils-9.1-1-x86_64",
    "cryptsetup-2.5.0-1-x86_64",
    "curl-7.85.0-2-x86_64",
    "dav1d-1.0.0-1-x86_64",
    "db-5.3.28-5-x86_64",
    "dbus-1.14.2-1-x86_64",
    "device-mapper-2.03.16-2-x86_64",
    "diffutils-3.8-1-x86_64",
    "docbook-xml-4.5-9-any",
    "docbook-xsl-1.79.2-7-any",
    "double-conversion-3.2.1-1-x86_64",
    "doxygen-1.9.3-1-x86_64",
    "duktape-2.7.0-4-x86_64",
    "e2fsprogs-1.46.5-4-x86_64",
    "expat-2.4.9-1-x86_64",
    "fakeroot-1.29-1-x86_64",
    "file-5.43-1-x86_64",
    "filesystem-2021.12.07-1-x86_64",
    "findutils-4.9.0-1-x86_64",
    "flac-1.4.1-1-x86_64",
    "flex-2.6.4-3-x86_64",
    "fluidsynth-2.3.0-2-x86_64",
    "fontconfig-2:2.14.0-1-x86_64",
    "freetype2-2.12.1-1-x86_64",
    "fribidi-1.0.12-1-x86_64",
    "gawk-5.2.0-3-x86_64",
    "gc-8.2.2-1-x86_64",
    "gcc-12.2.0-1-x86_64",
    "gcc-libs-12.2.0-1-x86_64",
    "gd-2.3.3-4-x86_64",
    "gdbm-1.23-1-x86_64",
    "gdk-pixbuf2-2.42.9-1-x86_64",
    "gettext-0.21-2-x86_64",
    "ghostscript-10.0.0-1-x86_64",
    "giflib-5.2.1-2-x86_64",
    "glib2-2.74.0-2-x86_64",
    "glibc-2.36-4-x86_64",
    "gmp-6.2.1-2-x86_64",
    "gnupg-2.2.39-1-x86_64",
    "gnutls-3.7.8-1-x86_64",
    "gpgme-1.18.0-1-x86_64",
    "graphite-1:1.3.14-2-x86_64",
    "graphviz-5.0.1-3-x86_64",
    "grep-3.8-2-x86_64",
    "groff-1.22.4-7-x86_64",
    "gsfonts-20200910-2-any",
    "gts-0.7.6.121130-2-x86_64",
    "guile-2.2.7-2-x86_64",
    "gzip-1.12-1-x86_64",
    "harfbuzz-5.2.0-1-x86_64",
    "hicolor-icon-theme-0.17-2-any",
    "hidapi-0.12.0-1-x86_64",
    "hwdata-0.362-2-any",
    "iana-etc-20220915-1-any",
    "icu-71.1-1-x86_64",
    "ijs-0.35-4-x86_64",
    "iptables-1:1.8.8-2-x86_64",
    "jack2-1.9.21-1-x86_64",
    "jansson-2.14-2-x86_64",
    "jbig2dec-0.19-1-x86_64",
    "json-c-0.16-1-x86_64",
    "jsoncpp-1.9.5-2-x86_64",
    "kbd-2.5.1-1-x86_64",
    "keyutils-1.6.3-1-x86_64",
    "kmod-30-1-x86_64",
    "krb5-1.19.3-3-x86_64",
    "lcms2-2.13.1-1-x86_64",
    "less-1:608-1-x86_64",
    "libarchive-3.6.1-2-x86_64",
    "libassuan-2.5.5-1-x86_64",
    "libasyncns-1:0.8+r3+g68cd5af-1-x86_64",
    "libavif-0.10.1-2-x86_64",
    "libb2-0.98.1-2-x86_64",
    "libcap-2.66-1-x86_64",
    "libcap-ng-0.8.3-1-x86_64",
    "libcups-1:2.4.2-3-x86_64",
    "libdaemon-0.14-5-x86_64",
    "libdatrie-0.2.13-1-x86_64",
    "libde265-1.0.8-2-x86_64",
    "libdrm-2.4.113-2-x86_64",
    "libedit-20210910_3.1-1-x86_64",
    "libelf-0.187-2-x86_64",
    "libevdev-1.13.0-1-x86_64",
    "libevent-2.1.12-2-x86_64",
    "libfdk-aac-2.0.2-1-x86_64",
    "libffi-3.4.3-1-x86_64",
    "libfreeaptx-0.1.1-1-x86_64",
    "libgcrypt-1.10.1-1-x86_64",
    "libglvnd-1.5.0-1-x86_64",
    "libgpg-error-1.45-2-x86_64",
    "libgudev-237-2-x86_64",
    "libheif-1.13.0-2-x86_64",
    "libice-1.0.10-4-x86_64",
    "libidn-1.41-1-x86_64",
    "libidn2-2.3.3-1-x86_64",
    "libinput-1.21.0-1-x86_64",
    "libinstpatch-1.1.6-1-x86_64",
    "libisl-0.25-1-x86_64",
    "libjpeg-turbo-2.1.4-2-x86_64",
    "libksba-1.6.0-1-x86_64",
    "libldac-2.0.2.3-1-x86_64",
    "libldap-2.6.3-1-x86_64",
    "libmnl-1.0.5-1-x86_64",
    "libmpc-1.2.1-2-x86_64",
    "libnetfilter_conntrack-1.0.9-1-x86_64",
    "libnfnetlink-1.0.2-1-x86_64",
    "libnftnl-1.2.3-1-x86_64",
    "libnghttp2-1.50.0-1-x86_64",
    "libnl-3.7.0-1-x86_64",
    "libnsl-2.0.0-2-x86_64",
    "libogg-1.3.5-1-x86_64",
    "libomxil-bellagio-0.9.3-3-x86_64",
    "libp11-kit-0.24.1-1-x86_64",
    "libpaper-1.1.28-2-x86_64",
    "libpcap-1.10.1-2-x86_64",
    "libpciaccess-0.16-4-x86_64",
    "libpng-1.6.38-1-x86_64",
    "libproxy-0.4.18-1-x86_64",
    "libpsl-0.21.1-1-x86_64",
    "libpulse-16.1-1-x86_64",
    "librsvg-2:2.54.5-1-x86_64",
    "libsamplerate-0.2.2-1-x86_64",
    "libsasl-2.1.28-1-x86_64",
    "libseccomp-2.5.4-1-x86_64",
    "libsecret-0.20.5-2-x86_64",
    "libsm-1.2.3-3-x86_64",
    "libsndfile-1.1.0-3-x86_64",
    "libssh2-1.10.0-1-x86_64",
    "libsysprof-capture-3.44.0-2-x86_64",
    "libtasn1-4.19.0-1-x86_64",
    "libthai-0.1.29-1-x86_64",
    "libtiff-4.4.0-4-x86_64",
    "libtirpc-1.3.3-1-x86_64",
    "libtool-2.4.7-5-x86_64",
    "libunistring-1.0-1-x86_64",
    "libunwind-1.6.2-1-x86_64",
    "libusb-1.0.26-1-x86_64",
    "libuv-1.44.2-1-x86_64",
    "libverto-0.3.2-4-x86_64",
    "libvorbis-1.3.7-3-x86_64",
    "libwacom-2.4.0-1-x86_64",
    "libwebp-1.2.4-1-x86_64",
    "libx11-1.8.1-3-x86_64",
    "libxau-1.0.10-1-x86_64",
    "libxaw-1.0.14-1-x86_64",
    "libxcb-1.15-1-x86_64",
    "libxcrypt-4.4.28-2-x86_64",
    "libxcursor-1.2.1-1-x86_64",
    "libxdamage-1.1.5-4-x86_64",
    "libxdmcp-1.1.3-4-x86_64",
    "libxext-1.3.4-4-x86_64",
    "libxfixes-6.0.0-1-x86_64",
    "libxft-2.3.6-1-x86_64",
    "libxi-1.8-1-x86_64",
    "libxkbcommon-1.4.1-1-x86_64",
    "libxkbcommon-x11-1.4.1-1-x86_64",
    "libxml2-2.10.2-2-x86_64",
    "libxmu-1.1.3-3-x86_64",
    "libxpm-3.5.13-3-x86_64",
    "libxrender-0.9.10-5-x86_64",
    "libxshmfence-1.3-3-x86_64",
    "libxslt-1.1.37-2-x86_64",
    "libxt-1.2.1-1-x86_64",
    "libxxf86vm-1.1.5-1-x86_64",
    "libyuv-r2322+3aebf69d-1-x86_64",
    "lilv-0.24.20-1-x86_64",
    "linux-api-headers-5.18.15-1-any",
    "llvm-libs-14.0.6-3-x86_64",
    "lm_sensors-1:3.6.0.r41.g31d1f125-1-x86_64",
    "lv2-1.18.10-1-x86_64",
    "lz4-1:1.9.4-1-x86_64",
    "lzo-2.10-3-x86_64",
    "m4-1.4.19-1-x86_64",
    "make-4.3-3-x86_64",
    "md4c-0.4.8-1-x86_64",
    "mesa-22.1.7-1-x86_64",
    "mpfr-4.1.0.p13-3-x86_64",
    "mtdev-1.1.6-2-x86_64",
    "ncurses-6.3-3-x86_64",
    "netpbm-10.73.37-2-x86_64",
    "nettle-3.8.1-1-x86_64",
    "npth-1.6-3-x86_64",
    "openjpeg2-2.5.0-1-x86_64",
    "openssl-1.1.1.q-1-x86_64",
    "opus-1.3.1-3-x86_64",
    "p11-kit-0.24.1-1-x86_64",
    "pacman-6.0.1-8-x86_64",
    "pacman-mirrorlist-20220828-1-any",
    "pam-1.5.2-1-x86_64",
    "pambase-20211210-1-any",
    "pango-1:1.50.10-1-x86_64",
    "patch-2.7.6-8-x86_64",
    "pcre-8.45-3-x86_64",
    "pcre2-10.40-3-x86_64",
    "perl-5.36.0-1-x86_64",
    "pinentry-1.2.0-1-x86_64",
    "pipewire-1:0.3.58-1-x86_64",
    "pixman-0.40.0-2-x86_64",
    "pkgconf-1.8.0-1-x86_64",
    "popt-1.18-3-x86_64",
    "portaudio-1:19.7.0-1-x86_64",
    "qt6-5compat-6.4.0-1-x86_64",
    "qt6-base-6.4.0-1-x86_64",
    "qt6-tools-6.4.0-1-x86_64",
    "qt6-translations-6.4.0-1-any",
    "rav1e-0.5.1-2-x86_64",
    "readline-8.1.002-1-x86_64",
    "rhash-1.4.2-1-x86_64",
    "run-parts-5.5-1-x86_64",
    "sbc-2.0-1-x86_64",
    "sdl2-2.24.0-2-x86_64",
    "sed-4.8-1-x86_64",
    "serd-0.30.16-1-x86_64",
    "shadow-4.11.1-1-x86_64",
    "shared-mime-info-2.0+155+gf4e7cbc-1-x86_64",
    "sonivox-3.6.11-1-x86_64",
    "sord-0.16.14-1-x86_64",
    "speex-1.2.1-1-x86_64",
    "speexdsp-1.2.1-1-x86_64",
    "sqlite-3.39.3-1-x86_64",
    "sratom-0.6.14-1-x86_64",
    "sudo-1.9.11.p3-1-x86_64",
    "svt-av1-1.2.1-1-x86_64",
    "systemd-251.4-1-x86_64",
    "systemd-libs-251.4-1-x86_64",
    "tar-1.34-1-x86_64",
    "texinfo-6.8-2-x86_64",
    "tpm2-tss-3.2.0-1-x86_64",
    "tslib-1.22-1-x86_64",
    "tzdata-2022d-1-x86_64",
    "util-linux-2.38.1-1-x86_64",
    "util-linux-libs-2.38.1-1-x86_64",
    "vulkan-headers-1:1.3.227-1-any",
    "vulkan-icd-loader-1.3.226-1-x86_64",
    "wayland-1.21.0-1-x86_64",
    "webrtc-audio-processing-0.3.1-3-x86_64",
    "which-2.21-5-x86_64",
    "x265-3.5-3-x86_64",
    "xcb-proto-1.15.2-1-any",
    "xcb-util-0.4.0-4-x86_64",
    "xcb-util-cursor-0.1.3-4-x86_64",
    "xcb-util-image-0.4.0-4-x86_64",
    "xcb-util-keysyms-0.4.0-4-x86_64",
    "xcb-util-renderutil-0.3.9-4-x86_64",
    "xcb-util-wm-0.4.1-4-x86_64",
    "xdg-utils-1.1.3+21+g1a58bc2-2-any",
    "xkeyboard-config-2.36+89+g382c5feb-1-any",
    "xorg-xprop-1.2.5-1-x86_64",
    "xorg-xset-1.2.4-3-x86_64",
    "xorgproto-2022.2-1-any",
    "xz-5.2.6-1-x86_64",
    "zlib-1:1.2.12-2-x86_64",
    "zstd-1.5.2-7-x86_64"
  ],
  "options": [
    "strip",
    "docs",
    "!libtool",
    "!staticlibs",
    "emptydirs",
    "zipman",
    "purge",
    "!debug",
    "lto"
  ],
  "packager": "David Runge <dvzrv@archlinux.org>",
  "pkgarch": "x86_64",
  "pkgbase": "drumstick",
  "pkgbuild_sha256sum": "b5bce9745b420b495ea41b11211c4a43291f34ea461dc97fe98dacbe385b8e87",
  "pkgname": "drumstick",
  "pkgver": "2.7.2-1",
  "startdir": "/startdir"
}

We are now using gcc 13.1. Have you tested builds against these versions?

FWIW, I can reproduce what is being reported in https://bugs.archlinux.org/task/78797 with the current toolchain. I could try building against gcc12.

dvzrv commented 1 year ago

Same issue building with gcc12, so it's not unlikely that it's indeed an issue with qt >= 6.5.

Here's a build log with current gcc (13.1) again (without the noise of the debug package): drumstick-2.7.2-2-x86_64-build.log

Building against qt 5 works indeed still fine.

dvzrv commented 1 year ago

After a asking our Qt maintainer: It appears drumstick is using private functionality by using Q_DECL_EXPORT instead of defining its own macros and this is likely what broke drumstick for qt >= 6.5.

pedrolcl commented 1 year ago

After a asking our Qt maintainer: It appears drumstick is using private functionality by using Q_DECL_EXPORT instead of defining its own macros and this is likely what broke drumstick for qt >= 6.5.

The Qt6 documentation recommends using this macro when creating shared libraries. It may be that this macro has changed over the years and its usage should be revised. Patches are welcome,

dvzrv commented 1 year ago

Sorry, I'm but a humble packager (not a Qt expert).

Did you set target_compile_definitions() for DRUMSTICK as described in the link you sent? I could not find that in the code base.

Following another tip by Antonio Rojas (our Qt maintainer), the following (which should be considered a workaround for the time being) allows me to compile drumstick again:

export CXXFLAGS+=" -D DRUMSTICK_EXPORT=\"__attribute__((visibility(\\\"default\\\")))\""
antonio-rojas commented 1 year ago

With Qt>=6.4, Q_DECL_EXPORT_OVERRIDABLE should be used instead. See https://code.qt.io/cgit/qt/qtbase.git/commit/?id=19b7f854a274812d9c95fc7aaf134a12530c105f

pedrolcl commented 1 year ago

@dvzrv :

Did you set target_compile_definitions() for DRUMSTICK as described in the link you sent? I could not find that in the code base.

You are probably asking where are defined the pre-processor symbols drumstick_alsa_EXPORTS, drumstick_file_EXPORTS, drumstick_rt_EXPORTS and drumstick_widgets_EXPORTS, right? these symbols are automatically defined by CMake >= 3.0 for shared libraries so you don't need to define them by hand using target_compile_definitions().

@antonio-rojas :

With Qt>=6.4, Q_DECL_EXPORT_OVERRIDABLE should be used instead.

There are exactly ZERO references in the official documentation to that macro. Google results are not much better either.

image

So, I will wait to use this macro until it is officially documented and supported for cross-platform projects. On the other hand, Q_DECL_EXPORT and Q_DECL_IMPORT macros are both officially and well documented.

@dvzrv :

Following another tip by Antonio Rojas (our Qt maintainer), the following (which should be considered a workaround for the time being) allows me to compile drumstick again: export CXXFLAGS+=" -D DRUMSTICK_EXPORT=\"attribute((visibility(\\"default\\")))\""

This was exactly the definition of Q_DECL_EXPORT in Qt for a long time. Yes, you may use this workaround, if it is needed in Arch.

pedrolcl commented 1 year ago

I've moved this issue to the "drumstick" repository, which seems more appropriate than the old location

pedrolcl commented 1 year ago

Corresponding ticket 49 in SourceForge

pedrolcl commented 1 year ago

@antonio-rojas :

When configuring Qt6 withFEATURE_no_direct_extern_access=ON, like in your Arch package, I got this error:

CMake Error at cmake/QtBuildInformation.cmake:508 (message):
  Feature "no_direct_extern_access": Forcing to "ON" breaks its condition:

      NOT WIN32 AND TEST_no_direct_extern_access

  Condition values dump:

      WIN32 = ""
      TEST_no_direct_extern_access = "FALSE"

Call Stack (most recent call first):
  cmake/QtFeature.cmake:288 (qt_configure_add_report_error)
  cmake/QtFeature.cmake:410 (qt_feature_check_and_save_internal_value)
  cmake/QtFeature.cmake:625 (qt_evaluate_feature)
  cmake/QtBaseGlobalTargets.cmake:112 (qt_feature_module_end)
  CMakeLists.txt:130 (include)

So, I've needed to set TEST_no_direct_extern_access=TRUE as well in order to build Qt6 with the feature. This makes me think that it is considered an experimental feature and perhaps should be taken with some care, and not expose all users to it yet.

This has already disrupted several other projects:

pedrolcl commented 1 year ago

@dvzrv : an "official" fix is now in Git, branch "develop". It will be included in the next Drumstick release when it is ready.

antonio-rojas commented 1 year ago

When configuring Qt6 withFEATURE_no_direct_extern_access=ON, like in your Arch package, I got this error

That means the feature test is failing on your system for some reason, it works fine here. The feature was turned on on Arch by recommendation from Qt's Thiago Maiceira himself.

pedrolcl commented 1 year ago

That means the feature test is failing on your system for some reason, it works fine here. The feature was turned on on Arch by recommendation from Qt's Thiago Maiceira himself.

I've noticed.

I've also noticed that you don't fully read the comments.

pedrolcl commented 1 year ago

Drumstick v2.8.0 has been released: https://sourceforge.net/projects/drumstick/files/2.8.0/

This issue is done on this release.