mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
Step 2 of the switch to support configuration with NPTL:
Define a new CPP symbol that the target OS is Linux, and use it where only the OS matters and not the threads Library. Until now, 'HAVE_LINUXTHREADS' was used to indicate "Target is Linux" in many places. When we support configuration with NPTL but no Linuxthreads, this misuse must cease.
This commit is contained in:
parent
48ba5e4956
commit
eaa79cb452
6 changed files with 11 additions and 10 deletions
|
@ -412,6 +412,7 @@ then
|
|||
MYSQLD_DEFAULT_SWITCHES="--skip-locking"
|
||||
TARGET_LINUX="true"
|
||||
AC_MSG_RESULT("yes");
|
||||
AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux])
|
||||
else
|
||||
MYSQLD_DEFAULT_SWITCHES=""
|
||||
TARGET_LINUX="false"
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
|
||||
|
||||
/* Fix problem with S_ISLNK() on Linux */
|
||||
#if defined(HAVE_LINUXTHREADS)
|
||||
#if defined(TARGET_OS_LINUX)
|
||||
#undef _GNU_SOURCE
|
||||
#define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
@ -214,13 +214,13 @@ C_MODE_START int __cxa_pure_virtual() {\
|
|||
#endif
|
||||
|
||||
/* In Linux-alpha we have atomic.h if we are using gcc */
|
||||
#if defined(HAVE_LINUXTHREADS) && defined(__GNUC__) && defined(__alpha__) && (__GNUC__ > 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 95)) && !defined(HAVE_ATOMIC_ADD)
|
||||
#if defined(TARGET_OS_LINUX) && defined(__GNUC__) && defined(__alpha__) && (__GNUC__ > 2 || ( __GNUC__ == 2 && __GNUC_MINOR__ >= 95)) && !defined(HAVE_ATOMIC_ADD)
|
||||
#define HAVE_ATOMIC_ADD
|
||||
#define HAVE_ATOMIC_SUB
|
||||
#endif
|
||||
|
||||
/* In Linux-ia64 including atomic.h will give us an error */
|
||||
#if (defined(HAVE_LINUXTHREADS) && defined(__GNUC__) && (defined(__ia64__)||defined(__powerpc64__))) || !defined(THREAD)
|
||||
#if (defined(TARGET_OS_LINUX) && defined(__GNUC__) && (defined(__ia64__)||defined(__powerpc64__))) || !defined(THREAD)
|
||||
#undef HAVE_ATOMIC_ADD
|
||||
#undef HAVE_ATOMIC_SUB
|
||||
#endif
|
||||
|
@ -755,7 +755,7 @@ typedef unsigned long uint32; /* Short for unsigned integer >= 32 bits */
|
|||
error "Neither int or long is of 4 bytes width"
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_ULONG) && !defined(HAVE_LINUXTHREADS) && !defined(__USE_MISC)
|
||||
#if !defined(HAVE_ULONG) && !defined(TARGET_OS_LINUX) && !defined(__USE_MISC)
|
||||
typedef unsigned long ulong; /* Short for unsigned long */
|
||||
#endif
|
||||
#ifndef longlong_defined
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
/* This makes a wrapper for mutex handling to make it easier to debug mutex */
|
||||
|
||||
#include <my_global.h>
|
||||
#if defined(HAVE_LINUXTHREADS) && !defined (__USE_UNIX98)
|
||||
#if defined(TARGET_OS_LINUX) && !defined (__USE_UNIX98)
|
||||
#define __USE_UNIX98 /* To get rw locks under Linux */
|
||||
#endif
|
||||
#if defined(THREAD) && defined(SAFE_MUTEX)
|
||||
|
|
|
@ -43,7 +43,7 @@ void safe_print_str(const char* name, const char* val, int max_len)
|
|||
fputc('\n', stderr);
|
||||
}
|
||||
|
||||
#ifdef HAVE_LINUXTHREADS
|
||||
#ifdef TARGET_OS_LINUX
|
||||
#define SIGRETURN_FRAME_COUNT 2
|
||||
|
||||
#if defined(__alpha__) && defined(__GNUC__)
|
||||
|
@ -201,7 +201,7 @@ end:
|
|||
stack trace is much more helpful in diagnosing the problem, so please do \n\
|
||||
resolve it\n");
|
||||
}
|
||||
#endif /* HAVE_LINUXTHREADS */
|
||||
#endif /* TARGET_OS_LINUX */
|
||||
#endif /* HAVE_STACKTRACE */
|
||||
|
||||
/* Produce a core for the thread */
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LINUXTHREADS
|
||||
#ifdef TARGET_OS_LINUX
|
||||
#if defined(HAVE_STACKTRACE) || (defined (__i386__) || (defined(__alpha__) && defined(__GNUC__)))
|
||||
#undef HAVE_STACKTRACE
|
||||
#define HAVE_STACKTRACE
|
||||
|
@ -30,7 +30,7 @@ extern char* heap_start;
|
|||
void print_stacktrace(gptr stack_bottom, ulong thread_stack);
|
||||
void safe_print_str(const char* name, const char* val, int max_len);
|
||||
#endif /* (defined (__i386__) || (defined(__alpha__) && defined(__GNUC__))) */
|
||||
#endif /* HAVE_LINUXTHREADS */
|
||||
#endif /* TARGET_OS_LINUX */
|
||||
|
||||
/* Define empty prototypes for functions that are not implemented */
|
||||
#ifndef HAVE_STACKTRACE
|
||||
|
|
|
@ -101,7 +101,7 @@ static CHARSET_INFO *cs= &my_charset_latin1;
|
|||
set by the user
|
||||
*/
|
||||
|
||||
#if defined(__i386__) && defined(HAVE_LINUXTHREADS)
|
||||
#if defined(__i386__) && defined(TARGET_OS_LINUX)
|
||||
#define DO_STACKTRACE 1
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue