Skip to content

Commit

Permalink
Used aggressive compiler flags for garbage collection and symbol stri…
Browse files Browse the repository at this point in the history
…pping to reduce binary size
  • Loading branch information
Knogle committed Sep 19, 2024
1 parent 2016134 commit 975b7b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
25 changes: 12 additions & 13 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
SUBDIRS = external/openssl src man

# Set of files to be formatted.
# Set of files to be formatted
FORMATSOURCES = src/*.c src/*.h

format:
clang-format -i -style=file $(FORMATSOURCES)

check-format:
clang-format -i -style=file $(FORMATSOURCES) && git diff --exit-code

# Add a rule to build OpenSSL first
all: build-openssl $(SUBDIRS)
all: build-openssl

build-openssl:
cd external/openssl && ./Configure linux-x86_64 no-shared no-comp no-engine no-md4 no-md2 no-ripemd no-whirlpool \
no-dsa no-dh no-ec no-ecdsa no-ecdh no-sm2 no-sm3 no-sm4 no-aria \
no-cast no-camellia no-seed no-rc2 no-rc4 no-rc5 no-des no-blake2 no-poly1305 \
no-chacha no-scrypt no-siphash no-ssl no-tls no-tls1 no-tls1_1 no-tls1_2 no-tls1_3 \
no-dtls no-dtls1 no-dtls1_2 no-nextprotoneg no-ocsp no-srp no-srtp no-psk \
no-deprecated no-legacy no-tests no-shared no-dso no-async no-atexit no-autoalginit \
no-autoload-config no-static-engine no-ui-console no-filenames \
--prefix=$(abs_top_srcdir)/external/openssl/build && make && make install_sw


no-dsa no-dh no-ec no-ecdsa no-ecdh no-sm2 no-sm3 no-sm4 no-aria \
no-cast no-camellia no-seed no-rc2 no-rc4 no-rc5 no-des no-blake2 no-poly1305 \
no-chacha no-scrypt no-siphash no-ssl no-tls no-tls1_1 no-tls1_2 no-tls1_3 \
no-dtls no-dtls1 no-dtls1_2 no-nextprotoneg no-ocsp no-srp no-srtp no-psk \
no-deprecated no-legacy no-tests no-shared no-dso no-async no-atexit no-autoalginit \
no-autoload-config no-static-engine no-ui-console no-filenames \
--prefix=$(abs_top_srcdir)/external/openssl/build && make -j$(shell nproc) && make install_sw

$(SUBDIRS):
$(MAKE) -C $@ -j$(NUM_PROCS)
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Include directories and linker flags for OpenSSL
AM_CFLAGS = -I$(top_srcdir)/external/openssl/build/include
AM_CFLAGS = -I$(top_srcdir)/external/openssl/build/include -Wl,--gc-sections -flto -Os -s -fno-ident
AM_LDFLAGS = -L$(top_srcdir)/external/openssl/build/lib64 -l:libssl.a -l:libcrypto.a

# List of binaries to be built
Expand Down

0 comments on commit 975b7b4

Please sign in to comment.