[MDEV-14439] Missing library path in mariadb_config Created: 2017-11-18  Updated: 2018-08-13  Resolved: 2018-08-13

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 10.2.10
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Bernard Spil Assignee: Sergei Golubchik
Resolution: Incomplete Votes: 0
Labels: need_feedback
Environment:

FreeBSD build.example.org 11.1-RELEASE-p1 FreeBSD 11.1-RELEASE-p1 #0 r323352: Sat Sep 9 14:25:36 CEST 2017 bernard@build.example.org:/usr/obj/usr/src/sys/BEASTIE111 amd64


Issue Links:
Relates
relates to MDEV-15820 Backward compatibility break of mysql... Closed

 Description   

The output of mysql_config has changed from 10.1 to 10.2. This is problematic for programs that use mysql_config (Apache APR-util).

10.1 `-L/usr/local/lib/mysql -lmysqlclient -pthread -lz -lm -lexecinfo -lssl -lcrypto -L/usr/local/lib`
10.2 `-L/usr/local/lib/mysql/ -lmariadb -lz -lm -lpthread -liconv -lssl -lcrypto -liconv`

Since libiconv.so is in /usr/local/lib, configure from APR-util fails to find iconv and doesn't buld the mysql dbd backend. Hacked this by adding " -L/usr/local/include" in mysql_config and that works



 Comments   
Comment by Daniel Black [ 2018-02-11 ]

Also looks like

https://github.com/MariaDB/mariadb-connector-c/blob/master/mariadb_config/libmariadb.pc.in needs to use INSTALL_LIBDIR (portable like MDEV-14340)

https://github.com/MariaDB/mariadb-connector-c/blob/master/mariadb_config/CMakeLists.txt#L55 installs to bin while it seems Debian is expecting a LIBDIR install (https://github.com/ottok/mariadb-10.3/blob/master/debian/mariadb_config) (no idea how portable this change will be).

Comment by Bernard Spil [ 2018-05-11 ]

Hi Sergei, can you take a look please? If any of the libs are not in a system lib path the path must be added to `--libs`

databases/mariadb102-client: "mysql_config --libs" lacks "-L/usr/local/lib"

Comment by Sergei Golubchik [ 2018-05-11 ]

How to define the system library path? Because CMAKE_SYSTEM_LIBRARY_PATH includes /usr/local/lib, so for cmake and everything that uses cmake libiconv.so is in the system library path.

In fact, mariadb_config strips all paths, not only "system library path", but if I fix it to strip only system paths, how to determine what path is "system"?

Comment by Bernard Spil [ 2018-05-12 ]

Hmmm... So how does CMake determine the `CMAKE_SYSTEM_LIBRARY_PATH`.

On FreeBSD, /usr/local/lib is not in the system library path, if I need that I always add it to the flags or linking will fail. This is exactly where currently some ports that depend on MariaDB libs are failing. I've hacked it into the port for now by patching mariadb_config.c

Comment by Sergei Golubchik [ 2018-05-13 ]

Yes, I've already seen your patch. I wondered why you did it that way, instead of a patch in files/.

Anyway, here's another thought. Command-line client mysql compiles just fine. Because it doesn't use -liconv but /usr/local/lib/libiconv.so. And then for mariadb_config cmake replaces all paths with -l.

So, perhaps there's no need to replace and mariadb_config should print exactly the line that was used for mysql command-line client? That line is known to work, because mysql was linked successfully.

Comment by Sergei Golubchik [ 2018-07-09 ]

Any reply to my last question? Agree? Disagree?

No reply for month might cause an issue to be closed as "Incomplete" (it's a manual process, so it won't necessarily close the issue, instead I might write a comment, like this one )

Generated at Thu Feb 08 08:13:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.