This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: compile failure due to undefined symbol


Hi Daniel,

If the RPATH directory is missing, it's ignored.  But if it's present,
it will be used - so putting some other libbfd there will break your
installed assembler and linker.  Potential security hole and definite
nuisance.

Ah, understood.


OK, so the patch works just as well without the RPATH entry being added to the libopcodes library, so here is a revised version for people to ponder.

Cheers
  Nick


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	2 Oct 2007 15:28:53 -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,122 ----
  
  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_LDFLAGS="-Wl,-z,defs"
!       SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.so"
!       SHARED_DEPENDENCIES="`pwd`/../bfd/.libs/libbfd.so"
!       ;;
!   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	2 Oct 2007 15:28:53 -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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]