# mysql57 does not build with ssl error



## YuryG (May 9, 2016)

Trying to build databases/mysql57-client gives an error about base ssl. 
	
	



```
[ 65%] Linking C static library libmysqlclient.a
/usr/bin/ld: /usr/lib/libssl.a(ssl_err.o): relocation R_X86_64_32 against `a loc
al symbol' can not be used when making a shared object; recompile with -fPIC
/usr/lib/libssl.a: could not read symbols: Bad value
```

Is it me or something?


----------



## abefar (May 10, 2016)

Did you find a solution? I'm getting the same error on 10.3-RELEASE while trying to build databases/mariadb100-client inside a jail.


----------



## YuryG (May 10, 2016)

Personally, I had to downgrade to mysql56.


----------



## SirDice (May 10, 2016)

Has the base OS been updated recently? The last security update did touch OpenSSL and it may be related.

https://www.freebsd.org/security/advisories/FreeBSD-SA-16:17.openssl.asc


----------



## YuryG (May 10, 2016)

Had upgraded to r298933 in 10.3-STABLE recently.


----------



## abefar (May 10, 2016)

Not mine, I'm still at 10.3-RELEASE - haven't upgraded to p1 or p2 yet. Just tried the same on bare OS (i.e. not inside a jail), and the same thing happens when trying to build databases/mariadb100-client version 10.0.25.
After upgrading from 10.2 to 10.3 I rebuilt all ports, including mariadb100-client-10.0.23, without any issues.

The only irregularity I can think of is that my world is built without profiled libraries (`WITHOUT_PROFILE` is set in src.conf(5)), otherwise it's pretty standard.


----------



## talsamon (May 10, 2016)

databases/mariadb100-client compiles if
either you comment out the line in databases/mysql100-server/Makefiles

```
-DWITH_SSL=${OPENSSLBASE}
```
or
you compile with

```
make -DWITH_OPENSSL_PORT.
```


----------



## YuryG (May 10, 2016)

By the way, isn't it contradictory in databases/mysql57-server Makefile: 

```
WITH_OPENSSL_PORT=yes
...
CMAKE_ARGS+=-DWITH_SSL=${OPENSSLBASE}
```
And (as with dns/bind910) it's not my favourable solution: to build OpenSSL from ports (and rebuild all dependent ports?)


----------



## kpa (May 10, 2016)

No, that's not an error. OPENSSLBASE can be either /usr or ${LOCALBASE} depending on what has been set with WITH_OPENSSL_BASE or WITH_OPENSSL_PORT.


----------



## KdeBruin (May 11, 2016)

Having the same error on various ports on a freshly patched and updated 10.3-p2 system. I have neither WITH_OPENSSL_BASE or WITH_OPENSSL_PORT set.


----------



## kpa (May 11, 2016)

Build just fine under `poudriere testport`, 10.3-RELEASE amd64 under VirtualBox. Ports tree is at revision @414981. I have WITH_OPENSSL_PORT set globally though.

Please try this:

- Fetch matching sources for your system if you don't already have from https://svn.freebsd.org/base/releng/10.3. Use `svnlite co https://svn.freebsd.org/base/releng/10.3 /usr/src` if you don't have the sources yet, `svnlite up /usr/src` if you do.

- Run `# make -C /usr/src -D BATCH_DELETE_OLD_FILES delete-old delete-old-libs`.

That should clean up any old files from the base system that might interfere with build of the port.


----------



## KdeBruin (May 11, 2016)

Tried this but still the same error from building databases/mariadb100-client:


```
/usr/bin/ld: /usr/lib/libssl.a(ssl_err.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/lib/libssl.a: could not read symbols: Bad value
```


----------



## SirDice (May 11, 2016)

kpa said:


> Build just fine under `poudriere testport`, 10.3-RELEASE amd64 under VirtualBox. Ports tree is at revision @414981. I have WITH_OPENSSL_PORT set globally though.


It fails to build for me. But I don't have WITH_OPENSSL_PORT set. 

So it looks like there's an issue with the base OpenSSL. Is there anyone with the same build issues on 10.2, 10.1 or 9.3? It may be specific to 10.3.


----------



## kpa (May 11, 2016)

SirDice said:


> It fails to build for me. But I don't have WITH_OPENSSL_PORT set.
> 
> So it looks like there's an issue with the base OpenSSL. Is there anyone with the same build issues on 10.2, 10.1 or 9.3? It may be specific to 10.3.



Yep, I just created a new poudriere set with WITH_OPENSSL_BASE set and it fails the same way. Someone submit a PR.


----------



## YuryG (May 11, 2016)

I have done `svn up` in /usr/src then rebuilt the world and the kernel also `make delete-old` and `make delete-old-libs` as instructed in Handsbook. The problem stays. (Although I have WITH_OPEN_SSL_BASE=yes.)


----------



## YuryG (May 11, 2016)

Is it O.K? https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209458


----------

