Skip to content

Commit

Permalink
enable -O3, no-exec stack for all deps [ci skip]
Browse files Browse the repository at this point in the history
- Except for OpenSSL, -O3 was not enabled everywhere.
  curl, libssh2 and libressl had -O2. CMake projects had -O3, autotools
  project had no optimization.
- Borrowed the no-exec stack option from OpenSSL and applied it to all
  components.
  • Loading branch information
vszakats committed May 20, 2022
1 parent 9369da4 commit 82301c8
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion brotli.sh
Expand Up @@ -40,7 +40,7 @@ _VER="$1"
find . -name '*.Plo' -delete
find . -name '*.pc' -delete

_CFLAGS="${_OPTM} -fno-ident -DMINGW_HAS_SECURE_API"
_CFLAGS="${_OPTM} -fno-ident -Wa,--noexecstack -DMINGW_HAS_SECURE_API"
[ "${_CPU}" = 'x86' ] && _CFLAGS="${_CFLAGS} -fno-asynchronous-unwind-tables"

options=''
Expand Down
2 changes: 1 addition & 1 deletion curl.sh
Expand Up @@ -40,7 +40,7 @@ _VER="$1"
# public libcurl functions being marked as 'exported'. Useful to
# avoid the chance of libcurl functions getting exported from final
# binaries when linked against static libcurl lib.
export CURL_CFLAG_EXTRAS='-DCURL_STATICLIB -DCURL_ENABLE_MQTT -fno-ident -DHAVE_ATOMIC'
export CURL_CFLAG_EXTRAS='-fno-ident -O3 -Wa,--noexecstack -DCURL_STATICLIB -DCURL_ENABLE_MQTT -DHAVE_ATOMIC'
[ "${_CPU}" = 'x86' ] && CURL_CFLAG_EXTRAS="${CURL_CFLAG_EXTRAS} -fno-asynchronous-unwind-tables"
export CURL_LDFLAG_EXTRAS='-static-libgcc -Wl,--nxcompat -Wl,--dynamicbase'
export CURL_LDFLAG_EXTRAS_EXE
Expand Down
2 changes: 1 addition & 1 deletion libgsasl.sh
Expand Up @@ -36,7 +36,7 @@ _VER="$1"
# Requires: autopoint (sometimes offered by the gettext package)
[ -f 'Makefile' ] || autoreconf --force --install

export CFLAGS="${_OPTM} -fno-ident"
export CFLAGS="${_OPTM} -fno-ident -O3 -Wa,--noexecstack"

if [ "${CC}" = 'mingw-clang' ]; then
export CC='clang'
Expand Down
2 changes: 1 addition & 1 deletion libidn2.sh
Expand Up @@ -56,7 +56,7 @@ _VER="$1"
export CC="${_CCPREFIX}gcc -static-libgcc"
fi

export CFLAGS="${LDFLAGS} -fno-ident"
export CFLAGS="${LDFLAGS} -fno-ident -O3 -Wa,--noexecstack"
LDFLAGS="${LDFLAGS}${ldonly}"
[ "${_CPU}" = 'x86' ] && CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables"
# shellcheck disable=SC2086
Expand Down
2 changes: 1 addition & 1 deletion libressl.sh
Expand Up @@ -78,7 +78,7 @@ _VER="$1"
export CFLAGS="${LDFLAGS} -Wno-attributes"
fi

CFLAGS="${CFLAGS} -fno-ident"
CFLAGS="${CFLAGS} -fno-ident -O3 -Wa,--noexecstack"
LDFLAGS="${LDFLAGS}${ldonly}"
[ "${_CPU}" = 'x86' ] && CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables"
[ "${_CPU}" = 'x86' ] && CPPFLAGS="${CPPFLAGS} -D__MINGW_USE_VC2005_COMPAT"
Expand Down
2 changes: 1 addition & 1 deletion libssh2.sh
Expand Up @@ -24,7 +24,7 @@ _VER="$1"
[ "${_CPU}" = 'x86' ] && ARCH='w32'
[ "${_CPU}" = 'x64' ] && ARCH='w64'

export LIBSSH2_CFLAG_EXTRAS='-fno-ident -DHAVE_STRTOI64 -DLIBSSH2_DH_GEX_NEW=1 -DHAVE_DECL_SECUREZEROMEMORY=1 -DHAVE_EVP_AES_128_CTR=1'
export LIBSSH2_CFLAG_EXTRAS='-fno-ident -O3 -Wa,--noexecstack -DHAVE_STRTOI64 -DLIBSSH2_DH_GEX_NEW=1 -DHAVE_DECL_SECUREZEROMEMORY=1 -DHAVE_EVP_AES_128_CTR=1'
[ "${_CPU}" = 'x86' ] && LIBSSH2_CFLAG_EXTRAS="${LIBSSH2_CFLAG_EXTRAS} -fno-asynchronous-unwind-tables"

export ZLIB_PATH=../../zlib/pkg/usr/local
Expand Down
2 changes: 1 addition & 1 deletion nghttp2.sh
Expand Up @@ -41,7 +41,7 @@ _VER="$1"
find . -name '*.Plo' -delete
find . -name '*.pc' -delete

_CFLAGS="${_OPTM} -fno-ident -DNDEBUG"
_CFLAGS="${_OPTM} -fno-ident -DNDEBUG -Wa,--noexecstack"
[ "${_CPU}" = 'x86' ] && _CFLAGS="${_CFLAGS} -fno-asynchronous-unwind-tables"

options=''
Expand Down
2 changes: 1 addition & 1 deletion nghttp3.sh
Expand Up @@ -41,7 +41,7 @@ _VER="$1"
find . -name '*.Plo' -delete
find . -name '*.pc' -delete

_CFLAGS="${_OPTM} -fno-ident -DNDEBUG"
_CFLAGS="${_OPTM} -fno-ident -DNDEBUG -Wa,--noexecstack"
[ "${_CPU}" = 'x86' ] && _CFLAGS="${_CFLAGS} -fno-asynchronous-unwind-tables"

options=''
Expand Down
2 changes: 1 addition & 1 deletion ngtcp2.sh
Expand Up @@ -39,7 +39,7 @@ _VER="$1"
fi

export CC="${_CCPREFIX}gcc -static-libgcc"
export CFLAGS="${_OPTM} -fno-ident"
export CFLAGS="${_OPTM} -fno-ident -O3 -Wa,--noexecstack"
[ "${_CPU}" = 'x86' ] && CFLAGS="${CFLAGS} -fno-asynchronous-unwind-tables"

# shellcheck disable=SC2086
Expand Down
2 changes: 1 addition & 1 deletion zlib.sh
Expand Up @@ -41,7 +41,7 @@ _VER="$1"
find . -name '*.Plo' -delete
find . -name '*.pc' -delete

_CFLAGS="${_OPTM} -fno-ident -D_LARGEFILE64_SOURCE=1 -D_LFS64_LARGEFILE=1"
_CFLAGS="${_OPTM} -fno-ident -Wa,--noexecstack -D_LARGEFILE64_SOURCE=1 -D_LFS64_LARGEFILE=1"
[ "${_CPU}" = 'x86' ] && _CFLAGS="${_CFLAGS} -fno-asynchronous-unwind-tables"

options=''
Expand Down

0 comments on commit 82301c8

Please sign in to comment.