Browse Source

Detect s390x and sparc64 as 32-bit architectures.

CLN fails to build on s390x and sparc64 as it detects them as 32-bit
architectures, due to __s390__ and __sparc__ matching respectively both
s390 and s390x, and both sparc and sparc64. The patch below fixes the
issue. (Reported as Debian bug#639494.)

Thanks to Aurelien Jarno <aurel32@debian.org>.
master
Richard Kreckel 13 years ago
parent
commit
b86458e11f
  1. 4
      include/cln/host_cpu.h.in
  2. 4
      include/cln/object.h
  3. 8
      include/cln/types.h

4
include/cln/host_cpu.h.in

@ -75,5 +75,9 @@
#undef __s390__ #undef __s390__
#endif #endif
#ifndef __s390x__
#undef __s390x__
#endif
#endif /* _CL_HOST_CPU_CONFIG_H */ #endif /* _CL_HOST_CPU_CONFIG_H */

4
include/cln/object.h

@ -22,10 +22,10 @@ namespace cln {
#if defined(__m68k__) #if defined(__m68k__)
#define cl_word_alignment 2 #define cl_word_alignment 2
#endif #endif
#if defined(__i386__) || defined(__mips__) || defined(__mipsel__) || (defined(__sparc__) && !defined(__sparc64__)) || defined(__hppa__) || defined(__arm__) || defined(__rs6000__) || defined(__m88k__) || defined(__convex__) || defined(__s390__) || defined(__sh__)
#if defined(__i386__) || defined(__mips__) || defined(__mipsel__) || (defined(__sparc__) && !defined(__arch64__)) || defined(__hppa__) || defined(__arm__) || defined(__rs6000__) || defined(__m88k__) || defined(__convex__) || (defined(__s390__) && !defined(__s390x__)) || defined(__sh__)
#define cl_word_alignment 4 #define cl_word_alignment 4
#endif #endif
#if defined(__alpha__) || defined(__ia64__) || defined(__mips64__) || defined(__powerpc64__) || defined(__sparc64__) || defined(__x86_64__)
#if defined(__alpha__) || defined(__ia64__) || defined(__mips64__) || defined(__powerpc64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__x86_64__) || defined(__s390x__)
#define cl_word_alignment 8 #define cl_word_alignment 8
#endif #endif
#if !defined(cl_word_alignment) #if !defined(cl_word_alignment)

8
include/cln/types.h

@ -48,7 +48,7 @@
#undef HAVE_LONGLONG #undef HAVE_LONGLONG
#endif #endif
#endif #endif
#if defined(HAVE_LONGLONG) && (defined(__alpha__) || defined(__ia64__) || defined(__mips64__) || defined(__powerpc64__) || defined(__sparc64__) || defined(__x86_64__))
#if defined(HAVE_LONGLONG) && (defined(__alpha__) || defined(__ia64__) || defined(__mips64__) || defined(__powerpc64__) || defined(__s390x__) || (defined(__sparc__) && defined(__arch64__)) || defined(__x86_64__))
// 64 bit registers in hardware // 64 bit registers in hardware
#define HAVE_FAST_LONGLONG #define HAVE_FAST_LONGLONG
#endif #endif
@ -76,7 +76,7 @@
// Integer type used for counters. // Integer type used for counters.
// Constraint: sizeof(uintC) >= sizeof(uintL) // Constraint: sizeof(uintC) >= sizeof(uintL)
#if (defined(HAVE_FAST_LONGLONG) && (defined(__alpha__) || defined(__ia64__) || defined(__powerpc64__) || defined(__x86_64__)))
#if (defined(HAVE_FAST_LONGLONG) && (defined(__alpha__) || defined(__ia64__) || defined(__powerpc64__) || defined(__s390x__) || (defined(__sparc__) && defined(__arch64__)) || defined(__x86_64__)))
#define intCsize long_bitsize #define intCsize long_bitsize
typedef long sintC; typedef long sintC;
typedef unsigned long uintC; typedef unsigned long uintC;
@ -88,7 +88,7 @@
// Integer type used for lfloat exponents. // Integer type used for lfloat exponents.
// Constraint: sizeof(uintE) >= sizeof(uintC) // Constraint: sizeof(uintE) >= sizeof(uintC)
#if (defined(HAVE_LONGLONG) && (defined(__alpha__) || defined(__ia64__) || defined(__powerpc64__) || defined(__x86_64__) || defined(__i386__) || defined(__mips__) || defined(__rs6000__)))
#if (defined(HAVE_LONGLONG) && (defined(__alpha__) || defined(__ia64__) || defined(__powerpc64__) || defined(__s390x__) || (defined(__sparc__) && defined(__arch64__)) || defined(__x86_64__) || defined(__i386__) || defined(__mips__) || defined(__rs6000__)))
#define intEsize 64 #define intEsize 64
typedef sint64 sintE; typedef sint64 sintE;
typedef uint64 uintE; typedef uint64 uintE;
@ -127,7 +127,7 @@
typedef int sintD; typedef int sintD;
typedef unsigned int uintD; typedef unsigned int uintD;
#else // we are not using GMP, so just guess something reasonable #else // we are not using GMP, so just guess something reasonable
#if (defined(HAVE_FAST_LONGLONG) && (defined(__alpha__) || defined(__ia64__) || defined(__powerpc64__) || defined(__x86_64__)))
#if (defined(HAVE_FAST_LONGLONG) && (defined(__alpha__) || defined(__ia64__) || defined(__powerpc64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__s390x__) || defined(__x86_64__)))
#define intDsize 64 #define intDsize 64
typedef sint64 sintD; typedef sint64 sintD;
typedef uint64 uintD; typedef uint64 uintD;

Loading…
Cancel
Save