From patchwork Fri Jan 7 21:19:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 77918 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id CA5EFB70E6 for ; Sat, 8 Jan 2011 08:19:48 +1100 (EST) Received: (qmail 19829 invoked by alias); 7 Jan 2011 21:19:47 -0000 Received: (qmail 19821 invoked by uid 22791); 7 Jan 2011 21:19:46 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, TW_DL, TW_FC X-Spam-Check-By: sourceware.org Received: from c2beaomr08.btconnect.com (HELO mail.btconnect.com) (213.123.26.186) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 07 Jan 2011 21:19:32 +0000 Received: from host81-138-1-83.in-addr.btopenworld.com (EHLO thor.office) ([81.138.1.83]) by c2beaomr08.btconnect.com with ESMTP id BGA74252; Fri, 07 Jan 2011 21:19:29 +0000 (GMT) Cc: GCC Patches Message-Id: From: IainS To: Richard Guenther In-Reply-To: Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: PING [PR46902/46912] Re: [Patch] Fix PR46916/46902 Date: Fri, 7 Jan 2011 21:19:28 +0000 References: <729B66E4-0D48-4823-9EC1-B346C3906C24@sandoe-acoustics.co.uk> X-Mirapoint-IP-Reputation: reputation=Fair-1, source=Queried, refid=tid=0001.0A0B0302.4D278360.010F, actions=tag X-Junkmail-Signature-Raw: score=unknown, refid=str=0001.0A0B0208.4D278362.0075, ss=1, fgs=0, ip=0.0.0.0, so=2010-07-22 22:03:31, dmn=2009-09-10 00:05:08, mode=single engine X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 7 Jan 2011, at 18:08, Richard Guenther wrote: >>> >>> Index: gcc/plugin.c >>> =================================================================== >>> --- gcc/plugin.c (revision 167973) >>> +++ gcc/plugin.c (working copy) >>> @@ -21,16 +21,19 @@ along with GCC; see the file COPYING3. If not >>> see >>> APIs described in doc/plugin.texi. */ >>> >>> #include "config.h" >>> -#include "system.h" >>> >>> /* If plugin support is not enabled, do not try to execute any code >>> that may reference libdl. The generic code is still compiled in >>> to >>> avoid including too many conditional compilation paths in the rest >>> - of the compiler. */ >>> + of the compiler. >>> + >>> + We must include system headers before "system.h" or the override >>> + for bool might be upset. */ >>> #ifdef ENABLE_PLUGIN >>> #include >>> #endif >>> >>> +#include "system.h" > > Hmm. dlfcn should be included from system.h instead. ah, that wasn't an obvious route to me - since it will affect all users of system.h, rather than just plugins. However ... like so? (passes plugin.exp=* on ppc-darwin9, thus solving the bug, full reg- test pending) Iain Index: gcc/system.h =================================================================== --- gcc/system.h (revision 168582) +++ gcc/system.h (working copy) @@ -583,6 +583,11 @@ extern int vsnprintf(char *, size_t, const char *, # endif #endif +#if defined (ENABLE_PLUGIN) && defined (HAVE_DLFCN_H) +/* If plugin support is enabled, we could use libdl. */ +#include +#endif + /* Get libiberty declarations. */ #include "libiberty.h" Index: gcc/plugin.c =================================================================== --- gcc/plugin.c (revision 168582) +++ gcc/plugin.c (working copy) @@ -22,15 +22,6 @@ along with GCC; see the file COPYING3. If not see #include "config.h" #include "system.h" - -/* If plugin support is not enabled, do not try to execute any code - that may reference libdl. The generic code is still compiled in to - avoid including too many conditional compilation paths in the rest - of the compiler. */ -#ifdef ENABLE_PLUGIN -#include -#endif - #include "coretypes.h" #include "diagnostic-core.h" #include "tree.h"