summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--package/haproxy/Config.in1
-rw-r--r--package/haproxy/haproxy.mk6
2 files changed, 6 insertions, 1 deletions
diff --git a/package/haproxy/Config.in b/package/haproxy/Config.in
index cbcbc0c388..fbe5941b55 100644
--- a/package/haproxy/Config.in
+++ b/package/haproxy/Config.in
@@ -1,7 +1,6 @@
config BR2_PACKAGE_HAPROXY
bool "haproxy"
depends on BR2_USE_MMU # fork()
- depends on BR2_TOOLCHAIN_HAS_SYNC_4 # __sync_*_4 intrisics
help
HAProxy is a free, very fast and reliable solution offering
high availability, load balancing, and proxying for TCP and
diff --git a/package/haproxy/haproxy.mk b/package/haproxy/haproxy.mk
index 363fc4447f..061a8cbbaf 100644
--- a/package/haproxy/haproxy.mk
+++ b/package/haproxy/haproxy.mk
@@ -20,7 +20,13 @@ HAPROXY_LIBS += -latomic
endif
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
+# threads uses atomics on gcc >= 4.7 and sync otherwise (see
+# include/common/hathreads.h)
+ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_7):$(BR2_TOOLCHAIN_HAS_ATOMIC),y:y)
HAPROXY_MAKE_OPTS += USE_THREAD=1
+else ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_4_7):$(BR2_TOOLCHAIN_HAS_SYNC_4),:y)
+HAPROXY_MAKE_OPTS += USE_THREAD=1
+endif
endif
ifeq ($(BR2_PACKAGE_LUA_5_3),y)
OpenPOWER on IntegriCloud