cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sylvain.ellisys
Observer
Observer
3,790 Views
Registered: ‎04-10-2015

Libtool version issue with 2017.2 autotools

Jump to solution

Hello,

 

I have been using petalinux for a while. My project is currently working as expected with petalinux 2016.2

 

My host is Ubuntu 16.04 LTS. I am quite sure I have all petalinux dependencies installed.

 

I am migrating to 2017.2 I thus have to transform all my apps makefile into yocto/bitbake recipes.

 

One of them is to build mono. 2016.2 makefile is quite simple as mono uses autoconf.

 

2017.2 recipes is equally simple as it mainly involves "inherit autotools".

 

However: while building mono is perfectly fine under 2016.2, I cannot have it to compile under 2017.2 despite all my efforts.

 

2017.2 build system complains that

| libtool: Version mismatch error. This is libtool 2.4.6, but the
| libtool: definition of this LT_INIT comes from libtool 2.4.2.
| libtool: You should recreate aclocal.m4 with macros from libtool 2.4.6
| libtool: and run autoconf again.

 

I tried many ways to fix this, including running autoreconf -ivf from inside or outside recipe, but in the best case it just fail later saying it cannot find "../libtool".

 

I cannot understand this: everything is fine with the same mono distribution, on the same machine, with petatlinux-2016.2 . Why is petalinux 2017.2 complaining about libtool version while 2016.2 is not? All source files are the same, the host environnement is the same, etc.

 

What can I do to have mono compile?

0 Kudos
1 Solution

Accepted Solutions
roccobrandi
Explorer
Explorer
5,266 Views
Registered: ‎10-14-2015

Hi @sylvain.ellisys,

sorry I forgot to tell you about bblayers.conf

yes, if you change the file in build/conf folder, you will lose your changes.

 

you have to change the bblayers in petalinux source code.

 

you can find it in <your_petalinux_source_directory>/components/yocto/source/arm/conf/bblayers.conf

 

then you just add the recipe(s) you want to use in your petalinux-image.bbapend file like this:

IMAGE_INSTALL_append = " mono"

(note the extra space before the name)

 

 

Regards,

Rocco

View solution in original post

0 Kudos
8 Replies
hpoetzl
Voyager
Voyager
3,763 Views
Registered: ‎06-24-2013

Hey @sylvain.ellisys,

 

Why is petalinux 2017.2 complaining about libtool version while 2016.2 is not?

Most likely because 2016.2 uses libtool 2.4.2 and 2017.2 uses libtool 2.4.6.

 

What can I do to have mono compile?

You probably need to update/regenerate some of the files required to build mono.

 

Best,

Herbert

-------------- Yes, I do this for fun!
0 Kudos
roccobrandi
Explorer
Explorer
3,716 Views
Registered: ‎10-14-2015

why don't you just download the meta-mono layer from the yocto project and use the existing recipes?

 

be sure to include the new layer in your bblayers.conf file

0 Kudos
sylvain.ellisys
Observer
Observer
3,712 Views
Registered: ‎04-10-2015

Hello hpoetzl,

 

Thanks for the reply.

 

This is precisely what I don't understand... I thought petalinux tools (i.e. petalinux-build) were relying on standard tools installed on the host OS (Ubuntu). We need to install gcc, libtool, and dozen of other things on the host OS for petalinux tools to work, so I assume libtool (for instance) doesn't come with petalinux.

 

That's why I think that the same libtool is used whenever I run 2016 petalinux-build or 2017 petalinux-build.

 

Am I wrong.

 

I regenerated (manually and from inside the recipe) all files using autoreconf --install --force but then the error is another one ("libtool not found")...

0 Kudos
sylvain.ellisys
Observer
Observer
3,711 Views
Registered: ‎04-10-2015

Hello roccobrandi,

 

Thanks for the suggestion. I will try this.

 

But I wish I can understand what's happening in order to be able to fix other issues: say I have my own autoconf-based library that does suffer from the same issue: I won't be able to find an existing recipe that will magically fix things.

 

Anyway I guess I can get some inspiration from the meta-mono layer thing...

 

Thanks,

0 Kudos
roccobrandi
Explorer
Explorer
3,696 Views
Registered: ‎10-14-2015

well, I think it's pretty clear what is happening: it's a mismatch version error

 

