diff options
author | Joern Rennecke <amylaar@gcc.gnu.org> | 2010-06-09 11:40:28 +0100 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2010-06-09 11:40:28 +0100 |
commit | 2d7f5f9b5f54aae8eaaaa6e430422ecbbfe91f4d (patch) | |
tree | 2a02e0c255a32712fe3a4acc240d7ac19d537f2e /gcc | |
parent | ff5dfc4869aad7bedad9e749e6eed7d5f783b970 (diff) | |
download | gcc-2d7f5f9b5f54aae8eaaaa6e430422ecbbfe91f4d.zip gcc-2d7f5f9b5f54aae8eaaaa6e430422ecbbfe91f4d.tar.gz gcc-2d7f5f9b5f54aae8eaaaa6e430422ecbbfe91f4d.tar.bz2 |
re PR testsuite/42843 (--enable-build-with-cxx plugin tests fail)
gcc:
PR testsuite/42843
* gcc-plugin.h (int plugin_is_GPL_compatible): Declare as extern "C".
* doc/plugins.texi (Plugin license check): Update information
on type of plugin_is_GPL_compatible.
* Makefile.in (PLUGINCC): Define as $(COMPILER).
(PLUGINCFLAGS): Define as $(COMPILER_FLAGS).
gcc/testsuite:
PR testsuite/42843
* gcc.dg/plugin/selfassign.c (pass_warn_self_assign): Use enumerator
TV_NONE to initialize tv_id field.
* g++.dg/plugin/selfassign.c (pass_warn_self_assign): Likewise.
* gcc.dg/plugin/one_time_plugin.c (one_pass): Likewise.
* g++.dg/plugin/dumb_plugin.c (pass_dumb_plugin_example): Likewise.
Include toplev.h .
* gcc.dg/plugin/finish_unit_plugin.c: Include cgraph.h.
* g++.dg/plugin/attribute_plugin.c: Include toplev.h and plugin.h .
* g++.dg/plugin/pragma_plugin.c: Include toplev.h .
From-SVN: r160461
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/Makefile.in | 4 | ||||
-rw-r--r-- | gcc/doc/plugins.texi | 6 | ||||
-rw-r--r-- | gcc/gcc-plugin.h | 11 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/plugin/attribute_plugin.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/plugin/dumb_plugin.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/plugin/pragma_plugin.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/plugin/selfassign.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/plugin/finish_unit_plugin.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/plugin/one_time_plugin.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/plugin/selfassign.c | 2 |
12 files changed, 49 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 86b2029..a1d7c0d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2010-06-09 Joern Rennecke <amylaar@spamcop.net> + + PR testsuite/42843 + * gcc-plugin.h (int plugin_is_GPL_compatible): Declare as extern "C". + * doc/plugins.texi (Plugin license check): Update information + on type of plugin_is_GPL_compatible. + * Makefile.in (PLUGINCC): Define as $(COMPILER). + (PLUGINCFLAGS): Define as $(COMPILER_FLAGS). + 2010-06-09 Bernd Schmidt <bernds@codesourcery.com> * config/arm/arm.c (thumb2_reorg): New function. @@ -13,7 +22,7 @@ 2010-06-09 Joern Rennecke <joern.rennecke@embecosm.com> - PR plugins/44459: + PR plugins/44459 * gcc-plugin.h: Encapsulate all declarations in extern "C". 2010-06-08 Jan Hubicka <jh@suse.cz> diff --git a/gcc/Makefile.in b/gcc/Makefile.in index a190225..54c854b 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -331,10 +331,10 @@ LTO_BINARY_READER = @LTO_BINARY_READER@ LTO_USE_LIBELF = @LTO_USE_LIBELF@ # Compiler needed for plugin support -PLUGINCC = @CC@ +PLUGINCC = $(COMPILER) # Flags needed for plugin support -PLUGINCFLAGS = @CFLAGS@ +PLUGINCFLAGS = $(COMPILER_FLAGS) # Libs and linker options needed for plugin support PLUGINLIBS = @pluginlibs@ diff --git a/gcc/doc/plugins.texi b/gcc/doc/plugins.texi index 77000fe..5a56042 100644 --- a/gcc/doc/plugins.texi +++ b/gcc/doc/plugins.texi @@ -50,8 +50,10 @@ fatal error: plugin <name> is not licensed under a GPL-compatible license compilation terminated @end smallexample -The type of the symbol is irrelevant. The compiler merely asserts that -it exists in the global scope. Something like this is enough: +The declared type of the symbol should be int, to match a forward declaration +in @file{gcc-plugin.h} that suppresses C++ mangling. It does not need to be in +any allocated section, though. The compiler merely asserts that +the symbol exists in the global scope. Something like this is enough: @smallexample int plugin_is_GPL_compatible; diff --git a/gcc/gcc-plugin.h b/gcc/gcc-plugin.h index 5db2c71..7573fa2 100644 --- a/gcc/gcc-plugin.h +++ b/gcc/gcc-plugin.h @@ -151,4 +151,15 @@ extern const char* default_plugin_dir_name (void); } #endif +/* In case the C++ compiler does name mangling for globals, declare + plugin_is_GPL_compatible extern "C" so that a later definition + in a plugin file will have this linkage. */ +#ifdef __cplusplus +extern "C" { +#endif +extern int plugin_is_GPL_compatible; +#ifdef __cplusplus +} +#endif + #endif /* GCC_PLUGIN_H */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fdce8b3..a17f5ae 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,16 @@ +2010-06-09 Joern Rennecke <amylaar@spamcop.net> + + PR testsuite/42843 + * gcc.dg/plugin/selfassign.c (pass_warn_self_assign): Use enumerator + TV_NONE to initialize tv_id field. + * g++.dg/plugin/selfassign.c (pass_warn_self_assign): Likewise. + * gcc.dg/plugin/one_time_plugin.c (one_pass): Likewise. + * g++.dg/plugin/dumb_plugin.c (pass_dumb_plugin_example): Likewise. + Include toplev.h . + * gcc.dg/plugin/finish_unit_plugin.c: Include cgraph.h. + * g++.dg/plugin/attribute_plugin.c: Include toplev.h and plugin.h . + * g++.dg/plugin/pragma_plugin.c: Include toplev.h . + 2010-06-08 Sandra Loosemore <sandra@codesourcery.com> PR tree-optimization/39874 diff --git a/gcc/testsuite/g++.dg/plugin/attribute_plugin.c b/gcc/testsuite/g++.dg/plugin/attribute_plugin.c index d62ab90..6327095 100644 --- a/gcc/testsuite/g++.dg/plugin/attribute_plugin.c +++ b/gcc/testsuite/g++.dg/plugin/attribute_plugin.c @@ -8,6 +8,8 @@ #include "tree.h" #include "tree-pass.h" #include "intl.h" +#include "toplev.h" +#include "plugin.h" int plugin_is_GPL_compatible; diff --git a/gcc/testsuite/g++.dg/plugin/dumb_plugin.c b/gcc/testsuite/g++.dg/plugin/dumb_plugin.c index 3aee8db..f12a6a0 100644 --- a/gcc/testsuite/g++.dg/plugin/dumb_plugin.c +++ b/gcc/testsuite/g++.dg/plugin/dumb_plugin.c @@ -9,6 +9,7 @@ #include "tree.h" #include "tree-pass.h" #include "intl.h" +#include "toplev.h" int plugin_is_GPL_compatible; @@ -65,7 +66,7 @@ static struct gimple_opt_pass pass_dumb_plugin_example = NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ - 0, /* tv_id */ + TV_NONE, /* tv_id */ PROP_cfg, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ diff --git a/gcc/testsuite/g++.dg/plugin/pragma_plugin.c b/gcc/testsuite/g++.dg/plugin/pragma_plugin.c index 237fcdd..241526b 100644 --- a/gcc/testsuite/g++.dg/plugin/pragma_plugin.c +++ b/gcc/testsuite/g++.dg/plugin/pragma_plugin.c @@ -13,6 +13,7 @@ #include "cpplib.h" #include "tree-pass.h" #include "intl.h" +#include "toplev.h" int plugin_is_GPL_compatible; diff --git a/gcc/testsuite/g++.dg/plugin/selfassign.c b/gcc/testsuite/g++.dg/plugin/selfassign.c index 8d76301..df42abd 100644 --- a/gcc/testsuite/g++.dg/plugin/selfassign.c +++ b/gcc/testsuite/g++.dg/plugin/selfassign.c @@ -275,7 +275,7 @@ static struct gimple_opt_pass pass_warn_self_assign = NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ - 0, /* tv_id */ + TV_NONE, /* tv_id */ PROP_ssa, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ diff --git a/gcc/testsuite/gcc.dg/plugin/finish_unit_plugin.c b/gcc/testsuite/gcc.dg/plugin/finish_unit_plugin.c index 634daee..26496a2 100644 --- a/gcc/testsuite/gcc.dg/plugin/finish_unit_plugin.c +++ b/gcc/testsuite/gcc.dg/plugin/finish_unit_plugin.c @@ -12,6 +12,7 @@ #include "tree.h" #include "tree-pass.h" #include "intl.h" +#include "cgraph.h" int plugin_is_GPL_compatible; diff --git a/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c b/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c index 4a6a8a6..2c4cd49 100644 --- a/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c +++ b/gcc/testsuite/gcc.dg/plugin/one_time_plugin.c @@ -37,7 +37,7 @@ struct gimple_opt_pass one_pass = NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ - 0, /* tv_id */ + TV_NONE, /* tv_id */ PROP_gimple_any, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ diff --git a/gcc/testsuite/gcc.dg/plugin/selfassign.c b/gcc/testsuite/gcc.dg/plugin/selfassign.c index 8d76301..df42abd 100644 --- a/gcc/testsuite/gcc.dg/plugin/selfassign.c +++ b/gcc/testsuite/gcc.dg/plugin/selfassign.c @@ -275,7 +275,7 @@ static struct gimple_opt_pass pass_warn_self_assign = NULL, /* sub */ NULL, /* next */ 0, /* static_pass_number */ - 0, /* tv_id */ + TV_NONE, /* tv_id */ PROP_ssa, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ |