Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libressl/files/, dev-libs/libressl/
Date: Wed, 13 Mar 2019 14:12:07
Message-Id: 1552486310.824d91914aef11c96be541564b90b8c9aed7288a.grobian@gentoo
1 commit: 824d91914aef11c96be541564b90b8c9aed7288a
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 13 14:11:26 2019 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 13 14:11:50 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=824d9191
7
8 dev-libs/libressl: fix compilation on Solaris 10
9
10 Closes: https://bugs.gentoo.org/679586
11 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
12 Package-Manager: Portage-2.3.62, Repoman-2.3.11
13
14 .../libressl/files/libressl-2.8.3-solaris10.patch | 69 ++++++++++++++++++++++
15 dev-libs/libressl/libressl-2.8.3.ebuild | 5 +-
16 dev-libs/libressl/libressl-2.9.0.ebuild | 5 +-
17 3 files changed, 77 insertions(+), 2 deletions(-)
18
19 diff --git a/dev-libs/libressl/files/libressl-2.8.3-solaris10.patch b/dev-libs/libressl/files/libressl-2.8.3-solaris10.patch
20 new file mode 100644
21 index 00000000000..20a0af0800b
22 --- /dev/null
23 +++ b/dev-libs/libressl/files/libressl-2.8.3-solaris10.patch
24 @@ -0,0 +1,69 @@
25 +From libressl Thu Jul 21 09:25:08 2016
26 +From: schily () schily ! net (Joerg Schilling)
27 +Date: Thu, 21 Jul 2016 09:25:08 +0000
28 +To: libressl
29 +Subject: Non-portable code in ./crypto/compat/getentropy_solaris.c
30 +Message-Id: <579094f4.Ca9M384ri4oiBOIa%schily () schily ! net>
31 +X-MARC-Message: https://marc.info/?l=libressl&m=146910737815443
32 +
33 +Hi,
34 +
35 +the code works only on Solaris based on OpenSolaris-ON from February 18 2010 or
36 +later.
37 +
38 +Many people however still use Solaris 10.
39 +
40 +BTW: there is an official portable ELF way based on the AUX vector to do the same
41 +but this was unfortunately not made a public libc interface, so it would need to
42 +be incorporated into your code:
43 +
44 +https://sourceforge.net/p/schillix-on/schillix-on/ci/default/tree/usr/src/lib/libc/port/gen/getauxv.c
45 +
46 +___getauxptr(AT_PHDR) returns the address of &phdr[0]
47 +___getauxval(AT_PHENT) returns sizeof(phdr[0])
48 +___getauxval(AT_PHNUM) returns # phdr entries
49 +
50 +
51 +Here is a patch to disable the non-portable code getting the code to compile at
52 +all:
53 +
54 +
55 +
56 +--- a/crypto/compat/getentropy_solaris.c
57 ++++ b/crypto/compat/getentropy_solaris.c
58 +@@ -72,7 +72,9 @@
59 + static int getentropy_urandom(void *buf, size_t len, const char *path,
60 + int devfscheck);
61 + static int getentropy_fallback(void *buf, size_t len);
62 ++#ifdef ElfW
63 + static int getentropy_phdr(struct dl_phdr_info *info, size_t size, void *data);
64 ++#endif
65 +
66 + int
67 + getentropy(void *buf, size_t len)
68 +@@ -244,6 +246,7 @@
69 + #endif
70 + };
71 +
72 ++#ifdef ElfW
73 + static int
74 + getentropy_phdr(struct dl_phdr_info *info, size_t size, void *data)
75 + {
76 +@@ -252,6 +255,7 @@
77 + SHA512_Update(ctx, &info->dlpi_addr, sizeof (info->dlpi_addr));
78 + return (0);
79 + }
80 ++#endif
81 +
82 + static int
83 + getentropy_fallback(void *buf, size_t len)
84 +@@ -290,7 +294,9 @@
85 + cnt += (int)tv.tv_usec;
86 + }
87 +
88 ++#ifdef ElfW
89 + dl_iterate_phdr(getentropy_phdr, &ctx);
90 ++#endif
91 +
92 + for (ii = 0; ii < sizeof(cl)/sizeof(cl[0]); ii++)
93 + HX(clock_gettime(cl[ii], &ts) == -1, ts);
94
95 diff --git a/dev-libs/libressl/libressl-2.8.3.ebuild b/dev-libs/libressl/libressl-2.8.3.ebuild
96 index 22b9aef5d69..b438e7c15ca 100644
97 --- a/dev-libs/libressl/libressl-2.8.3.ebuild
98 +++ b/dev-libs/libressl/libressl-2.8.3.ebuild
99 @@ -3,7 +3,7 @@
100
101 EAPI=6
102
103 -inherit multilib-minimal
104 +inherit multilib-minimal libtool
105
106 DESCRIPTION="Free version of the SSL/TLS protocol forked from OpenSSL"
107 HOMEPAGE="https://www.libressl.org/"
108 @@ -34,7 +34,10 @@ src_prepare() {
109 -e '/^[ \t]*USER_CFLAGS=/s#-O2"#"#' \
110 configure || die "fixing CFLAGS failed"
111
112 + eapply "${FILESDIR}"/${P}-solaris10.patch
113 eapply_user
114 +
115 + elibtoolize # for Solaris
116 }
117
118 multilib_src_configure() {
119
120 diff --git a/dev-libs/libressl/libressl-2.9.0.ebuild b/dev-libs/libressl/libressl-2.9.0.ebuild
121 index f7db72c5935..9356bf70659 100644
122 --- a/dev-libs/libressl/libressl-2.9.0.ebuild
123 +++ b/dev-libs/libressl/libressl-2.9.0.ebuild
124 @@ -3,7 +3,7 @@
125
126 EAPI=6
127
128 -inherit multilib-minimal
129 +inherit multilib-minimal libtool
130
131 DESCRIPTION="Free version of the SSL/TLS protocol forked from OpenSSL"
132 HOMEPAGE="https://www.libressl.org/"
133 @@ -34,7 +34,10 @@ src_prepare() {
134 -e '/^[ \t]*USER_CFLAGS=/s#-O2"#"#' \
135 configure || die "fixing CFLAGS failed"
136
137 + eapply "${FILESDIR}"/${PN}-2.8.3-solaris10.patch
138 eapply_user
139 +
140 + elibtoolize # for Solaris
141 }
142
143 multilib_src_configure() {