Hi Daniel,

On Fri, Nov 03, 2017 at 04:00:08PM +0100, Daniel Heitepriem wrote:
> Hi everyone,
> 
> I tried to compile the recent HAProxy 1.8 (pulled from the git
> repository) on Solaris 11.3 (x86) with these settings:
> gmake TARGET=solaris CPU=generic USE_TPROXY=1 USE_ZLIB=1 USE_OPENSSL=1
> USE_PCRE=1 USE_GETADDRINFO=1 USE_REGPARM=1 DEFINE="-D_XOPEN_SOURCE=600"
> 
> "-D_XOPEN_SOURCE=600" is necessary on my Solaris installation as we're
> running GCC5 and the default Makefile ships with XOPEN_SOURCE=500
> 
> Despite a few warnings regarding SPIN_LOCK
> 
>     <command-line>:0:0: note: this is the location of the previous
>     definition
>     In file included from include/common/memory.h:30:0,
>                      from include/common/chunk.h:29,
>                      from include/common/standard.h:36,
>                      from include/common/ticks.h:56,
>                      from src/ev_poll.c:22:
>     include/common/hathreads.h:75:0: warning: "SPIN_LOCK" redefined
>      #define SPIN_LOCK(lbl, l)    do { /* do nothing */ } while(0)
>      ^
>     In file included from /usr/include/sys/t_lock.h:15:0,
>                      from /usr/include/sys/stream.h:18,
>                      from /usr/include/netinet/in.h:66,
>                      from /usr/include/sys/socket.h:29,
>                      from include/common/compat.h:29,
>                      from src/ev_poll.c:20:
>     /usr/include/sys/machlock.h:60:0: note: this is the location of the
>     previous definition
>      #define SPIN_LOCK(pl) ((pl) > ipltospl(LOCK_LEVEL))

Ah nice one, I suspected it but was glad it didn't appear. At least
we didn't test on solaris :-) I'm CCing Emeric and Christopher. Guys,
I think that we'll have to rename all of these to HA_SPIN_LOCK() as
you did for the wrappers for atomic ops.

> I get an error which doesn't let me compile this version of HAProxy:
> 
>     src/haproxy.c: In function 'get_old_sockets':
>     src/haproxy.c:971:31: error: 'NAME_MAX' undeclared (first use in
>     this function)
>       tmpbuf = malloc(fd_nb * (1 + NAME_MAX + 1 + IFNAMSIZ + sizeof(int)));
>                                    ^
>     src/haproxy.c:971:31: note: each undeclared identifier is reported
>     only once for each function it appears in
>     gmake: *** [src/haproxy.o] Error 1

Oh too bad, we've already dealt with this a long time ago but now it
reappeared in new code. CCing Olivier. Olivier, in 2012 we already
faced this issue and addressed it in commit ee2663b ("BUILD: ssl:
NAME_MAX is not portable, use MAXPATHLEN instead") but resorting to
MAXPATHLEN.

> Is this a known issue so far?

It wasn't and that was exactly the purpose of -rc1 to collect such
precious feedback! For NAME_MAX I think it can easily be redefined
by building with :

    make ... DEFINE="-DNAME_MAX=MAXPATHLEN"

But for the spinlocks you'll have to modify each occurrence in many
files, which will be a real pain, so we'll have to raise this change
as a high priority in order not to wait too long without being able
to test some OSes.

Thanks very much!
Willy

Reply via email to