From ce97cdfa9280912fa77d444de2cf640047ddf285 Mon Sep 17 00:00:00 2001 From: amylaar Date: Wed, 18 Nov 2009 19:42:44 +0000 Subject: [PATCH] Change ici to be a plugin. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/ici-20091108-branch@154304 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/Makefile.in | 26 +++++++++++++++++--------- gcc/plugin.c | 11 ----------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 96ac49eefb0..68a8fd7f344 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1025,7 +1025,8 @@ INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \ .c.o: $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION) %.o : ici/%.c - $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $< $(OUTPUT_OPTION) + $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) -fPIC $< \ + $(OUTPUT_OPTION) # # Support for additional languages (other than C). @@ -1176,14 +1177,10 @@ OBJS-common = \ ebitmap.o \ emit-rtl.o \ et-forest.o \ - events.o \ except.o \ explow.o \ expmed.o \ expr.o \ - feature.o \ - feature-list.o \ - function-instrumentation.o \ final.o \ fixed-value.o \ fold-const.o \ @@ -1256,10 +1253,7 @@ OBJS-common = \ opts-common.o \ opts.o \ params.o \ - pass-manager.o \ passes.o \ - ici.o \ - plugin-loader.o \ plugin.o \ pointer-set.o \ postreload-gcse.o \ @@ -4302,7 +4296,7 @@ PLUGIN_HEADERS = $(TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(C_PRAGMA_H) $(CPPLIB_H) $(FUNCTION_H) # Install the headers needed to build a plugin. -install-plugin: installdirs lang.install-plugin +install-plugin: installdirs lang.install-plugin build-plugin # We keep the directory structure for files in config and .def files. All # other files are flattened to a single directory. $(mkinstalldirs) $(DESTDIR)$(plugin_includedir) @@ -4327,6 +4321,20 @@ install-plugin: installdirs lang.install-plugin $(INSTALL_DATA) $$path $(DESTDIR)$$dest; \ done +.PHONY: build-plugin build-ici build-adapt + +build-plugin: build-ici build-adapt + +build-ici: ici.so + +ICI_OBJS = feature.o feature-list.o function-instrumentation.o ici.o \ + pass-manager.o plugin-loader.o events.o + +ici.so: $(ICI_OBJS) + $(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -shared $^ -o $@ + +build-adapt: + # Install the compiler executables built during cross compilation. install-common: native lang.install-common installdirs for file in $(COMPILERS); do \ diff --git a/gcc/plugin.c b/gcc/plugin.c index 3ebbadbd9df..6a1207ce604 100644 --- a/gcc/plugin.c +++ b/gcc/plugin.c @@ -615,17 +615,6 @@ init_one_plugin (void **slot, void * ARG_UNUSED (info)) void initialize_plugins (void) { - /* Test ICI initialization code. */ - { - static char arg_name[] = "instrument-functions"; - static struct plugin_argument args0 - = { arg_name, NULL }; - static struct plugin_name_args args - = { NULL , NULL, 1, &args0, NULL, NULL }; - - plugin_init (&args, NULL); - } - /* If no plugin was specified in the command-line, simply return. */ if (!plugin_name_args_tab) return; -- 2.11.4.GIT