1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-22 07:27:59 -08:00

Teach symbols test about the namespace

This ensures that when adding public symbols, the magic is not omitted.

with/ok beck
This commit is contained in:
tb 2024-07-10 13:11:22 +00:00
parent 70eb162f69
commit 33482ba5f7
2 changed files with 9 additions and 3 deletions

View File

@ -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

View File

@ -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 <tb@openbsd.org>
#
@ -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")
}