summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2012-10-30 02:02:05 +0000
committerPádraig Brady <P@draigBrady.com>2012-11-04 00:49:04 +0000
commitda1329e715250faf950ce497a7d7601845c2b119 (patch)
tree1f300a2ad6d39bf2f129ba94e0de47d7e43de874
parent6108baa47e90aaefb83eb230e2e063906ca14e87 (diff)
downloadcoreutils-da1329e715250faf950ce497a7d7601845c2b119.tar.xz
build: avoid build failure on some HPPA systems
* src/longlong.h: Restrict some HPPA assembly variants to PA RISC V2.0. Note we also avoid this assembly for ilp32 runtimes, since even though the assembly is accepted there, it's not safe as the context can get clobbered between the 'add' and 'add,dc'. This fixes a compile failure with newer HPPA systems with default GCC CPU options. Reported by John David Anglin
-rw-r--r--src/longlong.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/longlong.h b/src/longlong.h
index 8d7161113..6ee157cda 100644
--- a/src/longlong.h
+++ b/src/longlong.h
@@ -679,7 +679,13 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
/* These macros are for ABI=2.0w. In ABI=2.0n they can't be used, since GCC
(3.2) puts longlong into two adjacent 32-bit registers. Presumably this
is just a case of no direct support for 2.0n but treating it like 1.0. */
-#if defined (__hppa) && W_TYPE_SIZE == 64 && ! defined (_LONG_LONG_LIMB)
+#if defined (__hppa) && W_TYPE_SIZE == 64 && ! defined (_LONG_LONG_LIMB) \
+ && defined (_PA_RISC2_0) && defined (_LP64)
+/* Note the _PA_RISC2_0 above is to exclude this code from GCC with
+ default -march options which doesn't support these instructions.
+ Also the width check for 'long' is to avoid ilp32 runtimes where
+ GNU/Linux and narrow HP-UX kernels are known to have issues with
+ clobbering of context between the add and add,dc instructions. */
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
__asm__ ("add%I5 %5,%r4,%1\n\tadd,dc %r2,%r3,%0" \
: "=r" (sh), "=&r" (sl) \