aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: bfd check fails with binutils-2.21  (Read 4609 times)

Gerd78

  • Hero Member
  • *****
  • Karma: 9
  • Offline Offline
  • Posts: 681
bfd check fails with binutils-2.21
« on: January 16, 2011, 12:22:40 AM »

Just noticed in config.log after updating binutils to the openSUSE 11.4 ("factory") package:
Code: [Select]
configure:13922: checking for bfd
configure:13948: gcc -o conftest     conftest.c -lbfd -liberty  -lz  >&5
conftest.c: In function 'main':
conftest.c:177:19: warning: initialization discards qualifiers from pointer target type
/usr/lib/gcc/i586-suse-linux/4.5/../../../libbfd.a(plugin.o): In function `try_load_plugin':
/usr/src/packages/BUILD/binutils-2.21/build-dir/bfd/../../bfd/plugin.c:132: undefined reference to `dlopen'
/usr/src/packages/BUILD/binutils-2.21/build-dir/bfd/../../bfd/plugin.c:139: undefined reference to `dlsym'
/usr/src/packages/BUILD/binutils-2.21/build-dir/bfd/../../bfd/plugin.c:135: undefined reference to `dlerror'
collect2: ld returned 1 exit status
configure:13948: $? = 1
-lbfd seems to require -ldl (as it's called on Linux, might be called differently on other systems) now.
Logged

Gerd78

  • Hero Member
  • *****
  • Karma: 9
  • Offline Offline
  • Posts: 681
Re: bfd check fails with binutils-2.21
« Reply #1 on: January 19, 2011, 05:25:38 PM »

Correcting myself: The determining factor is not binutils version 2.21, but whether binutils was compiled with --enable-plugins. It just happened that openSUSE added --enable-plugins at the same time the package was updated to version 2.21.

Is this the right way to fix it? Appears to work for me.
Code: [Select]
--- ./acinclude.m4
+++ ./acinclude.m4
@@ -439,7 +439,7 @@
 
  AC_MSG_CHECKING([for bfd])
  result=no
- for bfd_ldadd in "" "${LIBINTL}"; do
+ for bfd_ldadd in "" "${LIBINTL}" "-ldl"; do
  MULE_BACKUP([LIBS])
  MULE_BACKUP([LDFLAGS])
  MULE_PREPEND([LIBS], [-lbfd -liberty ${bfd_ldadd} ${ZLIB_LIBS}])
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: bfd check fails with binutils-2.21
« Reply #2 on: January 19, 2011, 08:02:51 PM »

Is this the right way to fix it?
Better this way:
Code: [Select]
--- ./acinclude.m4
+++ ./acinclude.m4
@@ -439,7 +439,7 @@
 
  AC_MSG_CHECKING([for bfd])
  result=no
- for bfd_ldadd in "" "${LIBINTL}"; do
+ for bfd_ldadd in "" "${LIBINTL}" "-ldl" "-ldl ${LIBINTL}"; do
  MULE_BACKUP([LIBS])
  MULE_BACKUP([LDFLAGS])
  MULE_PREPEND([LIBS], [-lbfd -liberty ${bfd_ldadd} ${ZLIB_LIBS}])
Logged
concordia cum veritate

Gerd78

  • Hero Member
  • *****
  • Karma: 9
  • Offline Offline
  • Posts: 681
Re: bfd check fails with binutils-2.21
« Reply #3 on: January 19, 2011, 09:45:15 PM »

Hm, I thought that glibc systems have libintl integrated in glibc and non-glibc systems have dlopen/dlsym/dlerror integrated in their respective libc, but now I see you may be right, Solaris seems to have both libintl and libdl outside its libc.

I did not actually test this on Solaris, however. Anyway, the extra test does certainly no harm, in the worst case it is not used.
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: bfd check fails with binutils-2.21
« Reply #4 on: January 20, 2011, 10:04:37 PM »

Committed in rev. 10436.
Logged
concordia cum veritate

Gerd78

  • Hero Member
  • *****
  • Karma: 9
  • Offline Offline
  • Posts: 681
Re: bfd check fails with binutils-2.21
« Reply #5 on: January 20, 2011, 10:55:29 PM »

Thanks!
Logged