From 33482ba5f7b4167e5977ff9ada6d1453ce6398da Mon Sep 17 00:00:00 2001 From: tb Date: Wed, 10 Jul 2024 13:11:22 +0000 Subject: [PATCH] Teach symbols test about the namespace This ensures that when adding public symbols, the magic is not omitted. with/ok beck --- regress/lib/libcrypto/symbols/Makefile | 4 ++-- regress/lib/libcrypto/symbols/symbols.awk | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/regress/lib/libcrypto/symbols/Makefile b/regress/lib/libcrypto/symbols/Makefile index 7b703bbf9e3..07cce7e9048 100644 --- a/regress/lib/libcrypto/symbols/Makefile +++ b/regress/lib/libcrypto/symbols/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.4 2023/06/22 19:23:27 tb Exp $ +# $OpenBSD: Makefile,v 1.5 2024/07/10 13:11:22 tb Exp $ TESTS = \ symbols @@ -22,7 +22,7 @@ LDADD= -lcrypto DPADD= ${LIBCRYPTO} LDFLAGS+= -lcrypto LDFLAGS+= -Wl,--no-allow-shlib-undefined -CFLAGS+= -Wno-deprecated-declarations +CFLAGS+= -Wno-deprecated-declarations -DUSE_LIBRESSL_NAMESPACE CLEANFILES+= include_headers.c symbols.c symbols.c.tmp diff --git a/regress/lib/libcrypto/symbols/symbols.awk b/regress/lib/libcrypto/symbols/symbols.awk index dec111b0b8f..c9a72660014 100644 --- a/regress/lib/libcrypto/symbols/symbols.awk +++ b/regress/lib/libcrypto/symbols/symbols.awk @@ -1,4 +1,4 @@ -# $OpenBSD: symbols.awk,v 1.11 2024/04/15 16:49:13 tb Exp $ +# $OpenBSD: symbols.awk,v 1.12 2024/07/10 13:11:22 tb Exp $ # Copyright (c) 2018,2020 Theo Buehler # @@ -32,6 +32,8 @@ BEGIN { # Undefine aliases, so we don't accidentally leave them in Symbols.list. printf("#ifdef %s\n#undef %s\n#endif\n", $0, $0) + + printf("static typeof(%s) *_libre_%s;\n", $0, $0); } END { @@ -41,12 +43,16 @@ END { printf("\tstruct {\n") printf("\t\tconst char *const name;\n") printf("\t\tconst void *addr;\n") + printf("\t\tconst void *libre_addr;\n") printf("\t} symbols[] = {\n") for (symbol in symbols) { printf("\t\t{\n") printf("\t\t\t.name = \"%s\",\n", symbol) printf("\t\t\t.addr = &%s,\n", symbol) + printf("#if defined(USE_LIBRESSL_NAMESPACE)\n") + printf("\t\t\t.libre_addr = &_libre_%s,\n", symbol) + printf("#endif\n") printf("\t\t},\n") }