On Sun, Jun 24, 2018 at 09:42:54AM +0200, William Lallemand wrote:
> On Sun, Jun 24, 2018 at 02:30:57AM +0000, Zero King wrote:
> > Hi,
> > 
> > I tried to update haproxy to 1.8.10 in MacPorts, but it fails to build
> > from source with the following error (without USE_THREAD):
> > 
> > /usr/bin/clang -arch x86_64 -Iinclude -Iebtree -Wall  -O2 -g 
> > -fno-strict-aliasing -Wdeclaration-after-statement -fwrapv 
> > -fno-strict-overflow  -Wno-address-of-packed-member -Wno-null-dereference 
> > -Wno-unused-label       -DTPROXY -DCONFIG_HAP_CRYPT -DUSE_ZLIB  
> > -DENABLE_POLL -DENABLE_KQUEUE -DCONFIG_REGPARM=3 -DUSE_OPENSSL  -DUSE_PCRE 
> > -I/opt/local/include  -DCONFIG_HAPROXY_VERSION=\"1.8.10-ec17d7a\" 
> > -DCONFIG_HAPROXY_DATE=\"2018/06/22\" -c -o src/log.o src/log.c
> > src/haproxy.c:2475:16: error: cannot take the address of an rvalue of type 
> > 'unsigned long'
> >         HA_ATOMIC_AND(&all_threads_mask, ~tid_bit);
> >                       ^~~~~~~~~~~~~~~~~
> > include/common/hathreads.h:41:42: note: expanded from macro 'HA_ATOMIC_AND'
> > #define HA_ATOMIC_AND(val, flags)    ({*(val) &= (flags);})
> >                                          ^~~
> > 1 error generated.
> > 
> 
> 
> Thanks for your report, there a patch that should solve this issue.
> 

Forgot to mention that it must be backported in the commit. 


-- 
William Lallemand
>From 081e7f64b1f2ff882be5eb1cb13e44fd2587e806 Mon Sep 17 00:00:00 2001
From: William Lallemand <[email protected]>
Date: Sun, 24 Jun 2018 09:37:03 +0200
Subject: [PATCH] BUG/BUILD: threads: unbreak build without threads

The build without threads was once again broken.

This issue was introduced in commit ba86c6c ("MINOR: threads: Be sure to
remove threads from all_threads_mask on exit").

This is exactly the same problem as last time it happened, because of
all_threads_mask not being defined with USE_THREAD=

This must be backported in 1.8
---
 src/haproxy.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/haproxy.c b/src/haproxy.c
index 11d1d47ce..4101cefa1 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -2473,9 +2473,8 @@ static void *run_thread_poll_loop(void *data)
 	list_for_each_entry(ptdf, &per_thread_deinit_list, list)
 		ptdf->fct();
 
-	HA_ATOMIC_AND(&all_threads_mask, ~tid_bit);
-
 #ifdef USE_THREAD
+	HA_ATOMIC_AND(&all_threads_mask, ~tid_bit);
 	if (tid > 0)
 		pthread_exit(NULL);
 #endif
-- 
2.16.1

Reply via email to