Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-77159

configure fails to detect static glib

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.12.4
    • Fix Version/s: 5.12.6, 5.13.2
    • Component/s: Build System
    • Labels:
      None
    • Environment:
      linux
    • Platform/s:
      Linux/X11
    • Commits:
      4ddc50c0cd16ddd146ea9ea21d6565c8f4a5e2bc (qt/qtbase/5.12) a1ea49878927dfe267416c795b50f3d5bdfa0b84 (qt/qtbase/5.13)

      Description

      When doing library detection via pkg-config, configure fails to detect static glib:

      looking for library glib
      Trying source 0 (type pkgConfig) of library glib ...
      + /usr/bin/pkg-config --exists --silence-errors glib-2.0 gthread-2.0
      + /usr/bin/pkg-config --modversion glib-2.0 gthread-2.0
      > 2.58.3
      > 2.58.3
      + /usr/bin/pkg-config --libs-only-L glib-2.0 gthread-2.0
      > -L/home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib
      + /usr/bin/pkg-config --libs-only-l glib-2.0 gthread-2.0
      > -lgthread-2.0 -lglib-2.0
      + /usr/bin/pkg-config --static --libs-only-L glib-2.0 gthread-2.0
      > -L/home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib
      + /usr/bin/pkg-config --static --libs-only-l glib-2.0 gthread-2.0
      > -lgthread-2.0 -lglib-2.0
      + /usr/bin/pkg-config --cflags glib-2.0 gthread-2.0
      > -pthread -I/home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/include -I/home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/include/glib-2.0 -I/home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/glib-2.0/include
      Note: Dropped compiler flags '-pthread'.
      + cd /home/conan/.conan/data/qt/5.12.4/bincrafters/tmp/build/3dc82447f9fcf7174732e76f4565e513c6d6d27c/config.tests/glib && /home/conan/.conan/data/qt/5.12.4/bincrafters/tmp/build/3dc82447f9fcf7174732e76f4565e513c6d6d27c/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared use_gold_linker warn_off console single_arch" 'DEFINES += PCRE2_STATIC' QMAKE_CC=clang QMAKE_LINK_C=clang QMAKE_LINK_C_SHLIB=clang QMAKE_CXX=clang++ QMAKE_LINK=clang++ QMAKE_LINK_SHLIB=clang++ QMAKE_CXXFLAGS+=-ftemplate-depth=1024 'QMAKE_USE += glib' 'QMAKE_LIBS_GLIB = /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libgthread-2.0.a /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a' 'QMAKE_INCDIR_GLIB = /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/include /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/include/glib-2.0 /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/glib-2.0/include' /home/conan/.conan/data/qt/5.12.4/bincrafters/tmp/build/3dc82447f9fcf7174732e76f4565e513c6d6d27c/config.tests/glib
      + cd /home/conan/.conan/data/qt/5.12.4/bincrafters/tmp/build/3dc82447f9fcf7174732e76f4565e513c6d6d27c/config.tests/glib && MAKEFLAGS= /usr/bin/make
      > clang++ -c -m32 -pipe -ftemplate-depth=1024 -O2 -w -fPIC -DPCRE2_STATIC -I. -I/home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/include -I/home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/include/glib-2.0 -I/home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/glib-2.0/include -I/home/conan/.conan/data/qt/5.12.4/bincrafters/tmp/source/qt5/qtbase/mkspecs/linux-clang-32 -o main.o main.cpp
      > clang++ -m32 -ccc-gcc-name g++ -fuse-ld=gold -o glib main.o   /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libgthread-2.0.a /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a   
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gmain.c.o):gmain.c:function g_get_worker_context: error: undefined reference to 'pthread_sigmask'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gmain.c.o):gmain.c:function g_get_worker_context: error: undefined reference to 'pthread_sigmask'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_mutex_impl_new: error: undefined reference to 'pthread_mutexattr_init'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_mutex_impl_new: error: undefined reference to 'pthread_mutexattr_settype'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_mutex_impl_new: error: undefined reference to 'pthread_mutexattr_destroy'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_mutex_trylock: error: undefined reference to 'pthread_mutex_trylock'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rec_mutex_init: error: undefined reference to 'pthread_mutexattr_init'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rec_mutex_init: error: undefined reference to 'pthread_mutexattr_settype'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rec_mutex_init: error: undefined reference to 'pthread_mutexattr_destroy'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rec_mutex_get_impl: error: undefined reference to 'pthread_mutexattr_init'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rec_mutex_get_impl: error: undefined reference to 'pthread_mutexattr_settype'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rec_mutex_get_impl: error: undefined reference to 'pthread_mutexattr_destroy'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rec_mutex_trylock: error: undefined reference to 'pthread_mutex_trylock'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rw_lock_init: error: undefined reference to 'pthread_rwlock_init'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rw_lock_clear: error: undefined reference to 'pthread_rwlock_destroy'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rw_lock_writer_lock: error: undefined reference to 'pthread_rwlock_wrlock'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rw_lock_writer_lock: error: undefined reference to 'pthread_rwlock_init'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rw_lock_writer_lock: error: undefined reference to 'pthread_rwlock_destroy'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rw_lock_writer_lock: error: undefined reference to 'pthread_rwlock_wrlock'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rw_lock_writer_trylock: error: undefined reference to 'pthread_rwlock_trywrlock'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rw_lock_writer_trylock: error: undefined reference to 'pthread_rwlock_init'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rw_lock_writer_trylock: error: undefined reference to 'pthread_rwlock_destroy'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rw_lock_writer_unlock: error: undefined reference to 'pthread_rwlock_unlock'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rw_lock_writer_unlock: error: undefined reference to 'pthread_rwlock_init'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rw_lock_writer_unlock: error: undefined reference to 'pthread_rwlock_destroy'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rw_lock_reader_lock: error: undefined reference to 'pthread_rwlock_rdlock'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rw_lock_reader_lock: error: undefined reference to 'pthread_rwlock_rdlock'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rw_lock_reader_trylock: error: undefined reference to 'pthread_rwlock_tryrdlock'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_rw_lock_reader_unlock: error: undefined reference to 'pthread_rwlock_unlock'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_cond_impl_new: error: undefined reference to 'pthread_condattr_setclock'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_private_get: error: undefined reference to 'pthread_getspecific'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_private_get_impl: error: undefined reference to 'pthread_key_create'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_private_get_impl: error: undefined reference to 'pthread_key_delete'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_private_set: error: undefined reference to 'pthread_setspecific'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_private_replace: error: undefined reference to 'pthread_getspecific'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_private_replace: error: undefined reference to 'pthread_setspecific'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_system_thread_free: error: undefined reference to 'pthread_detach'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_system_thread_new: error: undefined reference to 'pthread_attr_setstacksize'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_system_thread_new: error: undefined reference to 'pthread_create'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_system_thread_wait: error: undefined reference to 'pthread_join'
      > /home/conan/.conan/data/glib/2.58.3/bincrafters/stable/package/51e7fa4ea899ee3f8eae8bc8d29d8e41051ac227/lib/libglib-2.0.a(gthread-posix.c.o):gthread-posix.c:function g_system_thread_set_name: error: undefined reference to 'pthread_setname_np'
      > clang: error: linker command failed with exit code 1 (use -v to see invocation)
      > Makefile:67: recipe for target 'glib' failed
      > make: *** [glib] Error 1
       => source failed verification.
      test config.qtbase_corelib.libraries.glib FAILED
      

      It may be because configure never invokes "pkg-config --libs" https://code.qt.io/cgit/qt/qtbase.git/tree/mkspecs/features/qt_configure.prf?h=v5.12.4#n800 , so it has no way to know that glib requires the "-pthread" flag during link ?

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              kkohne Kai Köhne
              Reporter:
              ericlemanissier Eric Lemanissier
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes