# mysql56-client build errors on 10-STABLE [SOLVED]



## mb2015 (Sep 13, 2015)

I'm having trouble getting the databases/mysql56-client port to build on FreeBSD 10.2-STABLE. The C compiler (clang) is griping about numerous errors in the yassl code.

Here's the output: http://pastebin.com/raw.php?i=kXaDDJJY

All I'm doing: `portmaster databases/mysql56-server` (it builds databases/mysql56-client as well). The ports collection is up to date.

Platform: BeagleBone Black rev. C, with the 20150903-r287435 FreeBSD 10.2-STABLE snapshot from ftp.freebsd.org.

Any idea why this is happening?


----------



## talsamon (Sep 13, 2015)

Which clang version? On 10.2-release none of these errors appears wirh 3.4.1


----------



## ds_aim (Sep 13, 2015)

Why you use ports(7)? Ports is broken .

Use a clean FreeBSD and these commands:
`pkg update
pkg install mysql56-server`


----------



## kpa (Sep 13, 2015)

ds_aim said:


> Why you use ports? Ports is broken .



They are? Last time I checked they were working just fine. Maybe you should use FreeBSD ports for a while yourself before you make such statements in public.


----------



## talsamon (Sep 13, 2015)

> Why you use ports? Ports is broken


Ports are surely not broken.

Standard-question: what is in /etc/make.conf?
Why you use STABLE if there is a RELEASE ?


----------



## kpa (Sep 13, 2015)

You seem to have security/openssl installed or at least the OpenSSL include files are installed in /usr/local/include/openssl. Do you have WITH_OPENSSL_PORT=yes set in /etc/make.conf?


----------



## ds_aim (Sep 13, 2015)

kpa said:


> They are? Last time I checked they were working just fine. Maybe you should use FreeBSD ports for a while yourself before you make such statements in public.


For me using ports is useless.
The package tool is the best. 

Why? With ports if you install some package , it creates conflicts.. etc

If you want to install MySQL, do what i said before.


----------



## talsamon (Sep 13, 2015)

Sorry, that is nonsense. Which is created conflicts, pkg(8) or ports? - it is philosophic. It is the difference of versions between pkg(8) and ports. Both work.


> If u want to install MySQL do what i said before.


And hundreds installed it before with the port.


----------



## mb2015 (Sep 14, 2015)

Why run 10-STABLE instead of 10-RELEASE? Because support for my hardware (the BeagleBone Black, a Raspberry Pi-like board with an ARMv6 processor) requires 10-STABLE or 11-CURRENT, the only armv6 snapshots available.

Which clang version? 

```
[CMD=%]cc -v[/CMD]
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: armv6--freebsd10.2-gnueabi
Thread model: posix
Selected GCC installation
```

Contents of /etc/make.conf:
WITH_PKGNG=yes

Yes, security/openssl is installed. It is a required dependency for opensmtpd, which I want to run instead of sendmail; WITH_OPENSSL_PORT=yes is in mail/opensmtpd's Makefile. security/openssl is also getting installed when I enable the CA_BUNDLE option for various ports (like opensmtpd and ftp/curl).


----------



## kpa (Sep 14, 2015)

mb2015 said:


> Why run 10-STABLE instead of 10-RELEASE? Because support for my hardware (the BeagleBone Black, a Raspberry Pi-like board with an ARMv6 processor) requires 10-STABLE or 11-CURRENT, the only armv6 snapshots available.
> 
> Which clang version?
> 
> ...



There's a problem with the port in that case. The build should ignore OpenSSL in /usr/local because you're selecting the use of base system OpenSSL for databases/mysql56-client. File a PR.


----------



## mb2015 (Sep 14, 2015)

Thanks. Looks like there's a PR already: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192723

I added a "me too" there.


----------



## kpa (Sep 14, 2015)

To add to this, the port probably builds just fine under ports-mgmt/poudriere as noted in some of the PR comments. It's only when you're building/rebuilding the port on a "live" system with ports-mgmt/portmaster the problem manifests itself when there is also the unrelated security/openssl port installed at the same time.


----------



## talsamon (Sep 14, 2015)

You can try in the port: `CFLAGS+="-ferror-limit=0`", or `portmaster -m CFLAGS+="-ferror-limit=0" databases/mysql56-client`.


Another question is: With clang error messages like "redefined warning" or  
	
	



```
macro redefined
```
 it seems appears a lot more as in the past - thinking about if it makes sense (?).


----------



## iddqd (Sep 14, 2015)

As a possible work-around you can try the attached patch.  It causes the port to build against the system OpenSSL instead of using the bundled one.  Please note that this has not been tested in any way other than compiling the port.


----------



## talsamon (Sep 14, 2015)

The above suggestion I wrote would not work, overlooked `use of undeclared identifier 'SSL_SUCCESS'`.
I think it is caused by `namespace yassl` and the `extern "C"` pragma in ssl.cpp. Similiar problems in other programs I fixed with:

```
// replace
extern "C"
// with
#ifdef __cplusplus
extern "C" {
#endif
...
...
...
#ifdef __cplusplus
}
end extern "C"
```
in the related header-files.

I tested it  not here, cause I can not reproduce the error.


----------



## Gamecreature (Sep 14, 2015)

Thanks!!
The of iddqd patch seems to work !!

I also have ports-based openssl installation, which causes the issue.
By adding the options in the Makefile it builds and runs!


```
-DWITH_SSL="system"

USE_OPENSSL= yes
```


----------



## kpa (Sep 14, 2015)

iddqd said:


> As a possible work-around you can try the attached patch.  It causes the port to build against the system OpenSSL instead of using the bundled one.  Please note that this has not been tested in any way other than compiling the port.



Does your patch take into account WITH_OPENSSL_PORT=yes? The future of OpenSSL in FreeBSD looks very much like that the base system OpenSSL will be hidden from ports and for ports there will be only security/openssl or security/libressl.


----------



## iddqd (Sep 14, 2015)

Yes. The use of the USE_OPENSSL variable ensures that it will (hopefully) select the proper OpenSSL installation. My testing was done with WITH_OPENSSL_PORT=YES and compilation succeeded without error. But that's as far as I tested it.


----------



## iddqd (Sep 14, 2015)

On a side note percona56-{client,server} suffer from the same issue. The same "fix" can be used for them as well.


----------



## iddqd (Sep 16, 2015)

This is now fixed. See https://svnweb.freebsd.org/ports?view=revision&revision=397026 for details.


----------



## mb2015 (Sep 16, 2015)

Nice! I'm glad there's a global fix. I updated my ports collection and everything seems to be OK now. Hooray!


----------



## talsamon (Sep 16, 2015)

Please, mark  the thread as solved. In the right upper corner *thread tools* - *edit title*.


----------

