Skip to content

Commit

Permalink
Add HAProxy compatibility
Browse files Browse the repository at this point in the history
Co-authored-by: Gabriele Pappalardo <[email protected]>
Co-authored-by: Alberto Zurini <[email protected]>
Co-authored-by: Federico Bertossi <[email protected]>
Signed-off-by: Alessandro Grassi <[email protected]>
  • Loading branch information
4 people committed Oct 23, 2022
1 parent 5974451 commit cba5f6d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
18 changes: 18 additions & 0 deletions haproxy/Makefile.patch
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions haproxy/build.sh
Original file line number Diff line number Diff line change
@@ -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
Binary file added haproxy/haproxy
Binary file not shown.

0 comments on commit cba5f6d

Please sign in to comment.