configure.ac: configure: error: POSIX thread library is required

Issue #13 resolved
Reindl Harald created an issue

-------- Weitergeleitete Nachricht -------- Betreff: Re: configure: error: POSIX thread library is required Datum: Tue, 3 Nov 2015 15:16:42 +0100 Von: Florian Weimer fweimer@redhat.com An: devel@lists.fedoraproject.org

On 11/03/2015 02:58 PM, Reindl Harald wrote:

Am 03.11.2015 um 14:44 schrieb Florian Weimer:

On 11/03/2015 02:35 PM, Reindl Harald wrote:

how is "configure: error: POSIX thread library is required" possible when things like MariaDB and even libevent are building fine?

What does config.log contain around the failing test?

xz compressed config.log attached since i am not sure what's the really interesting part for you

The root cause is this snippet in configure.ac:

AC_ARG_ENABLE(optimized, AS_HELP_STRING([--enable-optimized], [Build software optimized]), [ if test "x$enableval" = "xyes" ; then CFLAGS=echo $CFLAGS|sed 's/-O.//' CFLAGS=echo $CFLAGS|sed 's/-g//' CFLAGS="$CFLAGS -O3" OPTIMIZED=1 else OPTIMIZED=0 fi ], [ OPTIMIZED=0 ] )

It turns "-g0" into "0", causing all future compiler invocations to fail. You should just remove it and rely on RPM_OPT_FLAGS.

