Tweak symbols test in such a way that it would have caught the recent
authortb <tb@openbsd.org>
Wed, 21 Sep 2022 15:24:45 +0000 (15:24 +0000)
committertb <tb@openbsd.org>
Wed, 21 Sep 2022 15:24:45 +0000 (15:24 +0000)
Symbols.list mistake: undefine aliases (except _cfb block ciphers which
are aliases for historical reasons). Use -Wl,--no-allow-shlib-undefined.

regress/lib/libcrypto/symbols/Makefile
regress/lib/libcrypto/symbols/symbols.awk

index 394bc08..b37fb87 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: Makefile,v 1.2 2022/06/19 17:05:31 tb Exp $
+#      $OpenBSD: Makefile,v 1.3 2022/09/21 15:24:45 tb Exp $
 
 TESTS = \
        symbols
@@ -23,7 +23,8 @@ include_headers.c: ${BSDSRCDIR}/lib/libcrypto/Symbols.list
 LDADD=         -lcrypto
 DPADD=         ${LIBCRYPTO}
 LDFLAGS+=      -lcrypto
-CFLAGS+= -Wno-deprecated-declarations
+LDFLAGS+=      -Wl,--no-allow-shlib-undefined
+CFLAGS+=       -Wno-deprecated-declarations
 
 CLEANFILES+= include_headers.c symbols.c symbols.c.tmp
 
index d7c5342..9d7f5ce 100644 (file)
@@ -1,4 +1,4 @@
-# $OpenBSD: symbols.awk,v 1.6 2022/01/12 09:04:40 tb Exp $
+# $OpenBSD: symbols.awk,v 1.7 2022/09/21 15:24:45 tb Exp $
 
 # Copyright (c) 2018,2020 Theo Buehler <tb@openbsd.org>
 #
@@ -114,6 +114,11 @@ BEGIN {
 
 {
        symbols[$0] = $0
+
+       # Undefine aliases, so we don't accidentally leave them in Symbols.list.
+       # The _cfb ciphers are aliased to _cfb64, so skip them.
+       if ($0 !~ "^EVP_.*cfb$")
+               printf("#ifdef %s\n#undef %s\n#endif\n", $0, $0)
 }
 
 END {