From: Anton Gladky Date: Thu, 14 Jan 2021 16:42:34 +0000 (+0100) Subject: Fix compilation on armel X-Git-Tag: archive/raspbian/3.1+ds1-4+rpi1^2~114 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=93f958ed06852bb94d9b9f6f240a4d733201558c;p=solvespace.git Fix compilation on armel --- diff --git a/debian/patches/fix_armel_compilation.patch b/debian/patches/fix_armel_compilation.patch new file mode 100644 index 0000000..5cb0296 --- /dev/null +++ b/debian/patches/fix_armel_compilation.patch @@ -0,0 +1,33 @@ +Description: Fix compilation on armel + use mnemonic 'yield' only for ARMv7 onwards +Author: Anton Gladky +Origin: https://github.com/boostorg/fiber/commit/388f52e9a07961c6cd331bcc38221d5a6599f030 +Last-Update: 2021-01-14 + +--- solvespace-3.0.rc1+repack1.orig/extlib/mimalloc/include/mimalloc-atomic.h ++++ solvespace-3.0.rc1+repack1/extlib/mimalloc/include/mimalloc-atomic.h +@@ -272,6 +272,24 @@ static inline void mi_atomic_maxi64(vola + static inline void mi_atomic_yield(void) { + asm volatile ("pause" ::: "memory"); + } ++#elif (defined(__ARM_ARCH_2__) || \ ++ defined(__ARM_ARCH_3__) || \ ++ defined(__ARM_ARCH_3M__) || \ ++ defined(__ARM_ARCH_4T__) || \ ++ defined(__TARGET_ARM_4T) || \ ++ defined(__ARM_ARCH_5__) || \ ++ defined(__ARM_ARCH_5E__) || \ ++ defined(__ARM_ARCH_5T__) || \ ++ defined(__ARM_ARCH_5TE__) || \ ++ defined(__ARM_ARCH_5TEJ__) || \ ++ defined(__ARM_ARCH_6__) || \ ++ defined(__ARM_ARCH_6J__) || \ ++ defined(__ARM_ARCH_6K__) || \ ++ defined(__ARM_ARCH_6Z__) || \ ++ defined(__ARM_ARCH_6ZK__) || \ ++ defined(__ARM_ARCH_6T2__)) \ ++# warning "architecture does not support yield/pause mnemonic" ++ std::this_thread::yield(); + #elif defined(__arm__) || defined(__aarch64__) + static inline void mi_atomic_yield(void) { + asm volatile("yield"); diff --git a/debian/patches/series b/debian/patches/series index f2c1edd..19a0d06 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ 01_RemoveGitHash.patch 20_use_system_flatbuffers.patch +fix_armel_compilation.patch diff --git a/debian/rules b/debian/rules index d8309f6..08f0acf 100755 --- a/debian/rules +++ b/debian/rules @@ -2,5 +2,10 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all +ifneq (,$(filter $(DEB_HOST_ARCH), armel m68k mips mipsel powerpc sh4)) + export DEB_CXXFLAGS_MAINT_APPEND += -Wl,--no-as-needed -latomic -Wl,--as-needed + export DEB_LDFLAGS_MAINT_APPEND += -Wl,--no-as-needed -latomic -Wl,--as-needed +endif + %: dh $@