somewhere in your mono source code is hard coded the libtool version to use

 

in particular, from your log: libtool: definition of this LT_INIT comes from libtool 2.4.2.

so try to follow LT_INIT  in your source code

or you can follow the suggestion of petalinux itself:  libtool: You should recreate aclocal.m4 with macros from libtool 2.4.6

 

personally, when I had to import my existing projects from v2016.2 to v2017.2 , I have replaced all my autotools libraries with the yocto recipes where they exist. It is simpler to build and also I have gained in performance as well

0 Kudos
sylvain.ellisys
Observer
Observer
3,645 Views
Registered: ‎04-10-2015

Hello @roccobrandi,

 

Thanks for your answer and advice.

 

I still don't understand why the same makefiles work with 2016.2 and not with 2017.2 on the same host linux installation. In both case the only installed libtool is 2.4.6.

 

2016.2 probably does some magic by default in order to convert makefiles (like recreate aclocal.m4 without even mentioning it), while 2017.2 doesn't.

 

I followed your advice and tried to use meta-mono, with the help of "petalinux yocto tips" but didn't manage to get it working: yocto tips says to configure the path to the newly added layer inside file ./build/conf/bblayers.conf, but as it is clearly stated at the beginning of this file, it is recreated on every build/config and the new layer is thus never taken into account. 

 

I searched and searched how to properly install meta-mono but to no avail.


I would be very curious to know how you did! 

 

In the end I simply looked at what meta-mono does in order to compile mono and found out that the recipe contains "inherit autotools-brokensep" instead of "inherit autotools", and more importantly, it contains this code:

do_configure_prepend() {
    ${S}/autogen.sh --verbose || bbnote "${PN} failed to autogen.sh"
    sed -e "s|slash\}libtool|slash\}${HOST_SYS}-libtool|" -i acinclude.m4
    sed -e "s|slash\}libtool|slash\}../${HOST_SYS}-libtool|" -i libgc/acinclude.m4
    sed -e "s|slash\}libtool|slash\}../${HOST_SYS}-libtool|" -i eglib/acinclude.m4
    sed -e "s|r/libtool|r/${HOST_SYS}-libtool|" -i runtime/mono-wrapper.in
    sed -e "s|r/libtool|r/${HOST_SYS}-libtool|" -i runtime/monodis-wrapper.in
    find . -name "*.pc.in" -exec sed -i -e 's:^\([^=]*=\).*pcfiledir.*/\.\./\.\.:\1@prefix@:g' {} \;
}

 

As far as I understand, this code is exactly meant to convert makefiles from one libtool version to the installed one and some tiny corrections, before calling configure.

 

With this added into my recipe I am able now to compile mono. I guess this is more or less what petalinux 2016.2 does when compiling autotools projects, but this is not documented, and I wonder why this has been removed from petalinux 2017.2

 

Anyway, I would prefer to use the whole meta-mono in a proper and clean way, but did not find how.

 

This (temporary?) hack does the trick for me now, so thanks a lot for pointing me to meta-mono in the first place.

 

I am not very happy with this trick, and thus any indication on how you succeeded into installing meta-mono properly into petalinux 2017.2 would be greatly appreciated.

 

Thanks!

0 Kudos
roccobrandi
Explorer
Explorer
5,267 Views
Registered: ‎10-14-2015

Hi @sylvain.ellisys,

sorry I forgot to tell you about bblayers.conf

yes, if you change the file in build/conf folder, you will lose your changes.

 

you have to change the bblayers in petalinux source code.

 

you can find it in <your_petalinux_source_directory>/components/yocto/source/arm/conf/bblayers.conf

 

then you just add the recipe(s) you want to use in your petalinux-image.bbapend file like this:

IMAGE_INSTALL_append = " mono"

(note the extra space before the name)

 

 

Regards,

Rocco

View solution in original post

0 Kudos
sylvain.ellisys
Observer
Observer
3,631 Views
Registered: ‎04-10-2015

Hi again @roccobrandi,

 

Ok, thanks for the info.

 

It looks weird to me to have to "hack" petalinux source in order to add a component, given petalinux is especially using yocto for its modularity.

 

Anyway, I'll try this, thank you for the detail.

 

Thanks a lot.

0 Kudos