From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23942 invoked by alias); 27 Nov 2012 08:16:37 -0000 Received: (qmail 23920 invoked by uid 22791); 27 Nov 2012 08:16:33 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_DL,TW_FC X-Spam-Check-By: sourceware.org Received: from mail-we0-f169.google.com (HELO mail-we0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 27 Nov 2012 08:16:27 +0000 Received: by mail-we0-f169.google.com with SMTP id t49so3319263wey.0 for ; Tue, 27 Nov 2012 00:16:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.51.21 with SMTP id a21mr5023615wec.176.1354004185815; Tue, 27 Nov 2012 00:16:25 -0800 (PST) Received: by 10.216.153.132 with HTTP; Tue, 27 Nov 2012 00:16:25 -0800 (PST) In-Reply-To: <20121127081142.GA3581@adacore.com> References: <20121127081142.GA3581@adacore.com> Date: Tue, 27 Nov 2012 08:16:00 -0000 Message-ID: Subject: Re: [PATCH] Fix libtool.m4 dlopen lookup for mingw From: Kai Tietz To: Joel Brobecker Cc: Pavel Chupin , gdb-patches@sourceware.org, "H.J. Lu" 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/msg00701.txt.bz2 2012/11/27 Joel Brobecker : > Hi Pavel, > >> Attached patch removes mingw from special cases of dlopen lookup. It >> allows dlopen to be found later in libdl and have it added properly as >> -ldl in bfd and sim builds. >> >> To reproduce the problem: >> >> ../configure --enable-plugins --target=arm-linux-android >> --host=i586-pc-mingw32msvc --build=i386-linux-gnu >> make >> >> Error: >> ../../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' >> >> ChangeLog: >> >> 2012-11-27 Pavel Chupin >> >> Fix libtool.m4 libdl lookup for mingw >> * libtool.m4: Remove mingw from special case of dlopen lookup >> * bfd/configure: Regenerate. >> * sim/arm/configure: Regenerate. >> * sim/avr/configure: Regenerate. >> * sim/bfin/configure: Regenerate. >> * sim/common/configure: Regenerate. >> * sim/cr16/configure: Regenerate. >> * sim/cris/configure: Regenerate. >> * sim/d10v/configure: Regenerate. >> * sim/erc32/configure: Regenerate. >> * sim/frv/configure: Regenerate. >> * sim/h8300/configure: Regenerate. >> * sim/iq2000/configure: Regenerate. >> * sim/lm32/configure: Regenerate. >> * sim/m32c/configure: Regenerate. >> * sim/m32r/configure: Regenerate. >> * sim/m68hc11/configure: Regenerate. >> * sim/mcore/configure: Regenerate. >> * sim/microblaze/configure: Regenerate. >> * sim/mips/configure: Regenerate. >> * sim/mn10300/configure: Regenerate. >> * sim/moxie/configure: Regenerate. >> * sim/rl78/configure: Regenerate. >> * sim/rx/configure: Regenerate. >> * sim/sh/configure: Regenerate. >> * sim/sh64/configure: Regenerate. >> * sim/v850/configure: Regenerate. > > Thanks for sending this patch. > > Changes to the root directory are controled by the GCC developers, > so you will need to send your patch there for approval. But looking > at your patch, I am wondering whether it is actually right. I have > two reasons for questioning your patch: > > - I don't think MinGW actually provides libdl, at least not by default. > Your change would probably break the build for those who do not > have the dlfcn extension installed; Right, by default there is no such library present. Therefore mingw can't dependent on the presence of such a library. > - Looking at bfd/plugin.c, there are implementations of these > dlfcn functions provided by that file for Windows. > These implementations are guarded by: > > #if !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H) > > I am guessing that your MinGW install has dlfcn.h. Perhaps the problem > would need to be fixed in bfd instead (binutils AT sourceware dot org). Yes, I assume that a fix of the issue you had should be addressed in binutils instead. Regards, Kai