From 461c2cda8fab74fe76c6ff44771025099e926046 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 15 Feb 2018 09:28:23 +0100 Subject: contrib/npclient: change {C,LD}FLAGS - reproducible builds; -Wl,--no-insert-timestamp - add HIGHENTROPYVA for 64-bit builds Reducing code size is a pointless exercise, still: - remove .eh_frame that only GNU uses - reduce 32-bit code size; -march=pentium4 - add few feel-good CFLAGS. maybe reduces code size, maybe doesn't do anything --- contrib/npclient/COMPILE.TXT | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/contrib/npclient/COMPILE.TXT b/contrib/npclient/COMPILE.TXT index d355fbcc..aee101d0 100644 --- a/contrib/npclient/COMPILE.TXT +++ b/contrib/npclient/COMPILE.TXT @@ -3,9 +3,19 @@ # This makes small binaries: CC=clang -CFLAGS='-Wall -Wextra -Wpedantic -Os -s -ffunction-sections -fdata-sections -Wl,--kill-at,--nxcompat,--dynamicbase,--as-needed,--gc-sections,--strip-all' + +CFLAGS=' \ +-Wall -Wextra -Wpedantic -Os -fomit-frame-pointer -mtune=generic \ +-ffunction-sections -fdata-sections -fvisibility=hidden \ +-Wl,--kill-at,--nxcompat,--dynamicbase,--as-needed,--gc-sections \ +-Wl,--no-insert-timestamp \ +-fno-math-errno -fno-trapping-math -fmerge-all-constants \ +-fno-stack-protector \ +' + +STRIP='strip --strip-all --remove-section=.eh_frame' cd -- "$(dirname -- "$0")" && -PATH=/mingw32/bin:"$PATH" sh -c "$CC -m32 $CFLAGS -mdll -o NPClient.dll npclient.c" && -PATH=/mingw64/bin:"$PATH" sh -c "$CC -m64 $CFLAGS -mdll -o NPClient64.dll npclient.c" && -ls -l NPClient{64,}.dll && mv NPClient{64,}.dll ../../bin/ +PATH=/mingw32/bin:"$PATH" sh -c "$CC -m32 -march=pentium4 $CFLAGS -mdll -o NPClient.dll npclient.c && $STRIP NPClient.dll" && +PATH=/mingw64/bin:"$PATH" sh -c "$CC -m64 -Wl,--high-entropy-va $CFLAGS -mdll -o NPClient64.dll npclient.c && $STRIP NPClient64.dll" && +ls -l NPClient{,64}.dll && openssl md5 NPClient{,64}.dll && mv NPClient{,64}.dll ../../bin/ -- cgit v1.2.3