From e6918187568dbd01842d8d1d2c808ce16a894239 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 21 Apr 2024 13:54:28 +0200 Subject: Adding upstream version 18.2.2. Signed-off-by: Daniel Baumann --- .../isa-l/isa-l_crypto/tools/check_format.sh | 87 ++++++++++++++ src/crypto/isa-l/isa-l_crypto/tools/gen_nmake.mk | 123 ++++++++++++++++++++ src/crypto/isa-l/isa-l_crypto/tools/iindent | 2 + .../isa-l/isa-l_crypto/tools/nasm-cet-filter.sh | 56 +++++++++ src/crypto/isa-l/isa-l_crypto/tools/nasm-filter.sh | 47 ++++++++ .../tools/remove_trailing_whitespace.sh | 2 + .../isa-l/isa-l_crypto/tools/test_autorun.sh | 63 ++++++++++ src/crypto/isa-l/isa-l_crypto/tools/test_checks.sh | 73 ++++++++++++ .../isa-l/isa-l_crypto/tools/test_extended.sh | 127 +++++++++++++++++++++ src/crypto/isa-l/isa-l_crypto/tools/test_tools.sh | 11 ++ .../isa-l/isa-l_crypto/tools/yasm-cet-filter.sh | 47 ++++++++ src/crypto/isa-l/isa-l_crypto/tools/yasm-filter.sh | 38 ++++++ 12 files changed, 676 insertions(+) create mode 100755 src/crypto/isa-l/isa-l_crypto/tools/check_format.sh create mode 100644 src/crypto/isa-l/isa-l_crypto/tools/gen_nmake.mk create mode 100755 src/crypto/isa-l/isa-l_crypto/tools/iindent create mode 100755 src/crypto/isa-l/isa-l_crypto/tools/nasm-cet-filter.sh create mode 100755 src/crypto/isa-l/isa-l_crypto/tools/nasm-filter.sh create mode 100755 src/crypto/isa-l/isa-l_crypto/tools/remove_trailing_whitespace.sh create mode 100755 src/crypto/isa-l/isa-l_crypto/tools/test_autorun.sh create mode 100755 src/crypto/isa-l/isa-l_crypto/tools/test_checks.sh create mode 100755 src/crypto/isa-l/isa-l_crypto/tools/test_extended.sh create mode 100755 src/crypto/isa-l/isa-l_crypto/tools/test_tools.sh create mode 100755 src/crypto/isa-l/isa-l_crypto/tools/yasm-cet-filter.sh create mode 100755 src/crypto/isa-l/isa-l_crypto/tools/yasm-filter.sh (limited to 'src/crypto/isa-l/isa-l_crypto/tools') diff --git a/src/crypto/isa-l/isa-l_crypto/tools/check_format.sh b/src/crypto/isa-l/isa-l_crypto/tools/check_format.sh new file mode 100755 index 000000000..8c67a931c --- /dev/null +++ b/src/crypto/isa-l/isa-l_crypto/tools/check_format.sh @@ -0,0 +1,87 @@ +#!/usr/bin/env bash + +set -e +rc=0 +verbose=0 +indent_args='-linux -l95 -cp1 -lps -il6 -ncs' +function iver { printf "%03d%03d%03d%03d" $(echo "$@" | sed 's/GNU indent//' | tr '.' ' '); } + +while [ -n "$*" ]; do + case "$1" in + -v ) + verbose=1 + shift + ;; + -h ) + echo check_format.sh [-h -v] + exit 0 + ;; + esac +done + +echo "Checking format of files in the git index at $PWD" +if ! git rev-parse --is-inside-work-tree >& /dev/null; then + echo "Not in a git repo: Fail" + exit 1 +fi + +if hash indent && [ $(iver $(indent --version)) -ge $(iver 2.2.12) ]; then + echo "Checking C files for coding style..." + for f in `git ls-files '*.c'`; do + [ "$verbose" -gt 0 ] && echo "checking style on $f" + if ! indent $indent_args -st $f | diff -q $f - >& /dev/null; then + echo " File found with formatting issues: $f" + [ "$verbose" -gt 0 ] 2> /dev/null && indent $indent_args -st $f | diff -u $f - + rc=1 + fi + done + [ "$rc" -gt 0 ] && echo " Run ./tools/iindent on files" +else + echo "You do not have a recent indent installed so your code style is not being checked!" +fi + +if hash grep; then + echo "Checking for dos and whitespace violations..." + for f in $(git ls-files); do + [ "$verbose" -gt 0 ] && echo "checking whitespace on $f" + if grep -q '[[:space:]]$' $f ; then + echo " File found with trailing whitespace: $f" + rc=1 + fi + if grep -q $'\r' $f ; then + echo " File found with dos formatting: $f" + rc=1 + fi + done +fi + +echo "Checking source files for permissions..." +while read -r perm _res0 _res1 f; do + [ -z "$f" ] && continue + [ "$verbose" -gt 0 ] && echo "checking permissions on $f" + if [ "$perm" -ne 100644 ]; then + echo " File found with permissions issue ($perm): $f" + rc=1 + fi +done <<< $(git ls-files -s -- ':(exclude)*.sh' ':(exclude)*iindent') + +echo "Checking script files for permissions..." +while read -r perm _res0 _res1 f; do + [ -z "$f" ] && continue + [ "$verbose" -gt 0 ] && echo "checking permissions on $f" + if [ "$perm" -ne 100755 ]; then + echo " Script found with permissions issue ($perm): $f" + rc=1 + fi +done <<< $(git ls-files -s '*.sh') + + +echo "Checking for signoff in commit message..." +if ! git log -n 1 --format=%B | grep -q "^Signed-off-by:" ; then + echo " Commit not signed off. Please read src/CONTRIBUTING.md" + rc=1 +fi + +[ "$rc" -gt 0 ] && echo Format Fail || echo Format Pass + +exit $rc diff --git a/src/crypto/isa-l/isa-l_crypto/tools/gen_nmake.mk b/src/crypto/isa-l/isa-l_crypto/tools/gen_nmake.mk new file mode 100644 index 000000000..f2c8b46ed --- /dev/null +++ b/src/crypto/isa-l/isa-l_crypto/tools/gen_nmake.mk @@ -0,0 +1,123 @@ +# Regenerate nmake file from makefiles or check its consistency + +test_nmake_file: tst.nmake + @diff -u Makefile.nmake tst.nmake || (echo Potential nmake consistency issue; $(RM) tst.nmake; false;) + @echo No nmake consistency issues + @$(RM) tst.nmake + +FORCE: +Makefile.nmake tst.nmake: FORCE + @echo Regenerating $@ + @echo '########################################################################' > $@ + @cat LICENSE | sed -e 's/^/#/ ' >> $@ + @echo '########################################################################' >> $@ + @echo '' >> $@ + @echo '# This file can be auto-regenerated with $$make -f Makefile.unx Makefile.nmake' >> $@ + @echo '' >> $@ + @echo -n 'objs =' >> $@ + @$(foreach o, $(subst /,\\,$(objs:.o=.obj)), printf " %s\n\t%s" \\ $(o) >> $@; ) + @echo '' >> $@ + @echo '' >> $@ + @echo 'INCLUDES = $(INCLUDE)' >> $@ + @echo '# Modern asm feature level, consider upgrading nasm/yasm before decreasing feature_level' >> $@ + @echo 'FEAT_FLAGS = -DHAVE_AS_KNOWS_AVX512 -DAS_FEATURE_LEVEL=10 -DHAVE_AS_KNOWS_SHANI' >> $@ + @echo 'CFLAGS_REL = -O2 -DNDEBUG /Z7 /MD /Gy' >> $@ + @echo 'CFLAGS_DBG = -Od -DDEBUG /Z7 /MDd' >> $@ + @echo 'LINKFLAGS = -nologo -incremental:no -debug' >> $@ + @echo 'CFLAGS = $$(CFLAGS_REL) -nologo -D_USE_MATH_DEFINES $$(FEAT_FLAGS) $$(INCLUDES) $$(D)' >> $@ + @echo 'AFLAGS = -f win64 $$(FEAT_FLAGS) $$(INCLUDES) $$(D)' >> $@ + @echo 'CC = cl' >> $@ + @echo '# or CC = icl -Qstd=c99' >> $@ + @echo 'AS = nasm' >> $@ + @echo '' >> $@ + @echo 'lib: bin static dll' >> $@ + @echo 'static: bin isa-l_crypto_static.lib' >> $@ + @echo 'dll: bin isa-l_crypto.dll' >> $@ + @echo '' >> $@ + @echo 'bin: ; -mkdir $$@' >> $@ + @echo '' >> $@ + @echo 'isa-l_crypto_static.lib: $$(objs)' >> $@ + @echo ' lib -out:$$@ @<<' >> $@ + @echo '$$?' >> $@ + @echo '<<' >> $@ + @echo '' >> $@ + @echo 'isa-l_crypto.dll: $$(objs)' >> $@ + @echo ' link -out:$$@ -dll -def:isa-l_crypto.def $$(LINKFLAGS) @<<' >> $@ + @echo '$$?' >> $@ + @echo '<<' >> $@ + @echo '' >> $@ + @$(foreach b, $(units), \ + printf "{%s}.c.obj:\n\t\$$(CC) \$$(CFLAGS) /c -Fo\$$@ \$$?\n{%s}.asm.obj:\n\t\$$(AS) \$$(AFLAGS) -o \$$@ \$$?\n\n" $(b) $(b) >> $@; ) + @echo '' >> $@ +ifneq (,$(examples)) + @echo "# Examples" >> $@ + @echo -n 'ex =' >> $@ + @$(foreach ex, $(notdir $(examples)), printf " %s\n\t%s.exe" \\ $(ex) >> $@; ) + @echo '' >> $@ + @echo '' >> $@ + @echo 'ex: lib $$(ex)' >> $@ + @echo '' >> $@ + @echo '$$(ex): $$(@B).obj' >> $@ +endif + @echo '' >> $@ + @echo '.obj.exe:' >> $@ + @echo ' link /out:$$@ $$(LINKFLAGS) isa-l_crypto.lib $$?' >> $@ + @echo '' >> $@ + @echo '# Check tests' >> $@ + @echo -n 'checks =' >> $@ + @$(foreach check, $(notdir $(check_tests)), printf " %s\n\t%s.exe" \\ $(check) >> $@; ) + @echo '' >> $@ + @echo '' >> $@ + @echo 'checks: lib $$(checks)' >> $@ + @echo '$$(checks): $$(@B).obj' >> $@ + @echo 'check: $$(checks)' >> $@ + @echo ' !$$?' >> $@ + @echo '' >> $@ + @echo '# Unit tests' >> $@ + @echo -n 'tests =' >> $@ + @$(foreach test, $(notdir $(unit_tests)), printf " %s\n\t%s.exe" \\ $(test) >> $@; ) + @echo '' >> $@ + @echo '' >> $@ + @echo 'tests: lib $$(tests)' >> $@ + @echo '$$(tests): $$(@B).obj' >> $@ + @echo '' >> $@ + @echo '# Performance tests' >> $@ + @echo -n 'perfs =' >> $@ + @$(foreach perf, $(notdir $(perf_tests)), printf " %s\n\t%s.exe" \\ $(perf) >> $@; ) + @echo '' >> $@ + @echo '' >> $@ + @echo 'perfs: lib $$(perfs)' >> $@ + @echo '$$(perfs): $$(@B).obj' >> $@ + @echo '' >> $@ + @echo -n 'progs =' >> $@ + @$(foreach prog, $(notdir $(bin_PROGRAMS)), printf " %s\n\t%s.exe" \\ $(prog) >> $@; ) + @echo '' >> $@ + @echo '' >> $@ + @echo 'progs: lib $$(progs)' >> $@ + @$(foreach p, $(notdir $(bin_PROGRAMS)), \ + printf "%s.exe: %s\n\tlink /out:\$$@ \$$(LINKFLAGS) isa-l_crypto.lib \$$?\n" $(p) $(subst /,\\,$(programs_$(p)_SOURCES:.c=.obj)) >> $@; ) + @echo '' >> $@ + @echo 'clean:' >> $@ + @echo ' -if exist *.obj del *.obj' >> $@ + @echo ' -if exist bin\*.obj del bin\*.obj' >> $@ + @echo ' -if exist isa-l_crypto_static.lib del isa-l_crypto_static.lib' >> $@ + @echo ' -if exist *.exe del *.exe' >> $@ + @echo ' -if exist *.pdb del *.pdb' >> $@ + @echo ' -if exist isa-l_crypto.lib del isa-l_crypto.lib' >> $@ + @echo ' -if exist isa-l_crypto.dll del isa-l_crypto.dll' >> $@ + @echo ' -if exist isa-l_crypto.exp del isa-l_crypto.exp' >> $@ + @echo '' >> $@ + @echo 'libcrypto.lib:' >> $@ + @cat $(foreach unit,$(units), $(unit)/Makefile.am) | sed \ + -e '/: /!d' \ + -e 's/\([^ :]*\)[ ]*/\1.exe /g' \ + -e :c -e 's/:\(.*\).exe/:\1/;tc' \ + -e 's/\.o[ $$]/.obj /g' \ + -e 's/\.o\.exe[ ]:/.obj:/g' \ + -e '/CFLAGS_.*+=/d' \ + -e '/:.*\%.*:/d' \ + -e 's/ :/:/' \ + -e 's/LDLIBS *+=//' \ + -e 's/-lcrypto/libcrypto.lib/' \ + -e 's/ $$//' \ + >> $@ diff --git a/src/crypto/isa-l/isa-l_crypto/tools/iindent b/src/crypto/isa-l/isa-l_crypto/tools/iindent new file mode 100755 index 000000000..48d26360f --- /dev/null +++ b/src/crypto/isa-l/isa-l_crypto/tools/iindent @@ -0,0 +1,2 @@ +#!/bin/sh +indent -linux -l95 -cp1 -lps -il6 -ncs "$@" diff --git a/src/crypto/isa-l/isa-l_crypto/tools/nasm-cet-filter.sh b/src/crypto/isa-l/isa-l_crypto/tools/nasm-cet-filter.sh new file mode 100755 index 000000000..19e03856c --- /dev/null +++ b/src/crypto/isa-l/isa-l_crypto/tools/nasm-cet-filter.sh @@ -0,0 +1,56 @@ +#/bin/sh + +# Filter out unnecessary options added by automake + +while [ -n "$*" ]; do + case "$1" in + -o ) + # Supported options with arg + options="$options $1 $2" + shift + object="$1" + shift + ;; + -f | -D ) + # Supported options with arg + options="$options $1 $2" + shift + shift + ;; + -I | -i ) + options="$options $1 $2/" + shift + shift + ;; + --prefix* ) + # Supported options without arg + options="$options $1" + shift + ;; + -I* | -i* ) + options="$options $1/" + shift + ;; + -D* ) # For defines we need to remove spaces + case "$1" in + *' '* ) ;; + *) options="$options $1" ;; + esac + shift + ;; + #-blah ) + # Unsupported options with args - none known + -* ) + # Unsupported options with no args + shift + ;; + * ) + args="$args $1" + shift + ;; + esac +done + +nasm $options $args +$CET_LD -r -z ibt -z shstk -o $object.tmp $object +mv $object.tmp $object diff --git a/src/crypto/isa-l/isa-l_crypto/tools/nasm-filter.sh b/src/crypto/isa-l/isa-l_crypto/tools/nasm-filter.sh new file mode 100755 index 000000000..5ec9ba3f3 --- /dev/null +++ b/src/crypto/isa-l/isa-l_crypto/tools/nasm-filter.sh @@ -0,0 +1,47 @@ +#/bin/sh + +# Filter out unnecessary options added by automake + +while [ -n "$*" ]; do + case "$1" in + -f | -o | -D ) + # Supported options with arg + options="$options $1 $2" + shift + shift + ;; + -I | -i ) + options="$options $1 $2/" + shift + shift + ;; + --prefix* ) + # Supported options without arg + options="$options $1" + shift + ;; + -I* | -i* ) + options="$options $1/" + shift + ;; + -D* ) # For defines we need to remove spaces + case "$1" in + *' '* ) ;; + *) options="$options $1" ;; + esac + shift + ;; + #-blah ) + # Unsupported options with args - none known + -* ) + # Unsupported options with no args + shift + ;; + * ) + args="$args $1" + shift + ;; + esac +done + +nasm $options $args diff --git a/src/crypto/isa-l/isa-l_crypto/tools/remove_trailing_whitespace.sh b/src/crypto/isa-l/isa-l_crypto/tools/remove_trailing_whitespace.sh new file mode 100755 index 000000000..bb82b9fa5 --- /dev/null +++ b/src/crypto/isa-l/isa-l_crypto/tools/remove_trailing_whitespace.sh @@ -0,0 +1,2 @@ +#!/bin/sh +sed -i -i.bak 's/[[:blank:]]*$//' "$@" diff --git a/src/crypto/isa-l/isa-l_crypto/tools/test_autorun.sh b/src/crypto/isa-l/isa-l_crypto/tools/test_autorun.sh new file mode 100755 index 000000000..756e1e069 --- /dev/null +++ b/src/crypto/isa-l/isa-l_crypto/tools/test_autorun.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +set -e #exit on fail + +# Override defaults if exist +READLINK=readlink +command -V greadlink >/dev/null 2>&1 && READLINK=greadlink + + +out="$PWD" +src=$($READLINK -f $(dirname $0))/.. +cd "$src" + +# Echo environment info +if test -d .git; then + branch=$(git describe) + commitid=$(git rev-parse HEAD) + brief=$(git log -1 --format='%s') + branch_changes=$(git diff --shortstat) +fi +if command -V uname >/dev/null 2>&1; then + node=$(uname -n) + os_name=$(uname -s) + os_all=$(uname -a) +fi + +echo "Test report v1" +echo "branch: $branch" +echo "brief: $brief" +echo "commitid: $commitid" +echo "node: $node" +echo "os_name: $os_name" +echo "os_all: $os_all" +echo "test_args: $@" +echo "changes: $branch_changes" +command -V lscpu > /dev/null 2>&1 && lscpu + +# Start tests + +[ -z "$1" ] && ./tools/test_checks.sh + +while [ -n "$1" ]; do + case "$1" in + check ) + ./tools/test_checks.sh + shift ;; + ext ) + ./tools/test_extended.sh + shift ;; + format ) + shift ;; + all ) + ./tools/test_checks.sh + ./tools/test_extended.sh + shift ;; + * ) + echo $0 undefined option: $1 + shift ;; + esac +done + +./tools/check_format.sh + diff --git a/src/crypto/isa-l/isa-l_crypto/tools/test_checks.sh b/src/crypto/isa-l/isa-l_crypto/tools/test_checks.sh new file mode 100755 index 000000000..9573554db --- /dev/null +++ b/src/crypto/isa-l/isa-l_crypto/tools/test_checks.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash + +set -xe #exit on fail + +# Defaults +cpus=1 +S=$RANDOM +MAKE=make +READLINK=readlink + +# Override defaults if exist +command -V gmake >/dev/null 2>&1 && MAKE=gmake +command -V greadlink >/dev/null 2>&1 && READLINK=greadlink + +out="$PWD" +src=$($READLINK -f $(dirname $0))/.. +source $src/tools/test_tools.sh +cd "$src" +tmp_install_dir=$out/tmp_install + +# Run on mult cpus +if command -V lscpu >/dev/null 2>&1; then + cpus=`lscpu -p | tail -1 | cut -d, -f 2` + cpus=$(($cpus + 1)) +elif command -V sysctl; then + if sysctl -n hw.ncpu >/dev/null 2>&1; then + cpus=$(sysctl -n hw.ncpu) + cpus=$(($cpus + 1)) + fi +fi +echo "Using $cpus cpu threads" + +# Pick a random test seed +if [ -z "$S" ]; then + S=`tr -cd 0-9 /dev/null || S="123" +fi +echo "Running with TEST_SEED=$S" + +# Fix Darwin issues +if uname | grep -q 'Darwin' 2>&1; then + export SED=`which sed` + opt_config_target='--target=darwin' +fi + +# Tests +time ./autogen.sh +time ./configure --prefix=$tmp_install_dir $opt_config_target +time $MAKE -j $cpus +test_start "check_tests" +time $MAKE check -j $cpus D="-D TEST_SEED=$S" +test_end "check_tests" $? +test_start "installation_test" +time $MAKE install +test_end "installation_test" $? + +# Check for gnu executable stack set +if command -V readelf >/dev/null 2>&1; then + if readelf -W -l $tmp_install_dir/lib/libisal_crypto.so | grep 'GNU_STACK' | grep -q 'RWE'; then + echo Stack NX check $tmp_install_dir/lib/libisal_crypto.so Fail + exit 1 + else + echo Stack NX check $tmp_install_dir/lib/libisal_crypto.so Pass + fi +else + echo Stack NX check not supported +fi + +$MAKE clean + + + +echo $0: Pass diff --git a/src/crypto/isa-l/isa-l_crypto/tools/test_extended.sh b/src/crypto/isa-l/isa-l_crypto/tools/test_extended.sh new file mode 100755 index 000000000..b79cbb0c1 --- /dev/null +++ b/src/crypto/isa-l/isa-l_crypto/tools/test_extended.sh @@ -0,0 +1,127 @@ +#!/usr/bin/env bash + +# Extended tests: Run a few more options other than make check + +set -xe #exit on fail + +# Defaults +cpus=1 +S=$RANDOM +MAKE=make +READLINK=readlink +test_level=check +build_opt='' +msg='' + +# Override defaults if exist +command -V gmake >/dev/null 2>&1 && MAKE=gmake +command -V greadlink >/dev/null 2>&1 && READLINK=greadlink +[ -n "$CC" ] && build_opt+="CC=$CC " +[ -n "$AS" ] && build_opt+="AS=$AS " + +out="$PWD" +src=$($READLINK -f $(dirname $0))/.. +source $src/tools/test_tools.sh +cd "$src" + +# Run on mult cpus +if command -V lscpu >/dev/null 2>&1; then + cpus=`lscpu -p | tail -1 | cut -d, -f 2` + cpus=$(($cpus + 1)) +elif command -V sysctl; then + if sysctl -n hw.ncpu >/dev/null 2>&1; then + cpus=$(sysctl -n hw.ncpu) + cpus=$(($cpus + 1)) + fi +fi +echo "Using $cpus cpu threads" + +if [ -z "$S" ]; then + S=`tr -cd 0-9 /dev/null || S="123" +fi +msg+="Running with TEST_SEED=$S".$'\n' + +# Fix Darwin issues +if uname | grep -q 'Darwin' 2>&1; then + export SED=`which sed` +fi + +# Check for test libs to add +if command -V ldconfig >/dev/null 2>&1; then + if ldconfig -p | grep -q libcrypto.so; then + test_level=test + msg+=$'With extra tests\n' + fi + if ldconfig -p | grep -q libefence.so; then + build_opt+="LDFLAGS+='-lefence' " + msg+=$'With efence\n' + fi +fi + +# Std makefile build test +$MAKE -f Makefile.unx clean +test_start "extended_build_test" +time $MAKE -f Makefile.unx -j $cpus $build_opt +test_end "extended_build_test" $? +msg+=$'Std makefile build: Pass\n' + +# Check for gnu executable stack set +if command -V readelf >/dev/null 2>&1; then + test_start "stack_nx_check" + if readelf -W -l bin/libisal_crypto.so | grep 'GNU_STACK' | grep -q 'RWE'; then + echo $0: Stack NX check bin/libisal_crypto.so: Fail + test_end "stack_nx_check" 1 + exit 1 + else + test_end "stack_nx_check" 0 + msg+=$'Stack NX check bin/lib/libisal_crypto.so: Pass\n' + fi +else + msg+=$'Stack NX check not supported: Skip\n' +fi + +# Std makefile build perf tests +test_start "extended_perf_test" +time $MAKE -f Makefile.unx -j $cpus perfs +test_end "extended_perf_test" $? +msg+=$'Std makefile build perf: Pass\n' + +# Std makefile run tests +test_start "extended_makefile_tests" +time $MAKE -f Makefile.unx -j $cpus $build_opt D="TEST_SEED=$S" $test_level +test_end "extended_makefile_tests" $? +msg+=$'Std makefile tests: Pass\n' + +# Std makefile build other +test_start "extended_other_tests" +time $MAKE -f Makefile.unx -j $cpus $build_opt D="TEST_SEED=$S" other +test_end "extended_other_tests" $? +msg+=$'Other tests build: Pass\n' + +$MAKE -f Makefile.unx clean + +# Std makefile run tests with NT_LDST +test_start "extended_makefile_tests with NT_LDST" +$MAKE -f Makefile.unx -j $cpus $build_opt D="TEST_SEED=$S NT_LDST" +time $MAKE -f Makefile.unx -j $cpus $build_opt D="TEST_SEED=$S NT_LDST" $test_level +test_end "extended_makefile_tests with NT_LDST" $? +msg+=$'Std makefile tests: Pass\n' + +$MAKE -f Makefile.unx clean + +# noarch makefile run tests +test_start "extended_makefile_tests" +time $MAKE -f Makefile.unx -j $cpus $build_opt D="TEST_SEED=$S" \ + arch=noarch +time $MAKE -f Makefile.unx -j $cpus $build_opt D="TEST_SEED=$S" \ + arch=noarch $test_level +test_end "extended_makefile_tests" $? +msg+=$'noarch makefile tests: Pass\n' + +set +x +echo +echo "Summary test $0:" +echo "Build opt: $build_opt" +echo "$msg" +echo "$0: Final: Pass" diff --git a/src/crypto/isa-l/isa-l_crypto/tools/test_tools.sh b/src/crypto/isa-l/isa-l_crypto/tools/test_tools.sh new file mode 100755 index 000000000..448b1f92b --- /dev/null +++ b/src/crypto/isa-l/isa-l_crypto/tools/test_tools.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +function test_start() +{ + echo "entering test: $1" +} + +function test_end() +{ + echo "leaving test: $1 status: $2" +} diff --git a/src/crypto/isa-l/isa-l_crypto/tools/yasm-cet-filter.sh b/src/crypto/isa-l/isa-l_crypto/tools/yasm-cet-filter.sh new file mode 100755 index 000000000..d7b3e973d --- /dev/null +++ b/src/crypto/isa-l/isa-l_crypto/tools/yasm-cet-filter.sh @@ -0,0 +1,47 @@ +#/bin/sh + +# Filter out unnecessary options added by automake + +while [ -n "$*" ]; do + case "$1" in + -o ) + # Supported options with arg + options="$options $1 $2" + shift + object="$1" + shift + ;; + -f | -I | -i | -D ) + # Supported options with arg + options="$options $1 $2" + shift + shift + ;; + -I* | -i* | --prefix* ) + # Supported options without arg + options="$options $1" + shift + ;; + -D* ) # For defines we need to remove spaces + case "$1" in + *' '* ) ;; + *) options="$options $1" ;; + esac + shift + ;; + #-blah ) + # Unsupported options with args - none known + -* ) + # Unsupported options with no args + shift + ;; + * ) + args="$args $1" + shift + ;; + esac +done + +yasm $options $args +$CET_LD -r -z ibt -z shstk -o $object.tmp $object +mv $object.tmp $object diff --git a/src/crypto/isa-l/isa-l_crypto/tools/yasm-filter.sh b/src/crypto/isa-l/isa-l_crypto/tools/yasm-filter.sh new file mode 100755 index 000000000..c33952a40 --- /dev/null +++ b/src/crypto/isa-l/isa-l_crypto/tools/yasm-filter.sh @@ -0,0 +1,38 @@ +#/bin/sh + +# Filter out unnecessary options added by automake + +while [ -n "$*" ]; do + case "$1" in + -f | -o | -I | -i | -D ) + # Supported options with arg + options="$options $1 $2" + shift + shift + ;; + -I* | -i* | --prefix* ) + # Supported options without arg + options="$options $1" + shift + ;; + -D* ) # For defines we need to remove spaces + case "$1" in + *' '* ) ;; + *) options="$options $1" ;; + esac + shift + ;; + #-blah ) + # Unsupported options with args - none known + -* ) + # Unsupported options with no args + shift + ;; + * ) + args="$args $1" + shift + ;; + esac +done + +yasm $options $args -- cgit v1.2.3