Add fix for compiling the scrypt module under hardening-wrapper

This commit is contained in:
Sebastian Messmer 2016-10-04 20:45:26 +02:00
parent bd74a5b762
commit 72b6874c12
3 changed files with 12 additions and 4 deletions

View File

@ -12,6 +12,7 @@ Improvements:
Compatibility:
* Compatible with libcurl version >= 7.50.0, and <= 7.21.6 (tested down to 7.19.0)
* Compatible with Crypto++ 5.6.4
* Compatible with compilers running under hardening-wrapper
Version 0.9.5
---------------

View File

@ -1311,7 +1311,7 @@ uninstall-man: uninstall-man1
cpusupport-config.h:
( export CC="${CC}"; export CFLAGS="${CFLAGS}"; command -p sh $(srcdir)/libcperciva/cpusupport/Build/cpusupport.sh ) > cpusupport-config.h.tmp && command -p mv cpusupport-config.h.tmp cpusupport-config.h
( export CC="${CC}"; export CFLAGS="${CFLAGS}"; command -p sh $(srcdir)/libcperciva/cpusupport/Build/cpusupport.sh "$$PATH") > cpusupport-config.h.tmp && command -p mv cpusupport-config.h.tmp cpusupport-config.h
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -1,5 +1,9 @@
# Should be sourced by `command -p sh path/to/cpusupport.sh` from
# Should be sourced by `command -p sh path/to/cpusupport.sh "$PATH"` from
# within a Makefile.
if ! [ ${PATH} = "$1" ]; then
echo "WARNING: POSIX violation: $SHELL's command -p resets \$PATH" 1>&2
PATH=$1
fi
# Standard output should be written to cpusupport-config.h, which is both a
# C header file defining CPUSUPPORT_ARCH_FEATURE macros and sourceable sh
# code which sets CFLAGS_ARCH_FEATURE environment variables.
@ -9,6 +13,9 @@ feature() {
ARCH=$1
FEATURE=$2
shift 2;
if ! [ -f ${SRCDIR}/cpusupport-$ARCH-$FEATURE.c ]; then
return
fi
printf "Checking if compiler supports $ARCH $FEATURE feature..." 1>&2
for CFLAG in "$@"; do
if ${CC} ${CFLAGS} -D_POSIX_C_SOURCE=200809L ${CFLAG} \
@ -24,11 +31,11 @@ feature() {
;;
"")
echo " yes" 1>&2
echo "#define CPUSUPPORT_${ARCH}_${FEATURE}"
echo "#define CPUSUPPORT_${ARCH}_${FEATURE} 1"
;;
*)
echo " yes, via $CFLAG" 1>&2
echo "#define CPUSUPPORT_${ARCH}_${FEATURE}"
echo "#define CPUSUPPORT_${ARCH}_${FEATURE} 1"
echo "#ifdef cpusupport_dummy"
echo "export CFLAGS_${ARCH}_${FEATURE}=\"${CFLAG}\""
echo "#endif"