Skip to content

Commit

Permalink
libressl: limit --noexecstack to llvm
Browse files Browse the repository at this point in the history
To avoid:
```
/usr/bin/x86_64-w64-mingw32-as: unrecognized option '--noexecstack'
```
Ref: https://github.com/curl/curl-for-win/actions/runs/6476061521/job/17584156242#step:3:4365
  • Loading branch information
vszakats committed Oct 11, 2023
1 parent 051939f commit bd00b55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion libressl-cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ _VER="$1"

rm -r -f "${_PKGDIR:?}" "${_BLDDIR:?}"

CFLAGS="-ffile-prefix-map=$(pwd)= -Wa,--noexecstack"
CFLAGS="-ffile-prefix-map=$(pwd)="

if [ "${_CC}" = 'llvm' ]; then
CFLAGS="${CFLAGS} -Wa,--noexecstack"
fi

[ "${_CPU}" = 'x86' ] && cpu='x86'
[ "${_CPU}" = 'x64' ] && cpu='x86_64'
Expand Down
6 changes: 4 additions & 2 deletions libressl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ _VER="$1"

options="${_CONFIGURE_GLOBAL}"
export CC="${_CC_GLOBAL}"
export CFLAGS="${_CFLAGS_GLOBAL} -O3 -Wa,--noexecstack"
export CFLAGS="${_CFLAGS_GLOBAL} -O3"
export CPPFLAGS="${_CPPFLAGS_GLOBAL}"
export LDFLAGS="${_LDFLAGS_GLOBAL} ${_LDFLAGS_GLOBAL_AUTOTOOLS}"
export LIBS="${_LIBS_GLOBAL}"

[ "${LIBRESSL_VER_}" = '3.8.1' ] && options="${options} --disable-asm"

if [ "${_CC}" = 'gcc' ]; then
if [ "${_CC}" = 'llvm' ]; then
CFLAGS="${CFLAGS} -Wa,--noexecstack"
else
CFLAGS="${CFLAGS} -Wno-attributes"
fi

Expand Down

0 comments on commit bd00b55

Please sign in to comment.