diff --git a/compel/src/main.c b/compel/src/main.c index cd4753c1c..2d2351753 100644 --- a/compel/src/main.c +++ b/compel/src/main.c @@ -120,7 +120,7 @@ static int usage(int rc) { fprintf(out, "Usage:\n" -" compel [--compat] includes | cflags | ldflags\n" +" compel [--compat] includes | cflags | ldflags | plugins\n" " compel -f FILE -o FILE -p NAME [-l N] hgen\n" " -f, --file FILE input (parasite object) file name\n" " -o, --output FILE output (header) file name\n" @@ -182,12 +182,25 @@ static void print_ldflags(bool compat) } } +static void print_plugins(const char *list[]) +{ + while (*list != NULL) { + if (uninst_root) + printf("%s/plugins/%s.built-in.o\n", + uninst_root, *list); + else + printf("%s/compel/%s.built-in.o\n", LIBEXECDIR, *list); + list++; + } +} + int main(int argc, char *argv[]) { int log_level = DEFAULT_LOGLEVEL; bool compat = false; int opt, idx; char *action; + const char *plugins_list[] = { "std", NULL }; static const char short_opts[] = "cf:o:p:hVl:"; static struct option long_opts[] = { @@ -260,6 +273,13 @@ int main(int argc, char *argv[]) return 0; } + if (!strcmp(action, "plugins")) { + /* TODO: add option to specify additional plugins + * if/when we'll have any */ + print_plugins(plugins_list); + return 0; + } + if (!strcmp(action, "hgen")) { if (!opts.input_filename) { fprintf(stderr, "Error: option --file required\n"); diff --git a/compel/test/infect/Makefile b/compel/test/infect/Makefile index 4ad8fd010..e9b96ddfd 100644 --- a/compel/test/infect/Makefile +++ b/compel/test/infect/Makefile @@ -2,7 +2,6 @@ CC := gcc CFLAGS ?= -O2 -g -Wall -Werror COMPEL := ../../../compel/compel-host -COMPEL_PLUGINS := ../../../compel/plugins COMPEL_LIBRARY := ../../../compel/libcompel.a all: victim spy @@ -25,8 +24,8 @@ parasite.h: parasite.po -p parasite \ -o $@ -parasite.po: parasite.o $(COMPEL_PLUGINS)/std.built-in.o - ld $(shell $(COMPEL) ldflags) -o $@ $^ +parasite.po: parasite.o + ld $(shell $(COMPEL) ldflags) -o $@ $^ $(shell $(COMPEL) plugins) parasite.o: parasite.c $(CC) $(CFLAGS) -c $(shell $(COMPEL) cflags) -o $@ $^ diff --git a/criu/pie/Makefile b/criu/pie/Makefile index 53acdcdc8..ca4f80d65 100644 --- a/criu/pie/Makefile +++ b/criu/pie/Makefile @@ -1,6 +1,5 @@ target += parasite restorer -compel_std := $(SRC_DIR)/compel/plugins/std.built-in.o parasite-obj-e += ./compel/plugins/std.built-in.o restorer-obj-e += ./compel/plugins/std.built-in.o @@ -36,6 +35,7 @@ ccflags-y += -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=0 ifneq ($(filter-out clean mrproper,$(MAKECMDGOALS)),) CFLAGS += $(shell $(COMPEL_BIN) cflags) + compel_std := $(shell $(COMPEL_BIN) plugins) endif ifeq ($(SRCARCH),arm)