|
From: <sv...@va...> - 2007-11-26 06:03:06
|
Author: sewardj
Date: 2007-11-26 06:03:05 +0000 (Mon, 26 Nov 2007)
New Revision: 7225
Log:
Don't break the build on unknown (to drd) platforms.
Modified:
trunk/exp-drd/pthread_object_size.h
Modified: trunk/exp-drd/pthread_object_size.h
===================================================================
--- trunk/exp-drd/pthread_object_size.h 2007-11-26 02:55:12 UTC (rev 7224)
+++ trunk/exp-drd/pthread_object_size.h 2007-11-26 06:03:05 UTC (rev 7225)
@@ -1,13 +1,15 @@
// TO DO: replace the constants below by macro's #define'd during the configure
// phase.
-#if defined(VGA_x86)
-#define PTHREAD_MUTEX_SIZE 24
-#define PTHREAD_COND_SIZE 48
-#elif defined(VGA_amd64)
-#define PTHREAD_MUTEX_SIZE 40
-#define PTHREAD_COND_SIZE 48
+#if defined(VGP_x86_linux)
+# define PTHREAD_MUTEX_SIZE 24
+# define PTHREAD_COND_SIZE 48
+#elif defined(VGP_amd64_linux)
+# define PTHREAD_MUTEX_SIZE 40
+# define PTHREAD_COND_SIZE 48
#else
-#error Unknown platform
+# warning "Unknown platform for PTHREAD_{MUTEX,COND}_SIZE"
+# define PTHREAD_MUTEX_SIZE 32
+# define PTHREAD_COND_SIZE 32
#endif
#define PTHREAD_SPINLOCK_SIZE 4
|
|
From: Bart V. A. <bar...@gm...> - 2007-11-26 21:03:59
|
Hello Julian,
Sorry that I did not yet provide a version of pthread_object_size.h
that builds on all supported platforms. As was already discussed
briefly in the past, the #define's in this header are a short-term
solution. The question is now how to properly fix this headerfile. An
easy fix would be to write a C program that generates the file
pthread_object_size.h at configure-time. However, this would break
cross-compilation. Is this acceptable ?
Another solution is to compile a program like the one below into
object form and to analyze the output with nm. This would certainly
work on Linux, but would this solution also work on AIX ?
$ cat pthread-object-size.c
#include <pthread.h>
pthread_mutex_t pthread_mutex_var;
pthread_cond_t pthread_cond_var;
$ gcc -c pthread-object-size.c
$ nm -td pthread-object-size.o
0000000000000048 C pthread_cond_var
0000000000000040 C pthread_mutex_var
Bart.
On Nov 26, 2007 7:03 AM, <sv...@va...> wrote:
> Author: sewardj
> Date: 2007-11-26 06:03:05 +0000 (Mon, 26 Nov 2007)
> New Revision: 7225
>
> Log:
> Don't break the build on unknown (to drd) platforms.
>
> Modified:
> trunk/exp-drd/pthread_object_size.h
>
>
> Modified: trunk/exp-drd/pthread_object_size.h
> ===================================================================
> --- trunk/exp-drd/pthread_object_size.h 2007-11-26 02:55:12 UTC (rev 7224)
> +++ trunk/exp-drd/pthread_object_size.h 2007-11-26 06:03:05 UTC (rev 7225)
> @@ -1,13 +1,15 @@
> // TO DO: replace the constants below by macro's #define'd during the configure
> // phase.
>
> -#if defined(VGA_x86)
> -#define PTHREAD_MUTEX_SIZE 24
> -#define PTHREAD_COND_SIZE 48
> -#elif defined(VGA_amd64)
> -#define PTHREAD_MUTEX_SIZE 40
> -#define PTHREAD_COND_SIZE 48
> +#if defined(VGP_x86_linux)
> +# define PTHREAD_MUTEX_SIZE 24
> +# define PTHREAD_COND_SIZE 48
> +#elif defined(VGP_amd64_linux)
> +# define PTHREAD_MUTEX_SIZE 40
> +# define PTHREAD_COND_SIZE 48
> #else
> -#error Unknown platform
> +# warning "Unknown platform for PTHREAD_{MUTEX,COND}_SIZE"
> +# define PTHREAD_MUTEX_SIZE 32
> +# define PTHREAD_COND_SIZE 32
> #endif
> #define PTHREAD_SPINLOCK_SIZE 4
|