Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-14439

Missing library path in mariadb_config

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Incomplete
    • 10.2.10
    • N/A
    • Scripts & Clients
    • 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

    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

      Attachments

        Issue Links

          Activity

            danblack Daniel Black added a comment -

            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).

            danblack Daniel Black added a comment - 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).
            spil Bernard Spil added a comment -

            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"

            spil Bernard Spil added a comment - 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"

            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"?

            serg Sergei Golubchik added a comment - 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"?
            spil Bernard Spil added a comment -

            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

            spil Bernard Spil added a comment - 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

            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.

            serg Sergei Golubchik added a comment - 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.

            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 )

            serg Sergei Golubchik added a comment - 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 )

            People

              serg Sergei Golubchik
              spil Bernard Spil
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.