LTIB - Strange problem building IMX6 Linux BSP from fresh on Ubuntu 13.10

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LTIB - Strange problem building IMX6 Linux BSP from fresh on Ubuntu 13.10

3,980 Views
makislivadas
Contributor IV

Decided to give the latest BSP a go and build it from fresh, remove /opt/freescale directory and installed new LTIB direcrory, from sources.

My Ubuntu 13.10 system already has a build version of the Linux BSP so it has all the necessary packages required to build it.

However when I try to rebuild from fresh it fails straight away when it tries to build rpm-fs package.

I believe the problem is the new version of Ubuntu 13.10. Usually a bit of trial and error fixes the problem and I can build the BSP, but in this case the problem appears a bit more stubborn.

Below is a trace with the failure I am getting.

----------------------------------------------------------------------------------------------------------------------------

Making all in tools
make[2]: Entering directory `/tmp/rpm-makis/BUILD/rpm-4.0.4/tools'
/bin/sh ../libtool --mode=link gcc  -g -O2 -D_GNU_SOURCE -D_REENTRANT -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts  -o dump  dump.o ../build/librpmbuild.la ../lib/librpm.la ../rpmdb/librpmdb.la ../rpmio/librpmio.la ../popt/libpopt.la
gcc -g -O2 -D_GNU_SOURCE -D_REENTRANT -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -o .libs/dump dump.o  ../build/.libs/librpmbuild.so ../lib/.libs/librpm.so ../rpmdb/.libs/librpmdb.so ../rpmio/.libs/librpmio.so -lz -lbz2 -lrt -lpthread ../popt/.libs/libpopt.so -Wl,--rpath -Wl,/opt/freescale/ltib/usr/lib
../rpmio/.libs/librpmio.so: undefined reference to `aio_suspend'
../rpmdb/.libs/librpmdb.so: undefined reference to `pthread_condattr_setpshared'
../rpmdb/.libs/librpmdb.so: undefined reference to `pthread_mutexattr_setpshared'
../rpmio/.libs/librpmio.so: undefined reference to `aio_return'
../rpmdb/.libs/librpmdb.so: undefined reference to `pthread_mutex_trylock'
../rpmio/.libs/librpmio.so: undefined reference to `aio_read'
../rpmdb/.libs/librpmdb.so: undefined reference to `pthread_mutexattr_init'
../rpmio/.libs/librpmio.so: undefined reference to `aio_error'
../rpmdb/.libs/librpmdb.so: undefined reference to `pthread_mutexattr_destroy'
../rpmio/.libs/librpmio.so: undefined reference to `aio_cancel'
collect2: error: ld returned 1 exit status
make[2]: *** [dump] Error 1
make[2]: Leaving directory `/tmp/rpm-makis/BUILD/rpm-4.0.4/tools'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/rpm-makis/BUILD/rpm-4.0.4'
make: *** [all-recursive-am] Error 2
error: Bad exit status from /home/makis/imx6/ltib/tmp/rpm-tmp.cnutYF (%build)


RPM build errors:
    Bad exit status from /home/makis/imx6/ltib/tmp/rpm-tmp.cnutYF (%build)
Build time for rpm-fs: 17 seconds

Failed building rpm-fs

---------------------------------------------------------------------------------------------------------------

Labels (1)
11 Replies

1,338 Views
steveosselton
Contributor I

I think something is broken on 13.10 64 bit WRT to multilib support. Trying to compile

a normal C application that uses pthread functions I get the same sort of link errors.

Interestingly if I look at the symbols I am trying to resolve from my shared library I

see stuff like:

U pthread_create

U pthread_attr_init@@GLIBC_2.2.5

U pthread_mutex_destroy@@GLIBC_2.2.5

U pthread_mutex_init@@GLIBC_2.2.5

The @@ symbols all resolve but the non scoped ones like "pthread_create" don't.

Not really sure why this is happening ?

0 Kudos

1,338 Views
billpringlemeir
Contributor V

If you can compile with -pthread and these errors should go away.

0 Kudos

1,338 Views
Raybiztech
Contributor V

Hi Makis,

                      From your debug log the problem is that, the rpm-fs package can't able to link with lrt and lpthread libraries so better do distclean and then start your build again.

-> ./ltib -m distclean

Thanks & Regards,

Raybiztech.

0 Kudos

1,338 Views
makislivadas
Contributor IV

Hi Thanks,

I did this and did not fix the issue. However, I see that this is a problem related to Ubuntu 13.10 64bit, on another Ubuntu 13.10 32bit machine there seems to be no issue building rpm-fs package.

Makis

0 Kudos

1,338 Views
makislivadas
Contributor IV

It appears that on the new Ubuntu 13.10 64bit version the rpm-fs package configuration is not finding the libraries needed for the build. So when is trying to complete the final link phase it fails. The libraries he is looking are stored into the 64 bit lib area but the rpm-fs build is not seeing them (and yes ./ltib -m distclean is not fixing this). I manage to get over this issue by doing a symbolic link of the libraries he is looking for into the usual lib directory /ust/lib. This Is not a great fix but is letting me build the image with LTIB on the 64bit system.

1,338 Views
davidfeeney
Contributor I

Hi Makis,

I tried your suggestion with the sym links, however the problem remained.  I am new to LTIB and perhaps am not targeting the correct lib directories.  Would you be able to provide the specific links that you added?

Best Regards,

david

0 Kudos

1,338 Views
makislivadas
Contributor IV

You will need to reboot the machine to enable the changes. And then it should work.

1,340 Views
davidfeeney
Contributor I

Just wanted to say "Thanks" Makis!

Just for the record, the specific solution is:

  1. sudo ln -s /usr/lib/x86_64-linux-gnu/librt.so /usr/lib/librt.so
  2. Reboot
0 Kudos

1,340 Views
LeonardoSandova
Specialist I

Makis, you are leading this Ubuntu 13.10 exploration with LTIB :smileyhappy: Good that you found and shared the link. In the other hand, you may know that Freescale will move to Yocto next year (there are two alphas but the beta release is expected next year), so I wonder if you have consider moving your development into this framework.

Leo

0 Kudos

1,340 Views
steveosselton
Contributor I

This is good news :smileyhappy: Have been using Yocto for some of the QorIQ systems and seems much more

robust and flexible than LTIB. Am keen to give the beta a try whenever ready.

0 Kudos

1,340 Views
LeonardoSandova
Specialist I

Yocto is more stable and portable than LTIB. Give it try and do not give up in the first try!

0 Kudos