Discussion:
stunnel fails to build
(too old to reply)
tech-lists
2016-07-21 08:15:00 UTC
Permalink
Hi,

ports: r418866
stable/11: r302999

I have the following defined in /etc/make.conf - could this be the issue?

DEFAULT_VERSIONS+= ssl=libressl-devel

###

build fails like this:

/usr/ports/security/stunnel # make MAKE_JOBS_UNSAFE=yes
===> Building for stunnel-5.35,1
Making all in src
/usr/bin/make all-am
CCLD libstunnel.la
CC stunnel-tls.o
In file included from tls.c:39:
./prototypes.h:656:9: error: unknown type name 'CRYPTO_RWLOCK'
typedef CRYPTO_RWLOCK *STUNNEL_RWLOCK;
^
tls.c:56:30: warning: incompatible pointer types passing 'void *(size_t,
const char *, int)' (aka 'void *(unsigned long, const char *, int)') to
parameter of type 'void *(*)(size_t)' (aka 'void *(*)(unsigned long)')
[-Wincompatible-pointer-types]
CRYPTO_set_mem_functions(str_alloc_detached_debug,
^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/openssl/crypto.h:412:38: note: passing argument to
parameter 'm' here
int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *,
size_t), void (*f)(void *));
^
tls.c:57:9: warning: incompatible pointer types passing 'void *(void *,
size_t, const char *, int)' (aka 'void *(void *, unsigned long, const
char *, int)') to parameter of type 'void *(*)(void *, size_t)' (aka
'void *(*)(void *, unsigned long)') [-Wincompatible-pointer-types]
str_realloc_debug, str_free_debug);
^~~~~~~~~~~~~~~~~
/usr/local/include/openssl/crypto.h:412:58: note: passing argument to
parameter 'r' here
int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *,
size_t), void (*f)(void *));
^
tls.c:57:28: warning: incompatible pointer types passing 'void (void *,
const char *, int)' to parameter of type 'void (*)(void *)'
[-Wincompatible-pointer-types]
str_realloc_debug, str_free_debug);
^~~~~~~~~~~~~~
/usr/local/include/openssl/crypto.h:412:85: note: passing argument to
parameter 'f' here
int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *,
size_t), void (*f)(void *));

^
3 warnings and 1 error generated.
*** Error code 1

Stop.
make[4]: stopped in /usr/ports/security/stunnel/work/stunnel-5.35/src
*** Error code 1

Stop.
make[3]: stopped in /usr/ports/security/stunnel/work/stunnel-5.35/src
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/security/stunnel/work/stunnel-5.35
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/security/stunnel
*** Error code 1

Stop.
make: stopped in /usr/ports/security/stunnel

===

same issues on -current

thanks,
--
J.
Walter Schwarzenfeld
2016-07-21 10:09:08 UTC
Permalink
Try:
remove --with-ssl="${OPENSSLBASE}"
from the Makefile
and add
to USES= ssl
Dewayne Geraghty
2016-07-21 10:29:21 UTC
Permalink
Post by tech-lists
Hi,
ports: r418866
stable/11: r302999
I have the following defined in /etc/make.conf - could this be the issue?
DEFAULT_VERSIONS+= ssl=libressl-devel
###
/usr/ports/security/stunnel # make MAKE_JOBS_UNSAFE=yes
===> Building for stunnel-5.35,1
Making all in src
/usr/bin/make all-am
CCLD libstunnel.la
CC stunnel-tls.o
./prototypes.h:656:9: error: unknown type name 'CRYPTO_RWLOCK'
typedef CRYPTO_RWLOCK *STUNNEL_RWLOCK;
^
tls.c:56:30: warning: incompatible pointer types passing 'void *(size_t,
const char *, int)' (aka 'void *(unsigned long, const char *, int)') to
parameter of type 'void *(*)(size_t)' (aka 'void *(*)(unsigned long)')
[-Wincompatible-pointer-types]
CRYPTO_set_mem_functions(str_alloc_detached_debug,
^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/openssl/crypto.h:412:38: note: passing argument to
parameter 'm' here
int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *,
size_t), void (*f)(void *));
^
tls.c:57:9: warning: incompatible pointer types passing 'void *(void *,
size_t, const char *, int)' (aka 'void *(void *, unsigned long, const
char *, int)') to parameter of type 'void *(*)(void *, size_t)' (aka
'void *(*)(void *, unsigned long)') [-Wincompatible-pointer-types]
str_realloc_debug, str_free_debug);
^~~~~~~~~~~~~~~~~
/usr/local/include/openssl/crypto.h:412:58: note: passing argument to
parameter 'r' here
int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *,
size_t), void (*f)(void *));
^
tls.c:57:28: warning: incompatible pointer types passing 'void (void *,
const char *, int)' to parameter of type 'void (*)(void *)'
[-Wincompatible-pointer-types]
str_realloc_debug, str_free_debug);
^~~~~~~~~~~~~~
/usr/local/include/openssl/crypto.h:412:85: note: passing argument to
parameter 'f' here
int CRYPTO_set_mem_functions(void *(*m)(size_t), void *(*r)(void *,
size_t), void (*f)(void *));
^
3 warnings and 1 error generated.
*** Error code 1
Stop.
make[4]: stopped in /usr/ports/security/stunnel/work/stunnel-5.35/src
*** Error code 1
Stop.
make[3]: stopped in /usr/ports/security/stunnel/work/stunnel-5.35/src
*** Error code 1
Stop.
make[2]: stopped in /usr/ports/security/stunnel/work/stunnel-5.35
*** Error code 1
Stop.
make[1]: stopped in /usr/ports/security/stunnel
*** Error code 1
Stop.
make: stopped in /usr/ports/security/stunnel
===
same issues on -current
thanks,
--
J.
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
After reading about your issue, I updated all of my ports, via svnlite, and
successfully built on yesterday's fresh FreeBSD 10.3 Stable for i386 using
openssl. Unfortunately on the amd64, which uses libressl, I receive:
===> stunnel-5.35,1 may not be packaged: The stunnel license restricts
distribution when linked to non-OpenSSL non-base SSL-libraries. (A recent
enhancement)

