From: tb Date: Mon, 17 Apr 2023 19:51:05 +0000 (+0000) Subject: Allow overriding the bc implementation used in run-bc X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=56b78144be04971646ae75840d5a51a91ca01088;p=openbsd Allow overriding the bc implementation used in run-bc While base bc is great, it uses libcrypto's BIGNUM implementation. This implies that the independent verification of the bn_test isn't as independent as it should be. With this commit, run-bc picks up bn-gh if it is installed. This appears to work on amd64, arm64 and sparc64 (where gbc is busted). I will send PRs to the regress maintainers once I will have tested this a bit more thoroughly. Committing this early since I juggle way too many diffs already. --- diff --git a/regress/lib/libcrypto/bn/Makefile b/regress/lib/libcrypto/bn/Makefile index 2ba1d396ddc..9d9d77ae2d1 100644 --- a/regress/lib/libcrypto/bn/Makefile +++ b/regress/lib/libcrypto/bn/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.30 2023/04/17 19:37:18 tb Exp $ +# $OpenBSD: Makefile,v 1.31 2023/04/17 19:51:05 tb Exp $ PROGS += bn_add_sub PROGS += bn_cmp @@ -53,10 +53,15 @@ CLEANFILES += bn_isqrt_gen_tables.txt.tmp bn_isqrt_gen_tables.txt run-regress-bn_test bn_test.out: bn_test ./bn_test -out bn_test.out +.if exists(/usr/local/bin/bc-gh) +BC ?= bc-gh +.endif +BC ?= bc + REGRESS_TARGETS += run-bc .PHONY: run-bc run-bc: bn_test.out - bc < $> | tee bc.out | grep -v '^0$$' + ${BC} < $> | tee bc.out | grep -v '^0$$' ! grep -v '^test '