Re: [PATCH]: dragonflybsd build fix

2021-09-04 Thread Willy TARREAU
Hi David,

On Sat, Sep 04, 2021 at 09:01:11AM +0100, David CARLIER wrote:
> Hi here a little fix proposal for this platform.
> 
> Cheers.

> From 6cfa1fce839504e04584d1bfedee188bc21c32b1 Mon Sep 17 00:00:00 2001
> From: DC 
> Date: Sat, 4 Sep 2021 09:58:57 +0100
> Subject: [PATCH] BUILD/MINOR: dragonfly build fix.
> 
> build failure since __read_mostly is undefined.

This seems to contradict the previous patch that touched this area:

commit d272b409d73f71b1a85dcc78b380a6188d194329
Author: Amaury Denoyelle 
Date:   Fri Apr 23 16:35:13 2021 +0200

BUILD: compiler: do not use already defined __read_mostly on dragonfly

DragonflyBSD already has an attribute __read_mostly which serves the
same purpose as the one in compiler.h.

As such I suspect that it might depend on the version and that we ought
to avoid relying on the OS but on the root cause of the problem, i.e.
that the macro is already defined. Thus for me the right fix would be
this:

- #if !defined(__DragonFly__)
+ #if !defined(__read_mostly)
  #define __read_mostly   HA_SECTION("read_mostly")
  #endif

Willy



[PATCH]: dragonflybsd build fix

2021-09-04 Thread David CARLIER
Hi here a little fix proposal for this platform.

Cheers.
From 6cfa1fce839504e04584d1bfedee188bc21c32b1 Mon Sep 17 00:00:00 2001
From: DC 
Date: Sat, 4 Sep 2021 09:58:57 +0100
Subject: [PATCH] BUILD/MINOR: dragonfly build fix.

build failure since __read_mostly is undefined.
---
 include/haproxy/compiler.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/haproxy/compiler.h b/include/haproxy/compiler.h
index ca3b844c1..435f7a28f 100644
--- a/include/haproxy/compiler.h
+++ b/include/haproxy/compiler.h
@@ -91,6 +91,8 @@
 /* use this attribute on a variable to move it to the read_mostly section */
 #if !defined(__DragonFly__)
 #define __read_mostly   HA_SECTION("read_mostly")
+#else
+#define __read_mostly
 #endif
 
 /* This allows gcc to know that some locations are never reached, for example
-- 
2.31.1