compel: Remove compel.h

The file only includes other headers (which may be not needed).
If we aim for one-include-for-compel, we could instead paste all
subheaders into "compel.h".
Rather, I think it's worth to migrate to more fine-grained compel
headers than follow the strategy 'one header to rule them all'.

Further, the header creates problems for cross-compilation: it's
included in files, those are used by host-compel. Which rightfully
confuses compiler/linker as host's definitions for fpu regs/other
platform details get drained into host's compel.

Signed-off-by: Dmitry Safonov <dima@arista.com>
This commit is contained in:
Dmitry Safonov 2020-03-05 15:00:08 +00:00 committed by Andrei Vagin
parent 62ad2f6095
commit 327554ee64
19 changed files with 15 additions and 40 deletions

View file

@ -86,7 +86,7 @@ Infecting code
~~~~~~~~~~~~~~
The parasitic code is compiled and converted to a header using *compel*, and included here.
*#include <compel/compel.h>*
*#include <compel/infect.h>*
*#include "parasite.h"*

View file

@ -1,6 +1,5 @@
#include <string.h>
#include "uapi/compel.h"
#include <errno.h>
#include "handle-elf.h"
#include "piegen.h"

View file

@ -1,6 +1,5 @@
#include <string.h>
#include "uapi/compel.h"
#include <errno.h>
#include "handle-elf.h"
#include "piegen.h"

View file

@ -1,6 +1,7 @@
#include <stdlib.h>
#include <sys/ptrace.h>
#include <sys/types.h>
#include <string.h>
#include <compel/plugins/std/syscall-codes.h>
#include <compel/asm/processor-flags.h>
#include "common/page.h"

View file

@ -2,6 +2,7 @@
#include <asm/cputable.h>
#include <errno.h>
#include <stdbool.h>
#include <string.h>
#include "compel-cpu.h"

View file

@ -1,6 +1,5 @@
#include <string.h>
#include "uapi/compel.h"
#include <errno.h>
#include "handle-elf.h"
#include "piegen.h"

View file

@ -1,6 +1,5 @@
#include <string.h>
#include "uapi/compel.h"
#include <errno.h>
#include "handle-elf.h"
#include "piegen.h"

View file

@ -5,6 +5,7 @@
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <elf.h>
#include <compel/plugins/std/syscall-codes.h>

View file

@ -1,6 +1,5 @@
#include <string.h>
#include "uapi/compel.h"
#include <errno.h>
#include "handle-elf.h"
#include "piegen.h"

View file

@ -3,6 +3,7 @@
#include <sys/auxv.h>
#include <sys/mman.h>
#include <sys/user.h>
#include <errno.h>
#include <compel/asm/fpu.h>

View file

@ -1,8 +1,7 @@
#ifndef COMPEL_LOG_H__
#define COMPEL_LOG_H__
#include "uapi/compel/compel.h"
#include "uapi/compel/loglevels.h"
#include "uapi/compel/log.h"
#ifndef LOG_PREFIX
# define LOG_PREFIX

View file

@ -1,14 +0,0 @@
#ifndef UAPI_COMPEL_H__
#define UAPI_COMPEL_H__
#include <errno.h>
#include <stdarg.h>
#include <compel/asm/infect-types.h>
#include <compel/handle-elf.h>
#include <compel/log.h>
#include <compel/infect-util.h>
#include <compel/infect-rpc.h>
#include <compel/infect.h>
#endif /* UAPI_COMPEL_H__ */

View file

@ -4,7 +4,7 @@
#include <unistd.h>
#include <stdint.h>
#include <string.h>
#include <stdint.h>
#include <errno.h>
#include <fcntl.h>
@ -12,8 +12,6 @@
#include <sys/stat.h>
#include <sys/mman.h>
#include "uapi/compel.h"
#include "handle-elf.h"
#include "piegen.h"
#include "log.h"
@ -228,7 +226,7 @@ int __handle_elf(void *mem, size_t size)
}
pr_out("/* Autogenerated from %s */\n", opts.input_filename);
pr_out("#include <compel/compel.h>\n");
pr_out("#include <compel/infect.h>\n");
for (i = 0; i < symtab_hdr->sh_size / symtab_hdr->sh_entsize; i++) {
Elf_Sym *sym = &symbols[i];

View file

@ -4,11 +4,8 @@
#include <stdarg.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <compel/compel.h>
#include "log.h"
static unsigned int current_loglevel = COMPEL_DEFAULT_LOGLEVEL;

View file

@ -13,8 +13,6 @@
#include <sys/stat.h>
#include <sys/mman.h>
#include "uapi/compel/compel.h"
#include "version.h"
#include "piegen.h"
#include "log.h"

View file

@ -5,7 +5,6 @@
#include <stdlib.h>
#include <sys/wait.h>
#include <compel/compel.h>
#include "parasite.h"
#define PARASITE_CMD_GETFD PARASITE_USER_CMDS

View file

@ -3,7 +3,6 @@
#include <stdlib.h>
#include <sys/wait.h>
#include <compel/compel.h>
#include "parasite.h"
#define PARASITE_CMD_INC PARASITE_USER_CMDS

View file

@ -4,8 +4,6 @@
#include <sys/wait.h>
#include <sys/syscall.h>
#include <compel/compel.h>
static void print_vmsg(unsigned int lvl, const char *fmt, va_list parms)
{
printf("\tLC%u: ", lvl);

View file

@ -3,7 +3,9 @@
#include <stdint.h>
#include <stdbool.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/uio.h>
/*
* Because of kernel doing kmalloc for user data passed