Bug 33109 - Telepathy-glib fails to build on blackfin
Summary: Telepathy-glib fails to build on blackfin
Status: RESOLVED NOTABUG
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: 0.13
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-14 06:49 UTC by Tiago Katcipis
Modified: 2011-01-17 04:16 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Makefile log (246.49 KB, text/x-log)
2011-01-14 06:49 UTC, Tiago Katcipis
Details
Configure log (59.74 KB, text/x-log)
2011-01-14 06:51 UTC, Tiago Katcipis
Details
generated abi.nm (506.07 KB, application/octet-stream)
2011-01-14 07:28 UTC, Tiago Katcipis
Details

Description Tiago Katcipis 2011-01-14 06:49:10 UTC
Created attachment 42034 [details]
Makefile log

Im trying to cross compile telepathy-glib to a blackfin platform, but i got stuck on this error on the build process:


/opt/uClinux/bfin-uclinux/bin/bfin-uclinux-nm -B .libs/libtelepathy-glib-internal.a > _gen/abi.nm
grep " [DT] " < _gen/abi.nm > _gen/abi.funcs
cut -d" " -f3 < _gen/abi.funcs > _gen/abi.funcnames
grep "^tp" < _gen/abi.funcnames > _gen/abi.tpfuncnames
make[3]: *** [_gen/abi.txt] Error 1
make[3]: Leaving directory `/home/katcipis/blackfin/flt/src/telepathy-glib-bfin/telepathy-glib'
make[2]: *** [all] Error 2
rm _gen/tp-spec-channel-dispatcher.xml _gen/tp-spec-connection-manager.xml _gen/tp-spec-channel-request.xml _gen/tp-spec-dbus-daemon.xml _gen/tp-spec-media-stream-handler.xml _gen/tp-spec-debug.xml _gen/tp-spec-client.xml _gen/tp-spec-connection.xml _gen/tp-spec-tls-cert.xml _gen/tp-spec-generic.xml _gen/tp-spec-account.xml _gen/tp-spec-account-manager.xml _gen/tp-spec-channel.xml _gen/tp-spec-protocol.xml _gen/tp-spec-media-session-handler.xml _gen/tp-spec-channel-dispatch-operation.xml
make[2]: Leaving directory `/home/katcipis/blackfin/flt/src/telepathy-glib-bfin/telepathy-glib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/katcipis/blackfin/flt/src/telepathy-glib-bfin'
make: *** [all] Error 2


first of all i thought i was doing something wrong, cross compiling to blackfin usually gives a lot of trouble :-). But searching for this kind of problem on google i bumped on this bug:

https://bugs.freedesktop.org//show_bug.cgi?id=14852

it seems to be like the problem i am having, but on another platform (ppc64), that is already fixed. So it made me think that maybe it is not my fault but a bug when building to this specific platform.

I'm going to take a dive on the make process, to try solving this problem, but it would be good to have the help of more experienced developers who are familiar with telepathy-glib build (I'm not even sure if it is a bug, sorry if it isn't).

The telepathy-glib version i'm trying to compile is 0.13.10.

