diff options
| author | Brent Cook <bcook@openbsd.org> | 2015-07-17 16:54:23 -0500 |
|---|---|---|
| committer | Brent Cook <bcook@openbsd.org> | 2015-07-17 16:54:23 -0500 |
| commit | a1a0f2c6e2c3029020d0f6d0a4277483af05822e (patch) | |
| tree | 9a92211446e69453753840ad2a945bf8c38dcd39 | |
| parent | fafc3e47f24d9ac25eb41221e2d91ee0b17f5c5b (diff) | |
| download | portable-a1a0f2c6e2c3029020d0f6d0a4277483af05822e.tar.gz portable-a1a0f2c6e2c3029020d0f6d0a4277483af05822e.tar.bz2 portable-a1a0f2c6e2c3029020d0f6d0a4277483af05822e.zip | |
implement compatibility shim for __warn_references
This will allow us to warn about deprecated function references at link-time.
| -rw-r--r-- | configure.ac | 12 | ||||
| -rw-r--r-- | include/Makefile.am | 1 | ||||
| -rw-r--r-- | include/sys/cdefs.h | 31 |
3 files changed, 44 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 43ef0cd..91ae7ce 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -88,6 +88,18 @@ case $host_cpu in | |||
| 88 | ;; | 88 | ;; |
| 89 | esac | 89 | esac |
| 90 | 90 | ||
| 91 | AC_MSG_CHECKING([if .gnu.warning accepts long strings]) | ||
| 92 | AC_LINK_IFELSE([AC_LANG_SOURCE([[ | ||
| 93 | extern void SSLv3_method(); | ||
| 94 | __asm__(".section .gnu.warning.SSLv3_method; .ascii \"SSLv3_method is insecure\" ; .text"); | ||
| 95 | int main() {return 0;} | ||
| 96 | ]])], [ | ||
| 97 | AC_DEFINE(HAS_GNU_WARNING_LONG, 1, [Define if .gnu.warning accepts long strings.]) | ||
| 98 | AC_MSG_RESULT(yes) | ||
| 99 | ], [ | ||
| 100 | AC_MSG_RESULT(no) | ||
| 101 | ]) | ||
| 102 | |||
| 91 | AC_ARG_ENABLE([asm], | 103 | AC_ARG_ENABLE([asm], |
| 92 | AS_HELP_STRING([--disable-asm], [Disable assembly])) | 104 | AS_HELP_STRING([--disable-asm], [Disable assembly])) |
| 93 | AM_CONDITIONAL([OPENSSL_NO_ASM], [test "x$enable_asm" = "xno"]) | 105 | AM_CONDITIONAL([OPENSSL_NO_ASM], [test "x$enable_asm" = "xno"]) |
diff --git a/include/Makefile.am b/include/Makefile.am index b620938..92ee9e7 100644 --- a/include/Makefile.am +++ b/include/Makefile.am | |||
| @@ -21,6 +21,7 @@ noinst_HEADERS += machine/endian.h | |||
| 21 | noinst_HEADERS += netinet/in.h | 21 | noinst_HEADERS += netinet/in.h |
| 22 | noinst_HEADERS += netinet/tcp.h | 22 | noinst_HEADERS += netinet/tcp.h |
| 23 | 23 | ||
| 24 | noinst_HEADERS += sys/cdefs.h | ||
| 24 | noinst_HEADERS += sys/ioctl.h | 25 | noinst_HEADERS += sys/ioctl.h |
| 25 | noinst_HEADERS += sys/mman.h | 26 | noinst_HEADERS += sys/mman.h |
| 26 | noinst_HEADERS += sys/select.h | 27 | noinst_HEADERS += sys/select.h |
diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h new file mode 100644 index 0000000..21ef031 --- /dev/null +++ b/include/sys/cdefs.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /* | ||
| 2 | * Public domain | ||
| 3 | * sys/cdefs.h compatibility shim | ||
| 4 | */ | ||
| 5 | |||
| 6 | #ifndef LIBCRYPTOCOMPAT_SYS_CDEFS_H | ||
| 7 | #define LIBCRYPTOCOMPAT_SYS_CDEFS_H | ||
| 8 | |||
| 9 | #ifdef _WIN32 | ||
| 10 | |||
| 11 | #define __warn_references(sym,msg) | ||
| 12 | |||
| 13 | #else | ||
| 14 | |||
| 15 | #include_next <sys/cdefs.h> | ||
| 16 | |||
| 17 | #ifndef __warn_references | ||
| 18 | |||
| 19 | #if defined(__GNUC__) && defined (HAS_GNU_WARNING_LONG) | ||
| 20 | #define __warn_references(sym,msg) \ | ||
| 21 | __asm__(".section .gnu.warning." __STRING(sym) \ | ||
| 22 | " ; .ascii \"" msg "\" ; .text"); | ||
| 23 | #else | ||
| 24 | #define __warn_references(sym,msg) | ||
| 25 | #endif | ||
| 26 | |||
| 27 | #endif /* __warn_references */ | ||
| 28 | |||
| 29 | #endif /* _WIN32 */ | ||
| 30 | |||
| 31 | #endif /* LIBCRYPTOCOMPAT_SYS_CDEFS_H */ | ||
