diff options
author | Fabian Groffen <grobian@gentoo.org> | 2019-03-13 15:11:26 +0100 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2019-03-13 15:11:50 +0100 |
commit | 824d91914aef11c96be541564b90b8c9aed7288a (patch) | |
tree | 8f035c6b3645c967f53152829f5bf5e9c01d201c /dev-libs/libressl/files | |
parent | mail-client/mutt: version bump (diff) | |
download | gentoo-824d91914aef11c96be541564b90b8c9aed7288a.tar.gz gentoo-824d91914aef11c96be541564b90b8c9aed7288a.tar.bz2 gentoo-824d91914aef11c96be541564b90b8c9aed7288a.zip |
dev-libs/libressl: fix compilation on Solaris 10
Closes: https://bugs.gentoo.org/679586
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Package-Manager: Portage-2.3.62, Repoman-2.3.11
Diffstat (limited to 'dev-libs/libressl/files')
-rw-r--r-- | dev-libs/libressl/files/libressl-2.8.3-solaris10.patch | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/dev-libs/libressl/files/libressl-2.8.3-solaris10.patch b/dev-libs/libressl/files/libressl-2.8.3-solaris10.patch new file mode 100644 index 000000000000..20a0af0800bd --- /dev/null +++ b/dev-libs/libressl/files/libressl-2.8.3-solaris10.patch @@ -0,0 +1,69 @@ +From libressl Thu Jul 21 09:25:08 2016 +From: schily () schily ! net (Joerg Schilling) +Date: Thu, 21 Jul 2016 09:25:08 +0000 +To: libressl +Subject: Non-portable code in ./crypto/compat/getentropy_solaris.c +Message-Id: <579094f4.Ca9M384ri4oiBOIa%schily () schily ! net> +X-MARC-Message: https://marc.info/?l=libressl&m=146910737815443 + +Hi, + +the code works only on Solaris based on OpenSolaris-ON from February 18 2010 or +later. + +Many people however still use Solaris 10. + +BTW: there is an official portable ELF way based on the AUX vector to do the same +but this was unfortunately not made a public libc interface, so it would need to +be incorporated into your code: + +https://sourceforge.net/p/schillix-on/schillix-on/ci/default/tree/usr/src/lib/libc/port/gen/getauxv.c + +___getauxptr(AT_PHDR) returns the address of &phdr[0] +___getauxval(AT_PHENT) returns sizeof(phdr[0]) +___getauxval(AT_PHNUM) returns # phdr entries + + +Here is a patch to disable the non-portable code getting the code to compile at +all: + + + +--- a/crypto/compat/getentropy_solaris.c ++++ b/crypto/compat/getentropy_solaris.c +@@ -72,7 +72,9 @@ + static int getentropy_urandom(void *buf, size_t len, const char *path, + int devfscheck); + static int getentropy_fallback(void *buf, size_t len); ++#ifdef ElfW + static int getentropy_phdr(struct dl_phdr_info *info, size_t size, void *data); ++#endif + + int + getentropy(void *buf, size_t len) +@@ -244,6 +246,7 @@ + #endif + }; + ++#ifdef ElfW + static int + getentropy_phdr(struct dl_phdr_info *info, size_t size, void *data) + { +@@ -252,6 +255,7 @@ + SHA512_Update(ctx, &info->dlpi_addr, sizeof (info->dlpi_addr)); + return (0); + } ++#endif + + static int + getentropy_fallback(void *buf, size_t len) +@@ -290,7 +294,9 @@ + cnt += (int)tv.tv_usec; + } + ++#ifdef ElfW + dl_iterate_phdr(getentropy_phdr, &ctx); ++#endif + + for (ii = 0; ii < sizeof(cl)/sizeof(cl[0]); ii++) + HX(clock_gettime(cl[ii], &ts) == -1, ts); |