aboutsummaryrefslogtreecommitdiffstats
path: root/src/gen-posix-lock-obj.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2016-02-26 00:29:14 +0000
committerNIIBE Yutaka <[email protected]>2016-02-26 00:29:14 +0000
commit5168b97fb5e2eebdc99b40f96f9b6289647e87d2 (patch)
tree77b997b8deace92efa60f0baba4701627a8e5976 /src/gen-posix-lock-obj.c
parentbuild: Create an SWDB file during "make distcheck" (diff)
downloadlibgpg-error-5168b97fb5e2eebdc99b40f96f9b6289647e87d2.tar.gz
libgpg-error-5168b97fb5e2eebdc99b40f96f9b6289647e87d2.zip
Add support for Solaris, fixing HPPA.
* configure.ac (HAVE_GCC_ATTRIBUTE_ALIGNED): Remove. (LIB_SCHED_YIELD): New. Check sched_yield in -lrt. * src/gen-posix-lock-obj.c (USE_16BYTE_ALIGNMENT): Remove. (USE_DOUBLE_FOR_ALIGNMENT, USE_LONG_DOUBLE_FOR_ALIGNMENT): New. * src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h: Update. -- Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'src/gen-posix-lock-obj.c')
-rw-r--r--src/gen-posix-lock-obj.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/gen-posix-lock-obj.c b/src/gen-posix-lock-obj.c
index 22de456..83356ad 100644
--- a/src/gen-posix-lock-obj.c
+++ b/src/gen-posix-lock-obj.c
@@ -43,15 +43,15 @@
#endif
/* Special requirements for certain platforms. */
-#if defined(__hppa__) && defined(__linux__)
-# define USE_16BYTE_ALIGNMENT 1
+#if defined(__solaris__) && (defined (__ILP32__) || defined(_ILP32))
+# define USE_DOUBLE_FOR_ALIGNMENT 1
#else
-# define USE_16BYTE_ALIGNMENT 0
+# define USE_DOUBLE_FOR_ALIGNMENT 0
#endif
-
-
-#if USE_16BYTE_ALIGNMENT && !HAVE_GCC_ATTRIBUTE_ALIGNED
-# error compiler is not able to enforce a 16 byte alignment
+#if defined(__hppa__)
+# define USE_LONG_DOUBLE_FOR_ALIGNMENT 1
+#else
+# define USE_LONG_DOUBLE_FOR_ALIGNMENT 0
#endif
#ifdef USE_POSIX_THREADS
@@ -116,8 +116,10 @@ main (void)
"\n"
"#define GPGRT_LOCK_INITIALIZER {%d,{{",
SIZEOF_PTHREAD_MUTEX_T,
-# if USE_16BYTE_ALIGNMENT
- " int _x16_align __attribute__ ((aligned (16)));\n",
+# if USE_DOUBLE_FOR_ALIGNMENT
+ " double _xd_align;\n",
+# elif USE_LONG_DOUBLE_FOR_ALIGNMENT
+ " long double _xld_align;\n",
# else
"",
# endif