]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 9 Jun 2010 10:40:28 +0000 (10:40 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 9 Jun 2010 10:40:28 +0000 (10:40 +0000)
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 .

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160461 138bc75d-0d04-0410-961f-82ee72b054a4

12 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/doc/plugins.texi
gcc/gcc-plugin.h
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/plugin/attribute_plugin.c
gcc/testsuite/g++.dg/plugin/dumb_plugin.c
gcc/testsuite/g++.dg/plugin/pragma_plugin.c
gcc/testsuite/g++.dg/plugin/selfassign.c
gcc/testsuite/gcc.dg/plugin/finish_unit_plugin.c
gcc/testsuite/gcc.dg/plugin/one_time_plugin.c
gcc/testsuite/gcc.dg/plugin/selfassign.c

index 86b202914dd4188315375b916ff0a75fe380e458..a1d7c0d8fa49486f7ffd2686e5d9f87389c73a3a 100644 (file)
@@ -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>
index a19022564b3813b1e58cc4c7320aaf5d21f7217e..54c854b222c5137ab5e8e4c8669cf8bd779d6f28 100644 (file)
@@ -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@
index 77000fee646f7bc2243bfc38685463dbdf405ee6..5a56042499356c2c0b40a68eaec75b1ffddf8659 100644 (file)
@@ -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;
index 5db2c710be577aed2baae9965fcd2bb8522b946f..7573fa28d7c8642d1fd5c91ce80c36a5dea01ca4 100644 (file)
@@ -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 */
index fdce8b3d3952cf13bac6fc86e19de9e4220907e6..a17f5aeee16c88c838175e0d34ebb5cd1062f574 100644 (file)
@@ -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
index d62ab90542cf8c950c232fb42d32eae01acf34a1..6327095f7cddc5a6642ab2779cf175febbd51f0a 100644 (file)
@@ -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;
 
index 3aee8db840c5d5cad05c8a9b3b8dd46e026ae277..f12a6a0d35bbf2831f02178edbdf090ed02508c8 100644 (file)
@@ -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 */
index 237fcdddfa9518248a450f8ed965d5bfd7960056..241526b1e2ce82d3f5124f764349e4c2dd7eadf2 100644 (file)
@@ -13,6 +13,7 @@
 #include "cpplib.h"
 #include "tree-pass.h"
 #include "intl.h"
+#include "toplev.h"
 
 int plugin_is_GPL_compatible;
 
index 8d76301d8155a24a5e91f9fa5176713a4558722a..df42abd27df1b3cef1077740454a41561afa91d3 100644 (file)
@@ -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 */
index 634daeeda135f9d427c6768d9dc458689ddfed89..26496a2e6953e7967ef3a8b04855cd0a8dfe3eca 100644 (file)
@@ -12,6 +12,7 @@
 #include "tree.h"
 #include "tree-pass.h"
 #include "intl.h"
+#include "cgraph.h"
 
 int plugin_is_GPL_compatible;
 
index 4a6a8a61969fe8ddc63dfa4070fe7592ee2d0ac1..2c4cd497192a3b236fe4975f2ca1c535b9bcd339 100644 (file)
@@ -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 */
index 8d76301d8155a24a5e91f9fa5176713a4558722a..df42abd27df1b3cef1077740454a41561afa91d3 100644 (file)
@@ -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 */