Commit b6a4a2f4 authored by unknown's avatar unknown
Browse files

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.


configure.in:
  Step 2 of the switch to support configuration with NPTL:
  Define a new CPP symbol that the target OS is Linux.
  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.
include/my_global.h:
  Step 2 of the switch to support configuration with NPTL:
  Use the new 'TARGET_OS_LINUX' where only the OS matters and not the threads Library.
mysys/thr_mutex.c:
  Step 2 of the switch to support configuration with NPTL:
  Use the new 'TARGET_OS_LINUX' where only the OS matters and not the threads Library.
sql/stacktrace.c:
  Step 2 of the switch to support configuration with NPTL:
  Use the new 'TARGET_OS_LINUX' where only the OS matters and not the threads Library.
sql/stacktrace.h:
  Step 2 of the switch to support configuration with NPTL:
  Use the new 'TARGET_OS_LINUX' where only the OS matters and not the threads Library.
tools/mysqlmanager.c:
  Step 2 of the switch to support configuration with NPTL:
  Use the new 'TARGET_OS_LINUX' where only the OS matters and not the threads Library.
parent 677fbc7d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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"
+4 −4
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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)
+2 −2
Original line number Diff line number Diff line
@@ -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 @@ terribly wrong...\n");
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 */
+2 −2
Original line number Diff line number Diff line
@@ -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
Loading