From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24217 invoked by alias); 16 Nov 2012 09:14:34 -0000 Received: (qmail 24207 invoked by uid 22791); 16 Nov 2012 09:14:33 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-qa0-f48.google.com (HELO mail-qa0-f48.google.com) (209.85.216.48) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Nov 2012 09:14:27 +0000 Received: by mail-qa0-f48.google.com with SMTP id s11so2073856qaa.0 for ; Fri, 16 Nov 2012 01:14:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.109.199 with SMTP id k7mr3628024qap.66.1353057266383; Fri, 16 Nov 2012 01:14:26 -0800 (PST) Received: by 10.224.142.82 with HTTP; Fri, 16 Nov 2012 01:14:26 -0800 (PST) In-Reply-To: References: Date: Fri, 16 Nov 2012 09:14:00 -0000 Message-ID: Subject: Re: [PATCH] fix sim build when configured with --enable-plugins From: Pavel Chupin To: "H.J. Lu" Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-11/txt/msg00458.txt.bz2 Changed: diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in index 1a3a6b6..bacfa24 100644 --- a/sim/common/Make-common.in +++ b/sim/common/Make-common.in @@ -58,6 +58,7 @@ man1dir = $(mandir)/man1 infodir = @infodir@ includedir = @includedir@ +lt_cv_dlopen_libs = @lt_cv_dlopen_libs@ # This can be referenced by the gettext configuration code. top_builddir = .. @@ -255,6 +256,7 @@ COMMON_DEP_CFLAGS = $(CONFIG_CFLAGS) $(CSEARCH) LIBIBERTY_LIB = ../../libiberty/libiberty.a BFD_LIB = ../../bfd/libbfd.a +@PLUGINS_TRUE@LIBDL = @lt_cv_dlopen_libs@ OPCODES_LIB = ../../opcodes/libopcodes.a LIBINTL = @LIBINTL@ LIBINTL_DEP = @LIBINTL_DEP@ @@ -262,7 +264,7 @@ CONFIG_LIBS = @LIBS@ LIBDEPS = $(BFD_LIB) $(OPCODES_LIB) $(LIBINTL_DEP) $(LIBIBERTY_LIB) \ $(SIM_EXTRA_LIBDEPS) EXTRA_LIBS = $(BFD_LIB) $(OPCODES_LIB) $(LIBINTL) $(LIBIBERTY_LIB) \ - $(CONFIG_LIBS) $(SIM_EXTRA_LIBS) + $(CONFIG_LIBS) $(SIM_EXTRA_LIBS) $(LIBDL) LIB_OBJS = callback.o syscall.o targ-map.o version.o $(SIM_OBJS) diff --git a/sim/common/acinclude.m4 b/sim/common/acinclude.m4 index fe0a5b7..b6ebf15 100644 --- a/sim/common/acinclude.m4 +++ b/sim/common/acinclude.m4 @@ -21,6 +21,12 @@ # Include global overrides and fixes for Autoconf. m4_include(../../config/override.m4) sinclude([../../config/zlib.m4]) +m4_include([../../config/plugins.m4]) +m4_include([../../libtool.m4]) +m4_include([../../ltoptions.m4]) +m4_include([../../ltsugar.m4]) +m4_include([../../ltversion.m4]) +m4_include([../../lt~obsolete.m4]) sinclude([../../config/depstand.m4]) AC_DEFUN([SIM_AC_COMMON], @@ -90,6 +96,12 @@ AC_CHECK_LIB(nsl, gethostbyname) # using the same condition. AM_ZLIB +# BFD uses libdl when when plugins enabled. +AC_PLUGINS +AM_CONDITIONAL(PLUGINS, test "$plugins" = yes) +LT_INIT([dlopen]) +AC_SUBST(lt_cv_dlopen_libs) + . ${srcdir}/../../bfd/configure.host dnl Standard (and optional) simulator options. ChangeLog: 2012-11-09 Pavel Chupin Fix sim build when bfd is configured with --enable-plugins * arm/configure: Regenerate. * avr/configure: Regenerate. * bfin/configure: Regenerate. * common/Make-common.in: Use lt_cv_dlopen_libs under PLUGINS condition. * common/acinclude.m4: Define lt_cv_dlopen_libs. * common/configure: Regenerate. * cr16/configure: Regenerate. * cris/configure: Regenerate. * d10v/configure: Regenerate. * erc32/configure: Regenerate. * frv/configure: Regenerate. * h8300/configure: Regenerate. * igen/configure: Regenerate. * iq2000/configure: Regenerate. * lm32/configure: Regenerate. * m32c/configure: Regenerate. * m32r/configure: Regenerate. * m68hc11/configure: Regenerate. * mcore/configure: Regenerate. * microblaze/configure: Regenerate. * mips/configure: Regenerate. * mn10300/configure: Regenerate. * moxie/configure: Regenerate. * ppc/configure: Regenerate. * rl78/configure: Regenerate. * rx/configure: Regenerate. * sh/configure: Regenerate. * sh64/configure: Regenerate. * testsuite/configure: Regenerate. * v850/configure: Regenerate. 2012/11/15 H.J. Lu : > On Thu, Nov 15, 2012 at 6:31 AM, Pavel Chupin wrote: >> Hi, >> Patch below fix sim builds for some targets when bfd build is >> configured with --enable-plugins. In this case libbfd.a (plugin.o) has >> dependencies on libdl so it should be included into link commands, >> similar as zlib. >> Is it OK for trunk? >> >> Patch: >> >> diff --git a/sim/common/acinclude.m4 b/sim/common/acinclude.m4 >> index fe0a5b7..1d2fd1c 100644 >> --- a/sim/common/acinclude.m4 >> +++ b/sim/common/acinclude.m4 >> @@ -21,6 +21,7 @@ >> # Include global overrides and fixes for Autoconf. >> m4_include(../../config/override.m4) >> sinclude([../../config/zlib.m4]) >> +sinclude([../../config/plugins.m4]) >> sinclude([../../config/depstand.m4]) >> >> AC_DEFUN([SIM_AC_COMMON], >> @@ -90,6 +91,12 @@ AC_CHECK_LIB(nsl, gethostbyname) >> # using the same condition. >> AM_ZLIB >> >> +# BFD uses libdl when when plugins enabled. >> +AC_PLUGINS >> +if test "x$plugins" = "xyes"; then >> + LIBS+=" -ldl" >> +fi >> + > > This is wrong. Please do it like: > > http://sourceware.org/git/?p=binutils.git;a=patch;h=f780e457f046c09d336e4dab0ffbcfbec70bfbee > > -- > H.J. -- Pavel Chupin Intel Corporation