Bug 47723 - Add libffi to configure
Summary: Add libffi to configure
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: mission-control (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL: http://cgit.collabora.com/git/user/as...
Whiteboard: review+
Keywords: patch
Depends on:
Blocks:
 
Reported: 2012-03-22 08:18 UTC by Alvaro Soliverez
Modified: 2012-05-08 09:33 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Alvaro Soliverez 2012-03-22 08:18:17 UTC
MC now depends on functions provided by libffi. In Android, the libs and cflags have to be added explicitely, as they are not inherited from glib.
Comment 1 Simon McVittie 2012-03-22 08:26:11 UTC
OK, I suppose, but the need to do this makes me sad. You really shouldn't need to do this if MC doesn't specifically call ffi_something().

Is there no way to get androgenizer, or indeed the Android libc, to pick up library interdependencies properly? On platforms where it's used, libtool has been solving this problem for a decade and a half, and modern GNU/Linux doesn't need that bit of libtool functionality anyway, because its linker does the right thing. It seems bad that Android is years behind GNU systems...
Comment 2 Simon McVittie 2012-03-22 08:35:21 UTC
One way to avoid this problem globally would be for all of our /Android.mk to do:

    ./configure [...] PKG_CONFIG="pkg-config --static"

which means that pkg-config will explicitly request the complete dependency chain of every library:

    % pkg-config --libs gobject-2.0
    -pthread -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0  

    % pkg-config --static --libs gobject-2.0
    -pthread -lgobject-2.0 -lffi -lgthread-2.0 -lglib-2.0 -lrt

I'd prefer this approach, assuming it works: I think this is a considerably better long-term solution than hard-coding random extra dependencies in all of our packages.
Comment 3 Alvaro Soliverez 2012-03-22 14:09:41 UTC
Fixed the branch with the suggestions made by Simon. Thanks!

Btw, we had to fix the glib uninstalled-pc.in files
Comment 4 Simon McVittie 2012-03-23 04:45:48 UTC
This change looks fine, but I'd prefer the commit message to say that this is only for Android, and the way you've broken the line makes it rather weird in git tools (have a look at how it looks in gitweb!).

Here's how I'd phrase it without hitting the 80ish character limit for the first line:

    On Android, use pkg-config --static

    This makes it output the complete dependency chain for each
    library, e.g. libffi for GObject. This is necessary because Android
    toolchains don't follow shared library interdependencies like
    normal GNU toolchains.

(Consider this change pre-reviewed for other Telepathy projects that have an Android.mk, too - it should work the same.)
Comment 5 Simon McVittie 2012-03-23 04:47:35 UTC
(In reply to comment #3)
> Btw, we had to fix the glib uninstalled-pc.in files

Please send that change upstream (I assume it consisted of adding libffi to either Libs.private or Requires.private?) - it'll also be necessary if anyone is crazy enough to link GLib statically.
Comment 6 Alvaro Soliverez 2012-03-23 05:11:05 UTC
(In reply to comment #4)
> This change looks fine, but I'd prefer the commit message to say that this is
> only for Android, and the way you've broken the line makes it rather weird in
> git tools (have a look at how it looks in gitweb!).
> 

Amended the commit message. Thanks!
Comment 7 Alvaro Soliverez 2012-03-23 05:18:09 UTC
(In reply to comment #5)
> (In reply to comment #3)
> > Btw, we had to fix the glib uninstalled-pc.in files
> 
> Please send that change upstream (I assume it consisted of adding libffi to
> either Libs.private or Requires.private?) - it'll also be necessary if anyone
> is crazy enough to link GLib statically.

Filed bug https://bugzilla.gnome.org/show_bug.cgi?id=672684

I don't have much hope,though, as the uninstalled files were removed in the latest glib version
Comment 8 Alvaro Soliverez 2012-03-24 04:09:41 UTC
(In reply to comment #7)
> (In reply to comment #5)
> > (In reply to comment #3)
> > > Btw, we had to fix the glib uninstalled-pc.in files
> > 
> > Please send that change upstream (I assume it consisted of adding libffi to
> > either Libs.private or Requires.private?) - it'll also be necessary if anyone
> > is crazy enough to link GLib statically.
> 
> Filed bug https://bugzilla.gnome.org/show_bug.cgi?id=672684
> 
> I don't have much hope,though, as the uninstalled files were removed in the
> latest glib version

As expected, that bug was closed as WONTFIX.
Comment 9 Simon McVittie 2012-03-26 04:16:33 UTC
(In reply to comment #6)
> Amended the commit message. Thanks!

Ship it.

(In reply to comment #7)
> > > Btw, we had to fix the glib uninstalled-pc.in files
[...]
> I don't have much hope,though, as the uninstalled files were removed in the
> latest glib version

Now seems an ideal time to investigate whether/how you can avoid needing the -uninstalled.pc.in files, then...
Comment 10 Alvaro Soliverez 2012-03-26 04:52:37 UTC
commit 370e642d6dc6983fee0ef1fcbedd96ef3a2b3b64
Author: Alvaro Soliverez <alvaro.soliverez@collabora.co.uk>
Date:   Thu Mar 22 18:05:04 2012 -0300

    On Android, use pkg-config --static
    
    This makes it output the complete dependency chain for each
    library, e.g. libffi for GObject. This is necessary because Android
    toolchains don't follow shared library interdependencies like
    normal GNU toolchains.

commit dcebc508f40abd0eaceb57039e5789638b5297b1
Author: Alvaro Soliverez <alvaro.soliverez@collabora.co.uk>
Date:   Thu Mar 22 18:04:31 2012 -0300

    Use the correct LD_FLAGS variable for the Android target


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.