All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v1] postgresql: fix xtensa pthread linking flags
@ 2015-03-19 23:17 Peter Seiderer
  2015-03-19 23:30 ` Max Filippov
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Seiderer @ 2015-03-19 23:17 UTC (permalink / raw)
  To: buildroot

Hello Max,

On Fri, Mar 20, 2015 at 01:50:22AM +0300, Max Filippov wrote:
> On Fri, Mar 20, 2015 at 12:42 AM, Max Filippov <jcmvbkbc@gmail.com> wrote:
> > On Fri, Mar 20, 2015 at 12:29 AM, Peter Seiderer <ps.report@gmx.net> wrote:
> >> Caused by pthread flags autodetection failure while configure (from config.log):
> >> configure:12436: checking whether pthreads work with -pthread
> >> configure:12521: host/usr/bin/xtensa-linux-gcc -o conftest -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mlongcalls -mtext-section-literals  -Os   -pthread -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE    conftest.c   -lssl -lcrypto -lz -lrt -lcrypt -ldl -lm  >&5
> >> conftest.c: In function 'main':
> >> conftest.c:140:27: warning: 'th' is used uninitialized in this function [-Wuninitialized]
> >>  pthread_t th; pthread_join(th, 0);
> >>                            ^
> >> host/usr/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
> >> configure:12521: $? = 0
> >
> > But the test has actually succeeded according to the exit code.
> > Maybe we'd better fix configure?
> 
> I see the issue comes from config/acx_pthread.m4:146
>     # Check both linking and compiling, because they might tolerate
> different options.
>     if test "`(eval $ac_link 2>&1 1>&5)`" = "" && test "`(eval
> $ac_compile 2>&1 1>&5)`" = ""; then
> 
> where non-empty stdout + stderr output of the linker and compiler
> fail the test. And the linker gives the following warning during that test:
> 
>     libcrypto.so: warning: gethostbyname is obsolescent, use
> getnameinfo() instead.' = ''
>

Thanks for taking a look at it, you are rigth with your problem description (I
suspected the warning output too), any suggestions how to fix it?
Or file a bugreport upstream?

Regards,
Peter
 
> -- 
> Thanks.
> -- Max

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v1] postgresql: fix xtensa pthread linking flags
  2015-03-19 23:17 [Buildroot] [PATCH v1] postgresql: fix xtensa pthread linking flags Peter Seiderer
@ 2015-03-19 23:30 ` Max Filippov
  0 siblings, 0 replies; 5+ messages in thread
From: Max Filippov @ 2015-03-19 23:30 UTC (permalink / raw)
  To: buildroot

On Fri, Mar 20, 2015 at 2:17 AM, Peter Seiderer <ps.report@gmx.net> wrote:
> Hello Max,
>
> On Fri, Mar 20, 2015 at 01:50:22AM +0300, Max Filippov wrote:
>> On Fri, Mar 20, 2015 at 12:42 AM, Max Filippov <jcmvbkbc@gmail.com> wrote:
>> > On Fri, Mar 20, 2015 at 12:29 AM, Peter Seiderer <ps.report@gmx.net> wrote:
>> >> Caused by pthread flags autodetection failure while configure (from config.log):
>> >> configure:12436: checking whether pthreads work with -pthread
>> >> configure:12521: host/usr/bin/xtensa-linux-gcc -o conftest -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mlongcalls -mtext-section-literals  -Os   -pthread -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE    conftest.c   -lssl -lcrypto -lz -lrt -lcrypt -ldl -lm  >&5
>> >> conftest.c: In function 'main':
>> >> conftest.c:140:27: warning: 'th' is used uninitialized in this function [-Wuninitialized]
>> >>  pthread_t th; pthread_join(th, 0);
>> >>                            ^
>> >> host/usr/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
>> >> configure:12521: $? = 0
>> >
>> > But the test has actually succeeded according to the exit code.
>> > Maybe we'd better fix configure?
>>
>> I see the issue comes from config/acx_pthread.m4:146
>>     # Check both linking and compiling, because they might tolerate
>> different options.
>>     if test "`(eval $ac_link 2>&1 1>&5)`" = "" && test "`(eval
>> $ac_compile 2>&1 1>&5)`" = ""; then
>>
>> where non-empty stdout + stderr output of the linker and compiler
>> fail the test. And the linker gives the following warning during that test:
>>
>>     libcrypto.so: warning: gethostbyname is obsolescent, use
>> getnameinfo() instead.' = ''
>>
>
> Thanks for taking a look at it, you are rigth with your problem description (I
> suspected the warning output too), any suggestions how to fix it?
> Or file a bugreport upstream?

The attached patch fixes it for me, but I'm curious why it was
done that way at all. Looking at postgres repository doesn't
reveal much...

-- 
Thanks.
-- Max
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-package-postgresql-fix-pthread-flags-detection.patch
Type: text/x-patch
Size: 2493 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20150320/f3a76cd6/attachment.bin>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v1] postgresql: fix xtensa pthread linking flags
  2015-03-19 21:42 ` Max Filippov
