This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: compile failure due to undefined symbol
- From: Nick Clifton <nickc at redhat dot com>
- To: "Peter S. Mazinger" <ps dot m at gmx dot net>
- Cc: binutils at sourceware dot org
- Date: Thu, 04 Oct 2007 15:05:29 +0100
- Subject: Re: compile failure due to undefined symbol
- References: <Pine.LNX.4.44.0710030924190.3480-100000@lnx.bridge.intra>
Hi Peter,
I have used SHARED_DEPENDENCIES pointing to `pwd`/../bfd/libbfd.la
Right. I should have been using that.
Here is the patch that I have checked in.
Cheers
Nick
opcodes/ChangeLog
2007-10-04 Nick Clifton <nickc@redhat.com>
* configure.in (WIN32LDFLAGS): Rename to SHARED_LDFLAGS.
(WIN32LIBADD): Rename to SHARED_LIBADD
(SHARED_DEPENDENCIES): New exported variable.
(enable_shared): Add dependency upon libbfd.la for non-cygwin
based shared library builds.
* Makefile.am (libopcodes_la_DEPENDENCIES): Append
SHARED_DEPENDENCIES.
(libopcodes_la_LIBADD): Rename WIN32LIBADD to SHARED_LIBADD.
(libopcodes_la_LDFLAGS): Rename WIN32LDFLAGS to SHARED_LDFLAGS.
* configure: Regenerate.
* Makefile.in: Regenerate.
Index: opcodes/configure.in
===================================================================
RCS file: /cvs/src/src/opcodes/configure.in,v
retrieving revision 1.78
diff -c -3 -p -r1.78 configure.in
*** opcodes/configure.in 9 Sep 2007 01:22:57 -0000 1.78
--- opcodes/configure.in 4 Oct 2007 13:58:40 -0000
*************** AC_SUBST(cgendir)
*** 97,115 ****
using_cgen=no
! # Horrible hacks to build DLLs on Windows.
! WIN32LDFLAGS=
! WIN32LIBADD=
! case "${host}" in
! *-*-cygwin*)
! if test "$enable_shared" = "yes"; then
! WIN32LDFLAGS="-no-undefined"
! WIN32LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin"
! fi
! ;;
! esac
! AC_SUBST(WIN32LDFLAGS)
! AC_SUBST(WIN32LIBADD)
# target-specific stuff:
--- 97,121 ----
using_cgen=no
! # Horrible hacks to build DLLs on Windows and a shared library elsewhere.
! SHARED_LDFLAGS=
! SHARED_LIBADD=
! SHARED_DEPENDENCIES=
! if test "$enable_shared" = "yes"; then
! case "${host}" in
! *-*-cygwin*)
! SHARED_LDFLAGS="-no-undefined"
! SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin"
! ;;
! *)
! SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.so"
! SHARED_DEPENDENCIES="`pwd`/../bfd/.libs/libbfd.la"
! ;;
! esac
! fi
! AC_SUBST(SHARED_LDFLAGS)
! AC_SUBST(SHARED_LIBADD)
! AC_SUBST(SHARED_DEPENDENCIES)
# target-specific stuff:
Index: opcodes/Makefile.am
===================================================================
RCS file: /cvs/src/src/opcodes/Makefile.am,v
retrieving revision 1.121
diff -c -3 -p -r1.121 Makefile.am
*** opcodes/Makefile.am 14 Sep 2007 19:28:56 -0000 1.121
--- opcodes/Makefile.am 4 Oct 2007 13:58:40 -0000
*************** libopcodes_la_SOURCES = dis-buf.c disas
*** 367,376 ****
# Unfortunately this causes libtool to add -L$(libdir), referring to the
# planned install directory of libbfd. This can cause us to pick up an
# old version of libbfd, or to pick up libbfd for the wrong architecture
! # if host != build.
! libopcodes_la_DEPENDENCIES = $(OFILES)
! libopcodes_la_LIBADD = $(OFILES) @WIN32LIBADD@
! libopcodes_la_LDFLAGS = -release `cat ../bfd/libtool-soversion` @WIN32LDFLAGS@
# libtool will build .libs/libopcodes.a. We create libopcodes.a in
# the build directory so that we don't have to convert all the
--- 367,377 ----
# Unfortunately this causes libtool to add -L$(libdir), referring to the
# planned install directory of libbfd. This can cause us to pick up an
# old version of libbfd, or to pick up libbfd for the wrong architecture
! # if host != build. So for building with shared libraries we use a
! # hardcoded path to libbfd.so instead of relying on the entries in libbfd.la.
! libopcodes_la_DEPENDENCIES = $(OFILES) @SHARED_DEPENDENCIES@
! libopcodes_la_LIBADD = $(OFILES) @SHARED_LIBADD@
! libopcodes_la_LDFLAGS = -release `cat ../bfd/libtool-soversion` @SHARED_LDFLAGS@
# libtool will build .libs/libopcodes.a. We create libopcodes.a in
# the build directory so that we don't have to convert all the