Closed olewales closed 3 years ago
I am not sure about this, I use docker so I actually do not deal with the compilation directly. If you find a solution, please add it to the wiki in a new section at the end of https://github.com/eried/portapack-mayhem/wiki/Compile-firmware
hi! My portapack works with 1.3.1 but not with 1.4.0. I figured no big deal, I'll simply bisect the issue, except I can't build because of this bug. Pretty please fix build with gcc 10
[522/620] /opt/gcc-arm-none-eabi/bin/arm-none-eabi-g++ -DCORTEX_USE_FPU=TRUE -DTHUMB_NO_INTERWORKING -DTHUMB_PRESENT -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/baseband/. -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/common -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios/os/ports/common/ARMCMx/CMSIS/include -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios/os/ports/common/ARMCMx -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios/os/ports/GCC/ARMCMx -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios-portapack/os/ports/GCC/ARMCMx/LPC43xx_M4 -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios/os/kernel/include -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios/test -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios/os/hal/include -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios-portapack/os/hal/platforms/LPC43xx_M4 -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios-portapack/os/hal/platforms/LPC43xx -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios-portapack/boards/PORTAPACK_BASEBAND -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios/os/various -mcpu=cortex-m4 -O3 -g -falign-functions=16 -fno-math-errno --specs=nano.specs -ffunction-sections -fdata-sections -fno-common -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -std=c++17 -fno-rtti -fno-exceptions -Weffc++ -Wuninitialized -Wall -Wextra -mno-thumb-interwork -mthumb -DTHUMB -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -MD -MT firmware/baseband/CMakeFiles/baseband_shared.dir/spectrum_collector.cpp.obj -MF firmware/baseband/CMakeFiles/baseband_shared.dir/spectrum_collector.cpp.obj.d -o firmware/baseband/CMakeFiles/baseband_shared.dir/spectrum_collector.cpp.obj -c /var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/baseband/spectrum_collector.cpp
FAILED: firmware/baseband/CMakeFiles/baseband_shared.dir/spectrum_collector.cpp.obj
/opt/gcc-arm-none-eabi/bin/arm-none-eabi-g++ -DCORTEX_USE_FPU=TRUE -DTHUMB_NO_INTERWORKING -DTHUMB_PRESENT -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/baseband/. -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/common -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios/os/ports/common/ARMCMx/CMSIS/include -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios/os/ports/common/ARMCMx -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios/os/ports/GCC/ARMCMx -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios-portapack/os/ports/GCC/ARMCMx/LPC43xx_M4 -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios/os/kernel/include -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios/test -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios/os/hal/include -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios-portapack/os/hal/platforms/LPC43xx_M4 -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios-portapack/os/hal/platforms/LPC43xx -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios-portapack/boards/PORTAPACK_BASEBAND -I/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/chibios/os/various -mcpu=cortex-m4 -O3 -g -falign-functions=16 -fno-math-errno --specs=nano.specs -ffunction-sections -fdata-sections -fno-common -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -std=c++17 -fno-rtti -fno-exceptions -Weffc++ -Wuninitialized -Wall -Wextra -mno-thumb-interwork -mthumb -DTHUMB -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -DLPC43XX -DLPC43XX_M4 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0 -D'VERSION_STRING="local-f161e85f"' -MD -MT firmware/baseband/CMakeFiles/baseband_shared.dir/spectrum_collector.cpp.obj -MF firmware/baseband/CMakeFiles/baseband_shared.dir/spectrum_collector.cpp.obj.d -o firmware/baseband/CMakeFiles/baseband_shared.dir/spectrum_collector.cpp.obj -c /var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/baseband/spectrum_collector.cpp
/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/baseband/spectrum_collector.cpp: In instantiation of 'typename T::value_type spectrum_window_hamming_3(const T&, size_t) [with T = std::array<std::complex<float>, 256>; typename T::value_type = std::complex<float>; size_t = unsigned int]':
/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/baseband/spectrum_collector.cpp:145:79: required from here
/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/baseband/spectrum_collector.cpp:116:28: error: non-constant condition for static assertion
116 | static_assert(power_of_two(s.size()), "Array size must be power of 2");
| ~~~~~~~~~~~~^~~~~~~~~~
/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/baseband/spectrum_collector.cpp:116:28: error: 's' is not a constant expression
/var/tmp/portage/net-wireless/portapack-mayhem-9999/work/portapack-mayhem-9999/firmware/baseband/spectrum_collector.cpp:117:19: error: 's' is not a constant expression
117 | constexpr size_t mask = s.size() - 1;
| ^~~~
ninja: build stopped: subcommand failed.
Hi, I updated the compile guide on the wiki with Debian arm-gcc install / compilation based on Aj's script. I think you can use it for most linux flavors, just adapt the apt parts and the directories to fit your need. GCC 10 is not yet supported / working. Debian 'testing' here. Link to doc: https://github.com/eried/portapack-mayhem/wiki/Compile-firmware#using-arm-on-debian
I am not sure about this, I use docker so I actually do not deal with the compilation directly. If you find a solution, please add it to the wiki in a new section at the end of https://github.com/eried/portapack-mayhem/wiki/Compile-firmware
Done
Was building with gcc 10 fixed? seems kind of short sighted to close this bug, it's not like gcc 9 will live forever, and gcc 11 is already released and being used by some distros....
oh, it can stay open in that case. Sorry about that.
Any news about it ? I am using Docker under windows and it compiles well , but the process is really slow, it takes many minutes any new test . It would be great to fix the compile errors with gcc 10 from Pentoo distro .
Just compile using Linux or a VM on Windows running Linux. Kali works fine.
Hi, thanks to all , who contributed to that good HackRf Portapack Mayhem firmware . And thaks to olewales for your comment and hints about that Compiler error , when changing GCC 9 --> GCC 10. I am newbie in C++ arm embedded firmware, but eager to learn .
I could reproduce exactly the same GCC 10 compiler error that Olewales pointed ,(on Pentoo (Gentoo distro) that from long time ago, uses GCC 10.)
1-) The compiler error appears only retated to that file :baseband/spectrum_collector.cpp,
2-) At compiler time, in the code we are defining 3 different values of spectrum Windowing in time template type T : static typename T::value_type spectrum_window_none static typename T::value_type spectrum_window_hamming_3 static typename T::value_type spectrum_window_blackman_3. But the code , in line same file , spectrum_collector.cpp, 145 , we are only using and calling that spectrum window hamming 3, that is why also the declaration structure is similar , the compiler , only claims error about the hamming_3 , lines 116, and 117 .
3-) Now in the current Portapack Mayhem fw , we have two types compiler errors (when using GCC10) ,
a-) error: 's' is not a constant expression , 117 | constexpr size_t mask = s.size() - 1;
After checking information about that "constexpr"
"The primary difference between const and constexpr variables is that the initialization of a const variable can be deferred until run time. A constexpr variable must be initialized at compile time. ... A variable can be declared with constexpr , when it has a literal type and is initialized."
then I believed that, as you said (Olewales ) , it can be sort out , changing constesxpr --> to const . _const sizet mask = s.size() - 1;
b-) Regarding the second error ,
“In instantiation of 'typename T::value_type spectrum_window_hamming_3(const T&, size_t) [with T = std::array<std::complex
error: non-constant condition for static assertion 116 | static_assert(power_of_two(s.size()), "Array size must be power of 2");”
I also tried to gather some information about it ,
"The compiler examines the static_assert declaration for syntax errors when the declaration is encountered. The compiler evaluates the constant-expression parameter immediately if it does not depend on a template parameter. Otherwise, the compiler evaluates the constant-expression parameter when the template is instantiated. Consequently, the compiler might issue a diagnostic message
And checking the static_assert declaration sintax : static_assert( constant-expression, string-literal );
The constant-expression parameter of a static_assert declaration represents a software assertion. A software assertion specifies a BOOLEAN condition that you expect to be true at a particular point in your program.
* If the boolean condition is TRUE the static_assert declaration has no effect.
* If the boolean condition is false, the assertion fails, the compiler displays the message in string-literal parameter, and the compilation fails with an error.
I need to check more the code, but I believed that in our Portapack case, always the
instantiation of 'typename T: is referring to an array size power of 2, not ?
Therefore , when we are compiling this line . static_assert , we alwasy will get TRUE, and no impacct at all about our code generation.
Then from that sense , it seems also OK to delele that particular “safety compile debugging line” ?
Then basically I can agree with Olewales suggestion, lines 116, 117 :
/ static_assert(power_of_two(s.size()), "Array size must be power of 2"); / const size_t mask = s.size() - 1;
I need to continue checking and studying about it , and confirming that there is also no side effects on GCC9 and GCC10 with those two changes.
If anyone has some other alternative better syntax solutions (regarding that static_assert declaration debugging test at compile time ) , it would be highly appreciated ! (compatible for both versions GCC9 / GCC10)
I believe this is related to a bug fixed in GCC10: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66477
you are correct, it was never valid. happens with gcc 11 too.
this is the only thing really breaking any of the docker vs. Other builds, the dockerfile just uses an old version of gcc that thinks it's valid. it's been invalid since it was added in b69a3abcb5d727e6456ef922f430d312c9cf7843
it is "safe" to delete it, but it's only there to protect people from using a type that is not valid (it's .size() needs to be power_of_two)
Solved in new release with #419
Thanks!
Trying to compile firmware with gcc 10 yields following error:
Code may be made to compile by removing constexpr and assertion but there should be a better way to fix this
I believe this is related to a bug fixed in GCC10: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66477
GCC version: