Re: MINOR: Revert part of clarifying samples support per os commit

2022-09-02 Thread Brad Smith

On 9/3/2022 12:12 AM, Willy Tarreau wrote:

On Thu, Aug 25, 2022 at 11:13:38PM -0400, Brad Smith wrote:

Commit 5c83e3a1563cd7face299bf08037e51f976eb5e3 made some adjustments
to clarify which TCP_INFO information is supported by each respective
OS.

(...)

Merged, thank you Brad!
Willy


Can you add this to 2.6?



Re: [PATCH] BUILD: makefile: enable crypt(3) for NetBSD

2022-09-02 Thread Brad Smith

On 9/3/2022 12:11 AM, Willy Tarreau wrote:

On Sat, Aug 13, 2022 at 12:57:31AM -0400, Brad Smith wrote:

Allow NetBSD to support encrypted passwords in Userlists.


Mergd, thank you Brad!
Willy


You should be able to bring that back to 2.4.



Re: MINOR: Revert part of clarifying samples support per os commit

2022-08-30 Thread Brad Smith

ping.

On 8/25/2022 11:13 PM, Brad Smith wrote:

Commit 5c83e3a1563cd7face299bf08037e51f976eb5e3 made some adjustments
to clarify which TCP_INFO information is supported by each respective
OS.

There was a comment like so..

Note that fc_rtt and fc_rttvar are supported on any OS that has TCP_INFO,
not just linux/freebsd/netbsd, so we continue to expose them unconditionally.

But the diff didn't do so in a consistent manner.


diff --git a/src/tcp_sample.c b/src/tcp_sample.c
index 300ce1c8d..925b93291 100644
--- a/src/tcp_sample.c
+++ b/src/tcp_sample.c
@@ -373,7 +373,6 @@ static inline int get_tcp_info(const struct arg *args, 
struct sample *smp,
return 1;
  }
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)

  /* get the mean rtt of a client connection */
  static int
  smp_fetch_fc_rtt(const struct arg *args, struct sample *smp, const char *kw, 
void *private)
@@ -387,9 +386,7 @@ smp_fetch_fc_rtt(const struct arg *args, struct sample 
*smp, const char *kw, voi
  
  	return 1;

  }
-#endif
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)

  /* get the variance of the mean rtt of a client connection */
  static int
  smp_fetch_fc_rttvar(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -403,8 +400,6 @@ smp_fetch_fc_rttvar(const struct arg *args, struct sample 
*smp, const char *kw,
  
  	return 1;

  }
-#endif
-
  
  #if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)

  /* get the unacked counter on a client connection */




Re: [PATCH] BUILD: makefile: enable crypt(3) for NetBSD

2022-08-30 Thread Brad Smith

ping.

On 8/13/2022 12:57 AM, Brad Smith wrote:

Allow NetBSD to support encrypted passwords in Userlists.


diff --git a/Makefile b/Makefile
index 580cf6f9e..10c9ef7b4 100644
--- a/Makefile
+++ b/Makefile
@@ -453,8 +453,8 @@ endif
  # NetBSD 8 and above
  ifeq ($(TARGET),netbsd)
set_target_defaults = $(call default_opts, \
-USE_POLL USE_TPROXY USE_THREAD USE_KQUEUE USE_ACCEPT4 USE_CLOSEFROM   \
-USE_GETADDRINFO)
+USE_POLL USE_TPROXY USE_LIBCRYPT USE_THREAD USE_KQUEUE USE_ACCEPT4\
+USE_CLOSEFROM USE_GETADDRINFO)
  endif
  
  # AIX 5.1 only




MINOR: Revert part of clarifying samples support per os commit

2022-08-25 Thread Brad Smith
Commit 5c83e3a1563cd7face299bf08037e51f976eb5e3 made some adjustments
to clarify which TCP_INFO information is supported by each respective
OS.

There was a comment like so..

Note that fc_rtt and fc_rttvar are supported on any OS that has TCP_INFO,
not just linux/freebsd/netbsd, so we continue to expose them unconditionally.

But the diff didn't do so in a consistent manner.


diff --git a/src/tcp_sample.c b/src/tcp_sample.c
index 300ce1c8d..925b93291 100644
--- a/src/tcp_sample.c
+++ b/src/tcp_sample.c
@@ -373,7 +373,6 @@ static inline int get_tcp_info(const struct arg *args, 
struct sample *smp,
return 1;
 }
 
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
 /* get the mean rtt of a client connection */
 static int
 smp_fetch_fc_rtt(const struct arg *args, struct sample *smp, const char *kw, 
void *private)
@@ -387,9 +386,7 @@ smp_fetch_fc_rtt(const struct arg *args, struct sample 
*smp, const char *kw, voi
 
return 1;
 }
-#endif
 
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
 /* get the variance of the mean rtt of a client connection */
 static int
 smp_fetch_fc_rttvar(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -403,8 +400,6 @@ smp_fetch_fc_rttvar(const struct arg *args, struct sample 
*smp, const char *kw,
 
return 1;
 }
-#endif
-
 
 #if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
 /* get the unacked counter on a client connection */



Re: [PATCH] MINOR: tcp_sample: extend support for get_tcp_info to OpenBSD

2022-08-23 Thread Brad Smith

On 8/23/2022 11:22 PM, Willy Tarreau wrote:

On Tue, Aug 23, 2022 at 10:37:28PM -0400, Brad Smith wrote:

On 8/23/2022 10:22 PM, Willy Tarreau wrote:

Hi Brad,

On Sat, Aug 13, 2022 at 11:25:32PM -0400, Brad Smith wrote:

I'm not sure if MINOR is right. Currently the build is broken since TCP_INFO
was added.

Just to be certain, you mean the build is broken without your patch or
with it ? If it's broken without, it means that your patch is a build
fix, but it also indicates there's something wrong in the whole code's
arrangement there that we'll have to re-adjust, because we must not
break things for operating systems that are not explicitely handled.

The build is broken without the diff. I was looking at older releases and
this
only affects 2.7 and 2.6.

It looks like this changed things in such a way that if TCP_INFO is added
but the OS is not added to the list of OS's it will not build.

http://git.haproxy.org/?p=haproxy-2.6.git;a=commitdiff;h=5c83e3a1563cd7face299bf08037e51f976eb5e3;hp=39e436e36c4e6c0efe95c304fe89fd01e111

Oh I see... What a mess! Thanks for the clarifiation.

I'll merge your patch as a build fix and with such indications. It's
suitable for backporting. As a next step for 2.7 and further, we should
change this to have a new USE_TCP_INFO build options that will be set
by default in the makefile for supported operating systems and tested
instead of testing all OS combinations.

If you want to work on this, you're welcome :-)


BTW, the exact error is..

src/tcp_sample.c:503:24: fatal error: use of undeclared identifier 
'smp_fetch_fc_rtt'
    { "fc_rtt",   smp_fetch_fc_rtt, ARG1(0,STR), 
val_fc_time_value, SMP_T_SINT, SMP_USE_L4CLI },

  ^
1 error generated.



Re: [PATCH] MINOR: tcp_sample: extend support for get_tcp_info to OpenBSD

2022-08-23 Thread Brad Smith

On 8/23/2022 10:22 PM, Willy Tarreau wrote:

Hi Brad,

On Sat, Aug 13, 2022 at 11:25:32PM -0400, Brad Smith wrote:

I'm not sure if MINOR is right. Currently the build is broken since TCP_INFO
was added.

Just to be certain, you mean the build is broken without your patch or
with it ? If it's broken without, it means that your patch is a build
fix, but it also indicates there's something wrong in the whole code's
arrangement there that we'll have to re-adjust, because we must not
break things for operating systems that are not explicitely handled.


The build is broken without the diff. I was looking at older releases 
and this

only affects 2.7 and 2.6.

It looks like this changed things in such a way that if TCP_INFO is added
but the OS is not added to the list of OS's it will not build.

http://git.haproxy.org/?p=haproxy-2.6.git;a=commitdiff;h=5c83e3a1563cd7face299bf08037e51f976eb5e3;hp=39e436e36c4e6c0efe95c304fe89fd01e111



If you mean that the build is broken on certain versions once your
patch is applied, that means we'll need to re-adjust it or to ease
configuration of the feature.

Thanks,
Willy




Re: [PATCH] MINOR: tcp_sample: extend support for get_tcp_info to OpenBSD

2022-08-19 Thread Brad Smith

ping.

On 8/12/2022 10:23 PM, Brad Smith wrote:

extend support for get_tcp_info to OpenBSD.


diff --git a/src/tcp_sample.c b/src/tcp_sample.c
index 2e8a62173..300ce1c8d 100644
--- a/src/tcp_sample.c
+++ b/src/tcp_sample.c
@@ -357,8 +357,8 @@ static inline int get_tcp_info(const struct arg *args, 
struct sample *smp,
case 5:  smp->data.u.sint = info.tcpi_retrans;break;
case 6:  smp->data.u.sint = info.tcpi_fackets;break;
case 7:  smp->data.u.sint = info.tcpi_reordering; break;
-# elif defined(__FreeBSD__) || defined(__NetBSD__)
-   /* the ones are found on FreeBSD and NetBSD featuring TCP_INFO */
+# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+   /* the ones are found on FreeBSD, NetBSD and OpenBSD featuring TCP_INFO 
*/
case 2:  smp->data.u.sint = info.__tcpi_unacked;  break;
case 3:  smp->data.u.sint = info.__tcpi_sacked;   break;
case 4:  smp->data.u.sint = info.__tcpi_lost; break;
@@ -373,7 +373,7 @@ static inline int get_tcp_info(const struct arg *args, 
struct sample *smp,
return 1;
  }
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)

+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
  /* get the mean rtt of a client connection */
  static int
  smp_fetch_fc_rtt(const struct arg *args, struct sample *smp, const char *kw, 
void *private)
@@ -389,7 +389,7 @@ smp_fetch_fc_rtt(const struct arg *args, struct sample 
*smp, const char *kw, voi
  }
  #endif
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)

