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

Build error rocksdb storage mariadb-10.4.7 on FreeBSD 12.0-p8

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.4.7, 10.4.8, 10.6.3, 10.6.4, 10.6.5, 10.5
    • 11.3.0
    • None
    • System: FreeBSD 12.0 - p8
      Compiler: clang 6.0.1 with cmake 3.15.1
      Build: cmake -DWITHOUT_TOKUDB=1 .

    Description

      System: FreeBSD 12.0 - p8
      Compiler: clang 6.0.1 with cmake 3.15.1

      Build: cmake -DWITHOUT_TOKUDB=1 .

      make Error:

      [ 74%] Built target rocksdb_tools
      [ 75%] Building CXX object storage/rocksdb/CMakeFiles/rocksdblib.dir/rocksdb/db/malloc_stats.cc.o
      c++: warning: -Wl,-z,relro,-z,now: 'linker' input unused [-Wunused-command-line-argument]
      In file included from /usr/local/src/mariadb-10.4.7/storage/rocksdb/rocksdb/db/malloc_stats.cc:16:
      /usr/local/src/mariadb-10.4.7/storage/rocksdb/rocksdb/port/jemalloc_helper.h:44:19: error: redefinition of
            'malloc_usable_size' as different kind of symbol
      extern "C" size_t malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void*)
                        ^
      /usr/include/malloc_np.h:71:8: note: previous definition is here
      size_t  malloc_usable_size(const void *ptr);
              ^
      In file included from /usr/local/src/mariadb-10.4.7/storage/rocksdb/rocksdb/db/malloc_stats.cc:16:
      /usr/local/src/mariadb-10.4.7/storage/rocksdb/rocksdb/port/jemalloc_helper.h:44:38: error: use of undeclared
            identifier 'JEMALLOC_USABLE_SIZE_CONST'
      extern "C" size_t malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void*)
                                           ^
      /usr/local/src/mariadb-10.4.7/storage/rocksdb/rocksdb/port/jemalloc_helper.h:44:71: error: expected ';' after top
            level declarator
      extern "C" size_t malloc_usable_size(JEMALLOC_USABLE_SIZE_CONST void*)
                                                                            ^
                                                                            ;
      /usr/local/src/mariadb-10.4.7/storage/rocksdb/rocksdb/port/jemalloc_helper.h:45:24: warning: declaration does not
            declare anything [-Wmissing-declarations]
          JEMALLOC_CXX_THROW __attribute__((__weak__));
                             ^
      /usr/local/src/mariadb-10.4.7/storage/rocksdb/rocksdb/port/jemalloc_helper.h:58:43: warning: comparison of function
            'malloc_usable_size' not equal to a null pointer is always true [-Wtautological-pointer-compare]
               malloc_stats_print != nullptr && malloc_usable_size != nullptr;
                                                ^~~~~~~~~~~~~~~~~~    ~~~~~~~
      /usr/local/src/mariadb-10.4.7/storage/rocksdb/rocksdb/port/jemalloc_helper.h:58:43: note: prefix with the address-of
            operator to silence this warning
               malloc_stats_print != nullptr && malloc_usable_size != nullptr;
                                                ^
                                                &
      2 warnings and 3 errors generated.
      *** Error code 1
       
      Stop.
      make[2]: stopped in /usr/local/src/mariadb-10.4.7
      *** Error code 1
       
      Stop.
      make[1]: stopped in /usr/local/src/mariadb-10.4.7
      *** Error code 1
       
      Stop.
      make: stopped in /usr/local/src/mariadb-10.4.7
      

      Attachments

        Activity

          spil Bernard Spil added a comment - - edited

          FreeBSD ships with jemalloc in the OS. Likely the root of this issue...

          PS. I'm the maintainer of the MariaDB ports on FreeBSD..

          spil Bernard Spil added a comment - - edited FreeBSD ships with jemalloc in the OS. Likely the root of this issue... PS. I'm the maintainer of the MariaDB ports on FreeBSD..
          spil Bernard Spil added a comment - - edited

          See also FreeBSD PR239653

          Patch provided there

          JEMALLOC_USABLE_SIZE_CONST is not defined in FreeBSD's jemalloc(3), define the
          macro to "const".
           
          This prevents build failures in FreeBSD.
           
          Reference upstream bug report: https://jira.mariadb.org/browse/MDEV-20248
          --- storage/rocksdb/rocksdb/port/jemalloc_helper.h.orig	2019-08-12 02:20:55 UTC
          +++ storage/rocksdb/rocksdb/port/jemalloc_helper.h
          @@ -12,6 +12,10 @@
           #include <jemalloc/jemalloc.h>
           #endif
           
          +#ifdef __FreeBSD__
          +#define JEMALLOC_USABLE_SIZE_CONST const
          +#endif
          +
           #ifndef JEMALLOC_CXX_THROW
           #define JEMALLOC_CXX_THROW
           #endif
          

          spil Bernard Spil added a comment - - edited See also FreeBSD PR239653 Patch provided there JEMALLOC_USABLE_SIZE_CONST is not defined in FreeBSD's jemalloc(3), define the macro to "const".   This prevents build failures in FreeBSD.   Reference upstream bug report: https://jira.mariadb.org/browse/MDEV-20248 --- storage/rocksdb/rocksdb/port/jemalloc_helper.h.orig 2019-08-12 02:20:55 UTC +++ storage/rocksdb/rocksdb/port/jemalloc_helper.h @@ -12,6 +12,10 @@ #include <jemalloc/jemalloc.h> #endif +#ifdef __FreeBSD__ +#define JEMALLOC_USABLE_SIZE_CONST const +#endif + #ifndef JEMALLOC_CXX_THROW #define JEMALLOC_CXX_THROW #endif
          gsnw Sebastian added a comment -

          I still had to use MDEV-20258 but patch works thanks to Bernard Spil.

          Is the patch also added to facebook github or should it be done by the ticket creator with reference to this ticket?

          gsnw Sebastian added a comment - I still had to use MDEV-20258 but patch works thanks to Bernard Spil. Is the patch also added to facebook github or should it be done by the ticket creator with reference to this ticket?
          TheLinuxJedi Andrew Hutchings (Inactive) added a comment - Upstream pull request created: https://github.com/facebook/rocksdb/pull/10575

          Fix has been merged upstream

          TheLinuxJedi Andrew Hutchings (Inactive) added a comment - Fix has been merged upstream

          People

            TheLinuxJedi Andrew Hutchings (Inactive)
            gsnw Sebastian
            Votes:
            0 Vote for this issue
            Watchers:
            5 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.