diff options
author | Werner Koch <[email protected]> | 2014-08-05 17:32:51 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-08-05 17:32:51 +0000 |
commit | 3325403c0dd2949bf52efa1b9a5b5cf3191110f9 (patch) | |
tree | a8293b188cd61b02aa36b1ebe739aa7cc047d8b3 /src/gen-posix-lock-obj.c | |
parent | Add new lock-obj-pub.*.h from debian buildds. (diff) | |
download | libgpg-error-3325403c0dd2949bf52efa1b9a5b5cf3191110f9.tar.gz libgpg-error-3325403c0dd2949bf52efa1b9a5b5cf3191110f9.zip |
Use 16 byte alignment for hppa-unknown-linux-gnu.
* configure.ac (HAVE_GCC_ATTRIBUTE_ALIGNED): New.
* src/gen-posix-lock-obj.c (USE_16BYTE_ALIGNMENT): Set for HPPA-Linux.
(main): Enforce alignment if needed.
* src/syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h: Use 16 byte
alignment.
--
Debian-bug-id: 757060
Diffstat (limited to 'src/gen-posix-lock-obj.c')
-rw-r--r-- | src/gen-posix-lock-obj.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/gen-posix-lock-obj.c b/src/gen-posix-lock-obj.c index df732c3..d2bc645 100644 --- a/src/gen-posix-lock-obj.c +++ b/src/gen-posix-lock-obj.c @@ -40,6 +40,19 @@ # error sizeof pthread_mutex_t is not known. #endif +/* Special requirements for certain platforms. */ +#if defined(__hppa__) && defined(__linux__) +# define USE_16BYTE_ALIGNMENT 1 +#else +# define USE_16BYTE_ALIGNMENT 0 +#endif + + +#if USE_16BYTE_ALIGNMENT && !HAVE_GCC_ATTRIBUTE_ALIGNED +# error compiler is not able to enforce a 16 byte alignment +#endif + + static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER; @@ -76,6 +89,7 @@ main (void) " long _vers;\n" " union {\n" " volatile char _priv[%d];\n" + "%s" " long _x_align;\n" " long *_xp_align;\n" " } u;\n" @@ -84,6 +98,11 @@ main (void) "#define GPGRT_LOCK_INITIALIZER {%d,{{", HOST_TRIPLET_STRING, SIZEOF_PTHREAD_MUTEX_T, +#if USE_16BYTE_ALIGNMENT + " int _x16_align __attribute__ ((aligned (16)));\n", +#else + "", +#endif LOCK_ABI_VERSION); p = (unsigned char *)&mtx; for (i=0; i < sizeof mtx; i++) |