+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
  /* get the variance of the mean rtt of a client connection */
  static int
  smp_fetch_fc_rttvar(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -406,7 +406,7 @@ smp_fetch_fc_rttvar(const struct arg *args, struct sample 
*smp, const char *kw,
  #endif
  
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)

+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
  /* get the unacked counter on a client connection */
  static int
  smp_fetch_fc_unacked(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -417,7 +417,7 @@ smp_fetch_fc_unacked(const struct arg *args, struct sample 
*smp, const char *kw,
  }
  #endif
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)

+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__)
  /* get the sacked counter on a client connection */
  static int
  smp_fetch_fc_sacked(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -428,7 +428,7 @@ smp_fetch_fc_sacked(const struct arg *args, struct sample 
*smp, const char *kw,
  }
  #endif
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)

+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
  /* get the lost counter on a client connection */
  static int
  smp_fetch_fc_lost(const struct arg *args, struct sample *smp, const char *kw, 
void *private)
@@ -439,7 +439,7 @@ smp_fetch_fc_lost(const struct arg *args, struct sample 
*smp, const char *kw, vo
  }
  #endif
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)

+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
  /* get the retrans counter on a client connection */
  static int
  smp_fetch_fc_retrans(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -450,7 +450,7 @@ smp_fetch_fc_retrans(const struct arg *args, struct sample 
*smp, const char *kw,
  }
  #endif
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)

+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__)
  /* get the fackets counter on a client connection */
  static int
  smp_fetch_fc_fackets(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -461,7 +461,7 @@ smp_fetch_fc_fackets(const struct arg *args, struct sample 
*smp, const char *kw,
  }
  #endif
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)

+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__)
  /* get the reordering counter on a client connection */
  static int
  smp_fetch_fc_reordering(const struct arg *args, struct sample *smp, const 
char *kw, void *private)
@@ -502,22 +502,22 @@ static struct sample_fetch_kw_list sample_fetch_keywords 
= {ILH, {
  #ifdef TCP_INFO

Re: [PATCH] MINOR: tcp_sample: extend support for get_tcp_info to OpenBSD

2022-08-13 Thread Brad Smith
I'm not sure if MINOR is right. Currently the build is broken since 
TCP_INFO was added.


On 8/12/2022 10:23 PM, Brad Smith wrote:

extend support for get_tcp_info to OpenBSD.


diff --git a/src/tcp_sample.c b/src/tcp_sample.c
index 2e8a62173..300ce1c8d 100644
--- a/src/tcp_sample.c
+++ b/src/tcp_sample.c
@@ -357,8 +357,8 @@ static inline int get_tcp_info(const struct arg *args, 
struct sample *smp,
case 5:  smp->data.u.sint = info.tcpi_retrans;break;
case 6:  smp->data.u.sint = info.tcpi_fackets;break;
case 7:  smp->data.u.sint = info.tcpi_reordering; break;
-# elif defined(__FreeBSD__) || defined(__NetBSD__)
-   /* the ones are found on FreeBSD and NetBSD featuring TCP_INFO */
+# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+   /* the ones are found on FreeBSD, NetBSD and OpenBSD featuring TCP_INFO 
*/
case 2:  smp->data.u.sint = info.__tcpi_unacked;  break;
case 3:  smp->data.u.sint = info.__tcpi_sacked;   break;
case 4:  smp->data.u.sint = info.__tcpi_lost; break;
@@ -373,7 +373,7 @@ static inline int get_tcp_info(const struct arg *args, 
struct sample *smp,
return 1;
  }
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)

+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
  /* get the mean rtt of a client connection */
  static int
  smp_fetch_fc_rtt(const struct arg *args, struct sample *smp, const char *kw, 
void *private)
@@ -389,7 +389,7 @@ smp_fetch_fc_rtt(const struct arg *args, struct sample 
*smp, const char *kw, voi
  }
  #endif
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)

+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
  /* get the variance of the mean rtt of a client connection */
  static int
  smp_fetch_fc_rttvar(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -406,7 +406,7 @@ smp_fetch_fc_rttvar(const struct arg *args, struct sample 
*smp, const char *kw,
  #endif
  
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)

+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
  /* get the unacked counter on a client connection */
  static int
  smp_fetch_fc_unacked(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -417,7 +417,7 @@ smp_fetch_fc_unacked(const struct arg *args, struct sample 
*smp, const char *kw,
  }
  #endif
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)

+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__)
  /* get the sacked counter on a client connection */
  static int
  smp_fetch_fc_sacked(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -428,7 +428,7 @@ smp_fetch_fc_sacked(const struct arg *args, struct sample 
*smp, const char *kw,
  }
  #endif
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)

+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
  /* get the lost counter on a client connection */
  static int
  smp_fetch_fc_lost(const struct arg *args, struct sample *smp, const char *kw, 
void *private)
@@ -439,7 +439,7 @@ smp_fetch_fc_lost(const struct arg *args, struct sample 
*smp, const char *kw, vo
  }
  #endif
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)

+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
  /* get the retrans counter on a client connection */
  static int
  smp_fetch_fc_retrans(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -450,7 +450,7 @@ smp_fetch_fc_retrans(const struct arg *args, struct sample 
*smp, const char *kw,
  }
  #endif
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)

+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__)
  /* get the fackets counter on a client connection */
  static int
  smp_fetch_fc_fackets(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -461,7 +461,7 @@ smp_fetch_fc_fackets(const struct arg *args, struct sample 
*smp, const char *kw,
  }
  #endif
  
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)

+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__)
  /* get the reordering counter on a client connection */
  static int
  smp_fetch_fc_reordering(const struct arg *args, struct sample *smp, const 
char *kw, void *private)
@@ -502,22 +502,2

[PATCH] BUILD: makefile: enable crypt(3) for NetBSD

2022-08-12 Thread Brad Smith
Allow NetBSD to support encrypted passwords in Userlists.


diff --git a/Makefile b/Makefile
index 580cf6f9e..10c9ef7b4 100644
--- a/Makefile
+++ b/Makefile
@@ -453,8 +453,8 @@ endif
 # NetBSD 8 and above
 ifeq ($(TARGET),netbsd)
   set_target_defaults = $(call default_opts, \
-USE_POLL USE_TPROXY USE_THREAD USE_KQUEUE USE_ACCEPT4 USE_CLOSEFROM   \
-USE_GETADDRINFO)
+USE_POLL USE_TPROXY USE_LIBCRYPT USE_THREAD USE_KQUEUE USE_ACCEPT4\
+USE_CLOSEFROM USE_GETADDRINFO)
 endif
 
 # AIX 5.1 only



[PATCH] MINOR: tcp_sample: extend support for get_tcp_info to OpenBSD

2022-08-12 Thread Brad Smith
extend support for get_tcp_info to OpenBSD.


