[MDEV-15353] use of undeclared identifier 'pthread_mutex_timedlock' in Mac OS Created: 2018-02-19  Updated: 2018-06-20

Status: Open
Project: MariaDB Server
Component/s: Compiling, Storage Engine - TokuDB
Affects Version/s: 10.1.31
Fix Version/s: 10.1

Type: Bug Priority: Major
Reporter: Jota Assignee: Vicențiu Ciorbaru
Resolution: Unresolved Votes: 0
Labels: None
Environment:

OS X 10.10.5


Attachments: Text File mariadb_10.1.31.patch    
Issue Links:
Relates
relates to MDEV-15446 use of undeclared identifiers pthread... Open

 Description   

Hi everyone,

We are trying to build the latest version of MariaDB 10.1.x (10.1.31) and we are running into this error message when running the make command:

/output_directory/src/mariadb-10.1.31/storage/tokudb/PerconaFT/ft/txn/txn.cc:271:19: warning: missing field '__opaque' initializer [-Wmissing-field-initializers]
    .state_cond = ZERO_COND_INITIALIZER,  // Not TOKU_COND_INITIALIZER
                  ^
/output_directory/src/mariadb-10.1.31/storage/tokudb/PerconaFT/portability/toku_pthread.h:167:13: note: expanded from macro 'ZERO_COND_INITIALIZER'
        { 0 }                 \
            ^
/output_directory/src/mariadb-10.1.31/storage/tokudb/PerconaFT/ft/txn/txn.cc:271:19: warning: missing field 'psi_cond' initializer [-Wmissing-field-initializers]
/output_directory/src/mariadb-10.1.31/storage/tokudb/PerconaFT/portability/toku_pthread.h:168:5: note: expanded from macro 'ZERO_COND_INITIALIZER'
    }
    ^
2 warnings generated.
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libtokufractaltree_static.a(tokufractaltree_static_depends.cc.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libtokufractaltree_static.a(tokufractaltree_static_depends.cc.o) has no symbols
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: libtokufractaltree_static.a the table of contents is empty (no object file members in the library define global symbols)
/Library/Developer/CommandLineTools/usr/bin/libtool: warning same member name (loader.cc.o) in output file used for input files: /output_directory/src/mariadb-10.1.31/storage/tokudb/PerconaFT/ft/libft_static.a(loader.cc.o) and: /output_directory/src/mariadb-10.1.31/storage/tokudb/PerconaFT/src/libtokudb_static_conv.a(loader.cc.o) due to use of basename, truncation and blank padding
In file included from /output_directory/src/mariadb-10.1.31/storage/tokudb/ha_tokudb.cc:26:
In file included from /output_directory/src/mariadb-10.1.31/storage/tokudb/hatoku_hton.h:29:
In file included from /output_directory/src/mariadb-10.1.31/storage/tokudb/hatoku_defines.h:36:
/output_directory/src/mariadb-10.1.31/sql/sql_class.h:5196:5: warning: 'register' storage class specifier is deprecated [-Wdeprecated-register]
    register ulonglong max_elems_in_tree=
    ^~~~~~~~~
In file included from /output_directory/src/mariadb-10.1.31/storage/tokudb/ha_tokudb.cc:26:
In file included from /output_directory/src/mariadb-10.1.31/storage/tokudb/hatoku_hton.h:33:
/output_directory/src/mariadb-10.1.31/storage/tokudb/tokudb_thread.h:377:13: error: use of undeclared identifier 'pthread_mutex_timedlock'
    int r = pthread_mutex_timedlock(&_mutex, &waittime);
            ^
/output_directory/src/mariadb-10.1.31/storage/tokudb/tokudb_thread.h:485:13: error: use of undeclared identifier 'pthread_mutex_timedlock'
    int r = pthread_mutex_timedlock(&_mutex, &waittime);
            ^
1 warning and 2 errors generated.
make[2]: *** [storage/tokudb/CMakeFiles/tokudb.dir/ha_tokudb.cc.o] Error 1
make[1]: *** [storage/tokudb/CMakeFiles/tokudb.dir/all] Error 2
make: *** [all] Error 2

As you can see, there are some undeclared variables during the execution of the make command that make the compilation to fail. We noticed that there were a lot of changes between MariaDB 10.1.30 and 10.1.31 to update TokuDB from `5.6.37-82.2` to `5.6.38-83.0`. In order to fix the issue, we took the lines from the previous MariaDB version that set that variable (see attached file)

Information about the different components we are using to build MariaDB:

  • System Version: OS X 10.10.5
  • cmake: 3.6.1
  • make: 3.81
  • clang: Apple LLVM version 7.0.2 (clang-700.1.81)

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