My customisations are:
i386 uses make.conf entry: ssl=openssl
amd64 uses make.conf: ssl=libressl
This may be significant to your situation?

If there is a problem with the Makefile, please log a PR so everyone can
benefit. ;)
tech-lists
2016-07-21 16:07:37 UTC
Permalink
Post by Walter Schwarzenfeld
remove --with-ssl="${OPENSSLBASE}"
from the Makefile
and add
to USES= ssl
Unfortunately, this didn't work. Here's my amended Makefile:

# Created by: Martti Kuparinen <***@ericsson.com>
# $FreeBSD: head/security/stunnel/Makefile 418695 2016-07-18 11:38:46Z zi $

PORTNAME= stunnel
PORTVERSION= 5.35
PORTEPOCH= 1
CATEGORIES= security
MASTER_SITES= https://www.stunnel.org/downloads/%SUBDIR%/ \
https://www.stunnel.org/downloads/beta/ \
http://mirrors.zerg.biz/stunnel/%SUBDIR%/ \
http://mirrors.go-part.com/stunnel/%SUBDIR%/ \
http://ftp.nluug.nl/pub/networking/stunnel/%SUBDIR%/ \
ftp://ftp.nluug.nl/pub/networking/stunnel/%SUBDIR%/ \
http://ftp.nluug.nl/pub/networking/stunnel/%SUBDIR%/ \
ftp://ftp.surfnet.nl/pub/networking/stunnel/%SUBDIR%/ \
http://ftp.surfnet.nl/pub/networking/stunnel/%SUBDIR%/ \
ftp://stunnel.mirt.net/stunnel/%SUBDIR%/ \
http://www.namesdir.com/mirrors/stunnel/%SUBDIR%/ \
http://stunnel.cybermirror.org/%SUBDIR%/ \
http://mirrors.zerg.biz/stunnel/%SUBDIR%/ \
http://mirrors.rit.edu/zi/

MAINTAINER= ***@FreeBSD.org
COMMENT= SSL encryption wrapper for standard network daemons

# FIXME: IMHO, there really ought to be a GPL-2+ option or some such.
LICENSE= GPLv2 GPLv3
LICENSE_COMB= dual

USES= cpe libtool perl5 shebangfix ssl
USE_PERL5= build
USE_LDCONFIG= yes
USE_OPENSSL= yes
USE_RC_SUBR= stunnel

GNU_CONFIGURE= yes
CONFIGURE_ARGS= --localstatedir=/var/tmp --enable-static --disable-systemd
SHEBANG_FILES= src/stunnel3.in

OPTIONS_DEFINE= DOCS EXAMPLES FIPS IPV6 LIBWRAP
OPTIONS_SINGLE= THREAD
OPTIONS_SINGLE_THREAD= FORK PTHREAD UCONTEXT

OPTIONS_DEFAULT= PTHREAD

FIPS_CONFIGURE_ENABLE= fips
IPV6_CONFIGURE_ENABLE= ipv6
LIBWRAP_CONFIGURE_ENABLE= libwrap

FIPS_DESC= Enable OpenSSL FIPS mode
FORK_DESC= Use the fork(3) threading model
PTHREAD_DESC= Use the pthread(3) threading model
UCONTEXT_DESC= Use the ucontext(3) threading model

STUNNEL_USER?= stunnel
STUNNEL_GROUP?= stunnel

USERS= ${STUNNEL_USER}
GROUPS= ${STUNNEL_GROUP}

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MLIBWRAP}
LDFLAGS+= -lwrap
.endif

