diff options
| author | tb <> | 2024-07-10 13:11:22 +0000 |
|---|---|---|
| committer | tb <> | 2024-07-10 13:11:22 +0000 |
| commit | b5b5d97f3d68df71d6ab206dee253d69a38f5c75 (patch) | |
| tree | 13daf4930710f544a03a2c4031b171187936f9ee /src | |
| parent | ac361ae116020c9b6f39c2d845684c72ce819994 (diff) | |
| download | openbsd-b5b5d97f3d68df71d6ab206dee253d69a38f5c75.tar.gz openbsd-b5b5d97f3d68df71d6ab206dee253d69a38f5c75.tar.bz2 openbsd-b5b5d97f3d68df71d6ab206dee253d69a38f5c75.zip | |
Teach symbols test about the namespace
This ensures that when adding public symbols, the magic is not omitted.
with/ok beck
Diffstat (limited to 'src')
| -rw-r--r-- | src/regress/lib/libcrypto/symbols/Makefile | 4 | ||||
| -rw-r--r-- | src/regress/lib/libcrypto/symbols/symbols.awk | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/regress/lib/libcrypto/symbols/Makefile b/src/regress/lib/libcrypto/symbols/Makefile index 7b703bbf9e..07cce7e904 100644 --- a/src/regress/lib/libcrypto/symbols/Makefile +++ b/src/regress/lib/libcrypto/symbols/Makefile | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: Makefile,v 1.4 2023/06/22 19:23:27 tb Exp $ | 1 | # $OpenBSD: Makefile,v 1.5 2024/07/10 13:11:22 tb Exp $ |
| 2 | 2 | ||
| 3 | TESTS = \ | 3 | TESTS = \ |
| 4 | symbols | 4 | symbols |
| @@ -22,7 +22,7 @@ LDADD= -lcrypto | |||
| 22 | DPADD= ${LIBCRYPTO} | 22 | DPADD= ${LIBCRYPTO} |
| 23 | LDFLAGS+= -lcrypto | 23 | LDFLAGS+= -lcrypto |
| 24 | LDFLAGS+= -Wl,--no-allow-shlib-undefined | 24 | LDFLAGS+= -Wl,--no-allow-shlib-undefined |
| 25 | CFLAGS+= -Wno-deprecated-declarations | 25 | CFLAGS+= -Wno-deprecated-declarations -DUSE_LIBRESSL_NAMESPACE |
| 26 | 26 | ||
| 27 | CLEANFILES+= include_headers.c symbols.c symbols.c.tmp | 27 | CLEANFILES+= include_headers.c symbols.c symbols.c.tmp |
| 28 | 28 | ||
diff --git a/src/regress/lib/libcrypto/symbols/symbols.awk b/src/regress/lib/libcrypto/symbols/symbols.awk index dec111b0b8..c9a7266001 100644 --- a/src/regress/lib/libcrypto/symbols/symbols.awk +++ b/src/regress/lib/libcrypto/symbols/symbols.awk | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # $OpenBSD: symbols.awk,v 1.11 2024/04/15 16:49:13 tb Exp $ | 1 | # $OpenBSD: symbols.awk,v 1.12 2024/07/10 13:11:22 tb Exp $ |
| 2 | 2 | ||
| 3 | # Copyright (c) 2018,2020 Theo Buehler <tb@openbsd.org> | 3 | # Copyright (c) 2018,2020 Theo Buehler <tb@openbsd.org> |
| 4 | # | 4 | # |
| @@ -32,6 +32,8 @@ BEGIN { | |||
| 32 | 32 | ||
| 33 | # Undefine aliases, so we don't accidentally leave them in Symbols.list. | 33 | # Undefine aliases, so we don't accidentally leave them in Symbols.list. |
| 34 | printf("#ifdef %s\n#undef %s\n#endif\n", $0, $0) | 34 | printf("#ifdef %s\n#undef %s\n#endif\n", $0, $0) |
| 35 | |||
| 36 | printf("static typeof(%s) *_libre_%s;\n", $0, $0); | ||
| 35 | } | 37 | } |
| 36 | 38 | ||
| 37 | END { | 39 | END { |
| @@ -41,12 +43,16 @@ END { | |||
| 41 | printf("\tstruct {\n") | 43 | printf("\tstruct {\n") |
| 42 | printf("\t\tconst char *const name;\n") | 44 | printf("\t\tconst char *const name;\n") |
| 43 | printf("\t\tconst void *addr;\n") | 45 | printf("\t\tconst void *addr;\n") |
| 46 | printf("\t\tconst void *libre_addr;\n") | ||
| 44 | printf("\t} symbols[] = {\n") | 47 | printf("\t} symbols[] = {\n") |
| 45 | 48 | ||
| 46 | for (symbol in symbols) { | 49 | for (symbol in symbols) { |
| 47 | printf("\t\t{\n") | 50 | printf("\t\t{\n") |
| 48 | printf("\t\t\t.name = \"%s\",\n", symbol) | 51 | printf("\t\t\t.name = \"%s\",\n", symbol) |
| 49 | printf("\t\t\t.addr = &%s,\n", symbol) | 52 | printf("\t\t\t.addr = &%s,\n", symbol) |
| 53 | printf("#if defined(USE_LIBRESSL_NAMESPACE)\n") | ||
| 54 | printf("\t\t\t.libre_addr = &_libre_%s,\n", symbol) | ||
| 55 | printf("#endif\n") | ||
| 50 | printf("\t\t},\n") | 56 | printf("\t\t},\n") |
| 51 | } | 57 | } |
| 52 | 58 | ||
