From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22013 invoked by alias); 15 Nov 2012 14:32:05 -0000 Received: (qmail 22003 invoked by uid 22791); 15 Nov 2012 14:32:04 -0000 X-SWARE-Spam-Status: No, hits=-3.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-qc0-f169.google.com (HELO mail-qc0-f169.google.com) (209.85.216.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 15 Nov 2012 14:31:58 +0000 Received: by mail-qc0-f169.google.com with SMTP id t2so1226453qcq.0 for ; Thu, 15 Nov 2012 06:31:58 -0800 (PST) MIME-Version: 1.0 Received: by 10.49.29.199 with SMTP id m7mr1163484qeh.41.1352989918118; Thu, 15 Nov 2012 06:31:58 -0800 (PST) Received: by 10.224.142.82 with HTTP; Thu, 15 Nov 2012 06:31:57 -0800 (PST) Date: Thu, 15 Nov 2012 14:32:00 -0000 Message-ID: Subject: [PATCH] fix sim build when configured with --enable-plugins From: Pavel Chupin To: 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/msg00399.txt.bz2 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 + . ${srcdir}/../../bfd/configure.host dnl Standard (and optional) simulator options. sim/ChangeLog entry: 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/acinclude.m4: Add libdl into 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. Can be reproduced on trunk with (for example): configure --enable-plugins --target arm-linux-androideabi make Error: gcc -DHAVE_CONFIG_H -DPROFILE=1 -DWITH_PROFILE=-1 -DDEFAULT_INLINE=0 -DMODET -DNEED_UI_LOOP_HOOK -DSIM_TARGET_SWITCHES -I. -I../../../sim/arm -I../common -I../../../sim/arm/../common -I../../include -I../../../sim/arm/../../include -I../../bfd -I../../../sim/arm/../../bfd -I../../opcodes -I../../../sim/arm/../../opcodes -g -O2 -static-libstdc++ -static-libgcc -o run \ run.o libsim.a ../../bfd/libbfd.a ../../opcodes/libopcodes.a ../../libiberty/libiberty.a -lz -lnsl ../../bfd/libbfd.a(plugin.o): In function `try_load_plugin': /tmp/gdb/BUILD/bfd/../../bfd/plugin.c:170: undefined reference to `dlopen' /tmp/gdb/BUILD/bfd/../../bfd/plugin.c:177: undefined reference to `dlsym' /tmp/gdb/BUILD/bfd/../../bfd/plugin.c:173: undefined reference to `dlerror' -- Pavel Chupin Intel Corporation