@ 2015-03-19 22:50   ` Max Filippov
  0 siblings, 0 replies; 5+ messages in thread
From: Max Filippov @ 2015-03-19 22:50 UTC (permalink / raw)
  To: buildroot

On Fri, Mar 20, 2015 at 12:42 AM, Max Filippov <jcmvbkbc@gmail.com> wrote:
> On Fri, Mar 20, 2015 at 12:29 AM, Peter Seiderer <ps.report@gmx.net> wrote:
>> Caused by pthread flags autodetection failure while configure (from config.log):
>> configure:12436: checking whether pthreads work with -pthread
>> configure:12521: host/usr/bin/xtensa-linux-gcc -o conftest -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mlongcalls -mtext-section-literals  -Os   -pthread -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE    conftest.c   -lssl -lcrypto -lz -lrt -lcrypt -ldl -lm  >&5
>> conftest.c: In function 'main':
>> conftest.c:140:27: warning: 'th' is used uninitialized in this function [-Wuninitialized]
>>  pthread_t th; pthread_join(th, 0);
>>                            ^
>> host/usr/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
>> configure:12521: $? = 0
>
> But the test has actually succeeded according to the exit code.
> Maybe we'd better fix configure?

I see the issue comes from config/acx_pthread.m4:146
    # Check both linking and compiling, because they might tolerate
different options.
    if test "`(eval $ac_link 2>&1 1>&5)`" = "" && test "`(eval
$ac_compile 2>&1 1>&5)`" = ""; then

where non-empty stdout + stderr output of the linker and compiler
fail the test. And the linker gives the following warning during that test:

    libcrypto.so: warning: gethostbyname is obsolescent, use
getnameinfo() instead.' = ''

-- 
Thanks.
-- Max

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v1] postgresql: fix xtensa pthread linking flags
  2015-03-19 21:29 Peter Seiderer
@ 2015-03-19 21:42 ` Max Filippov
  2015-03-19 22:50   ` Max Filippov
  0 siblings, 1 reply; 5+ messages in thread
From: Max Filippov @ 2015-03-19 21:42 UTC (permalink / raw)
  To: buildroot

On Fri, Mar 20, 2015 at 12:29 AM, Peter Seiderer <ps.report@gmx.net> wrote:
> Caused by pthread flags autodetection failure while configure (from config.log):
> configure:12436: checking whether pthreads work with -pthread
> configure:12521: host/usr/bin/xtensa-linux-gcc -o conftest -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mlongcalls -mtext-section-literals  -Os   -pthread -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE    conftest.c   -lssl -lcrypto -lz -lrt -lcrypt -ldl -lm  >&5
> conftest.c: In function 'main':
> conftest.c:140:27: warning: 'th' is used uninitialized in this function [-Wuninitialized]
>  pthread_t th; pthread_join(th, 0);
>                            ^
> host/usr/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
> configure:12521: $? = 0

But the test has actually succeeded according to the exit code.
Maybe we'd better fix configure?

> configure:12556: result: no

-- 
Thanks.
-- Max

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v1] postgresql: fix xtensa pthread linking flags
@ 2015-03-19 21:29 Peter Seiderer
  2015-03-19 21:42 ` Max Filippov
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Seiderer @ 2015-03-19 21:29 UTC (permalink / raw)
  To: buildroot

Fixes the following linker errror in case of xtensa tareget
with openssl packet enabled ([1], [2], [3]):

host/usr/bin/xtensa-linux-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mlongcalls -mtext-section-literals  -Os  pg_ctl.o  -L../../../src/common -lpgcommon -L../../../src/port -lpgport -L../../../src/interfaces/libpq -lpq -L../../../src/port -L../../../src/common  -Wl,-rpath,'/usr/lib',--enable-new-dtags  -lpgcommon -lpgport -lssl -lcrypto -lz -lreadline -lrt -lcrypt -ldl -lm  -o pg_ctl
host/usr/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
../../../src/interfaces/libpq/libpq.so: undefined reference to `pthread_sigmask'
collect2: error: ld returned 1 exit status
make[4]: *** [pg_ctl] Error 1
make[4]: Leaving directory `build/postgresql-9.4.1/src/bin/pg_ctl'

Caused by pthread flags autodetection failure while configure (from config.log):
configure:12436: checking whether pthreads work with -pthread
configure:12521: host/usr/bin/xtensa-linux-gcc -o conftest -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mlongcalls -mtext-section-literals  -Os   -pthread -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE    conftest.c   -lssl -lcrypto -lz -lrt -lcrypt -ldl -lm  >&5
conftest.c: In function 'main':
conftest.c:140:27: warning: 'th' is used uninitialized in this function [-Wuninitialized]
 pthread_t th; pthread_join(th, 0);
                           ^
host/usr/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
configure:12521: $? = 0
configure:12556: result: no

[1] http://autobuild.buildroot.net/results/745/745ad42bb99770e49a842ca812f798c350e9bf2e
[2] http://autobuild.buildroot.net/results/0b1/0b12a3aa4160aa5a60328050973eff56717aca59
[3] http://autobuild.buildroot.net/results/6f1/6f1cb7c377439fb4eb358d9fcb46db29bff2ab78

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 package/postgresql/postgresql.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/postgresql/postgresql.mk b/package/postgresql/postgresql.mk
index 7dc3f0b..30ff6b7 100644
--- a/package/postgresql/postgresql.mk
+++ b/package/postgresql/postgresql.mk
@@ -29,6 +29,10 @@ endif
 
 ifneq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
 	POSTGRESQL_CONF_OPTS += --disable-thread-safety
+else
+	# xtensa build with openssl enabled needs extra pthread
+	# because autodetection failes
+	POSTGRESQL_CONF_OPTS += LIBS='-pthread'
 endif
 
 ifeq ($(BR2_microblazeel)$(BR2_microblazebe)$(BR2_nios2)$(BR2_xtensa),y)
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-19 23:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-19 23:17 [Buildroot] [PATCH v1] postgresql: fix xtensa pthread linking flags Peter Seiderer
2015-03-19 23:30 ` Max Filippov
  -- strict thread matches above, loose matches on Subject: below --
2015-03-19 21:29 Peter Seiderer
2015-03-19 21:42 ` Max Filippov
2015-03-19 22:50   ` Max Filippov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.