Re: BUG #6758: ./configure script sets HAVE_WCSTOMBS_L 1

From: Andrew Hastie <andrew(at)ahastie(dot)net>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6758: ./configure script sets HAVE_WCSTOMBS_L 1
Date: 2012-08-31 12:18:52
Message-ID: 5040ABAC.4070808@ahastie.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


On 29/08/12 18:16, Tom Lane wrote:
> Andrew Hastie <andrew(at)ahastie(dot)net> writes:
>> I'm currently working on a project where I need to get PGv9.1 up and
>> running on an IBM AIXv7.1 server, so I do have access to a suitable
>> machine for a period of time if I can provide any further diags to help
>> resolve the issue.
> That would be helpful, because both of the previous complainants seem
> to have wandered off without helping us get to the bottom of it :-(.
>
> What I'd like to see at this point is the portion of config.log where
> the configure script is trying to probe for wcstombs_l. For example,
> on a machine that has wcstombs and not wcstombs_l, I see:
>
> ...
> configure:19272: checking for wcstombs
> configure:19328: gcc -o conftest -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wformat-security -fno-strict-aliasing -g -D_XOPEN_SOURCE_EXTENDED conftest.c -lz -lreadline -ltermcap -lm >&5
> configure:19335: $? = 0
> configure:19357: result: yes
> configure:19272: checking for wcstombs_l
> configure:19328: gcc -o conftest -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wformat-security -fno-strict-aliasing -g -D_XOPEN_SOURCE_EXTENDED conftest.c -lz -lreadline -ltermcap -lm >&5
> /usr/ccs/bin/ld: Unsatisfied symbols:
> wcstombs_l (code)
> collect2: ld returned 1 exit status
> configure:19335: $? = 1
> configure: failed program was:
> | /* confdefs.h. */
> | #define PACKAGE_NAME "PostgreSQL"
> | #define PACKAGE_TARNAME "postgresql"
> | #define PACKAGE_VERSION "9.3devel"
> | #define PACKAGE_STRING "PostgreSQL 9.3devel"
> | #define PACKAGE_BUGREPORT "pgsql-bugs(at)postgresql(dot)org"
> | #define PG_VERSION "9.3devel"
> | #define PG_MAJORVERSION "9.3"
> | #define USE_INTEGER_DATETIMES 1
> | #define DEF_PGPORT 5440
> | #define DEF_PGPORT_STR "5440"
> | #define BLCKSZ 8192
> | #define RELSEG_SIZE 131072
> | #define XLOG_BLCKSZ 8192
> | #define XLOG_SEG_SIZE (16 * 1024 * 1024)
> | #define USE_ASSERT_CHECKING 1
> | #define PG_KRB_SRVNAM "postgres"
> | #define HAVE_LIBM 1
> | #define HAVE_LIBREADLINE 1
> | #define HAVE_LIBZ 1
> | #define HAVE_SPINLOCKS 1
> | #define STDC_HEADERS 1
> | #define HAVE_SYS_TYPES_H 1
> | #define HAVE_SYS_STAT_H 1
> | #define HAVE_STDLIB_H 1
> | #define HAVE_STRING_H 1
> | #define HAVE_MEMORY_H 1
> | #define HAVE_STRINGS_H 1
> | #define HAVE_INTTYPES_H 1
> | #define HAVE_UNISTD_H 1
> | #define HAVE_CRYPT_H 1
> | #define HAVE_LANGINFO_H 1
> | #define HAVE_POLL_H 1
> | #define HAVE_PWD_H 1
> | #define HAVE_SYS_IOCTL_H 1
> | #define HAVE_SYS_IPC_H 1
> | #define HAVE_SYS_POLL_H 1
> | #define HAVE_SYS_PSTAT_H 1
> | #define HAVE_SYS_RESOURCE_H 1
> | #define HAVE_SYS_SEM_H 1
> | #define HAVE_SYS_SHM_H 1
> | #define HAVE_SYS_SOCKET_H 1
> | #define HAVE_SYS_TIME_H 1
> | #define HAVE_SYS_UN_H 1
> | #define HAVE_TERMIOS_H 1
> | #define HAVE_UTIME_H 1
> | #define HAVE_WCHAR_H 1
> | #define HAVE_NET_IF_H 1
> | #define HAVE_NETINET_IN_H 1
> | #define HAVE_NETINET_TCP_H 1
> | #define HAVE_READLINE_READLINE_H 1
> | #define HAVE_READLINE_HISTORY_H 1
> | #define WORDS_BIGENDIAN 1
> | #define USE_INLINE 1
> | #define HAVE_STRINGIZE 1
> | #define FLEXIBLE_ARRAY_MEMBER 1
> | #define HAVE_FUNCNAME__FUNC 1
> | #define HAVE_TZNAME 1
> | #define HAVE_UNIX_SOCKETS 1
> | #define HAVE_INTPTR_T 1
> | #define HAVE_UINTPTR_T 1
> | #define HAVE_LONG_LONG_INT 1
> | #define _FILE_OFFSET_BITS 64
> | #define SIZEOF_OFF_T 8
> | #define HAVE_INT_TIMEZONE /**/
> | #define ACCEPT_TYPE_RETURN int
> | #define ACCEPT_TYPE_ARG1 int
> | #define ACCEPT_TYPE_ARG2 struct sockaddr *
> | #define ACCEPT_TYPE_ARG3 size_t
> | #define HAVE_CBRT 1
> | #define HAVE_FDATASYNC 1
> | #define HAVE_GETRLIMIT 1
> | #define HAVE_MEMMOVE 1
> | #define HAVE_POLL 1
> | #define HAVE_PSTAT 1
> | #define HAVE_READLINK 1
> | #define HAVE_SETSID 1
> | #define HAVE_SIGPROCMASK 1
> | #define HAVE_SYMLINK 1
> | #define HAVE_TOWLOWER 1
> | #define HAVE_UTIME 1
> | #define HAVE_UTIMES 1
> | #define HAVE_WCSTOMBS 1
> | /* end confdefs.h. */
> | /* Define wcstombs_l to an innocuous variant, in case <limits.h> declares wcstombs_l.
> | For example, HP-UX 11i <limits.h> declares gettimeofday. */
> | #define wcstombs_l innocuous_wcstombs_l
> |
> | /* System header to define __stub macros and hopefully few prototypes,
> | which can conflict with char wcstombs_l (); below.
> | Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
> | <limits.h> exists even on freestanding compilers. */
> |
> | #ifdef __STDC__
> | # include <limits.h>
> | #else
> | # include <assert.h>
> | #endif
> |
> | #undef wcstombs_l
> |
> | /* Override any GCC internal prototype to avoid an error.
> | Use char because int might match the return type of a GCC
> | builtin and then its argument prototype would still apply. */
> | #ifdef __cplusplus
> | extern "C"
> | #endif
> | char wcstombs_l ();
> | /* The GNU C library defines this for functions which it implements
> | to always fail with ENOSYS. Some functions are actually named
> | something starting with __ and the normal name is an alias. */
> | #if defined __stub_wcstombs_l || defined __stub___wcstombs_l
> | choke me
> | #endif
> |
> | int
> | main ()
> | {
> | return wcstombs_l ();
> | ;
> | return 0;
> | }
> configure:19357: result: no
> configure:19374: checking for fseeko
> ...
>
> It would also be interesting to check what would happen if configure
> actually tried to probe for mbstowcs_l, instead of making assumptions.
> To do that, copy the test program above (removing the "| " indentation),
> replace "wcstombs_l" by "mbstowcs_l", and then try to compile it ---
> but be sure to use the compile command shown in your config.log, not
> mine.
>
> regards, tom lane
>
Hi Tom,

Thanks for the pointers. Hopefully some of the following may shed some
light on the issue.

Here's the portion from config.log when probing for "wctsombs" and
"wctsombs_l" :-

configure:18948: checking for wcstombs
configure:19004: xlc -o conftest -qlanglvl=extc89 -qnoansialias
-I/opt/freeware/include -I/home/ahastie/gnu/zlib-1.2.7
-I/home/ahastie/gnu/readline-6.2 -L/opt/freeware/lib conftest.c -lz
-lreadline -l
m -lssl -lcrypto -lz -lreadline -lcurses -lld -lmass -lm >&5
configure:19011: $? = 0
configure:19033: result: yes
configure:18948: checking for wcstombs_l
configure:19004: xlc -o conftest -qlanglvl=extc89 -qnoansialias
-I/opt/freeware/include -I/home/ahastie/gnu/zlib-1.2.7
-I/home/ahastie/gnu/readline-6.2 -L/opt/freeware/lib conftest.c -lz
-lreadline -l
m -lssl -lcrypto -lz -lreadline -lcurses -lld -lmass -lm >&5
configure:19011: $? = 0
configure:19033: result: yes

So both probe OK. Here's the fail from gmake just to confirm the error:-

ld: 0711-317 ERROR: Undefined symbol: .mbstowcs_l
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
gmake[2]: *** [postgres] Error 8
gmake[2]: Leaving directory `/home/ahastie/postgresql-9.1.5/src/backend'
gmake[1]: *** [all-backend-recurse] Error 2
gmake[1]: Leaving directory `/home/ahastie/postgresql-9.1.5/src'
gmake: *** [all-src-recurse] Error 2

Using confdefs.c as a template, I created 2 tests where I only changed
the method names contained in the final 14 lines. Here are the results:-

Test #1
=====
Source (end portion only)

....
char wcstombs_l ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_wcstombs_l |defined __stub___wcstombs_l
choke me
#endif

int
main ()
{
return wcstombs_l ();
;
return 0;
}$

Results #1
=======
$ xlc -o conftest -qlanglvl=extc89 -qnoansialias -I/opt/freeware/include
-I/home/ahastie/gnu/zlib-1.2.7 -I/home/ahastie/gnu/readline-6.2
-L/opt/freeware/lib pgtest.c -lz -lreadline -lm -lssl -lcrypto -lz
-lreadline -lcurses -lld -lmass -lm
$

Test #2
=====

Source (end portion only)

.......
char mbstowcs_l ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_wcstombs_l |defined __stub___wcstombs_l
choke me
#endif

int
main ()
{
return mbstowcs_l ();
;
return 0;
}$

Results #2
=======
$ xlc -o conftest -qlanglvl=extc89 -qnoansialias -I/opt/freeware/include
-I/home/ahastie/gnu/zlib-1.2.7 -I/home/ahastie/gnu/readline-6.2
-L/opt/freeware/lib pgtest2.c -lz -lreadline -lm -lssl -lcrypto -lz
-lreadline -lcurses -lld -lmass -lm
ld: 0711-317 ERROR: Undefined symbol: .mbstowcs_l
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
information.
$

If it helps, I tried the above call with the loadmap logging switched
on, and here is the output:-

(ld): halt 4
(ld): setfflag 4
(ld): savename conftest
(ld): filelist 14 1
(ld): i /lib/crt0.o
(ld): i pgtest2.o
(ld): lib /opt/freeware/lib/libz.a
(ld): lib /opt/freeware/lib/libreadline.a
(ld): lib /usr/lib/libm.a
(ld): lib /usr/lib/libssl.a
(ld): lib /usr/lib/libcrypto.a
(ld): lib /usr/lib/libcurses.a
(ld): lib /usr/lib/libld.a
(ld): lib /usr/lib/libmass.a
(ld): lib /usr/vac/lib/libxlopt.a
(ld): lib /usr/vac/lib/libxlipa.a
(ld): lib /usr/vac/lib/libxl.a
(ld): lib /usr/lib/libc.a
LIBRARY: Shared object libz.a[libz.so.1]: 72 symbols imported.
LIBRARY: Shared object libreadline.a[libreadline.so.4]: 398 symbols
imported.
LIBRARY: Shared object libssl.a[libssl.so.0.9.8]: 459 symbols imported.
LIBRARY: Shared object libcrypto.a[libcrypto.so.0.9.8]: 3040 symbols
imported.
LIBRARY: Shared object libcurses.a[shr42.o]: 508 symbols imported.
LIBRARY: Shared object libc.a[shr.o]: 3244 symbols imported.
LIBRARY: Shared object libc.a[meth.o]: 2 symbols imported.
LIBRARY: Shared object libc.a[posix_aio.o]: 20 symbols imported.
LIBRARY: Shared object libc.a[aio.o]: 18 symbols imported.
LIBRARY: Shared object libc.a[pse.o]: 8 symbols imported.
LIBRARY: Shared object libc.a[dl.o]: 4 symbols imported.
LIBRARY: Shared object libc.a[pty.o]: 1 symbols imported.
FILELIST: Number of previously inserted files processed: 14
(ld): resolve
RESOLVE: 30 of 13260 symbols were kept.
(ld): addgl /usr/lib/glink.o
ADDGL: Glink code added for 2 symbols.
(ld): er full
ld: 0711-318 ERROR: Undefined symbols were found.
The following symbols are in error:
Symbol Inpndx TY CL Source-File(Object-File) OR
Import-File{Shared-object}
RLD: Address Section Rld-type
Referencing Symbol
----------------------------------------------------------------------------------------------
.mbstowcs_l [20] ER PR pgtest2.c(pgtest2.o)
0000000c .text R_RBR [12] .main
ER: The return code is 8.

Again, let me know if you'd like me to test anything further.

Thanks,
Andrew

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message s0525775 2012-08-31 14:47:10 BUG #7512: can't install pgdg-centos91-9.1-4.noarch.rpm
Previous Message Chris Travers 2012-08-31 11:53:57 Re: BUG #6489: Alter table with composite type/table