чт, 16 апр. 2020 г. в 16:26, Willy Tarreau <w...@1wt.eu>: > On Thu, Apr 16, 2020 at 12:29:42PM +0200, Tim Düsterhus wrote: > > > FWIW musl seems to work OK here when building for linux-glibc-legacy. > > > > Yes. HAProxy linked against Musl is smoke tested as part of the Docker > > Official Images program, because the Alpine-based Docker images use Musl > > as their libc. In fact you can even use TARGET=linux-glibc + > USE_BACKTRACE=. > > By the way, I initially thought I was the only one building with musl > for my EdgeRouter-x that I'm using as a distcc load balancer for the > build farm at work. But if there are other users, we'd rather add >
private buildfarm ? what do you use ? just curious a linux-musl target, as the split between OS and library was precisely > made for this purpose! > > Anyone objects against something like this (+ the appropriate entries > in other places and doc) ? > looks good > > > diff --git a/Makefile b/Makefile > index d5841a5..a3dad36 100644 > --- a/Makefile > +++ b/Makefile > @@ -341,6 +341,18 @@ ifeq ($(TARGET),linux-glibc-legacy) > USE_ACCEPT4 USE_LINUX_SPLICE USE_PRCTL USE_THREAD_DUMP > USE_GETADDRINFO) > endif > > +# For linux >= 2.6.28 and musl > +ifeq ($(TARGET),linux-musl) > + set_target_defaults = $(call default_opts, \ > + USE_POLL USE_TPROXY USE_LIBCRYPT USE_DL USE_RT USE_CRYPT_H > USE_NETFILTER \ > + USE_CPU_AFFINITY USE_THREAD USE_EPOLL USE_FUTEX USE_LINUX_TPROXY > \ > + USE_ACCEPT4 USE_LINUX_SPLICE USE_PRCTL USE_THREAD_DUMP USE_NS > USE_TFO \ > + USE_GETADDRINFO) > +ifneq ($(shell echo __arm__/__aarch64__ | $(CC) -E -xc - | grep > '^[^\#]'),__arm__/__aarch64__) > + TARGET_LDFLAGS=-latomic > +endif > +endif > + > # Solaris 8 and above > ifeq ($(TARGET),solaris) > # We also enable getaddrinfo() which works since solaris 8. > > Willy >