mirror of
https://github.com/haproxy/haproxy.git
synced 2026-07-04 23:06:17 -04:00
BUILD: makefile: add a new generic target "tiny"
Some checks failed
Contrib / admin/halog/ (push) Has been cancelled
Contrib / dev/flags/ (push) Has been cancelled
Contrib / dev/haring/ (push) Has been cancelled
Contrib / dev/hpack/ (push) Has been cancelled
Contrib / dev/poll/ (push) Has been cancelled
FreeBSD / clang (push) Has been cancelled
VTest / Generate Build Matrix (push) Has been cancelled
Windows / Windows, gcc, all features (push) Has been cancelled
VTest / (push) Has been cancelled
Some checks failed
Contrib / admin/halog/ (push) Has been cancelled
Contrib / dev/flags/ (push) Has been cancelled
Contrib / dev/haring/ (push) Has been cancelled
Contrib / dev/hpack/ (push) Has been cancelled
Contrib / dev/poll/ (push) Has been cancelled
FreeBSD / clang (push) Has been cancelled
VTest / Generate Build Matrix (push) Has been cancelled
Windows / Windows, gcc, all features (push) Has been cancelled
VTest / (push) Has been cancelled
This target disables all possible features except poll(). It is meant to
serve as a base for small embedded setups, on top of which one may manually
enable select features. Even threads, traces/h2/fcgi/SPOE are disabled.
The default executable is roughly 80% smaller than with linux-glibc:
$ size haproxy-linux-glibc haproxy-tiny
text data bss dec hex filename
3660924 176964 9868784 13706672 d125b0 haproxy-linux-glibc
2537864 146512 84928 2769304 2a4198 haproxy-tiny
With SSL enabled, the difference shrinks a bit (-77%):
$ size haproxy-linux-glibc-ssl haproxy-tiny-ssl
text data bss dec hex filename
4163373 208788 9873904 14246065 d960b1 haproxy-linux-glibc-ssl
2950852 177732 90048 3218632 311cc8 haproxy-tiny-ssl
This commit is contained in:
parent
0bf32cee66
commit
7dfe7d240e
2 changed files with 19 additions and 5 deletions
15
INSTALL
15
INSTALL
|
|
@ -475,9 +475,9 @@ are the extra libraries that may be referenced at build time :
|
|||
-------------------
|
||||
Some build errors may happen depending on the options combinations or the
|
||||
selected target. When facing build errors, if you know that your system is a
|
||||
bit special or particularly old, start from TARGET=generic, it is easier to
|
||||
start from there and fix the remaining issues than trying to degrade another
|
||||
target. Common issues may include:
|
||||
bit special or particularly old, start from TARGET=generic or TARGET=tiny; it
|
||||
is easier to start from there and fix the remaining issues than trying to
|
||||
degrade another target. Common issues may include:
|
||||
|
||||
- clock_gettime() not found
|
||||
=> your system needs USE_RT=1
|
||||
|
|
@ -579,6 +579,7 @@ and assign it to the TARGET variable :
|
|||
- haiku for Haiku
|
||||
- generic for any other OS or version.
|
||||
- custom to manually adjust every setting
|
||||
- tiny to turn all default options off by default
|
||||
|
||||
Example:
|
||||
$ make -j $(nproc) TARGET=linux-glibc
|
||||
|
|
@ -603,8 +604,14 @@ well use that property to define your own set of options. USE_POLL and USE_SLZ
|
|||
can even be disabled by setting them to an empty string or a zero. For
|
||||
example :
|
||||
|
||||
$ gmake TARGET=tiny USE_POLL="" USE_SLZ=0 TARGET_CFLAGS=-fomit-frame-pointer
|
||||
$ gmake TARGET=small USE_POLL="" USE_SLZ=0 TARGET_CFLAGS=-fomit-frame-pointer
|
||||
|
||||
Note that when seeking the absolute smallest build (e.g. for low-spec embedded
|
||||
devices), the "tiny" target disables everything configurable and generally
|
||||
results in a binary that's 4-5 times smaller than the default one. From this
|
||||
point it then becomes possible to enable only what is desired:
|
||||
|
||||
$ make -j $(nproc) TARGET=tiny USE_EPOLL=1 USE_DL=1 USE_OPENSSL=1
|
||||
|
||||
5.2) Adding extra CFLAGS for compiling
|
||||
--------------------------------------
|
||||
|
|
|
|||
9
Makefile
9
Makefile
|
|
@ -157,7 +157,7 @@ DOCDIR = $(PREFIX)/doc/haproxy
|
|||
# following list (use the default "generic" if uncertain) :
|
||||
# linux-glibc, linux-glibc-legacy, linux-musl, solaris, freebsd, freebsd-glibc,
|
||||
# dragonfly, openbsd, netbsd, cygwin, haiku, aix51, aix52, aix72-gcc, osx, generic,
|
||||
# custom
|
||||
# custom, tiny
|
||||
TARGET =
|
||||
|
||||
#### No longer used
|
||||
|
|
@ -387,6 +387,13 @@ ifeq ($(TARGET),generic)
|
|||
set_target_defaults = $(call default_opts,USE_POLL USE_TPROXY)
|
||||
endif
|
||||
|
||||
# For embedded systems or to be used as a base, tiniest binary with fewest
|
||||
# features. Only poll() is enabled to avoid issues with select().
|
||||
ifeq ($(TARGET),tiny)
|
||||
set_target_defaults = $(call disable_opts,$(use_opts)) $(call enable_opts,USE_POLL)
|
||||
INSTALL = install -v
|
||||
endif
|
||||
|
||||
# Haiku
|
||||
ifeq ($(TARGET),haiku)
|
||||
TARGET_LDFLAGS = -lnetwork
|
||||
|
|
|
|||
Loading…
Reference in a new issue