Commit 29b4bd4e authored by Daniel Black's avatar Daniel Black

MDEV-30573 Server doesn't build with GCOV by GCC 11+

__gcov_flush was never an external symbol in the documentation.

It was removed in gcc-11. The correct function to use is __gcov_dump
which is defined in the gcov.h header.
parent 9f16d153
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
#include <m_string.h> #include <m_string.h>
#include <errno.h> #include <errno.h>
#ifdef HAVE_gcov #ifdef HAVE_gcov
extern void __gcov_flush(); #include <gcov.h>
#endif #endif
#ifndef DBUG_OFF #ifndef DBUG_OFF
...@@ -2212,7 +2212,7 @@ void _db_suicide_() ...@@ -2212,7 +2212,7 @@ void _db_suicide_()
fprintf(stderr, "SIGKILL myself\n"); fprintf(stderr, "SIGKILL myself\n");
fflush(stderr); fflush(stderr);
#ifdef HAVE_gcov #ifdef HAVE_gcov
__gcov_flush(); __gcov_dump();
#endif #endif
retval= kill(getpid(), SIGKILL); retval= kill(getpid(), SIGKILL);
...@@ -2262,7 +2262,7 @@ my_bool _db_my_assert(const char *file, int line, const char *msg) ...@@ -2262,7 +2262,7 @@ my_bool _db_my_assert(const char *file, int line, const char *msg)
fprintf(stderr, "%s:%d: assert: %s\n", file, line, msg); fprintf(stderr, "%s:%d: assert: %s\n", file, line, msg);
fflush(stderr); fflush(stderr);
#ifdef HAVE_gcov #ifdef HAVE_gcov
__gcov_flush(); __gcov_dump();
#endif #endif
} }
return a; return a;
......
...@@ -34,6 +34,9 @@ ...@@ -34,6 +34,9 @@
#include <execinfo.h> #include <execinfo.h>
#endif #endif
#ifdef HAVE_gcov
#include <gcov.h>
#endif
/** /**
Default handler for printing stacktrace Default handler for printing stacktrace
*/ */
...@@ -409,9 +412,6 @@ void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack, ...@@ -409,9 +412,6 @@ void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack,
/* Produce a core for the thread */ /* Produce a core for the thread */
void my_write_core(int sig) void my_write_core(int sig)
{ {
#ifdef HAVE_gcov
extern void __gcov_flush(void);
#endif
signal(sig, SIG_DFL); signal(sig, SIG_DFL);
#ifdef HAVE_gcov #ifdef HAVE_gcov
/* /*
...@@ -419,7 +419,7 @@ void my_write_core(int sig) ...@@ -419,7 +419,7 @@ void my_write_core(int sig)
information from this process, causing gcov output to be incomplete. information from this process, causing gcov output to be incomplete.
So we force the writing of coverage information here before terminating. So we force the writing of coverage information here before terminating.
*/ */
__gcov_flush(); __gcov_dump();
#endif #endif
pthread_kill(pthread_self(), sig); pthread_kill(pthread_self(), sig);
#if defined(P_MYID) && !defined(SCO) #if defined(P_MYID) && !defined(SCO)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment