commit 4e2f1cf12a9d0055458b767979f38f0a400a9d2c
parent 7191d4d09f1646adc6c3ed6998c7b1c8511ccd73
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 12 Jul 2014 20:01:19 +0000
add libressl
thanks to the sabotage project for some of the patches. thanks to the
OpenBSD team for libressl!
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
Diffstat:
7 files changed, 112 insertions(+), 0 deletions(-)
diff --git a/libressl/checksums b/libressl/checksums
@@ -0,0 +1 @@
+c945f4c1b77f2b54fa2445cd5d9263545630b4fe5d603d7740ba7c1bb9f50ba5557635c073f518708c18d03af17a6ff58b104c665338fc727130c4ae95a8e3da libressl-2.0.0.tar.gz
diff --git a/libressl/depsinc.mk b/libressl/depsinc.mk
@@ -0,0 +1,11 @@
+<$libressl_DEPDIR/v.mk
+
+libressl_bindir = ${libressl_DEPDIR}/libressl-$v/lib/bin
+libressl_libdir = ${libressl_DEPDIR}/libressl-$v/lib/lib
+libressl_includedir = ${libressl_DEPDIR}/libressl-$v/lib/include
+
+libressl_CFLAGS = -I${libressl_includedir}
+libressl_LDFLAGS = -L${libressl_libdir} -lssl
+
+DEPS_CFLAGS = $DEPS_CFLAGS ${libressl_CFLAGS}
+DEPS_LDFLAGS = $DEPS_LDFLAGS ${libressl_LDFLAGS}
diff --git a/libressl/libressl-entropy-nonsense.patch b/libressl/libressl-entropy-nonsense.patch
@@ -0,0 +1,18 @@
+--- libressl-2.0.0.org/crypto/compat/getentropy_linux.c 2014-07-12 10:49:35.360915885 +0000
++++ libressl-2.0.0/crypto/compat/getentropy_linux.c 2014-07-12 10:51:06.879916029 +0000
+@@ -65,7 +65,6 @@
+
+ int getentropy(void *buf, size_t len);
+
+-extern int main(int, char *argv[]);
+ static int gotdata(char *buf, size_t len);
+ static int getentropy_urandom(void *buf, size_t len);
+ #ifdef CTL_MAXNAME
+@@ -338,7 +337,6 @@
+ HX(sigprocmask(SIG_BLOCK, NULL, &sigset) == -1,
+ sigset);
+
+- HD(main); /* an addr in program */
+ HD(getentropy); /* an addr in this library */
+ HD(printf); /* an addr in libc */
+ p = (char *)&p;
diff --git a/libressl/libressl-glibc.patch b/libressl/libressl-glibc.patch
@@ -0,0 +1,42 @@
+--- libressl-2.0.0.org/crypto/compat/issetugid_linux.c
++++ libressl-2.0.0/crypto/compat/issetugid_linux.c
+@@ -4,7 +4,9 @@
+ */
+
+ #include <errno.h>
++#ifdef __GLIBC__
+ #include <gnu/libc-version.h>
++#endif
+ #include <string.h>
+ #include <sys/types.h>
+ #include <unistd.h>
+@@ -33,15 +35,19 @@
+ * info: http://lwn.net/Articles/519085/
+ *
+ */
++#ifdef __GLIBC__
+ const char *glcv = gnu_get_libc_version();
+ if (strverscmp(glcv, "2.19") >= 0) {
++#endif
+ errno = 0;
+ if (getauxval(AT_SECURE) == 0) {
+ if (errno != ENOENT) {
+ return 0;
+ }
+ }
++#ifdef __GLIBC__
+ }
++#endif
+ #endif
+ return 1;
+ }
+--- libressl-2.0.0.org/crypto/compat/getentropy_linux.c
++++ libressl-2.0.0/crypto/compat/getentropy_linux.c
+@@ -24,7 +24,6 @@
+ #include <sys/ioctl.h>
+ #include <sys/resource.h>
+ #include <sys/syscall.h>
+-#include <sys/sysctl.h>
+ #include <sys/statvfs.h>
+ #include <sys/socket.h>
+ #include <sys/mount.h>
diff --git a/libressl/libressl.mk b/libressl/libressl.mk
@@ -0,0 +1,29 @@
+TARG = libressl
+
+<$mkbuild/mk.common-noinst
+
+libressl:QV:
+ # remove -Werror (mostly due to __bounded__ attribute warnings,
+ # which will make the build fail).
+ sed -i 's@-Werror@@g' configure
+ #
+ export CFLAGS="$CFLAGS $DEPS_CFLAGS"
+ export LDFLAGS="$LDFLAGS $DEPS_LDFLAGS"
+ #
+ CC="$CC -static" ./configure \
+ --build="${TOOLCHAIN_TRIPLET}" \
+ --host="${HOST_TOOLCHAIN_TRIPLET}" \
+ --prefix="$PREFIX" \
+ --mandir="$ROOT/share/man" \
+ --disable-shared \
+ --enable-static
+ # Set path to libssl.a and libcrypto.a for apps/.
+ export LDFLAGS="-all-static $LDFLAGS -L`pwd`/crypto -L`pwd`/ssl -lcrypto -lssl"
+ make -j$nprocs V="1" LDFLAGS="$LDFLAGS"
+ # install lib for use as a dependency.
+ make -j$nprocs install DESTDIR="`pwd`/lib" V="1"
+ # remove .la files for now ?
+ find `pwd`/lib -iname "*.la" -exec rm {} \;
+
+install:QV:
+ make -j$nprocs install DESTDIR="$ROOT" V="1"
diff --git a/libressl/mkfile b/libressl/mkfile
@@ -0,0 +1,10 @@
+<$mkbuild/mk.3rdparty
+
+<v.mk
+src = libressl-$v
+url = http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-$v.tar.gz
+mkfile = ../libressl.mk
+
+patches = \
+ ../libressl-entropy-nonsense.patch \
+ ../libressl-glibc.patch
diff --git a/libressl/v.mk b/libressl/v.mk
@@ -0,0 +1 @@
+v = 2.0.0