FS#14215 - Anjuta lacks the valgrind plugin

Attached to Project: Arch Linux
Opened by Giuseppe Borzi (gborzi) - Monday, 13 April 2009, 14:08 GMT
Last edited by Jan de Groot (JGC) - Saturday, 02 May 2009, 18:01 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jan de Groot (JGC)
Andreas Radke (AndyRTR)
Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
anjuta 2.26.0 lacks the valgrind plugin, although the packager tried to activate it with configure, valgrind is in optdepends as 'valgrind: for the valgrind debugger plugin' and is in makedepends. The problem lies in configure.in that currently has this check for activating this plugin

AC_CHECK_LIB(bfd, bfd_get_error, [PLUGIN_VALGRIND_LIBS="-Wl,-Bstatic -lbfd -liberty -Wl,-Bdynamic"],
valgrind="no",
-liberty)

this fails because libbfd requires both libiberty and *libz*.Changing the above check in configure.in to

AC_CHECK_LIB(bfd, bfd_get_error, [PLUGIN_VALGRIND_LIBS="-Wl,-Bstatic -lbfd -liberty -lz -Wl,-Bdynamic"],
valgrind="no",
[-liberty -lz])

and regenerating configure with autoconf fixes the problem. I'm attaching the patch I used to recompile the package.
On a side note, I would suggest to add ctags to optdepends, because ctags is needed by the new symbol-db plugin. anjuta complains of a missing ctags if it doesn't find it.

Additional info:
* package version(s)
* config and/or log files etc.


Steps to reproduce:
Open anjuta and try to activate the valgrind plugin: it's not among the available plugins.
This task depends upon

Closed by  Jan de Groot (JGC)
Saturday, 02 May 2009, 18:01 GMT
Reason for closing:  Fixed
Additional comments about closing:  binutils in testing contains a correct libbfd.so, anjuta 2.26.1.0-1 is built against a fixed libbfd.so file.
Comment by Giuseppe Borzi (gborzi) - Monday, 13 April 2009, 14:08 GMT
I forgot the patch :-( .
Comment by Jan de Groot (JGC) - Monday, 13 April 2009, 14:29 GMT
Isn't this a bug in libbfd instead? If it needs libz, it should link to that.
Comment by Giuseppe Borzi (gborzi) - Monday, 13 April 2009, 15:11 GMT
Actually libbfd belongs to the binutils package, which doesn't depend on libz, altough libbfd links to libz (see the output of "ldd /usr/lib/libbfd-2.19.1.20090205.so"). Please note that binutils contains static libraries (If I'm not wrong, these needs to be explicitly linked with any needed library) and dynamic libraries with names like "lib<somethin>-<version>.so. I'm not sure, but I think that linking with -lbfd -liberty links with the static libraries and misses the libz library.
Comment by Andreas Radke (AndyRTR) - Wednesday, 15 April 2009, 20:15 GMT
it works that way. but I also think binutils should be fixed first to seem if the anjuta configure patch becomes obsolete then.

Allan, would you mind building/releasing a binutils quickfix foir this? I know you have commited this already to trunk some time ago.
Comment by Allan McRae (Allan) - Wednesday, 15 April 2009, 22:36 GMT
gcc-4.4 should get released in the next week so I will do the binutils bump as part of the toolchain rebuild then.
Comment by Allan McRae (Allan) - Sunday, 19 April 2009, 08:56 GMT
BTW, I'd guarantee that whoever built anjuta had zlib installed (its part of base) so the binutils bump will likely not fix this. It just adds the dep to the package info.
Comment by Andreas Radke (AndyRTR) - Sunday, 19 April 2009, 10:21 GMT
This should probably be reported and discussed upstream by the bug reporter. I don't use anjuta myself.
Comment by Giuseppe Borzi (gborzi) - Sunday, 19 April 2009, 12:15 GMT
I looked into binutils and found this in PKGBUILD

# Remove these symlinks, with binutils prereleases they are not ABI stable.
# Programs should compile static to the .a file.
rm -f ${startdir}/pkg/usr/lib/lib{bfd,opcodes}.so

adding a symlink in this way "cd /usr/lib && ln -s libbfd-2.19.1.20090205.so libbfd.so" fixes the missing valgrind plugin issue without the need to change configure.in and rebuild configure with autoconf. I don't think this can be considered an anjuta bug and reported upstream, anjuta's authors rely (and rightly so) on the availability of libbfd.so. Now I agree with Jan, it's a binutils bug due to the way it is packaged.
Comment by Jan de Groot (JGC) - Sunday, 19 April 2009, 12:35 GMT
This is a bug in binutils because the .a file isn't linked correctly. As for the .so file: we remove those symbolic links because we don't want programs to link dynamic to it. This is not an anjuta bug.
Comment by Allan McRae (Allan) - Sunday, 19 April 2009, 14:52 GMT
I have added a nice linker script for libbfd.so to the binutils PKGBUILD (credit to Fedora spec file):

echo "INPUT (libbfd.a -liberty -lz )" >${pkgdir}/usr/lib/libbfd.so

This fixes the issue. This will be done with the gcc-4.4.0 toolchain rebuild which should be this week (provided no blocker to gcc-4.4.0 release is found).
Comment by Giuseppe Borzi (gborzi) - Sunday, 19 April 2009, 15:11 GMT
It works, I deleted the symlink to libbfd-2.19.1.20090205.so and created a new libbfd.so as suggested by Allan, i.e.
$ echo "INPUT (libbfd.a -liberty -lz )" > /usr/lib/libbfd.so
and configure now reports it can build the valgrid plugin. Although this is a binutils bug, anjuta still needs to be rebuilt to get the plugin.

Loading...