diff --git a/haproxy/Makefile.patch b/haproxy/Makefile.patch new file mode 100644 index 0000000..dc2b83f --- /dev/null +++ b/haproxy/Makefile.patch @@ -0,0 +1,18 @@ +--- Makefile_OLD.txt 2022-10-23 16:24:37.113951164 +0200 ++++ Makefile 2022-10-23 15:25:44.686153369 +0200 +@@ -326,13 +326,13 @@ + # These CFLAGS contain general optimization options, CPU-specific optimizations + # and debug flags. They may be overridden by some distributions which prefer to + # set all of them at once instead of playing with the CPU and DEBUG variables. +-CFLAGS = $(ARCH_FLAGS) $(CPU_CFLAGS) $(DEBUG_CFLAGS) $(SPEC_CFLAGS) ++CFLAGS = -fPIC $(ARCH_FLAGS) $(CPU_CFLAGS) $(DEBUG_CFLAGS) $(SPEC_CFLAGS) + + #### Common LDFLAGS + # These LDFLAGS are used as the first "ld" options, regardless of any library + # path or any other option. They may be changed to add any linker-specific + # option at the beginning of the ld command line. +-LDFLAGS = $(ARCH_FLAGS) -g ++LDFLAGS = -static-pie $(ARCH_FLAGS) -g + + #### list of all "USE_*" options. These ones must be updated if new options are + # added, so that the relevant options are properly added to the CFLAGS and to diff --git a/haproxy/build.sh b/haproxy/build.sh new file mode 100755 index 0000000..e84a30b --- /dev/null +++ b/haproxy/build.sh @@ -0,0 +1,16 @@ +\#!/bin/bash + +# Clean up. +rm -fr haproxy-git + +echo -n "Downloading HAProxy ... " +git clone https://github.com/haproxy/haproxy.git haproxy-git +echo "" +echo -n "Building HAProxy ... " +pushd haproxy-git > /dev/null 2>&1 +patch Makefile < ../Makefile.patch +make TARGET=linux-glibc-legacy +popd > /dev/null 2>&1 + +cp haproxy-git/haproxy . +rm -fr haproxy-git diff --git a/haproxy/haproxy b/haproxy/haproxy new file mode 100644 index 0000000..493b6da Binary files /dev/null and b/haproxy/haproxy differ