Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-83

linkage fails when system pcre library is recent

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • 1.1.1
    • Core
    • None
    • Archlinux, develop branch

    Description

      MariaDB includes a bundled and patched pcre source tree. When building mariadb, with WITH_PCRE=auto (the default), cmake checks the system pcre for a specific patch (existence of the symbol pcre_stack_guard). If the system pcre has that, mysqld will be dynamically linked to it, and the bundled pcre version will not be used.

      For Ubuntu and debian, the system pcre is too old, so the bundled pcre ends up being statically linked to libmysqld.

      MaxScale assumes that libmysqld defines the PCRE symbols. Linkage thus fails on missing pcre_* symbols.

      Adding -lpcre to the linkage command, or adding pcre to target_link_libraries fixes the issue.

      Probably the correct fix would be to test for the existence of pcre_stack_guard in libmysqld or in the system's libpcre, and link appropriately. If this is correct, let me know, I'll work on a patch.

      Attachments

        Activity

          Changed the severity to Minor, as ArchLinux is not officially support OS for MaxScale at this time.
          Supported OS are RHEL, CentOS, Fedora, OpenSUSE, SLES, Debian and Ubuntu.

          dshjoshi Dipti Joshi (Inactive) added a comment - Changed the severity to Minor, as ArchLinux is not officially support OS for MaxScale at this time. Supported OS are RHEL, CentOS, Fedora, OpenSUSE, SLES, Debian and Ubuntu.
          yhager Yuval Hager added a comment -

          Okay, I'll open future archlinux related issues with Minor severity in the future.

          This one is not specific to archlinux/gentoo, rather to any system with a recent pcre. It might pop up on supported distros as they update their pcre.

          Will you accept a patch for this though?

          yhager Yuval Hager added a comment - Okay, I'll open future archlinux related issues with Minor severity in the future. This one is not specific to archlinux/gentoo, rather to any system with a recent pcre. It might pop up on supported distros as they update their pcre. Will you accept a patch for this though?
          markus makela markus makela added a comment -

          CMake now checks for pcre_stack_guard and if it is not found, looks for an installed PCRE library. If successful, MaxScale is linked with -lpcre.

          markus makela markus makela added a comment - CMake now checks for pcre_stack_guard and if it is not found, looks for an installed PCRE library. If successful, MaxScale is linked with -lpcre.

          verified by checking cmake files. Actual test on ArchLinux is not implemented due to minor severity of bug and significant amount of work to setup ArchLinux env. Please reopen if problem is still present.

          tturenko Timofey Turenko added a comment - verified by checking cmake files. Actual test on ArchLinux is not implemented due to minor severity of bug and significant amount of work to setup ArchLinux env. Please reopen if problem is still present.

          People

            markus makela markus makela
            yhager Yuval Hager
            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.