diff --git a/src/tcp_sample.c b/src/tcp_sample.c
index 2e8a62173..300ce1c8d 100644
--- a/src/tcp_sample.c
+++ b/src/tcp_sample.c
@@ -357,8 +357,8 @@ static inline int get_tcp_info(const struct arg *args, 
struct sample *smp,
case 5:  smp->data.u.sint = info.tcpi_retrans;break;
case 6:  smp->data.u.sint = info.tcpi_fackets;break;
case 7:  smp->data.u.sint = info.tcpi_reordering; break;
-# elif defined(__FreeBSD__) || defined(__NetBSD__)
-   /* the ones are found on FreeBSD and NetBSD featuring TCP_INFO */
+# elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+   /* the ones are found on FreeBSD, NetBSD and OpenBSD featuring TCP_INFO 
*/
case 2:  smp->data.u.sint = info.__tcpi_unacked;  break;
case 3:  smp->data.u.sint = info.__tcpi_sacked;   break;
case 4:  smp->data.u.sint = info.__tcpi_lost; break;
@@ -373,7 +373,7 @@ static inline int get_tcp_info(const struct arg *args, 
struct sample *smp,
return 1;
 }
 
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__APPLE__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
 /* get the mean rtt of a client connection */
 static int
 smp_fetch_fc_rtt(const struct arg *args, struct sample *smp, const char *kw, 
void *private)
@@ -389,7 +389,7 @@ smp_fetch_fc_rtt(const struct arg *args, struct sample 
*smp, const char *kw, voi
 }
 #endif
 
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__APPLE__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
 /* get the variance of the mean rtt of a client connection */
 static int
 smp_fetch_fc_rttvar(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -406,7 +406,7 @@ smp_fetch_fc_rttvar(const struct arg *args, struct sample 
*smp, const char *kw,
 #endif
 
 
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__APPLE__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
 /* get the unacked counter on a client connection */
 static int
 smp_fetch_fc_unacked(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -417,7 +417,7 @@ smp_fetch_fc_unacked(const struct arg *args, struct sample 
*smp, const char *kw,
 }
 #endif
 
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__)
 /* get the sacked counter on a client connection */
 static int
 smp_fetch_fc_sacked(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -428,7 +428,7 @@ smp_fetch_fc_sacked(const struct arg *args, struct sample 
*smp, const char *kw,
 }
 #endif
 
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__APPLE__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
 /* get the lost counter on a client connection */
 static int
 smp_fetch_fc_lost(const struct arg *args, struct sample *smp, const char *kw, 
void *private)
@@ -439,7 +439,7 @@ smp_fetch_fc_lost(const struct arg *args, struct sample 
*smp, const char *kw, vo
 }
 #endif
 
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__APPLE__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__) || defined(__APPLE__)
 /* get the retrans counter on a client connection */
 static int
 smp_fetch_fc_retrans(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -450,7 +450,7 @@ smp_fetch_fc_retrans(const struct arg *args, struct sample 
*smp, const char *kw,
 }
 #endif
 
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__)
 /* get the fackets counter on a client connection */
 static int
 smp_fetch_fc_fackets(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -461,7 +461,7 @@ smp_fetch_fc_fackets(const struct arg *args, struct sample 
*smp, const char *kw,
 }
 #endif
 
-#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || 
defined(__OpenBSD__)
 /* get the reordering counter on a client connection */
 static int
 smp_fetch_fc_reordering(const struct arg *args, struct sample *smp, const char 
*kw, void *private)
@@ -502,22 +502,22 @@ static struct sample_fetch_kw_list sample_fetch_keywords 
= {ILH, {
 #ifdef TCP_INFO
{ "fc_rtt",   smp_fetch_fc_rtt,   ARG1(0,STR), 
val_fc_time_value, SMP_T_SINT, SMP_USE_L4CLI },
{ 

Re: [PR] Fix -v flag usage with install(1) on OpenBSD/NetBSD/Solaris/AIX

2022-07-16 Thread Brad Smith

On 7/16/2022 12:52 PM, Willy Tarreau wrote:

On Sat, Jul 16, 2022 at 05:18:50AM -0400, Brad Smith wrote:

On Sat, Jul 16, 2022 at 11:09:19AM +0200, Willy Tarreau wrote:

Looks good. Let's just add a commit message and I'll merge it.


BUILD: makefile: Fix install(1) handling for OpenBSD/NetBSD/Solaris/AIX

(...)

Applied, thank you Brad!
Willy


Thanks. Can this please be backported to at least 2.6?



Re: [PR] Fix -v flag usage with install(1) on OpenBSD/NetBSD/Solaris/AIX

2022-07-16 Thread Brad Smith
On Sat, Jul 16, 2022 at 11:09:19AM +0200, Willy Tarreau wrote:
> Looks good. Let's just add a commit message and I'll merge it.


BUILD: makefile: Fix install(1) handling for OpenBSD/NetBSD/Solaris/AIX

Add a new INSTALL variable to allow overridiing the flags passed to
install(1). install(1) on OpenBSD/NetBSD/Solaris/AIX does not support
the -v flag. With the new INSTALL variable and handling only use the
-v flag with the Linux targets.


diff --git a/Makefile b/Makefile
index 85f6c632d..5cc59a061 100644
--- a/Makefile
+++ b/Makefile
@@ -81,6 +81,9 @@
 #   DESTDIR is not set by default and is used for installation only.
 #   It might be useful to set DESTDIR if you want to install haproxy
 #   in a sandbox.
+#   INSTALL is set to "install" by default and is used to provide the name of
+#   the install binary used by the install targets and any additional
+#   flags.
 #   PREFIX  is set to "/usr/local" by default and is used for installation 
only.
 #   SBINDIR is set to "$(PREFIX)/sbin" by default and is used for installation
 #   only.
@@ -170,6 +173,7 @@ cc-nowarn = $(if $(cc-anywno),-Wno-$(1),$(shell set -e; if 
$(CC) -Werror -W$(1)
 
  Installation options.
 DESTDIR =
+INSTALL = install
 PREFIX = /usr/local
 SBINDIR = $(PREFIX)/sbin
 MANDIR = $(PREFIX)/share/man
@@ -378,6 +382,7 @@ ifeq ($(TARGET),linux-glibc)
 USE_CPU_AFFINITY USE_THREAD USE_EPOLL USE_LINUX_TPROXY\
 USE_ACCEPT4 USE_LINUX_SPLICE USE_PRCTL USE_THREAD_DUMP USE_NS USE_TFO \
 USE_GETADDRINFO USE_BACKTRACE)
+  INSTALL = install -v
 endif
 
 # For linux >= 2.6.28, glibc without new features
@@ -386,6 +391,7 @@ ifeq ($(TARGET),linux-glibc-legacy)
 USE_POLL USE_TPROXY USE_LIBCRYPT USE_DL USE_RT USE_CRYPT_H USE_NETFILTER  \
 USE_CPU_AFFINITY USE_THREAD USE_EPOLL USE_LINUX_TPROXY\
 USE_ACCEPT4 USE_LINUX_SPLICE USE_PRCTL USE_THREAD_DUMP USE_GETADDRINFO)
+  INSTALL = install -v
 endif
 
 # For linux >= 2.6.28 and musl
@@ -395,6 +401,7 @@ ifeq ($(TARGET),linux-musl)
 USE_CPU_AFFINITY USE_THREAD USE_EPOLL USE_LINUX_TPROXY\
 USE_ACCEPT4 USE_LINUX_SPLICE USE_PRCTL USE_THREAD_DUMP USE_NS USE_TFO \
 USE_GETADDRINFO)
+  INSTALL = install -v
 endif
 
 # Solaris 10 and above
@@ -1043,16 +1050,16 @@ src/haproxy.o:  src/haproxy.c $(DEP)
   -c -o $@ $<
 
 install-man:
-   $(Q)install -v -d "$(DESTDIR)$(MANDIR)"/man1
-   $(Q)install -v -m 644 doc/haproxy.1 "$(DESTDIR)$(MANDIR)"/man1
+   $(Q)$(INSTALL) -d "$(DESTDIR)$(MANDIR)"/man1
+   $(Q)$(INSTALL) -m 644 doc/haproxy.1 "$(DESTDIR)$(MANDIR)"/man1
 
 EXCLUDE_DOCUMENTATION = lgpl gpl coding-style
 DOCUMENTATION = $(filter-out $(EXCLUDE_DOCUMENTATION),$(patsubst 
doc/%.txt,%,$(wildcard doc/*.txt)))
 
 install-doc:
-   $(Q)install -v -d "$(DESTDIR)$(DOCDIR)"
+   $(Q)$(INSTALL) -d "$(DESTDIR)$(DOCDIR)"
$(Q)for x in $(DOCUMENTATION); do \
-   install -v -m 644 doc/$$x.txt "$(DESTDIR)$(DOCDIR)" ; \
+   $(INSTALL) -m 644 doc/$$x.txt "$(DESTDIR)$(DOCDIR)" ; \
done
 
 install-bin:
@@ -1062,8 +1069,8 @@ install-bin:
exit 1; \
fi; \
done
-   $(Q)install -v -d "$(DESTDIR)$(SBINDIR)"
-   $(Q)install -v haproxy $(EXTRA) "$(DESTDIR)$(SBINDIR)"
+   $(Q)$(INSTALL) -d "$(DESTDIR)$(SBINDIR)"
+   $(Q)$(INSTALL) haproxy $(EXTRA) "$(DESTDIR)$(SBINDIR)"
 
 install: install-bin install-man install-doc
 



Re: [PR] Fix -v flag usage with install(1) on OpenBSD/NetBSD/Solaris/AIX

2022-07-15 Thread Brad Smith
On Sat, Jul 16, 2022 at 06:25:52AM +0200, Willy Tarreau wrote:
> On Sat, Jul 16, 2022 at 12:22:49AM -0400, Brad Smith wrote:
> > On 7/15/2022 11:59 PM, Willy Tarreau wrote:
> > > Hello,
> > > 
> > > On Fri, Jul 15, 2022 at 07:27:12PM -0400, Brad Smith wrote:
> > > > On 7/15/2022 1:34 AM,  ??? wrote:
> > > > > I wonder how do NetBSD/OpenBSD ports work, do they use their own
> > > > > "install" invocation instead of "make install" ?
> > > > > shouldn't they switch to "make install" ?
> > > > NetBSD uses the Makefile's install targets but patches out the -v flag.
> > > > OpenBSD used it's own install target
> > > > but I'm trying to remove that special casing and I had basically the 
> > > > same
> > > > sort of diff NetBSD has. Can't switch
> > > > to the make install target until the Makfile is fixed.
> > > I agree with the principle of your patch, just not with the way it's done,
> > > because this variable "IV" is a bit cryptic and not easy to follow. Other
> > > programs also like to redefine the install program, thus I'd propose a
> > > simpler and more flexible approach:
> > > 
> > >- define "INSTALL = install" early, next to DESTDIR and friends
> > >- set "INSTALL = install -v" in the LINUX targets
> > >- use $(INSTALL) in the install targets
> > > 
> > > This way it even allows users of any platform to simply pass the INSTALL
> > > variable to match their needs (including setting it to "ginstall -v" on
> > > non-linux platforms where this often points to GNU install).
> > 
> > 
> > Hi Willy,
> > 
> > I kind of figured you would not be Ok with it as is. I did think about doing
> > something
> > as you suggested today as I was thinking about this. I was trying to keep
> > the
> > variable name short and I agree with you. What you have suggested is typical
> > in autoconf / automake environments.
> 
> Yes, INSTALL is among the common variables to look for in makefiles.

How about something like the following?


diff --git a/Makefile b/Makefile
index 85f6c632d..5cc59a061 100644
--- a/Makefile
+++ b/Makefile
@@ -81,6 +81,9 @@
 #   DESTDIR is not set by default and is used for installation only.
 #   It might be useful to set DESTDIR if you want to install haproxy
 #   in a sandbox.
+#   INSTALL is set to "install" by default and is used to provide the name of
+#   the install binary used by the install targets and any additional
+#   flags.
 #   PREFIX  is set to "/usr/local" by default and is used for installation 
only.
 #   SBINDIR is set to "$(PREFIX)/sbin" by default and is used for installation
 #   only.
@@ -170,6 +173,7 @@ cc-nowarn = $(if $(cc-anywno),-Wno-$(1),$(shell set -e; if 
$(CC) -Werror -W$(1)
 
  Installation options.
 DESTDIR =
+INSTALL = install
 PREFIX = /usr/local
 SBINDIR = $(PREFIX)/sbin
 MANDIR = $(PREFIX)/share/man
@@ -378,6 +382,7 @@ ifeq ($(TARGET),linux-glibc)
 USE_CPU_AFFINITY USE_THREAD USE_EPOLL USE_LINUX_TPROXY\
 USE_ACCEPT4 USE_LINUX_SPLICE USE_PRCTL USE_THREAD_DUMP USE_NS USE_TFO \
 USE_GETADDRINFO USE_BACKTRACE)
+  INSTALL = install -v
 endif
 
 # For linux >= 2.6.28, glibc without new features
@@ -386,6 +391,7 @@ ifeq ($(TARGET),linux-glibc-legacy)
 USE_POLL USE_TPROXY USE_LIBCRYPT USE_DL USE_RT USE_CRYPT_H USE_NETFILTER  \
 USE_CPU_AFFINITY USE_THREAD USE_EPOLL USE_LINUX_TPROXY\
 USE_ACCEPT4 USE_LINUX_SPLICE USE_PRCTL USE_THREAD_DUMP USE_GETADDRINFO)
+  INSTALL = install -v
 endif
 
 # For linux >= 2.6.28 and musl
@@ -395,6 +401,7 @@ ifeq ($(TARGET),linux-musl)
 USE_CPU_AFFINITY USE_THREAD USE_EPOLL USE_LINUX_TPROXY\
 USE_ACCEPT4 USE_LINUX_SPLICE USE_PRCTL USE_THREAD_DUMP USE_NS USE_TFO \
 USE_GETADDRINFO)
+  INSTALL = install -v
 endif
 
 # Solaris 10 and above
@@ -1043,16 +1050,16 @@ src/haproxy.o:  src/haproxy.c $(DEP)
   -c -o $@ $<
 
 install-man:
-   $(Q)install -v -d "$(DESTDIR)$(MANDIR)"/man1
-   $(Q)install -v -m 644 doc/haproxy.1 "$(DESTDIR)$(MANDIR)"/man1
+   $(Q)$(INSTALL) -d "$(DESTDIR)$(MANDIR)"/man1
+   $(Q)$(INSTALL) -m 644 doc/haproxy.1 "$(DESTDIR)$(MANDIR)"/man1
 
 EXCLUDE_DOCUMENTATION = lgpl gpl coding-style
 DOCUMENTATION = $(filter-out $(EXCLUDE_DOCUMENTATION),$(patsubst 
doc/%.txt,%,$(wildcard doc/*.txt)))
 
 install-doc:
-   $(Q)install -v -d "$(DESTDIR)$(DOCDIR)"
+   $(Q)$(INSTALL) -d "$(DESTDIR)$(DOCDIR)"
$(Q)for x in $(DOCUMENTATI

Re: [PR] Fix -v flag usage with install(1) on OpenBSD/NetBSD/Solaris/AIX

2022-07-15 Thread Brad Smith

On 7/15/2022 11:59 PM, Willy Tarreau wrote:

Hello,

On Fri, Jul 15, 2022 at 07:27:12PM -0400, Brad Smith wrote:

On 7/15/2022 1:34 AM,  ??? wrote:

I wonder how do NetBSD/OpenBSD ports work, do they use their own
"install" invocation instead of "make install" ?
shouldn't they switch to "make install" ?

NetBSD uses the Makefile's install targets but patches out the -v flag.
OpenBSD used it's own install target
but I'm trying to remove that special casing and I had basically the same
sort of diff NetBSD has. Can't switch
to the make install target until the Makfile is fixed.

I agree with the principle of your patch, just not with the way it's done,
because this variable "IV" is a bit cryptic and not easy to follow. Other
programs also like to redefine the install program, thus I'd propose a
simpler and more flexible approach:

   - define "INSTALL = install" early, next to DESTDIR and friends
   - set "INSTALL = install -v" in the LINUX targets
   - use $(INSTALL) in the install targets

This way it even allows users of any platform to simply pass the INSTALL
variable to match their needs (including setting it to "ginstall -v" on
non-linux platforms where this often points to GNU install).



Hi Willy,

I kind of figured you would not be Ok with it as is. I did think about 
doing something
as you suggested today as I was thinking about this. I was trying to 
keep the

variable name short and I agree with you. What you have suggested is typical
in autoconf / automake environments.




Re: [PR] Fix -v flag usage with install(1) on OpenBSD/NetBSD/Solaris/AIX

2022-07-15 Thread Brad Smith

On 7/15/2022 1:34 AM, Илья Шипицин wrote:
I wonder how do NetBSD/OpenBSD ports work, do they use their own 
"install" invocation instead of "make install" ?

shouldn't they switch to "make install" ?


NetBSD uses the Makefile's install targets but patches out the -v flag. 
OpenBSD used it's own install target
but I'm trying to remove that special casing and I had basically the 
same sort of diff NetBSD has. Can't switch

to the make install target until the Makfile is fixed.


пт, 15 июл. 2022 г. в 10:25, PR Bot :

    Dear list!

Author: Brad Smith 
Number of patches: 1

This is an automated relay of the Github pull request:
   Fix -v flag usage with install(1) on OpenBSD/NetBSD/Solaris/AIX

Patch title(s):
   Fix -v flag usage with install(1) on OpenBSD/NetBSD/Solaris/AIX

Link:
https://github.com/haproxy/haproxy/pull/1786

Edit locally:
   wget https://github.com/haproxy/haproxy/pull/1786.patch && vi
1786.patch

Apply locally:
   curl https://github.com/haproxy/haproxy/pull/1786.patch | git am -

Description:
   The install(1) program on OpenBSD/NetBSD/Solaris/AIX do not support
   the -v verbose flag. FreeBSD / DragonFlyBSD/ macOS and GNU
install do.
   The generic target now has the flag disabled the target is more
   portable.

Instructions:
   This github pull request will be closed automatically; patch
should be
   reviewed on the haproxy mailing list (haproxy@formilux.org).
Everyone is
   invited to comment, even the patch's author. Please keep the
author and
   list CCed in replies. Please note that in absence of any
response this
   pull request will be lost.


Re: [PATCH]: DragonFlyBSD little build update

2020-12-02 Thread Brad Smith

On 12/2/2020 2:27 PM, Willy Tarreau wrote:

Hi David,

On Wed, Dec 02, 2020 at 10:50:52AM +, David CARLIER wrote:

Hi, heere a little build update for DragonFlyBSD proposal.

I'm having a concern here, which is that by relying on pthread_setaffinity_np
it will add an implicit dependency on pthread, which is not necessary till
now (we'll support nbproc till 2.4 included).

I thought DragonFlyBSD was a derivative of FreeBSD, if so it should have
cpuset_setaffinity(). Maybe it requires an include we're missing, have
you checked this just in case ? Otherwise I'm afraid we'll have to make a
special case for it to condition the feature to pthread on this platform.

Thanks!
Willy


DragonFly forked from FreeBSD 4.8 16 years ago. They do heavily borrow bits
from FreeBSD, but that does not mean that everything is exactly the same 
with

regard to userland and kernel API.

It does not appear as if DragonFly has cpuset_setaffinity(). 
sched_setaffinity()

appears to be the DragonFly equivalent.


https://www.freebsd.org/cgi/man.cgi?query=cpuset_setaffinity

https://man.dragonflybsd.org/?command=sched_setaffinity




Warning during Haiku build

2020-10-12 Thread Brad Smith

Just FYI the only warning during the build on Haiku is the following...

cc -Iinclude -O2 -g -Wall -Wextra -Wdeclaration-after-statement -fwrapv 
-Wno-unused-label -Wno-sign-compare
-Wno-unused-parameter -Wno-clobbered -Wno-missing-field-initializers 
-Wno-cast-function-type -Wtype-limits
-Wshift-negative-value -Wshift-overflow=2 -Wduplicated-cond 
-Wnull-dereference -DUSE_POLL -DUSE_TPROXY
-DCONFIG_HAPROXY_VERSION=\"2.3-dev6-6b736b-1\" 
-DCONFIG_HAPROXY_DATE=\"2020/10/11\" -c -o src/xxhash.o src/xxhash.c

src/xxhash.c:118: warning: "_PACKED" redefined
 #  define _PACKED

In file included from /boot/system/develop/headers/posix/sys/types.h:11,
 from /boot/system/develop/headers/posix/alloca.h:9,
 from /boot/system/develop/headers/posix/stdlib.h:9,
 from /boot/system/develop/headers/bsd/stdlib.h:9, from
 src/xxhash.c:86:
/boot/system/develop/headers/os/BeBuild.h:80: note: this is the location 
of the previous definition

 #define _PACKED __attribute__((packed))




Haiku and Cygwin targets

2020-10-10 Thread Brad Smith

Haiku has getaddrinfo().

Cygwin also appears to have getaddrinfo(). Also the target can be 
simplified a bit

as 2009 was quite some time ago and IPv6 is the norm now.




[PATCH] BUILD: makefile: Enable getaddrinfo() on OS/X

2020-10-09 Thread Brad Smith
Enable getaddrinfo() on OS/X.


diff --git a/Makefile b/Makefile
index db9bbe7e9..2fb05c719 100644
--- a/Makefile
+++ b/Makefile
@@ -382,7 +382,8 @@ endif
 # Mac OS/X
 ifeq ($(TARGET),osx)
   set_target_defaults = $(call default_opts, \
-USE_POLL USE_TPROXY USE_LIBCRYPT USE_THREAD USE_CPU_AFFINITY USE_KQUEUE)
+USE_POLL USE_TPROXY USE_LIBCRYPT USE_THREAD USE_CPU_AFFINITY USE_KQUEUE   \
+USE_GETADDRINFO)
   EXPORT_SYMBOL  = -export_dynamic
 endif
 



[PATCH] BUILD: makefile: Update feature flags for NetBSD

2020-10-08 Thread Brad Smith
This updates the feature flags for NetBSD.

NetBSD 8 adds support for accept4().

Enable getaddrinfo().


diff --git a/INSTALL b/INSTALL
index 0263cf34c..2ae98bf6b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -377,7 +377,7 @@ and assign it to the TARGET variable :
   - solaris for Solaris 10 and above
   - freebsd for FreeBSD 10 and above
   - dragonfly   for DragonFlyBSD 4.3 and above
-  - netbsd  for NetBSD
+  - netbsd  for NetBSD 8 and above
   - osx for Mac OS/X
   - openbsd for OpenBSD 6.3 and above
   - aix51   for AIX 5.1
diff --git a/Makefile b/Makefile
index 4aabe34dc..1c64593d0 100644
--- a/Makefile
+++ b/Makefile
@@ -393,10 +393,11 @@ ifeq ($(TARGET),openbsd)
 USE_GETADDRINFO)
 endif
 
-# NetBSD
+# NetBSD 8 and above
 ifeq ($(TARGET),netbsd)
   set_target_defaults = $(call default_opts, \
-USE_POLL USE_TPROXY USE_KQUEUE)
+USE_POLL USE_TPROXY USE_THREAD USE_KQUEUE USE_ACCEPT4 USE_CLOSEFROM   \
+USE_GETADDRINFO)
 endif
 
 # AIX 5.1 only



[PATCH] BUILD: Add a DragonFlyBSD target

2020-10-07 Thread Brad Smith
Add a target for DragonFlyBSD 4.3 and above.


diff --git a/INSTALL b/INSTALL
index f562a7102..0263cf34c 100644
--- a/INSTALL
+++ b/INSTALL
@@ -376,6 +376,7 @@ and assign it to the TARGET variable :
   - linux-musl  for Linux kernel 2.6.28 and above with musl libc
   - solaris for Solaris 10 and above
   - freebsd for FreeBSD 10 and above
+  - dragonfly   for DragonFlyBSD 4.3 and above
   - netbsd  for NetBSD
   - osx for Mac OS/X
   - openbsd for OpenBSD 6.3 and above
diff --git a/Makefile b/Makefile
index 7958b89d6..4aabe34dc 100644
--- a/Makefile
+++ b/Makefile
@@ -142,8 +142,9 @@ DOCDIR = $(PREFIX)/doc/haproxy
  TARGET system
 # Use TARGET= to optimize for a specific target OS among the
 # following list (use the default "generic" if uncertain) :
-#linux-glibc, linux-glibc-legacy, linux-musl, solaris, freebsd, openbsd,
-#netbsd, cygwin, haiku, aix51, aix52, aix72-gcc, osx, generic, custom
+#linux-glibc, linux-glibc-legacy, linux-musl, solaris, freebsd, dragonfly,
+#openbsd, netbsd, cygwin, haiku, aix51, aix52, aix72-gcc, osx, generic,
+#custom
 TARGET =
 
  TARGET CPU
@@ -371,6 +372,13 @@ ifeq ($(TARGET),freebsd)
 USE_ACCEPT4 USE_CLOSEFROM USE_GETADDRINFO)
 endif
 
+# DragonFlyBSD 4.3 and above
+ifeq ($(TARGET),dragonfly)
+  set_target_defaults = $(call default_opts, \
+USE_POLL USE_TPROXY USE_LIBCRYPT USE_THREAD USE_CPU_AFFINITY USE_KQUEUE   \
+USE_ACCEPT4 USE_CLOSEFROM USE_GETADDRINFO)
+endif
+
 # Mac OS/X
 ifeq ($(TARGET),osx)
   set_target_defaults = $(call default_opts, \
@@ -773,8 +781,9 @@ all:
@echo
@echo "Please choose the target among the following supported list :"
@echo
-   @echo "   linux-glibc, linux-glibc-legacy, linux-musl, solaris, 
freebsd, openbsd, "
-   @echo "   netbsd, cygwin, haiku, aix51, aix52, aix72-gcc, osx, generic, 
custom"
+   @echo "   linux-glibc, linux-glibc-legacy, linux-musl, solaris, 
freebsd, dragonfly, "
+   @echo "   iopenbs, netbsd, cygwin, haiku, aix51, aix52, aix72-gcc, osx, 
generic, "
+   @echo "   custom"
@echo
@echo "Use \"generic\" if you don't want any optimization, \"custom\" 
if you"
@echo "want to precisely tweak every option, or choose the target which"
@@ -850,8 +859,9 @@ help:
 fi; \
   else \
 echo "TARGET not set, you may pass 'TARGET=xxx' to set one among 
:";\
-echo "  linux-glibc, linux-glibc-legacy, solaris, freebsd, netbsd, 
osx,"; \
-echo "  openbsd, aix51, aix52, aix72-gcc, cygwin, haiku, generic, 
custom"; \
+echo "  linux-glibc, linux-glibc-legacy, solaris, freebsd, 
dragonfly, netbsd,"; \
+echo "  osx, openbsd, aix51, aix52, aix72-gcc, cygwin, haiku, 
generic,"; \
+echo "  custom"; \
   fi
$(Q)echo;echo "Enabled features for TARGET '$(TARGET)' (disable with 
'USE_xxx=') :"
$(Q)set -- $(foreach opt,$(patsubst USE_%,%,$(use_opts)),$(if 
$(USE_$(opt)),$(opt),)); echo "  $$*" | (fmt || cat) 2>/dev/null



[PATCH] DOC: update INSTALL with supported OpenBSD / FreeBSD versions

2020-10-02 Thread Brad Smith
Update INSTALL with the OpenBSD / FreeBSD versions that are supported.



diff --git a/INSTALL b/INSTALL
index 04b034908..f562a7102 100644
--- a/INSTALL
+++ b/INSTALL
@@ -375,10 +375,10 @@ and assign it to the TARGET variable :
   - linux-glibc-legacy  for Linux kernel 2.6.28 and above without new features
   - linux-musl  for Linux kernel 2.6.28 and above with musl libc
   - solaris for Solaris 10 and above
-  - freebsd for FreeBSD 5 to 12 (others untested)
+  - freebsd for FreeBSD 10 and above
   - netbsd  for NetBSD
   - osx for Mac OS/X
-  - openbsd for OpenBSD 5.7 and above
+  - openbsd for OpenBSD 6.3 and above
   - aix51   for AIX 5.1
   - aix52   for AIX 5.2
   - aix72-gcc   for AIX 7.2 (using gcc)



Re: [PATCH] BUILD: makefile: Enable closefrom() support on Solaris

2020-10-01 Thread Brad Smith
On Thu, Oct 01, 2020 at 10:08:47AM +0200, Willy Tarreau wrote:
> On Wed, Sep 30, 2020 at 04:54:30PM -0400, Brad Smith wrote:
> > On 9/30/2020 4:22 PM,  ??? wrote:
> > > there also several documentation files like this one
> > > https://github.com/haproxy/haproxy/blob/master/INSTALL#L159
> > > <https://github.com/haproxy/haproxy/blob/master/INSTALL#L159>
> > > 
> > > can you please review documentation as well ?
> > 
> > That seems to be the only file. I will update the relevant bits there too.
> 
> OK so I'll take your new patch instead.



diff --git a/INSTALL b/INSTALL
index 69fe94f42..04b034908 100644
--- a/INSTALL
+++ b/INSTALL
@@ -374,7 +374,7 @@ and assign it to the TARGET variable :
   - linux-glibc for Linux kernel 2.6.28 and above
   - linux-glibc-legacy  for Linux kernel 2.6.28 and above without new features
   - linux-musl  for Linux kernel 2.6.28 and above with musl libc
-  - solaris for Solaris 8 or 10 (others untested)
+  - solaris for Solaris 10 and above
   - freebsd for FreeBSD 5 to 12 (others untested)
   - netbsd  for NetBSD
   - osx for Mac OS/X
diff --git a/Makefile b/Makefile
index 197126db5..77bf9ff3c 100644
--- a/Makefile
+++ b/Makefile
@@ -353,12 +353,11 @@ ifneq ($(shell echo __arm__/__aarch64__ | $(CC) -E -xc - 
| grep '^[^\#]'),__arm_
 endif
 endif
 
-# Solaris 8 and above
+# Solaris 10 and above
 ifeq ($(TARGET),solaris)
-  # We also enable getaddrinfo() which works since solaris 8.
   set_target_defaults = $(call default_opts, \
 USE_POLL USE_TPROXY USE_LIBCRYPT USE_CRYPT_H USE_GETADDRINFO USE_THREAD \
-USE_RT USE_OBSOLETE_LINKER USE_EVPORTS)
+USE_RT USE_OBSOLETE_LINKER USE_EVPORTS USE_CLOSEFROM)
   TARGET_CFLAGS  = -DFD_SETSIZE=65536 -D_REENTRANT -D_XOPEN_SOURCE=500 
-D__EXTENSIONS__
   TARGET_LDFLAGS = -lnsl -lsocket
 endif



Re: [PATCH] BUILD: makefile: Enable closefrom() support on Solaris

2020-09-30 Thread Brad Smith

On 9/30/2020 4:22 PM, Илья Шипицин wrote:

there also several documentation files like this one
https://github.com/haproxy/haproxy/blob/master/INSTALL#L159 



can you please review documentation as well ?


That seems to be the only file. I will update the relevant bits there too.

Thanks.




[PATCH] BUILD: makefile: Enable closefrom() support on Solaris

2020-09-30 Thread Brad Smith
Solaris 9 (released 2002) added support for closefrom().

I bumped the version in the comment to 10 as the default feature
flags already has event ports enabled which were introduced in
Solaris 10.


diff --git a/Makefile b/Makefile
index 197126db5..e7d716dd3 100644
--- a/Makefile
+++ b/Makefile
@@ -353,12 +353,11 @@ ifneq ($(shell echo __arm__/__aarch64__ | $(CC) -E -xc - 
| grep '^[^\#]'),__arm_
 endif
 endif
 
-# Solaris 8 and above
+# Solaris 10 and above
 ifeq ($(TARGET),solaris)
-  # We also enable getaddrinfo() which works since solaris 8.
   set_target_defaults = $(call default_opts, \
 USE_POLL USE_TPROXY USE_LIBCRYPT USE_CRYPT_H USE_GETADDRINFO USE_THREAD \
-USE_RT USE_OBSOLETE_LINKER USE_EVPORTS)
+USE_RT USE_OBSOLETE_LINKER USE_EVPORTS USE_CLOSEFROM)
   TARGET_CFLAGS  = -DFD_SETSIZE=65536 -D_REENTRANT -D_XOPEN_SOURCE=500 
-D__EXTENSIONS__
   TARGET_LDFLAGS = -lnsl -lsocket
 endif



Re: [PATCH] BUILD: makefile: Fix building with closefrom() support enabled

2020-09-29 Thread Brad Smith

Looks like this should be back ported to 2.0, 2.1 and 2.2.

On 9/30/2020 1:04 AM, Brad Smith wrote:

I noticed the USE_CLOSEFROM define was not being passed along like the rest
during the build.

Looking around I see this was broken with the following two commits and related
series..

BUILD: Makefile: also report disabled options in the BUILD_OPTIONS variable
http://git.haproxy.org/?p=haproxy.git;a=commit;h=05fd82da76d1bbc8d65d63ab246bda7cbcf8481a

BUILD: pass all "USE_*" variables as -DUSE_* to the compiler
http://git.haproxy.org/?p=haproxy.git;a=commit;h=824cd00d3bda8f7f6d4c30baf77ba6c19ab47811



diff --git a/Makefile b/Makefile
index 197126db5..d84b032c2 100644
--- a/Makefile
+++ b/Makefile
@@ -37,6 +37,7 @@
  #   USE_LUA  : enable Lua support.
  #   USE_FUTEX: enable use of futex on kernel 2.6. Automatic.
  #   USE_ACCEPT4  : enable use of accept4() on linux. Automatic.
+#   USE_CLOSEFROM: enable use of closefrom() on *bsd, solaris. 
Automatic.
  #   USE_PRCTL: enable use of prctl(). Automatic.
  #   USE_ZLIB : enable zlib library support.
  #   USE_SLZ  : enable slz library instead of zlib (pick at most 
one).
@@ -291,7 +292,7 @@ use_opts = USE_EPOLL USE_KQUEUE USE_NETFILTER   
  \
 USE_STATIC_PCRE USE_STATIC_PCRE2 USE_TPROXY USE_LINUX_TPROXY   
\
 USE_LINUX_SPLICE USE_LIBCRYPT USE_CRYPT_H  
\
 USE_GETADDRINFO USE_OPENSSL USE_LUA USE_FUTEX USE_ACCEPT4  
\
-   USE_ZLIB USE_SLZ USE_CPU_AFFINITY USE_TFO USE_NS   \
+   USE_CLOSEFROM USE_ZLIB USE_SLZ USE_CPU_AFFINITY USE_TFO USE_NS \
 USE_DL USE_RT USE_DEVICEATLAS USE_51DEGREES USE_WURFL USE_SYSTEMD  
\
 USE_OBSOLETE_LINKER USE_PRCTL USE_THREAD_DUMP USE_EVPORTS
  





[PATCH] BUILD: makefile: Fix building with closefrom() support enabled

2020-09-29 Thread Brad Smith
I noticed the USE_CLOSEFROM define was not being passed along like the rest
during the build.

Looking around I see this was broken with the following two commits and related
series..

BUILD: Makefile: also report disabled options in the BUILD_OPTIONS variable
http://git.haproxy.org/?p=haproxy.git;a=commit;h=05fd82da76d1bbc8d65d63ab246bda7cbcf8481a

BUILD: pass all "USE_*" variables as -DUSE_* to the compiler
http://git.haproxy.org/?p=haproxy.git;a=commit;h=824cd00d3bda8f7f6d4c30baf77ba6c19ab47811



diff --git a/Makefile b/Makefile
index 197126db5..d84b032c2 100644
--- a/Makefile
+++ b/Makefile
@@ -37,6 +37,7 @@
 #   USE_LUA  : enable Lua support.
 #   USE_FUTEX: enable use of futex on kernel 2.6. Automatic.
 #   USE_ACCEPT4  : enable use of accept4() on linux. Automatic.
+#   USE_CLOSEFROM: enable use of closefrom() on *bsd, solaris. 
Automatic.
 #   USE_PRCTL: enable use of prctl(). Automatic.
 #   USE_ZLIB : enable zlib library support.
 #   USE_SLZ  : enable slz library instead of zlib (pick at most 
one).
@@ -291,7 +292,7 @@ use_opts = USE_EPOLL USE_KQUEUE USE_NETFILTER   
  \
USE_STATIC_PCRE USE_STATIC_PCRE2 USE_TPROXY USE_LINUX_TPROXY   \
USE_LINUX_SPLICE USE_LIBCRYPT USE_CRYPT_H  \
USE_GETADDRINFO USE_OPENSSL USE_LUA USE_FUTEX USE_ACCEPT4  \
-   USE_ZLIB USE_SLZ USE_CPU_AFFINITY USE_TFO USE_NS   \
+   USE_CLOSEFROM USE_ZLIB USE_SLZ USE_CPU_AFFINITY USE_TFO USE_NS \
USE_DL USE_RT USE_DEVICEATLAS USE_51DEGREES USE_WURFL USE_SYSTEMD  \
USE_OBSOLETE_LINKER USE_PRCTL USE_THREAD_DUMP USE_EVPORTS
 



Re: [PATCH] BUILD: makefile: Update feature flags for FreeBSD

2020-09-29 Thread Brad Smith

On 9/29/2020 5:12 AM, Willy Tarreau wrote:

On Tue, Sep 15, 2020 at 03:10:04AM -0400, Brad Smith wrote:

This updates the feature flags for FreeBSD.

FreeBSD 10 adds support for accept4().

Enable getaddrinfo().

>From the FreeBSD port / package.

Applied, thanks Brad! And sorry for missing it the first time, it simply
went out of my scrolling area :-)

Willy


Thanks.



Re: [PATCH] BUILD: makefile: Update feature flags for FreeBSD

2020-09-27 Thread Brad Smith

Willy?

They've been shipping with these enabled with their 1.7 - 2.3 ports / 
packages.


MAKE_ARGS=    TARGET=freebsd DEFINE=-DFREEBSD_PORTS USE_GETADDRINFO=1 \
    USE_ZLIB=1 USE_CPU_AFFINITY=1 USE_ACCEPT4=1 \
    CC="${CC}" DEBUG_CFLAGS="" CPU_CFLAGS="${CFLAGS}"

On 9/15/2020 3:10 AM, Brad Smith wrote:

This updates the feature flags for FreeBSD.

FreeBSD 10 adds support for accept4().

Enable getaddrinfo().

 From the FreeBSD port / package.



diff --git a/Makefile b/Makefile
index 934ca1666..e69870595 100644
--- a/Makefile
+++ b/Makefile
@@ -363,11 +363,11 @@ ifeq ($(TARGET),solaris)
TARGET_LDFLAGS = -lnsl -lsocket
  endif
  
-# FreeBSD 5 and above

+# FreeBSD 10 and above
  ifeq ($(TARGET),freebsd)
set_target_defaults = $(call default_opts, \
  USE_POLL USE_TPROXY USE_LIBCRYPT USE_THREAD USE_CPU_AFFINITY USE_KQUEUE   
\
-USE_CLOSEFROM)
+USE_ACCEPT4 USE_CLOSEFROM USE_GETADDRINFO)
  endif
  
  # Mac OS/X






[PATCH] BUILD: makefile: Update feature flags for OpenBSD

2020-09-26 Thread Brad Smith
Update the OpenBSD target features being enabled.

I updated the list of features after noticing
"BUILD: makefile: disable threads by default on OpenBSD".

The Makefile utilizing gcc(1) by default resulted in utilizing
our legacy and obsolete compiler (GCC 4.2.1) instead of the
proper system compiler (Clang), which does support TLS. With
"BUILD: makefile: change default value of CC from gcc to cc"
that is resolved.


diff --git a/Makefile b/Makefile
index 934ca1666..197126db5 100644
--- a/Makefile
+++ b/Makefile
@@ -377,10 +377,11 @@ ifeq ($(TARGET),osx)
   EXPORT_SYMBOL  = -export_dynamic
 endif
 
-# OpenBSD 5.7 and above
+# OpenBSD 6.3 and above
 ifeq ($(TARGET),openbsd)
   set_target_defaults = $(call default_opts, \
-USE_POLL USE_TPROXY USE_KQUEUE USE_ACCEPT4)
+USE_POLL USE_TPROXY USE_THREAD USE_KQUEUE USE_ACCEPT4 USE_CLOSEFROM   \
+USE_GETADDRINFO)
 endif
 
 # NetBSD



Re: [PATCH] BUILD: makefile: Update feature flags for FreeBSD

2020-09-22 Thread Brad Smith

ping.

On 9/15/2020 3:10 AM, Brad Smith wrote:

This updates the feature flags for FreeBSD.

FreeBSD 10 adds support for accept4().

Enable getaddrinfo().

 From the FreeBSD port / package.



diff --git a/Makefile b/Makefile
index 934ca1666..e69870595 100644
--- a/Makefile
+++ b/Makefile
@@ -363,11 +363,11 @@ ifeq ($(TARGET),solaris)
TARGET_LDFLAGS = -lnsl -lsocket
  endif
  
-# FreeBSD 5 and above

+# FreeBSD 10 and above
  ifeq ($(TARGET),freebsd)
set_target_defaults = $(call default_opts, \
  USE_POLL USE_TPROXY USE_LIBCRYPT USE_THREAD USE_CPU_AFFINITY USE_KQUEUE   
\
-USE_CLOSEFROM)
+USE_ACCEPT4 USE_CLOSEFROM USE_GETADDRINFO)
  endif
  
  # Mac OS/X






Re: [PATCH] BUILD: makefile: Update feature flags for Solaris / FreeBSD / NetBSD / OpenBSD

2020-09-15 Thread Brad Smith

On 9/15/2020 3:45 AM, Lukas Tribus wrote:

On Tue, 15 Sep 2020 at 09:05, Brad Smith  wrote:

NetBSD 8.0 adds support for accept4() and closefrom(). Enable getaddrinfo().

We just had to disable threading on OpenBSD 6.7 for the build to succeed:

https://github.com/haproxy/haproxy/issues/725

Did you actually test all those combinations? Because otherwise it
does not seem like a good idea to commit this.

I know. I saw that. That was wrong. The other diff I submitted switching
the compiler default
as well as this came from that bogus diff.

2 of the 4 targets are (FreeBSD / OpenBSD). The other 2 are just based
on being aware of the API
and what has been implemented and when. I'll split up my diff and send
in the tested bits first.

Ok thanks (I was concerned about disabling threading on OpenBSD as well).

Please add the information that your previous patch switching gcc to
cc is required for the OpenBSD change to work; it's obvious to me now,
but when looking at the single change we are not always aware of the
history (especially later during bisects).


I will do so. Yes, those details can be important.



[PATCH] BUILD: makefile: Update feature flags for FreeBSD

2020-09-15 Thread Brad Smith
This updates the feature flags for FreeBSD.

FreeBSD 10 adds support for accept4().

Enable getaddrinfo().

>From the FreeBSD port / package.



diff --git a/Makefile b/Makefile
index 934ca1666..e69870595 100644
--- a/Makefile
+++ b/Makefile
@@ -363,11 +363,11 @@ ifeq ($(TARGET),solaris)
   TARGET_LDFLAGS = -lnsl -lsocket
 endif
 
-# FreeBSD 5 and above
+# FreeBSD 10 and above
 ifeq ($(TARGET),freebsd)
   set_target_defaults = $(call default_opts, \
 USE_POLL USE_TPROXY USE_LIBCRYPT USE_THREAD USE_CPU_AFFINITY USE_KQUEUE   \
-USE_CLOSEFROM)
+USE_ACCEPT4 USE_CLOSEFROM USE_GETADDRINFO)
 endif
 
 # Mac OS/X



Re: [PATCH] BUILD: makefile: Update feature flags for Solaris / FreeBSD / NetBSD / OpenBSD

2020-09-15 Thread Brad Smith

On 9/14/2020 5:39 AM, Lukas Tribus wrote:

Hello Brad,

On Sun, 13 Sep 2020 at 09:08, Brad Smith  wrote:

The following diff updates the feature flags for Solaris / FreeBSD / NetBSD / 
OpenBSD.

Bump the baseline Solaris to 9 which intruduced closefrom().

FreeBSD 10 is already EOL for support but its the new baseline. Introduces 
accept4().
Enable getaddrinfo(). The FreeBSD port enables these.

OpenBSD 6.3 is pretty old but it brings a compiler that supports TLS for the 
threads
support. 5.7 already supported closefrom(). Enable getaddrinfo().

NetBSD 8.0 adds support for accept4() and closefrom(). Enable getaddrinfo().

We just had to disable threading on OpenBSD 6.7 for the build to succeed:

https://github.com/haproxy/haproxy/issues/725

Did you actually test all those combinations? Because otherwise it
does not seem like a good idea to commit this.


I know. I saw that. That was wrong. The other diff I submitted switching 
the compiler default

as well as this came from that bogus diff.

2 of the 4 targets are (FreeBSD / OpenBSD). The other 2 are just based 
on being aware of the API
and what has been implemented and when. I'll split up my diff and send 
in the tested bits first.




Re: [PATCH] BUILD: makefile: change default value of CC from gcc to cc

2020-09-15 Thread Brad Smith

On 9/15/2020 1:31 AM, Willy Tarreau wrote:

On Mon, Sep 14, 2020 at 11:42:47PM -0400, Brad Smith wrote:

It's not about package maintainers as they know to do the right
thing. It's
about end users that don't know any better. In this case someone
submitted
a bogus patch which was commited based on using the wrong compiler.

why they do not just use package system ?

I don't know, but it's beside the point now. All kinds of people for various
reasons (re)build software outside of pre-built packages.

Well, after sleeping over it, I think your points above are valid. We
used to support exclusively gcc by extensively using GNU extensions,
but over time other compilers like icc, clang, and tcc have adopted a
lot of these GNU extensions and are compatible. And it makes sense not
to ask them to call themselves gcc of course. So I think we can do this,
and that 2.3 is the right version to do it, and it will leave us enough
time to see if any issues are reported. In practice I expect the vast
majority of systems where development packages are installed to have
at least one working "cc".

I'm going to take your patch, thanks!


Thanks.



Re: [PATCH] BUILD: makefile: change default value of CC from gcc to cc

2020-09-14 Thread Brad Smith

On 9/14/2020 11:25 PM, Илья Шипицин wrote:



вт, 15 сент. 2020 г. в 02:42, Brad Smith <mailto:b...@comstyle.com>>:


On 9/14/2020 5:26 AM, Willy Tarreau wrote:
> Hi Brad,
>
> On Sun, Sep 13, 2020 at 02:53:06AM -0400, Brad Smith wrote:
>> Change the default value of CC from gcc to cc to be more
appropriate
>> for modern day mix of compilers. On GCC based OS's cc -> gcc.
On Clang
>> based OS's cc -> clang. FreeBSD / OpenBSD have switched to
Clang and
>> this corrects building with the proper compiler on OS's using Clang
>> as the default compiler. This especially matters for the
necessity for
>> TLS on OpenBSD. I would expect this affects OpenMandriva and other
>> Linux OS's using Clang as well.
> I don't have a strong opinion on this one, I'd like to get feedback
> from distro maintainers first. In any case it's trivial to set CC
> while building so it's no big deal for sure.

It's not about package maintainers as they know to do the right
thing. It's
about end users that don't know any better. In this case someone
submitted
a bogus patch which was commited based on using the wrong compiler.



why they do not just use package system ?


I don't know, but it's beside the point now. All kinds of people for 
various reasons

(re)build software outside of pre-built packages.


Re: [PATCH] BUILD: makefile: change default value of CC from gcc to cc

2020-09-14 Thread Brad Smith

On 9/14/2020 5:26 AM, Willy Tarreau wrote:

Hi Brad,

On Sun, Sep 13, 2020 at 02:53:06AM -0400, Brad Smith wrote:

Change the default value of CC from gcc to cc to be more appropriate
for modern day mix of compilers. On GCC based OS's cc -> gcc. On Clang
based OS's cc -> clang. FreeBSD / OpenBSD have switched to Clang and
this corrects building with the proper compiler on OS's using Clang
as the default compiler. This especially matters for the necessity for
TLS on OpenBSD. I would expect this affects OpenMandriva and other
Linux OS's using Clang as well.

I don't have a strong opinion on this one, I'd like to get feedback
from distro maintainers first. In any case it's trivial to set CC
while building so it's no big deal for sure.


It's not about package maintainers as they know to do the right thing. It's
about end users that don't know any better. In this case someone submitted
a bogus patch which was commited based on using the wrong compiler.



[PATCH] BUILD: makefile: Update feature flags for Solaris / FreeBSD / NetBSD / OpenBSD

2020-09-13 Thread Brad Smith
The following diff updates the feature flags for Solaris / FreeBSD / NetBSD / 
OpenBSD.

Bump the baseline Solaris to 9 which intruduced closefrom().

FreeBSD 10 is already EOL for support but its the new baseline. Introduces 
accept4().
Enable getaddrinfo(). The FreeBSD port enables these.

OpenBSD 6.3 is pretty old but it brings a compiler that supports TLS for the 
threads
support. 5.7 already supported closefrom(). Enable getaddrinfo().

NetBSD 8.0 adds support for accept4() and closefrom(). Enable getaddrinfo().


diff --git a/Makefile b/Makefile
index 48c595511..0a3ac70e8 100644
--- a/Makefile
+++ b/Makefile
@@ -353,21 +353,20 @@ ifneq ($(shell echo __arm__/__aarch64__ | $(CC) -E -xc - 
| grep '^[^\#]'),__arm_
 endif
 endif
 
-# Solaris 8 and above
+# Solaris 9 and above
 ifeq ($(TARGET),solaris)
-  # We also enable getaddrinfo() which works since solaris 8.
   set_target_defaults = $(call default_opts, \
 USE_POLL USE_TPROXY USE_LIBCRYPT USE_CRYPT_H USE_GETADDRINFO USE_THREAD \
-USE_RT USE_OBSOLETE_LINKER USE_EVPORTS)
+USE_RT USE_OBSOLETE_LINKER USE_EVPORTS USE_CLOSEFROM)
   TARGET_CFLAGS  = -DFD_SETSIZE=65536 -D_REENTRANT -D_XOPEN_SOURCE=500 
-D__EXTENSIONS__
   TARGET_LDFLAGS = -lnsl -lsocket
 endif
 
-# FreeBSD 5 and above
+# FreeBSD 10 and above
 ifeq ($(TARGET),freebsd)
   set_target_defaults = $(call default_opts, \
 USE_POLL USE_TPROXY USE_LIBCRYPT USE_THREAD USE_CPU_AFFINITY USE_KQUEUE   \
-USE_CLOSEFROM)
+USE_ACCEPT4 USE_CLOSEFROM USE_GETADDRINFO)
 endif
 
 # Mac OS/X
@@ -377,16 +376,18 @@ ifeq ($(TARGET),osx)
   EXPORT_SYMBOL  = -export_dynamic
 endif
 
-# OpenBSD 5.7 and above
+# OpenBSD 6.3 and above
 ifeq ($(TARGET),openbsd)
   set_target_defaults = $(call default_opts, \
-USE_POLL USE_TPROXY USE_KQUEUE USE_ACCEPT4)
+USE_POLL USE_TPROXY USE_THREAD USE_KQUEUE USE_ACCEPT4 USE_CLOSEFROM   \
+USE_GETADDRINFO)
 endif
 
-# NetBSD
+# NetBSD 8 and above
 ifeq ($(TARGET),netbsd)
   set_target_defaults = $(call default_opts, \
-USE_POLL USE_TPROXY USE_KQUEUE)
+USE_POLL USE_TPROXY USE_THREAD USE_KQUEUE USE_ACCEPT4 USE_CLOSEFROM   \
+USE_GETADDRINFO)
 endif
 
 # AIX 5.1 only



[PATCH] BUILD: makefile: change default value of CC from gcc to cc

2020-09-13 Thread Brad Smith
Change the default value of CC from gcc to cc to be more appropriate
for modern day mix of compilers. On GCC based OS's cc -> gcc. On Clang
based OS's cc -> clang. FreeBSD / OpenBSD have switched to Clang and
this corrects building with the proper compiler on OS's using Clang
as the default compiler. This especially matters for the necessity for
TLS on OpenBSD. I would expect this affects OpenMandriva and other
Linux OS's using Clang as well.


diff --git a/Makefile b/Makefile
index 48c595511..841b4a639 100644
--- a/Makefile
+++ b/Makefile
@@ -58,8 +58,8 @@
 # given TARGET is enumerated at the end of "make help".
 #
 # Variables useful for packagers :
-#   CC is set to "gcc" by default and is used for compilation only.
-#   LD is set to "gcc" by default and is used for linking only.
+#   CC is set to "cc" by default and is used for compilation only.
+#   LD is set to "cc" by default and is used for linking only.
 #   ARCH may be useful to force build of 32-bit binary on 64-bit systems
 #   CFLAGS is automatically set for the specified CPU and may be overridden.
 #   LDFLAGS is automatically set to -g and may be overridden.
@@ -157,8 +157,7 @@ CPU = generic
 ARCH =
 
  Toolchain options.
-# GCC is normally used both for compiling and linking.
-CC = gcc
+CC = cc
 LD = $(CC)
 
  Debug flags (typically "-g").