Bug #74100 clang/xcode 6.0 -DMYSQL_MAINTAINER_MODE=1 build failure
Submitted: 26 Sep 2014 8:49 Modified: 13 Sep 2016 17:18
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.7.5 OS:MacOS (10.9)
Assigned to: CPU Architecture:Any

[26 Sep 2014 8:49] Laurynas Biveinis
Description:
$ cmake -DWITH_DEBUG=ON -DMYQSL_MAINTAINER_MODE=1
...
$ make
...
[ 16%] Building C object mysys/CMakeFiles/mysys.dir/stacktrace.c.o
/Users/laurynas/percona/lp-mysql-server/mysql-server/mysys/stacktrace.c:144:21: error: 'sbrk' is deprecated [-Werror,-Wdeprecated-declarations]
  heap_end= (char*) sbrk(0);
                    ^
/usr/include/unistd.h:582:7: note: 'sbrk' has been explicitly marked deprecated here
void    *sbrk(int);
         ^
1 error generated.
make[2]: *** [mysys/CMakeFiles/mysys.dir/stacktrace.c.o] Error 1
make[1]: *** [mysys/CMakeFiles/mysys.dir/all] Error 2
make: *** [all] Error 2

$ clang --version
Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

How to repeat:
See above

Suggested fix:
Fix the 6.0 warnings
[26 Sep 2014 12:00] MySQL Verification Team
[ 17%] Building C object mysys/CMakeFiles/mysys.dir/stacktrace.c.o
/Users/miguel/mysql-5.7.5-m15/mysys/stacktrace.c:144:21: warning: 'sbrk' is deprecated [-Wdeprecated-declarations]
  heap_end= (char*) sbrk(0);
                    ^
/usr/include/unistd.h:582:7: note: 'sbrk' declared here
void    *sbrk(int);
         ^
1 warning generated.

Users/miguel/mysql-5.7.5-m15/boost/boost_1_55_0/boost/geometry/strategies/concepts/convex_hull_concept.hpp:51:27: note: initialize the variable 'st' to silence
      this warning
            state_type* st;
                          ^
                           = NULL
/Users/miguel/mysql-5.7.5-m15/boost/boost_1_55_0/boost/geometry/strategies/concepts/convex_hull_concept.hpp:59:50: warning: variable 'v' is uninitialized when
      used here [-Wuninitialized]
            str->result(*st, std::back_inserter(*v), true);
                                                 ^
/Users/miguel/mysql-5.7.5-m15/boost/boost_1_55_0/boost/geometry/strategies/concepts/convex_hull_concept.hpp:53:39: note: initialize the variable 'v' to silence
      this warning
            std::vector<point_type> *v;
                                      ^
                                       = NULL
20 warnings generated.
[ 53%] Building CXX object sql/CMakeFiles/sql.dir/item_row.cc.o
[ 53%] Building CXX object sql/CMakeFiles/sql.dir/item_strfunc.cc.o

      [-Wunneeded-internal-declaration]
static PSI_socket_info all_server_sockets[]=
                       ^
1 warning generated.
[ 83%] Building C object libmysqld/CMakeFiles/sql_embedded.dir/libmysqld.c.o
[ 84%] Building CXX object libmysqld/CMakeFiles/sql_embedded.dir/__/sql/sql_builtin.cc.o

[08:59:31][pochita:]mysql-5.7.5-m15 miguel$ clang --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
[26 Sep 2014 12:05] MySQL Verification Team
Thank you for the bug report.
[17 Jun 2016 18:16] Paul DuBois
Posted by developer:
 
Fixed in 8.0.0.

Compilation failed on OS X when MySQL was configured with
-DMYSQL_MAINTAINER_MODE=1 and compiled with clang/Xcode 6.0.
[13 Sep 2016 6:12] Laurynas Biveinis
commit ff53f03cdc600b2d5134dbbdc4e340213c1c8101
Author: Jon Olav Hauglid <jon.hauglid@oracle.com>
Date:   Thu Jun 16 09:34:41 2016 +0200

    Bug#23575445: NO STACK TRACE ON CRASH IN FREEBSD
    
    Stack traces were not printed by our signal handler on FreeBSD
    since we didn't find backtrace(). However, since FreeBSD 10.0
    backtrace() is available, but it requires the execinfo library.
    
    This patch fixes the problem by adding -lexecinfo when
    doing CMake configure checks and when linking the server
    (if execinfo exists). Note that the number of stack frames
    returned by backtrace() seems very limited - at least on
    FreeBSD 10.2.
    
    Also, the PTR_SANE macro which tries to check if a pointer
    is invalid (used when printing pointer values in stack traces)
    gave false negatives on OSX/FreeBSD. On these platforms we
    now simply check if the pointer is non-null. This also removes
    a sbrk() deprecation warning when building on OS X. (It was
    before only disabled with building using XCode).
[13 Sep 2016 17:18] Laurynas Biveinis
bug 82975