From 0c5d770e3b46be27a9ba00351fdadc75ff97f10e Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Sun, 9 Jan 2011 12:41:33 +0000 Subject: [PATCH] re PR c/46902 (gcc.dg/plugin/plugindir*.c gives ICEs on powerpc-apple-darwin9) PR gcc/46902 PR testsuite/46912 * plugin.c: Move include of dlfcn.h from here... * system.h: ... to here. From-SVN: r168611 --- gcc/ChangeLog | 9 ++++++++- gcc/plugin.c | 9 --------- gcc/system.h | 5 +++++ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e9bee6d61c3d..0bb8b7ea1c1d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,11 @@ -2010-01-09 Ralf Wildenhues +2011-01-09 Iain Sandoe + + PR gcc/46902 + PR testsuite/46912 + * plugin.c: Move include of dlfcn.h from here... + * system.h: ... to here. + +2011-01-09 Ralf Wildenhues * doc/cpp.texi (C++ Named Operators): Fix markup for header file name. diff --git a/gcc/plugin.c b/gcc/plugin.c index 2179b8192885..c93daed055d7 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -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" diff --git a/gcc/system.h b/gcc/system.h index a9a29f16b214..0bf9b9256851 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -583,6 +583,11 @@ extern int vsnprintf(char *, size_t, const char *, va_list); # 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"