Are you guys fine with these patches ? Thanks, willy
>From 573604dd22843805c0d8e47befc1453c2da80872 Mon Sep 17 00:00:00 2001 From: Willy Tarreau <w...@1wt.eu> Date: Fri, 14 Jun 2019 16:32:09 +0200 Subject: BUILD: makefile: rename "linux2628" to "linux-glibc" and remove older targets
The linux targets have become more than confusing over time. We used to have "linux2628" to match the features available in kernels 2.6.28 and above, without consideration for the libc, and due to many new features appearing later in kernels, some other options were added that are not enabled by default in linux2628, so this target doesn't make any sense anymore. The older ones (linux 2.2, linux 2.4, ...) do not make sense either since these versions are not supported anymore. Let's clean things up by creating a new "linux-glibc" target that matches what is available by default on Linux kernels and glibc present on supported distros at the time of release. Other libc implementation may use a custom or generic target or be added later if needed. All the older linux targets were removed. --- Makefile | 41 +++++++---------------------------------- 1 file changed, 7 insertions(+), 34 deletions(-) diff --git a/Makefile b/Makefile index 0e123e937..3405db3c6 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ # # When in doubt, invoke help, possibly with a known target : # [g]make help -# [g]make help TARGET=linux +# [g]make help TARGET=linux-glibc # # By default the detailed commands are hidden for a cleaner output, but you may # see them by appending "V=1" to the make command. @@ -142,8 +142,8 @@ DOCDIR = $(PREFIX)/doc/haproxy #### TARGET system # Use TARGET=<target_name> to optimize for a specifc target OS among the # following list (use the default "generic" if uncertain) : -# generic, linux22, linux24, linux24e, linux26, solaris, -# freebsd, openbsd, netbsd, cygwin, haiku, custom, aix51, aix52 +# linux-glibc, solaris, freebsd, openbsd, netbsd, cygwin, +# haiku, aix51, aix52, osx, generic, custom TARGET = #### TARGET CPU @@ -319,34 +319,8 @@ ifeq ($(TARGET),haiku) set_target_defaults = $(call default_opts,USE_POLL USE_TPROXY) endif -# Linux 2.2 -ifeq ($(TARGET),linux22) - set_target_defaults = $(call default_opts, \ - USE_POLL USE_TPROXY USE_LIBCRYPT USE_DL USE_RT) -endif - -# Standard Linux 2.4 with netfilter but without epoll() -ifeq ($(TARGET),linux24) - set_target_defaults = $(call default_opts, \ - USE_POLL USE_TPROXY USE_LIBCRYPT USE_DL USE_RT USE_CRYPT_H USE_NETFILTER) -endif - -# Enhanced Linux 2.4 with netfilter and epoll() patch > 0.21 -ifeq ($(TARGET),linux24e) - set_target_defaults = $(call default_opts, \ - USE_POLL USE_TPROXY USE_LIBCRYPT USE_DL USE_RT USE_CRYPT_H USE_NETFILTER \ - USE_EPOLL USE_MY_EPOLL) -endif - -# Standard Linux 2.6 with netfilter and standard epoll() -ifeq ($(TARGET),linux26) - set_target_defaults = $(call default_opts, \ - USE_POLL USE_TPROXY USE_LIBCRYPT USE_DL USE_RT USE_CRYPT_H USE_NETFILTER \ - USE_EPOLL USE_FUTEX USE_PRCTL) -endif - -# Standard Linux >= 2.6.28 with netfilter, epoll, tproxy and splice -ifeq ($(TARGET),linux2628) +# For linux >= 2.6.28 and glibc +ifeq ($(TARGET),linux-glibc) 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 \ @@ -759,9 +733,8 @@ all: @echo @echo "Please choose the target among the following supported list :" @echo - @echo " linux2628, linux26, linux24, linux24e, linux22, solaris," - @echo " freebsd, netbsd, osx, openbsd, aix51, aix52, cygwin, haiku," - @echo " generic, custom" + @echo " linux-glibc, solaris, freebsd, openbsd, netbsd, cygwin," + @echo " haiku, aix51, aix52, osx, generic, 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" -- 2.20.1
>From 46d2f00d8f54173519518cf3f6c19fe7042bbcfa Mon Sep 17 00:00:00 2001 From: Willy Tarreau <w...@1wt.eu> Date: Fri, 14 Jun 2019 16:44:49 +0200 Subject: BUILD: makefile: detect and reject recently removed linux targets We've just removed old linux targets "linux22", "linux24", "linux24e", "linux26" and "linux2628" and it's likely that many build scripts and packages will still reference these. So let's have the makefile detect these and reject with instructions instead of silently building with incorrect options. --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 3405db3c6..299e707e3 100644 --- a/Makefile +++ b/Makefile @@ -742,6 +742,14 @@ all: @echo "out of it. Please check the Makefile in case of doubts." @echo @exit 1 +else ifneq ($(filter $(TARGET), linux22 linux24 linux24e linux26 linux2628),) +all: + @echo + @echo "Target '$(TARGET)' was removed from HAProxy 2.0 due to being irrelevant and" + @echo "often wrong. Please use 'linux-glibc' instead or define your custom target" + @echo "by checking available options using 'make help TARGET=<your-target>'." + @echo + @exit 1 else all: haproxy $(EXTRA) endif -- 2.20.1
>From f8bcfbadb57922da12d71a3a2616e975ad187d4f Mon Sep 17 00:00:00 2001 From: Willy Tarreau <w...@1wt.eu> Date: Fri, 14 Jun 2019 16:54:51 +0200 Subject: BUILD: makefile: enable linux namespaces by default on linux Oldest kernel found on a supported Linux distro (2.6.32 + backports on RHEL6) supports network namespaces, so we have no reason not to enable them by default on the linux-glibc target. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 299e707e3..ef592c7ac 100644 --- a/Makefile +++ b/Makefile @@ -324,7 +324,7 @@ ifeq ($(TARGET),linux-glibc) 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_ACCEPT4 USE_LINUX_SPLICE USE_PRCTL USE_THREAD_DUMP USE_NS) endif # Solaris 8 and above -- 2.20.1
>From 4dca8c4b0f27653211e01f8938a9508a5462aea7 Mon Sep 17 00:00:00 2001 From: Willy Tarreau <w...@1wt.eu> Date: Fri, 14 Jun 2019 16:57:42 +0200 Subject: BUILD: makefile: enable TFO on linux platforms TCP Fast Open is supported on all supported Linux kernels and on all kernels shipped in supported distros, except the older 2.6.32 that comes with RHEL6. However the option is harmless, will not prevent from building and smoothly falls back even if forcefully enabled, so it makes sense to enable it by default. It's still possible to pass "USE_TFO=" to force it disabled if really desired. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ef592c7ac..958f9d00d 100644 --- a/Makefile +++ b/Makefile @@ -324,7 +324,7 @@ ifeq ($(TARGET),linux-glibc) 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_ACCEPT4 USE_LINUX_SPLICE USE_PRCTL USE_THREAD_DUMP USE_NS USE_TFO) endif # Solaris 8 and above -- 2.20.1