summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjye2 <jye2@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-14 07:29:25 +0000
committerjye2 <jye2@138bc75d-0d04-0410-961f-82ee72b054a4>2014-01-14 07:29:25 +0000
commit48f24eb222403f3299a9aa29c10598400f2a9149 (patch)
treef56ba0c06a6dbcd4e08ce444fa5277b6aac27dff
parentfbf4df62d6b0b02afe0d73288b1ff6c41f5ba5d1 (diff)
downloadgcc-48f24eb222403f3299a9aa29c10598400f2a9149.tar.gz
2014-01-14 Joey Ye <joey.ye@arm.com>
* doc/plugin.texi (Building GCC plugins): Update to C++. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206597 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/doc/plugins.texi20
2 files changed, 14 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 53428a637e9..3a832d0e898 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2014-01-14 Joey Ye <joey.ye@arm.com>
+
+ * doc/plugin.texi (Building GCC plugins): Update to C++.
+
2014-01-14 Kirill Yukhin <kirill.yukhin@intel.com>
* config/i386/avx512erintrin.h (_mm_rcp28_round_sd): New.
diff --git a/gcc/doc/plugins.texi b/gcc/doc/plugins.texi
index f1983808b06..a283a7162aa 100644
--- a/gcc/doc/plugins.texi
+++ b/gcc/doc/plugins.texi
@@ -465,18 +465,18 @@ integer numbers, so a plugin could ensure it is built for GCC 4.7 with
The following GNU Makefile excerpt shows how to build a simple plugin:
@smallexample
-GCC=gcc
-PLUGIN_SOURCE_FILES= plugin1.c plugin2.c
-PLUGIN_OBJECT_FILES= $(patsubst %.c,%.o,$(PLUGIN_SOURCE_FILES))
-GCCPLUGINS_DIR:= $(shell $(GCC) -print-file-name=plugin)
-CFLAGS+= -I$(GCCPLUGINS_DIR)/include -fPIC -O2
-
-plugin.so: $(PLUGIN_OBJECT_FILES)
- $(GCC) -shared $^ -o $@@
+HOST_GCC=g++
+TARGET_GCC=gcc
+PLUGIN_SOURCE_FILES= plugin1.c plugin2.cc
+GCCPLUGINS_DIR:= $(shell $(TARGET_GCC) -print-file-name=plugin)
+CXXFLAGS+= -I$(GCCPLUGINS_DIR)/include -fPIC -fno-rtti -O2
+
+plugin.so: $(PLUGIN_SOURCE_FILES)
+ $(HOST_GCC) -shared $(CXXFLAGS) $^ -o $@@
@end smallexample
-A single source file plugin may be built with @code{gcc -I`gcc
--print-file-name=plugin`/include -fPIC -shared -O2 plugin.c -o
+A single source file plugin may be built with @code{g++ -I`gcc
+-print-file-name=plugin`/include -fPIC -shared -fno-rtti -O2 plugin.c -o
plugin.so}, using backquote shell syntax to query the @file{plugin}
directory.