Hi guys,

On Sat, Feb 17, 2018 at 09:15:56PM +0300, Dmitry Sivachenko wrote:
> > On 14 February 2018 at 11:09, Dmitry Sivachenko <trtrmi...@gmail.com> wrote:
> >> What about this change?
> >> 
> >> --- work/haproxy-1.8.4/include/common/hathreads.h       2018-02-08 
> >> 13:05:15.000000000 +0000
> >> +++ /tmp/hathreads.h    2018-02-14 11:06:25.031422000 +0000
> >> @@ -104,7 +104,7 @@ extern THREAD_LOCAL unsigned long tid_bi
> >> /* TODO: thread: For now, we rely on GCC builtins but it could be a good 
> >> idea to
> >>  * have a header file regrouping all functions dealing with threads. */
> >> 
> >> -#if defined(__GNUC__) && (__GNUC__ < 4 || __GNUC__ == 4 && __GNUC_MINOR__ 
> >> < 7) && !defined(__clang__)
> >> +#if (defined(__GNUC__) && (__GNUC__ < 4 || __GNUC__ == 4 && 
> >> __GNUC_MINOR__ < 7) && !defined(__clang__)) || (defined(__clang__) && 
> >> defined(__i386__))
> >> /* gcc < 4.7 */
> >> 
> >> #define HA_ATOMIC_ADD(val, i)        __sync_add_and_fetch(val, i)
> >> 
> >> 
> 
> 
> > On 14 Feb 2018, at 14:13, David CARLIER <devne...@gmail.com> wrote:
> > Whatever works best for you. Regards.
> 
> 
> Well, I wonder if this is worth including into haproxy src?

Well, I'll see with Olivier with whom we've done some of the lockless
changes. We noticed already certain similar issues and figured that we
didn't properly restrict what CPUs should be supported. In practice
given that we do use some compare-and-swap operations that are not
present on i386, the minimally supported CPU should be i486. And I'm
pretty sure that looking closer we'll find other restrictions. So I'd
like that instead we try to cleanly redefine the exact compatbility
matrix so that threads are only enabled where reasonably possible, and
that we don't try to do marvels where it doesn't make sense.

Note that I've had a similar issue when building for a dual-core MIPS,
requiring libatomic for the same symbols, which my toolchain didn't have...
That situation is definitely not the cleanest we can think of!

Cheers,
Willy

Reply via email to