[MDEV-8073] Build error in sql/mdl.cc on OS X 10.10 Created: 2015-04-28  Updated: 2015-04-30  Resolved: 2015-04-30

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.1.4
Fix Version/s: 10.1.5

Type: Bug Priority: Major
Reporter: Kolbe Kegel (Inactive) Assignee: Sergey Vojtovich
Resolution: Fixed Votes: 1
Labels: None
Environment:

Mac OS X 10.10.



 Description   

cmake ../server/ -DBUILD_CONFIG=mysql_release -DWITH_WSREP=OFF -DPLUGIN_TOKUDB=NO -DPLUGIN_MROONGA=NO

[ 43%] Building CXX object sql/CMakeFiles/sql.dir/mdl.cc.o
/Users/kolbe/Devel/git/maria/server/sql/mdl.cc:562:43: error: default initialization of an object of const type 'const MDL_lock::MDL_scoped_lock' requires a user-provided default constructor
const MDL_lock::MDL_scoped_lock MDL_lock::m_scoped_lock_strategy;
                                          ^
/Users/kolbe/Devel/git/maria/server/sql/mdl.cc:563:43: error: default initialization of an object of const type 'const MDL_lock::MDL_object_lock' requires a user-provided default constructor
const MDL_lock::MDL_object_lock MDL_lock::m_object_lock_strategy;
                                          ^
/Users/kolbe/Devel/git/maria/server/sql/mdl.cc:669:39: warning: offset of on non-POD type 'MDL_key' [-Winvalid-offsetof]
  MDL_key *mdl_key= (MDL_key*) (key - offsetof(MDL_key, m_ptr));
                                      ^                 ~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h:87:24: note: expanded from macro 'offsetof'
#define offsetof(t, d) __builtin_offsetof(t, d)
                       ^
1 warning and 2 errors generated.
make[2]: *** [sql/CMakeFiles/sql.dir/mdl.cc.o] Error 1
make[1]: *** [sql/CMakeFiles/sql.dir/all] Error 2
make: *** [all] Error 2



 Comments   
Comment by Daniel Black [ 2015-04-30 ]

Also fails with clang-3.4 on ubuntu x86_64 https://travis-ci.org/openquery/mariadb-server/jobs/60551855

This is the only error in the build. Plenty of warnings (that should be addressed) however.

edit: removed 10.0 tag - think i merged 10.1 into my build accidentally.

Comment by Daniel Black [ 2015-04-30 ]

thanks for the quick fix. confirmed as building as expected. https://travis-ci.org/openquery/mariadb-server/jobs/60670668

Nice background research in the bug.

I raised a llvm/clang bug report: https://llvm.org/bugs/show_bug.cgi?id=23381

Generated at Thu Feb 08 07:24:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.