.if ${PORT_OPTIONS:MUCONTEXT}
CONFIGURE_ARGS+=--with-threads=ucontext
LDFLAGS+= -lpthread
.elif ${PORT_OPTIONS:MFORK}
CONFIGURE_ARGS+=--with-threads=fork
.else
CONFIGURE_ARGS+=--with-threads=pthread
LDFLAGS+= -lpthread
.endif

.include <bsd.port.pre.mk>

.if ${PORT_OPTIONS:MFIPS} && ${SSL_DEFAULT} == libressl
IGNORE= LibreSSL does not support FIPS standard
.endif

.if ${SSL_DEFAULT} == libressl
NO_PACKAGE= The stunnel license restricts distribution when linked
to non-OpenSSL non-base SSL-libraries
.endif

post-patch:
# place files under /var/tmp so that this can be run by an unprivileged
# user stunnel and group stunnel
@${REINPLACE_CMD} -E -e
's|\@prefix\@/var/lib/stunnel/|/var/tmp/stunnel|; \
s|nobody|stunnel|;s|nogroup|stunnel|' \
${WRKSRC}/tools/stunnel.conf-sample.in
@${REINPLACE_CMD} -E -e
's|\$$\(prefix\)/var/run/stunnel/stunnel.pid|$$(localstatedir)/stunnel.pid|'
\
${WRKSRC}/src/Makefile.in
@${FIND} ${WRKSRC} -type f -name Makefile.in | ${XARGS}
${REINPLACE_CMD} -E -e 's,@(ACLOCAL|AUTO(MAKE|CONF|HEADER))@,/usr/bin/true,'
@${REINPLACE_CMD} -E -e 's|install-confDATA
install-data-local|install-confDATA|g' \
${WRKSRC}/tools/Makefile.in
.if empty(PORT_OPTIONS:MDOCS)
@${REINPLACE_CMD} -E -e 's/ install-docDATA/ /'
${WRKSRC}/Makefile.in
@${REINPLACE_CMD} -E -e '/install-data-am/s,install-docDATA,,'
${WRKSRC}/doc/Makefile.in
.endif
.if empty(PORT_OPTIONS:MEXAMPLES)
@${REINPLACE_CMD} -E -e 's/([^n])install-examplesDATA/\1/' \
${WRKSRC}/tools/Makefile.in
.else
@${REINPLACE_CMD} -E -e
's|\$$\(docdir\)/examples|${EXAMPLESDIR}|g' ${WRKSRC}/tools/Makefile.in
.endif

post-build:
@${STRIP_CMD} ${WRKSRC}/src/.libs/libstunnel.so

cert:
@${ECHO} ""
@${ECHO}
"**************************************************************************"
@${ECHO} "The new certificate will be saved into
${ETCDIR}/stunnel.pem"
@${ECHO}
"**************************************************************************"
@${ECHO} ""
@(cd ${WRKSRC}/tools/; make install-data-local)

.include <bsd.port.post.mk>
--
J.
tech-lists
2016-07-21 16:13:32 UTC
Permalink
Post by Dewayne Geraghty
After reading about your issue, I updated all of my ports, via svnlite, and
successfully built on yesterday's fresh FreeBSD 10.3 Stable for i386 using
===> stunnel-5.35,1 may not be packaged: The stunnel license restricts
distribution when linked to non-OpenSSL non-base SSL-libraries. (A recent
enhancement)
i386 uses make.conf entry: ssl=openssl
amd64 uses make.conf: ssl=libressl
This may be significant to your situation?
If there is a problem with the Makefile, please log a PR so everyone can
benefit. ;)
I dunno if there's a problem with the makefile or with the software as
suggested amendments had no effect. The "stunnel may not be packaged"
message is one related to distribution and is not a problem with
compilation per se.

thanks,
--
J.
Walter Schwarzenfeld
2016-07-21 16:48:32 UTC
Permalink
I think you should file a PR. The try with the Makefile was a "weak" one.
I think it is the same problem as appears in other ports with libressl.
e.g. (this patch is from 2014 and only an example )
"HAVE_RAND_EGD -.thing"
https://github.com/sabotage-linux/sabotage/commit/9b47cbbf3ce903dee042c45c8197db066e8e0053

I can't provide a patch, cause I can't test it.
tech-lists
2016-07-21 16:53:14 UTC
Permalink
Post by Walter Schwarzenfeld
I think you should file a PR.
will do, thanks for your suggestion anyway
--
J.
Walter Schwarzenfeld
2016-07-23 06:03:02 UTC
Permalink
found something:

maybe, this could help
remove or comment out--with-ssl="${OPENSSLBASE}"

and add to the Makefile:

CONFIGURE_ENV= OPENSSL_LIBS="-L${OPENSSLLIB} -lcrypto"
OPENSSL_CFLAGS="-I${OPENSSLINC}"
MAKE_ARGS= LDFLAGS="${LDFLAGS}"

Loading...