From 7cd6ad5e7ea50933eab6c48e9a071eb834353098 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 8 Dec 2016 01:44:28 -0800 Subject: [PATCH] compel hgen: drop -u option This -u option always looked wrong to me, I mean, how the hell a user is supposed to know where the hell those headers are? It took quite a while to figure out what to do with it, but the end result is -- this option is not needed at all and can easily be dropped. For finding paths to includes, there is a -I compiler option, there's no need to specify something to compel. In fact, it should know by itself where its own headers are kept (and emit -I... to cflags if needed), but that's another story which is to be told when we'll decide to pack compel as a standalone tool. For now, just add "#include " and be done. Signed-off-by: Kir Kolyshkin Signed-off-by: Pavel Emelyanov Signed-off-by: Andrei Vagin --- compel/include/piegen.h | 1 - compel/src/lib/handle-elf.c | 2 +- compel/src/main.c | 7 +------ compel/test/infect/Makefile | 1 - criu/pie/Makefile | 1 - 5 files changed, 2 insertions(+), 10 deletions(-) diff --git a/compel/include/piegen.h b/compel/include/piegen.h index 3dd62e62c..fd72f9c22 100644 --- a/compel/include/piegen.h +++ b/compel/include/piegen.h @@ -11,7 +11,6 @@ typedef struct { char *input_filename; char *output_filename; - char *uapi_dir; char *prefix; FILE *fout; } piegen_opt_t; diff --git a/compel/src/lib/handle-elf.c b/compel/src/lib/handle-elf.c index 148410022..b28830195 100644 --- a/compel/src/lib/handle-elf.c +++ b/compel/src/lib/handle-elf.c @@ -222,7 +222,7 @@ int __handle_elf(void *mem, size_t size) } pr_out("/* Autogenerated from %s */\n", opts.input_filename); - pr_out("#include \"%s/compel.h\"\n", opts.uapi_dir); + pr_out("#include \n"); for (i = 0; i < symtab_hdr->sh_size / symtab_hdr->sh_entsize; i++) { Elf_Sym *sym = &symbols[i]; diff --git a/compel/src/main.c b/compel/src/main.c index 30920677e..b75c04085 100644 --- a/compel/src/main.c +++ b/compel/src/main.c @@ -54,7 +54,6 @@ static const compel_cflags_t compel_cflags[] = { piegen_opt_t opts = { .input_filename = NULL, .output_filename = NULL, - .uapi_dir = "piegen/uapi", .fout = NULL, }; @@ -145,12 +144,11 @@ int main(int argc, char *argv[]) int opt, idx, i; char *action; - static const char short_opts[] = "a:f:o:u:p:hVl:"; + static const char short_opts[] = "a:f:o:p:hVl:"; static struct option long_opts[] = { { "arch", required_argument, 0, 'a' }, { "file", required_argument, 0, 'f' }, { "output", required_argument, 0, 'o' }, - { "uapi-dir", required_argument, 0, 'u' }, { "prefix", required_argument, 0, 'p' }, { "help", no_argument, 0, 'h' }, { "version", no_argument, 0, 'V' }, @@ -183,9 +181,6 @@ int main(int argc, char *argv[]) case 'o': opts.output_filename = optarg; break; - case 'u': - opts.uapi_dir = optarg; - break; case 'p': opts.prefix = optarg; break; diff --git a/compel/test/infect/Makefile b/compel/test/infect/Makefile index d5187495e..65c17280f 100644 --- a/compel/test/infect/Makefile +++ b/compel/test/infect/Makefile @@ -28,7 +28,6 @@ spy: spy.c $(COMPEL_LIBRARY) | parasite.h parasite.h: parasite.po $(COMPEL) hgen -f $^ -l 4 \ -p parasite \ - -u $(COMPEL_IDIR) \ -o $@ parasite.po: parasite.o $(COMPEL_PLUGINS)/std.built-in.o diff --git a/criu/pie/Makefile b/criu/pie/Makefile index 38f166b87..05c1b08da 100644 --- a/criu/pie/Makefile +++ b/criu/pie/Makefile @@ -127,7 +127,6 @@ $(obj)/%-blob.h: $(obj)/%.built-in.bin.o $(SRC_DIR)/compel/compel-host $(Q) $(SRC_DIR)/compel/compel-host hgen -f $< \ -l 4 \ -p $(call target-name,$@) \ - -u $(SRC_DIR)/compel/include/uapi \ -o $@ $(piegen_stdout) else # !piegen-y