Comments (8)

  1. Reindl Harald reporter

    sorry, but i added the patch to my rpmbuild but still the same error

    [builduser@testserver:/rpmbuild/SPECS]$ rpmbuild -bb libzdb.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.c2XsAS + umask 022 + cd /home/builduser/rpmbuild/BUILD + cd /home/builduser/rpmbuild/BUILD + rm -rf libzdb-3.1 + /usr/bin/gzip -dc /home/builduser/rpmbuild/SOURCES/libzdb-3.1.tar.gz + /usr/bin/tar -xof - + STATUS=0 + '[' 0 -ne 0 ']' + cd libzdb-3.1 + /usr/bin/chmod -Rf a+rX,u+w,g-w,o-w . + echo 'Patch #1 (libzdb-configure.patch):' Patch #1 (libzdb-configure.patch): + /usr/bin/patch -p1 --fuzz=0 patching file configure.ac + rm -f 'doc/api-docs/._*' + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.oz1P8x + umask 022 + cd /home/builduser/rpmbuild/BUILD + cd libzdb-3.1 + export 'CFLAGS=-m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -fPIC -fPIE' + CFLAGS='-m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -fPIC -fPIE' + export 'CXXFLAGS=-m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -fPIC -fPIE' + CXXFLAGS='-m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -fPIC -fPIE' + export 'FFLAGS=-m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -fPIC -fPIE' + FFLAGS='-m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -fPIC -fPIE' + export 'CPPFLAGS=-m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -fPIC -fPIE' + CPPFLAGS='-m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -fPIC -fPIE' + export 'LDFLAGS=-Wl,-z,now -Wl,-z,relro -pie -m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security' + LDFLAGS='-Wl,-z,now -Wl,-z,relro -pie -m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security' + export 'SH_LDFLAGS=-Wl,-z,now -Wl,-z,relro -m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security' + SH_LDFLAGS='-Wl,-z,now -Wl,-z,relro -m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security' + CFLAGS='-m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -fPIC -fPIE' + export CFLAGS + CXXFLAGS='-m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -fPIC -fPIE' + export CXXFLAGS + FFLAGS='-m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -fPIC -fPIE' + export FFLAGS + FCFLAGS='-m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security -I/usr/lib64/gfortran/modules' + export FCFLAGS + LDFLAGS='-Wl,-z,now -Wl,-z,relro -pie -m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -pipe -fno-strict-aliasing -fomit-frame-pointer -finline-functions -fexceptions -fstack-protector-strong --param=ssp-buffer-size=6 -D_FORTIFY_SOURCE=2 -Wstack-protector -Wformat -Werror=format-security' + export LDFLAGS + ./configure --host=x86_64-redhat-linux --build=x86_64-redhat-linux --target=x86_64-redhat-linux --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-static --with-pic --enable-protected --enable-optimized --disable-openssl --without-postgresql --without-sqlite --without-oci checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for x86_64-redhat-linux-gcc... x86_64-redhat-linux-gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether x86_64-redhat-linux-gcc accepts -g... yes checking for x86_64-redhat-linux-gcc option to accept ISO C89... none needed checking whether x86_64-redhat-linux-gcc understands -c and -o together... yes checking for style of include used by make... GNU checking dependency style of x86_64-redhat-linux-gcc... none checking for x86_64-redhat-linux-g++... x86_64-redhat-linux-g++ checking whether we are using the GNU C++ compiler... yes checking whether x86_64-redhat-linux-g++ accepts -g... yes checking dependency style of x86_64-redhat-linux-g++... none checking how to run the C preprocessor... x86_64-redhat-linux-gcc -E checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking whether x86_64-redhat-linux-gcc needs -traditional... no checking for re2c... no checking for flex... flex checking lex output file root... lex.yy checking lex library... -lfl checking whether yytext is a pointer... yes checking build system type... x86_64-redhat-linux-gnu checking host system type... x86_64-redhat-linux-gnu checking how to print strings... printf checking for a sed that does not truncate output... /usr/bin/sed checking for fgrep... /usr/bin/grep -F checking for ld used by x86_64-redhat-linux-gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking how to convert x86_64-redhat-linux-gnu file names to x86_64-redhat-linux-gnu format... func_convert_file_noop checking how to convert x86_64-redhat-linux-gnu file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for x86_64-redhat-linux-objdump... no checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for x86_64-redhat-linux-dlltool... no checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for x86_64-redhat-linux-ar... no checking for ar... ar checking for archiver @FILE support... @ checking for x86_64-redhat-linux-strip... no checking for strip... strip checking for x86_64-redhat-linux-ranlib... no checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from x86_64-redhat-linux-gcc object... ok checking for sysroot... no checking for a working dd... /usr/bin/dd checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1 checking for x86_64-redhat-linux-mt... no checking for mt... no checking if : is a manifest tool... no checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if x86_64-redhat-linux-gcc supports -fno-rtti -fno-exceptions... no checking for x86_64-redhat-linux-gcc option to produce PIC... -fPIC -DPIC checking if x86_64-redhat-linux-gcc PIC flag -fPIC -DPIC works... yes checking if x86_64-redhat-linux-gcc static flag -static works... no checking if x86_64-redhat-linux-gcc supports -c -o file.o... yes checking if x86_64-redhat-linux-gcc supports -c -o file.o... (cached) yes checking whether the x86_64-redhat-linux-gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking how to run the C++ preprocessor... x86_64-redhat-linux-g++ -E checking for ld used by x86_64-redhat-linux-g++... /usr/bin/ld -m elf_x86_64 checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the x86_64-redhat-linux-g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking for x86_64-redhat-linux-g++ option to produce PIC... -fPIC -DPIC checking if x86_64-redhat-linux-g++ PIC flag -fPIC -DPIC works... yes checking if x86_64-redhat-linux-g++ static flag -static works... no checking if x86_64-redhat-linux-g++ supports -c -o file.o... yes checking if x86_64-redhat-linux-g++ supports -c -o file.o... (cached) yes checking whether the x86_64-redhat-linux-g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for library containing pthread_create... no configure: error: POSIX thread library is required error: Bad exit status from /var/tmp/rpm-tmp.oz1P8x (%build)

  2. Tildeslash repo owner

    Hmm. Just to narrow this down and see if this is the problem, could you try removing the line referenced in 80cc39c1a0d1 and see if that helps? This is the line pointed out in your original report. Alternatively, don't build with the --enable-optimized switch. If this works, please double check the patch was applied.

  3. Reindl Harald reporter

    ok - without --enable-optimized the problem goes away and it's a optimize dbuild anyways because "-m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -fstack-protector-strong -Wl,-z -Wl,now -Wl,-z -Wl,relro -m64 -O2 -g0 -march=sandybridge -mtune=sandybridge -fopenmp -mfpmath=sse -fstack-protector-strong" which are my default flags for rpmbuild it's optimized anyways

  4. Reindl Harald reporter

    P.S.: yes, the patch got applied because "echo 'Patch #1 (libzdb-configure.patch):' Patch #1 (libzdb-configure.patch): + /usr/bin/patch -p1 --fuzz=0 patching file configure.ac" it's the relevant output

    in case of rpmbuild these two parts are responsible for apply patches to the fresh unpacked vanilla source - hard to see in my post because stripped linebreaks

    Patch1: %{name}-configure.patch

    %prep %setup -q %patch1 -p1

  5. Log in to comment