Compilation error

Get help for specific problems
Posts: 3
Joined: 19 Aug 2021

rcfa

Hi,

I'm trying to compile from source a arm64 version for Kali-Linux on a Raspberry Pi 4.
I'm roughly following the instructions here (where applicable): https://github.com/pmkees/build-FreeFileSync-on-raspberry-pi

Dependencies were (so far) taken care of by
sudo apt install libgtk2.0-dev libxtst-dev libwxbase3.0-dev libwxgtk3.0-gtk3-dev libwxgtk-media3.0-gtk3-dev libwxgtk-webview3.0-gtk3-dev wx-common wx3.0-headers wx3.0-doc libssh2-1-dev libcurl4-openssl-dev
But I'm getting stuck at the following compilation error:
In file included from ../../zen/i18n.h:12,
                 from <command-line>:
../../zen/globals.h: In member function ‘void zen::PodSpinMutex::lock()’:
../../zen/globals.h:226:15: error: ‘struct std::atomic_flag’ has no member named ‘wait’
  226 |         flag_.wait(true, std::memory_order_relaxed);
      |               ^~~~
compilation terminated due to -Wfatal-errors.
What's required to fix this?
Posts: 309
Joined: 7 Jan 2018

bgstack15

--- 11.9-0/zen/globals.h   2021-05-10 08:10:14.755776667 -0400
+++ 11.9-1/zen/globals.h   2021-05-10 09:17:25.122241641 -0400
@@ -223,7 +223,11 @@
 void PodSpinMutex::lock()
 {
     while (!tryLock())
+#ifdef __cpp_lib_atomic_wait
         flag_.wait(true, std::memory_order_relaxed);
+#else
+        ;
+#endif
 }


@@ -231,7 +235,9 @@
 void PodSpinMutex::unlock()
 {
     flag_.clear(std::memory_order_release);
+#ifdef __cpp_lib_atomic_wait
     flag_.notify_one();
+#endif
 }
edit: fixed content
Posts: 8
Joined: 19 Jul 2020

pmkees2

Thanks bgstack15 for the hints! Before your edits, I tried the latest gcc 10 compiler (10.3) but it didn't change anything.

I hit one other problem (related to zen/legacy_compiler.cpp if memory serves me right) I took a shortcut and copied an earlier version of the file to successfully finished compilation- unsure if the executable is healthy and fully functional though (but worked enough for my task at hand).

FFS is forward-leaning when it comes to keeping your dependencies up-to-date, that's for sure. :)

-pmkees