]> granicus.if.org Git - postgresql/commitdiff
Attempt to work around a 32bit xlc compiler bug from a different place.
authorAndres Freund <andres@anarazel.de>
Fri, 7 Aug 2015 23:19:02 +0000 (01:19 +0200)
committerAndres Freund <andres@anarazel.de>
Fri, 7 Aug 2015 23:19:02 +0000 (01:19 +0200)
In de6fd1c8 I moved the the work around from 53f73879 into the aix
template. The previous location was removed in the former commit, and I
thought that it would be nice to emit a warning when running configure.

That didn't turn out to work because at the point the template is
included we don't know whether we're compiling a 32/64 bit binary and
it's possible to install compilers for both on a 64 bit kernel/OS.

So go back to a less ambitious approach and define
PG_FORCE_DISABLE_INLINE in port/aix.h, without emitting a warning. We
could try a more fancy approach, but it doesn't seem worth it.

This requires moving the check for PG_FORCE_DISABLE_INLINE in c.h to
after including the system headers included from therein which isn't
perfect, as it seems slightly more robust to include all system headers
in a similar environment. Oh well.

Discussion: 20150807132000.GC13310@awork2.anarazel.de

src/include/c.h
src/include/port/aix.h
src/template/aix

index e84c77460c0250c655ecddb5de171c887ba99f8c..b719eb95e141e05c17ae2a4a1e897bbb6e3b732a 100644 (file)
 #include "pg_config.h"
 #include "pg_config_manual.h"  /* must be after pg_config.h */
 
-/*
- * Force disable inlining if PG_FORCE_DISABLE_INLINE is defined. This is used
- * to work around compiler bugs and might also be useful for investigatory
- * purposes.
- *
- * This is done early (in slightly the wrong section) for two reasons: a) we
- * don't want to include headers with different settings of this b)
- * functionality later in this file might want to rely on inline functions.
- */
-#ifdef PG_FORCE_DISABLE_INLINE
-#undef inline
-#define inline
-#endif
-
 /*
  * We always rely on the WIN32 macro being set by our build system,
  * but _WIN32 is the compiler pre-defined macro. So make sure we define
 #include "pg_config_os.h"
 #endif
 
+/*
+ * Force disable inlining if PG_FORCE_DISABLE_INLINE is defined. This is used
+ * to work around compiler bugs and might also be useful for investigatory
+ * purposes by defining the symbol in the platform's header..
+ *
+ * This is done early (in slightly the wrong section) as functionality later
+ * in this file might want to rely on inline functions.
+ */
+#ifdef PG_FORCE_DISABLE_INLINE
+#undef inline
+#define inline
+#endif
+
 /* Must be before gettext() games below */
 #include <locale.h>
 
index dc4013e46e20111e94b629f900e4e0c65eba2c5b..5b1159c57857494e92f23a57168d76433531ca33 100644 (file)
@@ -3,3 +3,12 @@
  */
 #define CLASS_CONFLICT
 #define DISABLE_XOPEN_NLS
+
+/*
+ * "IBM XL C/C++ for AIX, V12.1" miscompiles, for 32-bit, some inline
+ * expansions of ginCompareItemPointers() "long long" arithmetic.  To take
+ * advantage of inlining, build a 64-bit PostgreSQL.
+ */
+#if defined(__ILP32__) && defined(__IBMC__)
+#define PG_FORCE_DISABLE_INLINE
+#endif
index f12023d7316e200c14c59c94e5365f1751c05fbe..b566ff129df6008b28d3b90470371e30e4f4adb4 100644 (file)
@@ -12,14 +12,6 @@ if test "$GCC" != yes ; then
   esac
 fi
 
-# "IBM XL C/C++ for AIX, V12.1" miscompiles, for 32-bit, some inline
-# expansions of ginCompareItemPointers() "long long" arithmetic.  To
-# take advantage of inlining, build a 64-bit PostgreSQL.
-if test "$GCC" != yes -a $(getconf HARDWARE_BITMODE) == '32'; then
-  echo "$as_me: WARNING: disabling inlining on 32 bit aix due to a bug in xlc" 2>&1
-  CPPFLAGS="$CPPFLAGS -DPG_FORCE_DISABLE_INLINE"
-fi
-
 # Native memset() is faster, tested on:
 #      AIX 5.1 and 5.2, XLC 6.0 (IBM's cc)
 #      AIX 5.3 ML3, gcc 4.0.1