diff --git a/Makefile b/Makefile index 964b7fbb5..46da6fbbb 100644 --- a/Makefile +++ b/Makefile @@ -177,8 +177,8 @@ 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, dragonfly, -# openbsd, netbsd, cygwin, haiku, aix51, aix52, aix72-gcc, osx, generic, +# linux-glibc, linux-glibc-legacy, linux-musl, solaris, freebsd, freebsd-glibc, +# dragonfly, openbsd, netbsd, cygwin, haiku, aix51, aix52, aix72-gcc, osx, generic, # custom TARGET = @@ -412,6 +412,13 @@ ifeq ($(TARGET),freebsd) USE_ACCEPT4 USE_CLOSEFROM USE_GETADDRINFO USE_PROCCTL) endif +# kFreeBSD glibc +ifeq ($(TARGET),freebsd-glibc) + set_target_defaults = $(call default_opts, \ + USE_POLL USE_TPROXY USE_LIBCRYPT USE_THREAD USE_CPU_AFFINITY USE_KQUEUE \ + USE_ACCEPT4 USE_GETADDRINFO USE_CRYPT_H USE_DL) +endif + # DragonFlyBSD 4.3 and above ifeq ($(TARGET),dragonfly) set_target_defaults = $(call default_opts, \ diff --git a/include/haproxy/cpuset-t.h b/include/haproxy/cpuset-t.h index 5f812aa17..984df8d83 100644 --- a/include/haproxy/cpuset-t.h +++ b/include/haproxy/cpuset-t.h @@ -16,7 +16,7 @@ #include -#if defined(__linux__) || defined(__DragonFly__) +#if defined(__linux__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) # define CPUSET_REPR cpu_set_t # define CPUSET_USE_CPUSET diff --git a/src/tools.c b/src/tools.c index c48a9698c..f62032b9c 100644 --- a/src/tools.c +++ b/src/tools.c @@ -43,7 +43,7 @@ extern void *__elf_aux_vector; #include #include -#if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) +#if defined(__linux__) && defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) #include #endif @@ -4791,7 +4791,7 @@ const char *get_exec_path() { const char *ret = NULL; -#if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) +#if defined(__linux__) && defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) long execfn = getauxval(AT_EXECFN); if (execfn && execfn != ENOENT)