Best Regards,
Tiago Katcipis
Comment 1 Tiago Katcipis 2011-01-14 06:51:01 UTC
Created attachment 42035 [details]
Configure log
Comment 2 Simon McVittie 2011-01-14 06:59:06 UTC
(In reply to comment #0)
> /opt/uClinux/bfin-uclinux/bin/bfin-uclinux-nm -B
> .libs/libtelepathy-glib-internal.a > _gen/abi.nm
> grep " [DT] " < _gen/abi.nm > _gen/abi.funcs
> cut -d" " -f3 < _gen/abi.funcs > _gen/abi.funcnames
> grep "^tp" < _gen/abi.funcnames > _gen/abi.tpfuncnames

What appears in telepathy-glib/_gen/abi.nm after attempting a build? (Attaching the whole file is probably easiest.)
Comment 3 Tiago Katcipis 2011-01-14 07:28:26 UTC
Created attachment 42036 [details]
generated abi.nm
Comment 4 Simon McVittie 2011-01-14 07:32:51 UTC
It looks as though your toolchain prepends an extra underscore to every symbol name (as seen by nm). I wonder how that interacts with symbol versioning...
Comment 5 Tiago Katcipis 2011-01-14 07:44:33 UTC
(In reply to comment #4)
> It looks as though your toolchain prepends an extra underscore to every symbol
> name (as seen by nm). I wonder how that interacts with symbol versioning...

i compared the blackfin nm with a x86 one and it really has an extra _ at the start of every symbol.

i did not understand what do you mean with "how that interacts with symbol versioning", the problem is the toolchain im using, the way im using it...or the tpglib build system ?
Comment 6 Simon McVittie 2011-01-14 08:15:58 UTC
The problem is that telepathy-glib is trying to do clever tricks with symbol versioning so we can detect accidental ABI breaks (and library users get better diagnostics if their telepathy-glib is too old), and I'm not sure how those interact with toolchains that prepend an underscore.

http://lists.gnupg.org/pipermail/gcrypt-devel/2010-June/001639.html seems to be basically the same problem.

One way we could work around this would be to try the symbol-versioning magic on a tiny library with known contents, and disable it if weird stuff is happening.

One workaround you could use to get a build would be to force the HAVE_LD_VERSION_SCRIPT conditional to be false.
Comment 7 Tiago Katcipis 2011-01-14 10:38:22 UTC
(In reply to comment #6)
> The problem is that telepathy-glib is trying to do clever tricks with symbol
> versioning so we can detect accidental ABI breaks (and library users get better
> diagnostics if their telepathy-glib is too old), and I'm not sure how those
> interact with toolchains that prepend an underscore.
> 
> http://lists.gnupg.org/pipermail/gcrypt-devel/2010-June/001639.html seems to be
> basically the same problem.
> 
> One way we could work around this would be to try the symbol-versioning magic
> on a tiny library with known contents, and disable it if weird stuff is
> happening.

This would be great, it seems that any little difference on how the toolchain generates the symbols can break the build.

> 
> One workaround you could use to get a build would be to force the
> HAVE_LD_VERSION_SCRIPT conditional to be false.

i tried to do that and dont worked, i run a grep on the source dir to find where HAVE_LD_VERSION_SCRIPT is used, but grep didnt find it anywhere...are you sure this is used on tpglib too? on the libgcrypt it seems to exist, but not on tpglib.

im looking at the blackfin toolchain nm to see if i can found another workaround...maybe configure it to make an output that works.

thanks for the help Simon, as soon as i get a solution ill post it here.
Comment 8 Tiago Katcipis 2011-01-14 10:55:41 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > The problem is that telepathy-glib is trying to do clever tricks with symbol
> > versioning so we can detect accidental ABI breaks (and library users get better
> > diagnostics if their telepathy-glib is too old), and I'm not sure how those
> > interact with toolchains that prepend an underscore.
> > 
> > http://lists.gnupg.org/pipermail/gcrypt-devel/2010-June/001639.html seems to be
> > basically the same problem.
> > 
> > One way we could work around this would be to try the symbol-versioning magic
> > on a tiny library with known contents, and disable it if weird stuff is
> > happening.
> 
> This would be great, it seems that any little difference on how the toolchain
> generates the symbols can break the build.
> 
> > 
> > One workaround you could use to get a build would be to force the
> > HAVE_LD_VERSION_SCRIPT conditional to be false.
> 
> i tried to do that and dont worked, i run a grep on the source dir to find
> where HAVE_LD_VERSION_SCRIPT is used, but grep didnt find it anywhere...are you
> sure this is used on tpglib too? on the libgcrypt it seems to exist, but not on
> tpglib.

im sorry, im not sure what i did wrong before...but the HAVE_LD_VERSION_SCRIPT actually exists. 

i set it to 'no' on my environment, on the config.log it is set as:

HAVE_LD_VERSION_SCRIPT_FALSE='#'
HAVE_LD_VERSION_SCRIPT_TRUE=''

...but the build still fails on the same point.

/opt/uClinux/bfin-uclinux/bin/bfin-uclinux-nm -B .libs/libtelepathy-glib-internal.a > _gen/abi.nm
grep " [DT] " < _gen/abi.nm > _gen/abi.funcs
cut -d" " -f3 < _gen/abi.funcs > _gen/abi.funcnames
grep "^tp" < _gen/abi.funcnames > _gen/abi.tpfuncnames
make[3]: ** [_gen/abi.txt] Erro 1

> 
> im looking at the blackfin toolchain nm to see if i can found another
> workaround...maybe configure it to make an output that works.
> 
> thanks for the help Simon, as soon as i get a solution ill post it here.
Comment 9 Emilio Pozuelo Monfort 2011-01-14 11:04:01 UTC
(In reply to comment #8)
> i set it to 'no' on my environment, on the config.log it is set as:
> 
> HAVE_LD_VERSION_SCRIPT_FALSE='#'
> HAVE_LD_VERSION_SCRIPT_TRUE=''

That means it didn't work. configure probably doesn't look at your environment but does some check instead. An AC_DEFINE in configure.ac is probably what you want.
Comment 10 Tiago Katcipis 2011-01-14 11:11:14 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > i set it to 'no' on my environment, on the config.log it is set as:
> > 
> > HAVE_LD_VERSION_SCRIPT_FALSE='#'
> > HAVE_LD_VERSION_SCRIPT_TRUE=''
> 
> That means it didn't work. configure probably doesn't look at your environment
> but does some check instead.

i thought that a HAVE_LD_VERSION_SCRIPT_FALSE='#' would mean that the FALSE option is enable, while a HAVE_LD_VERSION_SCRIPT_TRUE with an empty '' means not enabled, not very used with this config stuff :-).

> An AC_DEFINE in configure.ac is probably what you
> want.

im going to take a look on it.

Thanks for the help Emilio.
Comment 11 Tiago Katcipis 2011-01-14 12:05:10 UTC
Taking a look at configure.ac/Makefile.am/abi.am ...well a lot of stuff, it seems that i cant configure HAVE_LD_VERSION_SCRIPT, the generated configure will check if the compiler support it and will enable or disable it automatically, i didn't find anything to disable it.

i could easily force it to bypass all this on configure.ac and compile, but i was thinking on fix that better. If I'm right and there is no way to manually disable this, what do you guys think about creating an option to disable it on configure.ac ? i could do the changes, test it and make a patch.

or i could mess around a little more with the grep logic that breaks because of the extra "_" appended at the start of the symbols.

not sure about the better option to solve the problem.
Comment 12 Tiago Katcipis 2011-01-17 04:16:05 UTC
(In reply to comment #11)
> Taking a look at configure.ac/Makefile.am/abi.am ...well a lot of stuff, it
> seems that i cant configure HAVE_LD_VERSION_SCRIPT, the generated configure
> will check if the compiler support it and will enable or disable it
> automatically, i didn't find anything to disable it.
> 
> i could easily force it to bypass all this on configure.ac and compile, but i
> was thinking on fix that better. If I'm right and there is no way to manually
> disable this, what do you guys think about creating an option to disable it on
> configure.ac ? i could do the changes, test it and make a patch.
> 
> or i could mess around a little more with the grep logic that breaks because of
> the extra "_" appended at the start of the symbols.
> 
> not sure about the better option to solve the problem.


A better solution has appeared :-).
bfin-uclinux-nm was being called with a -B, changing the nm call to:

bfin-uclinux-nm --demangle=gnu

fixes the problem, the default -B is the same as --demangle=bsd.
on way to set this is by calling:

export NM="bfin-uclinux-nm --demangle=gnu"

before compiling, overriding the toolchain default -B.

thanks for all the help.

Best regards,
Tiago Katcipis


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.