gbevin / ShowMIDI

Multi-platform GUI application to effortlessly visualize MIDI activity

Home Page:https://uwyn.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failure to build on arm with gcc 8.3.0

riban-bw opened this issue · comments

Attempts to build on a Raspberrry Pi running Debian Bullseye armv71 (32-bit) fails with the error:

/usr/include/c++/8/bits/unique_ptr.h:79:16: error: invalid application of ‘sizeof’ to incomplete type ‘showmidi::MainLayoutComponent::Pimpl’
  static_assert(sizeof(_Tp)>0,

This is during an attempt to build the standalone or the LV2 plugin:

make Standalone
make LV2

I will also test on 64-bit Bookworm...

Is that the only error, is there more for additional context?

Full context of error:

Compiling PluginEditor.cpp
In file included from /usr/include/c++/8/condition_variable:43,
                 from ../../JUCE/modules/juce_core/system/juce_StandardHeader.h:54,
                 from ../../JUCE/modules/juce_core/juce_core.h:204,
                 from ../../JUCE/modules/juce_audio_basics/juce_audio_basics.h:54,
                 from ../../JuceLibraryCode/JuceHeader.h:17,
                 from ../../Source/PluginEditor.h:20,
                 from ../../Source/PluginEditor.cpp:18:
/usr/include/c++/8/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = showmidi::MainLayoutComponent::Pimpl]’:
/usr/include/c++/8/bits/unique_ptr.h:274:17:   required from ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = showmidi::MainLayoutComponent::Pimpl; _Dp = std::default_delete<showmidi::MainLayoutComponent::Pimpl>]’
../../Source/MainLayoutComponent.h:48:49:   required from here
/usr/include/c++/8/bits/unique_ptr.h:79:16: error: invalid application of ‘sizeof’ to incomplete type ‘showmidi::MainLayoutComponent::Pimpl’
  static_assert(sizeof(_Tp)>0,
                ^~~~~~~~~~~
make: *** [Makefile:329: build/intermediate/Release/PluginEditor_94d4fb09.o] Error 1

I am working back through commits to see if it is a regression but have reached 0.6.1 tag and still errors.

Same error on arm 64 bit. Builds okay on x86_64 GNU/Linux (Ubuntu).

I have built without error on an ARM 64: Linux riban-modular-1 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux using gcc 12.2.0. It fails on ARM 32: Linux zynthian 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l GNU/Linux and ARM 64: Linux z2 6.1.37-v8+ #1660 SMP PREEMPT Mon Jul 3 12:56:29 BST 2023 aarch64 GNU/Linux, both using gcc 8.3.0.

The working platform is using DietPi OS whereas the failing platforms are using ZynthianOS which is basically Debian Bullseye.

So this may be related to gcc version.

Oh, I'm not surprised this doesn't build on a 32-bit OS

Also this expects C++14 compatibility at least, if the compiler isn't capable of that, it'll not work

I just built it on a Debian 11 aarch64 machine without any issue, all packages updated.

lscpu
Architecture:                       aarch64
CPU op-mode(s):                     32-bit, 64-bit
Byte Order:                         Little Endian
CPU(s):                             2
On-line CPU(s) list:                0,1
Thread(s) per core:                 1
Core(s) per socket:                 2
Socket(s):                          1
NUMA node(s):                       1
Vendor ID:                          ARM
Model:                              1
Model name:                         Neoverse-N1
gcc --version
gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I reworked component instantiation, since it seems that's where your compiler was getting confused. It still builds on all the machines I'm testing on, include that arm machine that passed before too. Would be worth a shot to try that on your system.

Ok, I managed to reproduce your error by installing Debian 10, which has gcc 8.3.0. My latest commit does fix the build and everything succeeds. Closing the issue.

Thanks for a quick response. There are several warnings during compilation with gcc 8 but they relate to changes in parameter passing since gcc 7 - certainly not worth investigating as they go away with later versions of gcc. I am really pleased that you have fixed this for the older compiler as it means we can use it now in Zynthian and not wait for the (fairly imminent) update to 64-bit Debian 12. I am sharing the news on the Zynthian forum. Cheers!