Re: [BUGS] ./configure error: Cannot find a working 64-bit integer type

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUGS] ./configure error: Cannot find a working 64-bit integer type
Дата
Msg-id 17306.1507652788@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [BUGS] ./configure error: Cannot find a working 64-bit integer type  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
I wrote:
> The problem with configure is that it *expects* to get failures,
> and silently copes with them.  This means that whenever
> $blithering_idiot_compiler_maintainer decides that some legal-per-spec
> coding pattern deserves a warning, -Werror will mean that configure
> decides that features are missing from your O/S, and then we silently
> work around them as best we can.  This is not what you want to have
> happen.

Just to prove the point, I applied the proposed patch, ran configure
with CFLAGS="-O2 -Werror", and compared the output to what I normally
get.

I first had to remove --with-python, because it said that Python.h
couldn't be compiled.  The logfile shows

configure:15997: gcc -c -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels
-Wmissing-format-attribute-Wformat-security -fno-strict-aliasing -fwrapv -g -O2 -Werror -I/usr/include/python2.6
-D_GNU_SOURCE conftest.c >&5 
In file included from /usr/include/python2.6/pyconfig.h:6,
                 from /usr/include/python2.6/Python.h:8,
                 from conftest.c:197:
/usr/include/python2.6/pyconfig-64.h:1034:1: error: "_POSIX_C_SOURCE" redefined
In file included from /usr/include/stdio.h:28,
                 from conftest.c:164:
/usr/include/features.h:162:1: error: this is the location of the previous definition
In file included from /usr/include/python2.6/pyconfig.h:6,
                 from /usr/include/python2.6/Python.h:8,
                 from conftest.c:197:
/usr/include/python2.6/pyconfig-64.h:1043:1: error: "_XOPEN_SOURCE" redefined
In file included from /usr/include/stdio.h:28,
                 from conftest.c:164:
/usr/include/features.h:164:1: error: this is the location of the previous definition

It's not clear to me why those complaints show up in this mode, because
I don't see them when actually building PG.  So the blame might lie with
Autoconf or with Python, but in any case this is likely not something
PG could fix.

Without that option, the configure run went through, but I got all of the
attached diffs in pg_config.h, none of which are good.  The build step
failed immediately, apparently because of the incorrect conclusions about
builtin bswap functions.

            regards, tom lane

--- src/include/pg_config.h.save    2017-10-10 11:15:40.160422393 -0400
+++ src/include/pg_config.h    2017-10-10 12:10:55.461411757 -0400
@@ -76,7 +76,7 @@
 #define FLOAT8PASSBYVAL true

 /* Define to 1 if gettimeofday() takes only 1 argument. */
-/* #undef GETTIMEOFDAY_1ARG */
+#define GETTIMEOFDAY_1ARG 1

 #ifdef GETTIMEOFDAY_1ARG
 # define gettimeofday(a,b) gettimeofday(a)
@@ -101,7 +101,7 @@
 /* #undef HAVE_BIO_METH_NEW */

 /* Define to 1 if you have the `cbrt' function. */
-#define HAVE_CBRT 1
+/* #undef HAVE_CBRT */

 /* Define to 1 if you have the `class' function. */
 /* #undef HAVE_CLASS */
@@ -359,7 +359,7 @@
 /* #undef HAVE_MBSTOWCS_L */

 /* Define to 1 if you have the `memmove' function. */
-#define HAVE_MEMMOVE 1
+/* #undef HAVE_MEMMOVE */

 /* Define to 1 if you have the <memory.h> header file. */
 #define HAVE_MEMORY_H 1
@@ -413,7 +413,7 @@
 /* #undef HAVE_PTHREAD_IS_THREADED_NP */

 /* Have PTHREAD_PRIO_INHERIT. */
-#define HAVE_PTHREAD_PRIO_INHERIT 1
+/* #undef HAVE_PTHREAD_PRIO_INHERIT */

 /* Define to 1 if you have the `random' function. */
 #define HAVE_RANDOM 1
@@ -434,7 +434,7 @@
 #define HAVE_READLINK 1

 /* Define to 1 if you have the `rint' function. */
-#define HAVE_RINT 1
+/* #undef HAVE_RINT */

 /* Define to 1 if you have the global variable
    'rl_completion_append_character'. */
@@ -462,7 +462,7 @@
 #define HAVE_SHM_OPEN 1

 /* Define to 1 if you have the `snprintf' function. */
-#define HAVE_SNPRINTF 1
+/* #undef HAVE_SNPRINTF */

 /* Define to 1 if you have spinlocks. */
 #define HAVE_SPINLOCKS 1
@@ -604,7 +604,7 @@
 #define HAVE_TYPEOF 1

 /* Define to 1 if you have the external array `tzname'. */
-#define HAVE_TZNAME 1
+/* #undef HAVE_TZNAME */

 /* Define to 1 if you have the <ucred.h> header file. */
 /* #undef HAVE_UCRED_H */
@@ -658,7 +658,7 @@
 /* #undef HAVE_UUID_UUID_H */

 /* Define to 1 if you have the `vsnprintf' function. */
-#define HAVE_VSNPRINTF 1
+/* #undef HAVE_VSNPRINTF */

 /* Define to 1 if you have the <wchar.h> header file. */
 #define HAVE_WCHAR_H 1
@@ -676,16 +676,16 @@
 /* #undef HAVE__BUILTIN_BSWAP16 */

 /* Define to 1 if your compiler understands __builtin_bswap32. */
-#define HAVE__BUILTIN_BSWAP32 1
+/* #undef HAVE__BUILTIN_BSWAP32 */

 /* Define to 1 if your compiler understands __builtin_bswap64. */
-#define HAVE__BUILTIN_BSWAP64 1
+/* #undef HAVE__BUILTIN_BSWAP64 */

 /* Define to 1 if your compiler understands __builtin_constant_p. */
-#define HAVE__BUILTIN_CONSTANT_P 1
+/* #undef HAVE__BUILTIN_CONSTANT_P */

 /* Define to 1 if your compiler understands __builtin_types_compatible_p. */
-#define HAVE__BUILTIN_TYPES_COMPATIBLE_P 1
+/* #undef HAVE__BUILTIN_TYPES_COMPATIBLE_P */

 /* Define to 1 if your compiler understands __builtin_unreachable. */
 #define HAVE__BUILTIN_UNREACHABLE 1
@@ -845,7 +845,7 @@
 /* #undef USE_PAM */

 /* Use replacement snprintf() functions. */
-/* #undef USE_REPL_SNPRINTF */
+#define USE_REPL_SNPRINTF 1

 /* Define to 1 to use Intel SSE 4.2 CRC instructions with a runtime check. */
 /* #undef USE_SLICING_BY_8_CRC32C */
@@ -913,7 +913,7 @@
 /* Define to `__inline__' or `__inline' if that's what the C compiler
    calls it, or to nothing if 'inline' is not supported under any name.  */
 #ifndef __cplusplus
-/* #undef inline */
+#define inline
 #endif

 /* Define to the type of a signed integer type wide enough to hold a pointer,
@@ -921,7 +921,7 @@
 /* #undef intptr_t */

 /* Define to empty if the C compiler does not understand signed types. */
-/* #undef signed */
+#define signed /**/

 /* Define to how the compiler spells `typeof'. */
 /* #undef typeof */

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [BUGS] ./configure error: Cannot find a working 64-bit integer type
Следующее
От: Andres Freund
Дата:
Сообщение: Re: [BUGS] ./configure error: Cannot find a working 64-bit integertype