Kirill Brilliantov

Building GLib-2.33.3

Discussion created by Kirill Brilliantov on Aug 9, 2012

Hello!

I work with Freescale iMX53 Quick Start Board and use ltib 9.1.1
I need to build GLib-2.33.3

My spec-file, based on spec for Glib-2.18.1:
%define pfx /opt/freescale/rootfs/%{_target_cpu}
................
Version         : 2.33.3
...............
%Prep
%setup -n glib-%{version}
%Build
glib_cv_stack_grows=no \
glib_cv_uscore=no \
ac_cv_func_posix_getpwuid_r=yes \
ac_cv_func_posix_getgrgid_r=yes \
./configure --prefix=%{_prefix} --host=$CFGHOST --build=%{_build} \
    --disable-maintainer-mode --disable-modular-tests \
    --disable-largefile --disable-selinux --disable-fam \
    --disable-xattr --disable-libelf --enable-gtk-doc-html=no \
    --enable-dtrace=no --enable-systemtap=no --enable-gcov=no

%Install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT/%{pfx}
find $RPM_BUILD_ROOT/%{pfx}/%{_prefix}/lib -name "*.la" | xargs rm -f

But build is failed:
Executing(%install): /bin/sh -e /opt/IMX53/ltib/tmp/rpm-tmp.10324
+ umask 022
+ cd /opt/IMX53/ltib/rpm/BUILD
+ cd glib-2.33.3
+ rm -rf /opt/IMX53/ltib/tmp/glib2
+ make install DESTDIR=/opt/IMX53/ltib/tmp/glib2//opt/freescale/rootfs/arm
Making install in .
make[1]: Entering directory `/opt/IMX53/ltib/rpm/BUILD/glib-2.33.3'
make[2]: Entering directory `/opt/IMX53/ltib/rpm/BUILD/glib-2.33.3'
test -z "/usr/bin" || /bin/mkdir -p "/opt/IMX53/ltib/tmp/glib2//opt/freescale/rootfs/arm/usr/bin"
test -z "/usr/share/glib-2.0/gettext" || /bin/mkdir -p "/opt/IMX53/ltib/tmp/glib2//opt/freescale/rootfs/arm/usr/share/glib-2.0/gettext"
test -z "/usr/lib/pkgconfig" || /bin/mkdir -p "/opt/IMX53/ltib/tmp/glib2//opt/freescale/rootfs/arm/usr/lib/pkgconfig"
 /usr/bin/install -c glib-gettextize '/opt/IMX53/ltib/tmp/glib2//opt/freescale/rootfs/arm/usr/bin'
 /usr/bin/install -c mkinstalldirs '/opt/IMX53/ltib/tmp/glib2//opt/freescale/rootfs/arm/usr/share/glib-2.0/gettext'
 /usr/bin/install -c -m 644 glib-2.0.pc gobject-2.0.pc gmodule-2.0.pc gmodule-export-2.0.pc gmodule-no-export-2.0.pc gthread-2.0.pc gio-2.0.pc gio-unix-2.0.pc '/opt/IMX53/ltib/tmp/glib2//opt/freescale/rootfs/arm/usr/lib/pkgconfig'
make[2]: Leaving directory `/opt/IMX53/ltib/rpm/BUILD/glib-2.33.3'
....................................
.....................................
 CCLD   gdbus
  CCLD   gresource
/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.4.4/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libgthread-2.0.so.0, needed by ../gobject/.libs/libgobject-2.0.so, not found (try using -rpath or -rpath-link)
/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.4.4/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libgmodule-2.0.so.0, needed by ./.libs/libgio-2.0.so, not found (try using -rpath or -rpath-link)
./.libs/libgio-2.0.so: undefined reference to `g_module_close'
./.libs/libgio-2.0.so: undefined reference to `g_module_symbol'
./.libs/libgio-2.0.so: undefined reference to `g_module_supported'
./.libs/libgio-2.0.so: undefined reference to `g_module_open'
./.libs/libgio-2.0.so: undefined reference to `g_module_error'
collect2: ld returned 1 exit status
make[3]: *** [glib-compile-resources] Error 1
make[3]: *** Waiting for unfinished jobs....
/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.4.4/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libgmodule-2.0.so.0, needed by ./.libs/libgio-2.0.so, not found (try using -rpath or -rpath-link)
/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/../lib/gcc/arm-fsl-linux-gnueabi/4.4.4/../../../../arm-fsl-linux-gnueabi/bin/ld: warning: libgthread-2.0.so.0, needed by ../gobject/.libs/libgobject-2.0.so, not found (try using -rpath or -rpath-link)
./.libs/libgio-2.0.so: undefined reference to `g_module_close'
./.libs/libgio-2.0.so: undefined reference to `g_module_symbol'
./.libs/libgio-2.0.so: undefined reference to `g_module_supported'
./.libs/libgio-2.0.so: undefined reference to `g_module_open'
./.libs/libgio-2.0.so: undefined reference to `g_module_error'
................

This is a very strange because glib-2.18.1 builded success.

$ ls /opt/IMX53/ltib/tmp/glib2/opt/freescale/rootfs/arm/usr/lib/pkgconfig/
gio-2.0.pc       glib-2.0.pc     gmodule-export-2.0.pc     gobject-2.0.pc
gio-unix-2.0.pc  gmodule-2.0.pc  gmodule-no-export-2.0.pc  gthread-2.0.pc

$ cat /opt/IMX53/ltib/tmp/glib2/opt/freescale/rootfs/arm/usr/lib/pkgconfig/gthread-2.0.pc
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: GThread
Description: Thread support for GLib
Requires: glib-2.0
Version: 2.33.3
Libs: -L${libdir} -lgthread-2.0 -pthread -lrt
Cflags: -pthread

How can I solve this error?

Thank you and excuse me for my bad english.

Outcomes