# Problem building ucspi-tcp with SSL



## colornokia (Jan 3, 2015)

Hello,

I'm trying to build sysutils/ucspi-tcp from ports on brand new FreeBSD 10.1 (all up to date). If I leave the default options (only IP6 on) it is building correctly. However I intend to use the system for qmail server so I need the option for SSL. With this option the build is unsuccessful. I don't have much experience of troubleshooting ports issues so I decided to post here before adding a bug to Bugzilla.

```
FreeBSD srv 10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 21:02:49 UTC 2014  root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

root@srv:/usr/ports/sysutils/ucspi-tcp # make showconfig
===> The following configuration options are available for ucspi-tcp-0.88_2:
  IPV6=off: IPv6 protocol support
  LIMITS=off: Implement per-connection and other limits
  RBL2SMTPD=off: Don't drop connection, pass envvar to smtpd
  RSS_DIFF=on: Patch rblsmtpd for qmail users
  SSL=on: SSL protocol support
===> Use 'make config' to modify these settings

./load tcpserver rules.o remoteinfo.o timeoutconn.o cdb.a  dns.a time.a unix.a byte.a  -L/usr/lib  -lssl `cat socket.lib`
/usr/bin/ld: //lib/libcrypto.so.7: invalid DSO for symbol `BIO_new_socket' definition
//lib/libcrypto.so.7: could not read symbols: Bad value
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [tcpserver] Error code 1

make[2]: stopped in /usr/ports/sysutils/ucspi-tcp/work/ucspi-tcp-0.88
1 error

make[2]: stopped in /usr/ports/sysutils/ucspi-tcp/work/ucspi-tcp-0.88
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/sysutils/ucspi-tcp
*** Error code 1

Stop.
make: stopped in /usr/ports/sysutils/ucspi-tcp
```
I have tried to set MAKE_JOBS_UNSAFE=yes and rebuild but again it is not good. Any help will be greatly appreciated!


----------



## talsamon (Jan 3, 2015)

Builds with `poudriere`.


----------



## jrm@ (Jan 3, 2015)

I tried to build it in poudriere and I get the same error.  If you want to file a PR, that build log will remain up, so you can link to it.  The error is at the linking stage, so it might be trivial to fix.  It might even be the double slash in //lib/libcrypto.so.7.


----------



## jrm@ (Jan 3, 2015)

talsamon, did you turn off IPv6 and turn on SSL?  I built in a 10.1 amd64 jail.  What did you build in?


----------



## talsamon (Jan 3, 2015)

You are right. I forget to change the options. `Poudriere` also failed with

```
./load tcpserver rules.o remoteinfo.o timeoutconn.o cdb.a  dns.a time.a unix.a byte.a  -L/usr/lib  -lssl `cat socket.lib`
/usr/bin/ld: //lib/libcrypto.so.7: invalid DSO for symbol `BIO_new_socket' definition
//lib/libcrypto.so.7: could not read symbols: Bad value
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1
```
Seems to be a bug.


----------



## colornokia (Jan 3, 2015)

I have submitted a bug report in Bugzilla - bug 196469


----------



## colornokia (Jan 10, 2015)

I had some time to play around and it looks like if you change in /usr/ports/sysutils/ucspi-tcp/work/ucspi-tcp-0.88/Makefile


```
LIBS=-L/usr/lib  -lssl
```
to

```
LIBS=-L/usr/lib  -lcrypto -lssl
```
It is building successfully. I will update that back to bugzilla.


----------

