Message ID | 1426800588-28574-1-git-send-email-ps.report@gmx.net |
---|---|
State | Rejected |
Headers | show |
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
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.' = ''
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)
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(+)