Skip to contentSkip to conversation

wampcc: needs atomic

PATCH New Fabrice Fontaine 2 participants 2 messages Jul 10, 2018 – Jul 16, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 wampcc: needs atomic

Fixes:
- http://autobuild.buildroot.net/results/2f994762d4e01a904c50cf2728a4103e6e79da2a

---
Changes v1 -> v2 (after review of Thomas Petazzoni):
- Add BR2_TOOLCHAIN_HAS_ATOMIC in Config.in

 package/wampcc/Config.in | 3 +++
 package/wampcc/wampcc.mk | 5 +++++
 2 files changed, 8 insertions(+)
package/wampcc/Config.in +3 -0
index 9cf7d99dfe..92abc9cb25 100644
@@ -4,6 +4,7 @@ config BR2_PACKAGE_WAMPCC
 	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # libuv
 	depends on BR2_USE_MMU # libuv
 	depends on !BR2_STATIC_LIBS # libuv
+	depends on BR2_TOOLCHAIN_HAS_ATOMIC
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # libuv
 	depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 # std::shared_future
 	select BR2_PACKAGE_LIBUV
@@ -17,11 +18,13 @@ config BR2_PACKAGE_WAMPCC
 
 comment "wampcc needs a toolchain w/ C++, NPTL, dynamic library"
 	depends on BR2_USE_MMU
+	depends on BR2_TOOLCHAIN_HAS_ATOMIC
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4
 	depends on !BR2_INSTALL_LIBSTDCPP || \
 		!BR2_TOOLCHAIN_HAS_THREADS_NPTL || BR2_STATIC_LIBS
 
 comment "wampcc needs a toolchain not affected by GCC bug 64735"
 	depends on BR2_USE_MMU
+	depends on BR2_TOOLCHAIN_HAS_ATOMIC
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4
 	depends on BR2_TOOLCHAIN_HAS_GCC_BUG_64735
package/wampcc/wampcc.mk +5 -0
index d8e093f679..dcd65f49d5 100644
@@ -11,4 +11,9 @@ WAMPCC_INSTALL_STAGING = YES
 WAMPCC_LICENSE = MIT
 WAMPCC_LICENSE_FILES = LICENSE
 
+# Uses __atomic_fetch_add_8
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+WAMPCC_CONF_OPTS += -DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -latomic"
+endif
+
 $(eval $(cmake-package))
Signature · 1 line
2.14.1
#1 lore raw

PATCH v2 1/1 wampcc: needs atomic

Hello,

Quoted 7 lines · Fabrice Fontaine

Fixes:
- http://autobuild.buildroot.net/results/2f994762d4e01a904c50cf2728a4103e6e79da2a

---
Changes v1 -> v2 (after review of Thomas Petazzoni):
- Add BR2_TOOLCHAIN_HAS_ATOMIC in Config.in

Applied to master, thanks. I believe there's probably quite a few packages that link with -latomic if BR2_TOOLCHAIN_HAS_LIBATOMIC=y, but don't depend on BR2_TOOLCHAIN_HAS_ATOMIC. However, it's not as simple as adding "depends on BR2_TOOLCHAIN_HAS_ATOMIC" to all packages that link with -latomic, because some packages can use either __sync or __atomic built-ins.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com