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

Treat openssl,pcre and zlib library headers as "system"

    XMLWordPrintable

Details

    • Notable changes

    Description

      When I compile MariaDB using a recent clang on MacOSX against the homebrew version of openssl I get compile errors (see the attached full log). e.g.

      [build] In file included from /Users/gkodinov/dev/server-10.11/libmariadb/plugins/auth/sha256_pw.c:47:
      [build] In file included from /opt/homebrew/Cellar/openssl@4/4.1.0/include/openssl/rsa.h:21:
      [build] In file included from /opt/homebrew/Cellar/openssl@4/4.1.0/include/openssl/asn1.h:32:
      [build] In file included from /opt/homebrew/Cellar/openssl@4/4.1.0/include/openssl/bio.h:32:
      [build] In file included from /opt/homebrew/Cellar/openssl@4/4.1.0/include/openssl/crypto.h:36:
      [build] /opt/homebrew/Cellar/openssl@4/4.1.0/include/openssl/safestack.h:280:1: error: cast from 'OPENSSL_sk_freefunc' (aka 'void (*)(void *)') to 'sk_OPENSSL_STRING_freefunc' (aka 'void (*)(char *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
      [build]   280 | SKM_DEFINE_STACK_OF_INTERNAL(OPENSSL_STRING, char, char)
      [build]       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      

      This, according to my grok, is because of an unrelated clang/openssl compilation issue:

      The error is a strict function-pointer cast inside OpenSSL's stack macros. This is not a bug in sha256_pw.c. Clang is rejecting a cast inside an OpenSSL header, and MariaDB's maintainer build turns that warning into an error.
      

      While we could try and fix openssl code to compile well under clang, the easiest way is to make the OpenSSL (and other 3d party libraries) headers compile as 3d party (system) headers, so that the warning doesn't get promoted to error.

      Attachments

        Activity

          People

            gkodinov Georgi Kodinov
            gkodinov Georgi Kodinov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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