Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/checkpoint-restore/criu.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@openvz.org>2016-02-15 15:26:55 +0300
committerPavel Emelyanov <xemul@virtuozzo.com>2016-02-15 15:32:45 +0300
commitdb6cb69394a7618532791af801e65a2f32e54c98 (patch)
treebe12fdabb77ca4e7695e2af184c302a4a992505e
parent3410d39514ae789a7681737dcb297aefe5305b8c (diff)
build: Move everything criu related into criu directory
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
-rw-r--r--.gitignore24
-rw-r--r--Documentation/Makefile18
-rw-r--r--Makefile408
-rw-r--r--Makefile.crtools94
-rw-r--r--Makefile.inc18
-rw-r--r--Makefile.install31
-rw-r--r--arch/aarch64/Makefile59
-rw-r--r--arch/arm/Makefile59
-rw-r--r--arch/ppc64/Makefile55
-rw-r--r--arch/ppc64/syscalls-ppc64.sh57
-rw-r--r--criu/Makefile173
-rw-r--r--criu/Makefile.config (renamed from Makefile.config)43
-rw-r--r--criu/Makefile.crtools92
-rw-r--r--criu/Makefile.version (renamed from scripts/Makefile.version)23
-rw-r--r--criu/action-scripts.c (renamed from action-scripts.c)0
-rw-r--r--criu/aio.c (renamed from aio.c)0
-rw-r--r--criu/arch/aarch64/Makefile7
-rw-r--r--criu/arch/aarch64/Makefile.syscalls50
-rw-r--r--criu/arch/aarch64/cpu.c (renamed from arch/aarch64/cpu.c)0
-rw-r--r--criu/arch/aarch64/crtools.c (renamed from arch/aarch64/crtools.c)0
-rw-r--r--criu/arch/aarch64/include/asm/atomic.h (renamed from arch/aarch64/include/asm/atomic.h)0
-rw-r--r--criu/arch/aarch64/include/asm/bitops.h (renamed from arch/aarch64/include/asm/bitops.h)0
-rw-r--r--criu/arch/aarch64/include/asm/bitsperlong.h (renamed from arch/aarch64/include/asm/bitsperlong.h)0
-rw-r--r--criu/arch/aarch64/include/asm/cpu.h (renamed from arch/aarch64/include/asm/cpu.h)0
-rw-r--r--criu/arch/aarch64/include/asm/dump.h (renamed from arch/aarch64/include/asm/dump.h)0
-rw-r--r--criu/arch/aarch64/include/asm/fpu.h (renamed from arch/aarch64/include/asm/fpu.h)0
-rw-r--r--criu/arch/aarch64/include/asm/int.h (renamed from arch/aarch64/include/asm/int.h)0
-rw-r--r--criu/arch/aarch64/include/asm/linkage.h (renamed from arch/aarch64/include/asm/linkage.h)0
-rw-r--r--criu/arch/aarch64/include/asm/page.h (renamed from arch/aarch64/include/asm/page.h)0
-rw-r--r--criu/arch/aarch64/include/asm/parasite-syscall.h (renamed from arch/aarch64/include/asm/parasite-syscall.h)0
-rw-r--r--criu/arch/aarch64/include/asm/parasite.h (renamed from arch/aarch64/include/asm/parasite.h)0
-rw-r--r--criu/arch/aarch64/include/asm/processor-flags.h (renamed from arch/aarch64/include/asm/processor-flags.h)0
-rw-r--r--criu/arch/aarch64/include/asm/restore.h (renamed from arch/aarch64/include/asm/restore.h)0
-rw-r--r--criu/arch/aarch64/include/asm/restorer.h (renamed from arch/aarch64/include/asm/restorer.h)0
-rw-r--r--criu/arch/aarch64/include/asm/string.h (renamed from arch/aarch64/include/asm/string.h)0
-rw-r--r--criu/arch/aarch64/include/asm/syscall-aux.S (renamed from arch/aarch64/include/asm/syscall-aux.S)0
-rw-r--r--criu/arch/aarch64/include/asm/syscall-aux.h (renamed from arch/aarch64/include/asm/syscall-aux.h)0
-rw-r--r--criu/arch/aarch64/include/asm/types.h (renamed from arch/aarch64/include/asm/types.h)0
-rw-r--r--criu/arch/aarch64/include/asm/vdso.h (renamed from arch/aarch64/include/asm/vdso.h)0
-rw-r--r--criu/arch/aarch64/intraprocedure.S (renamed from arch/aarch64/intraprocedure.S)0
-rw-r--r--criu/arch/aarch64/parasite-head.S (renamed from arch/aarch64/parasite-head.S)0
-rw-r--r--criu/arch/aarch64/restorer.c (renamed from arch/aarch64/restorer.c)0
-rw-r--r--criu/arch/aarch64/syscalls/syscall-common.S (renamed from arch/aarch64/syscall-common.S)0
l---------criu/arch/aarch64/syscalls/syscall.def1
-rw-r--r--criu/arch/aarch64/vdso-pie.c (renamed from arch/aarch64/vdso-pie.c)0
-rw-r--r--criu/arch/arm/Makefile6
-rw-r--r--criu/arch/arm/Makefile.syscalls50
-rw-r--r--criu/arch/arm/cpu.c (renamed from arch/arm/cpu.c)0
-rw-r--r--criu/arch/arm/crtools.c (renamed from arch/arm/crtools.c)0
-rw-r--r--criu/arch/arm/include/asm/atomic.h (renamed from arch/arm/include/asm/atomic.h)0
-rw-r--r--criu/arch/arm/include/asm/bitops.h (renamed from arch/arm/include/asm/bitops.h)0
-rw-r--r--criu/arch/arm/include/asm/bitsperlong.h (renamed from arch/arm/include/asm/bitsperlong.h)0
-rw-r--r--criu/arch/arm/include/asm/cpu.h (renamed from arch/arm/include/asm/cpu.h)0
-rw-r--r--criu/arch/arm/include/asm/dump.h (renamed from arch/arm/include/asm/dump.h)0
-rw-r--r--criu/arch/arm/include/asm/fpu.h (renamed from arch/arm/include/asm/fpu.h)0
-rw-r--r--criu/arch/arm/include/asm/int.h (renamed from arch/arm/include/asm/int.h)0
-rw-r--r--criu/arch/arm/include/asm/linkage.h (renamed from arch/arm/include/asm/linkage.h)0
-rw-r--r--criu/arch/arm/include/asm/page.h (renamed from arch/arm/include/asm/page.h)0
-rw-r--r--criu/arch/arm/include/asm/parasite-syscall.h (renamed from arch/arm/include/asm/parasite-syscall.h)0
-rw-r--r--criu/arch/arm/include/asm/parasite.h (renamed from arch/arm/include/asm/parasite.h)0
-rw-r--r--criu/arch/arm/include/asm/processor-flags.h (renamed from arch/arm/include/asm/processor-flags.h)0
-rw-r--r--criu/arch/arm/include/asm/processor.h (renamed from arch/arm/include/asm/processor.h)0
-rw-r--r--criu/arch/arm/include/asm/restore.h (renamed from arch/arm/include/asm/restore.h)0
-rw-r--r--criu/arch/arm/include/asm/restorer.h (renamed from arch/arm/include/asm/restorer.h)0
-rw-r--r--criu/arch/arm/include/asm/string.h (renamed from arch/arm/include/asm/string.h)0
-rw-r--r--criu/arch/arm/include/asm/syscall-aux.S (renamed from arch/arm/include/asm/syscall-aux.S)0
-rw-r--r--criu/arch/arm/include/asm/syscall-aux.h (renamed from arch/arm/include/asm/syscall-aux.h)0
-rw-r--r--criu/arch/arm/include/asm/types.h (renamed from arch/arm/include/asm/types.h)0
-rw-r--r--criu/arch/arm/parasite-head.S (renamed from arch/arm/parasite-head.S)0
-rw-r--r--criu/arch/arm/restorer.c (renamed from arch/arm/restorer.c)0
-rw-r--r--criu/arch/arm/syscalls/syscall-common.S (renamed from arch/arm/syscall-common.S)0
-rw-r--r--criu/arch/arm/syscalls/syscall.def (renamed from arch/arm/syscall.def)0
-rw-r--r--criu/arch/arm/uidiv.S (renamed from arch/arm/uidiv.S)0
-rw-r--r--criu/arch/ppc64/Makefile6
-rw-r--r--criu/arch/ppc64/Makefile.syscalls50
-rw-r--r--criu/arch/ppc64/cpu.c (renamed from arch/ppc64/cpu.c)0
-rw-r--r--criu/arch/ppc64/crtools.c (renamed from arch/ppc64/crtools.c)0
-rw-r--r--criu/arch/ppc64/include/asm/atomic.h (renamed from arch/ppc64/include/asm/atomic.h)0
-rw-r--r--criu/arch/ppc64/include/asm/bitops.h (renamed from arch/ppc64/include/asm/bitops.h)0
-rw-r--r--criu/arch/ppc64/include/asm/bitsperlong.h (renamed from arch/ppc64/include/asm/bitsperlong.h)0
-rw-r--r--criu/arch/ppc64/include/asm/cmpxchg.h (renamed from arch/ppc64/include/asm/cmpxchg.h)0
-rw-r--r--criu/arch/ppc64/include/asm/cpu.h (renamed from arch/ppc64/include/asm/cpu.h)0
-rw-r--r--criu/arch/ppc64/include/asm/dump.h (renamed from arch/ppc64/include/asm/dump.h)0
-rw-r--r--criu/arch/ppc64/include/asm/fpu.h (renamed from arch/ppc64/include/asm/fpu.h)0
-rw-r--r--criu/arch/ppc64/include/asm/int.h (renamed from arch/ppc64/include/asm/int.h)0
-rw-r--r--criu/arch/ppc64/include/asm/linkage.h (renamed from arch/ppc64/include/asm/linkage.h)0
-rw-r--r--criu/arch/ppc64/include/asm/page.h (renamed from arch/ppc64/include/asm/page.h)0
-rw-r--r--criu/arch/ppc64/include/asm/parasite-syscall.h (renamed from arch/ppc64/include/asm/parasite-syscall.h)0
-rw-r--r--criu/arch/ppc64/include/asm/parasite.h (renamed from arch/ppc64/include/asm/parasite.h)0
-rw-r--r--criu/arch/ppc64/include/asm/prlimit.h (renamed from arch/ppc64/include/asm/prlimit.h)0
-rw-r--r--criu/arch/ppc64/include/asm/processor-flags.h (renamed from arch/ppc64/include/asm/processor-flags.h)0
-rw-r--r--criu/arch/ppc64/include/asm/restore.h (renamed from arch/ppc64/include/asm/restore.h)0
-rw-r--r--criu/arch/ppc64/include/asm/restorer.h (renamed from arch/ppc64/include/asm/restorer.h)0
-rw-r--r--criu/arch/ppc64/include/asm/string.h (renamed from arch/ppc64/include/asm/string.h)0
-rw-r--r--criu/arch/ppc64/include/asm/types.h (renamed from arch/ppc64/include/asm/types.h)0
-rw-r--r--criu/arch/ppc64/include/asm/vdso.h (renamed from arch/ppc64/include/asm/vdso.h)0
-rw-r--r--criu/arch/ppc64/memcmp_64.S (renamed from arch/ppc64/memcmp_64.S)0
-rw-r--r--criu/arch/ppc64/memcpy_power7.S (renamed from arch/ppc64/memcpy_power7.S)0
-rw-r--r--criu/arch/ppc64/misc.S (renamed from arch/ppc64/misc.S)0
-rw-r--r--criu/arch/ppc64/parasite-head.S (renamed from arch/ppc64/parasite-head.S)0
-rw-r--r--criu/arch/ppc64/restorer.c (renamed from arch/ppc64/restorer.c)0
-rw-r--r--criu/arch/ppc64/syscalls/syscall-common-ppc64.S (renamed from arch/ppc64/syscall-common-ppc64.S)0
-rw-r--r--criu/arch/ppc64/syscalls/syscall-ppc64.tbl (renamed from arch/ppc64/syscall-ppc64.def)0
-rw-r--r--criu/arch/ppc64/vdso-pie.c (renamed from arch/ppc64/vdso-pie.c)0
-rw-r--r--criu/arch/ppc64/vdso-trampoline.S (renamed from arch/ppc64/vdso-trampoline.S)0
-rwxr-xr-xcriu/arch/scripts/arm/gen-sys-exec-tbl.pl (renamed from arch/scripts/arm/gen-sys-exec-tbl.pl)0
-rwxr-xr-xcriu/arch/scripts/arm/gen-syscalls.pl (renamed from arch/scripts/arm/gen-syscalls.pl)0
-rw-r--r--criu/arch/x86/Makefile7
-rw-r--r--criu/arch/x86/Makefile.syscalls (renamed from arch/x86/Makefile)71
-rw-r--r--criu/arch/x86/cpu.c (renamed from arch/x86/cpu.c)0
-rw-r--r--criu/arch/x86/crtools.c (renamed from arch/x86/crtools.c)0
-rw-r--r--criu/arch/x86/include/asm/atomic.h (renamed from arch/x86/include/asm/atomic.h)0
-rw-r--r--criu/arch/x86/include/asm/bitops.h (renamed from arch/x86/include/asm/bitops.h)0
-rw-r--r--criu/arch/x86/include/asm/bitsperlong.h (renamed from arch/x86/include/asm/bitsperlong.h)0
-rw-r--r--criu/arch/x86/include/asm/cmpxchg.h (renamed from arch/x86/include/asm/cmpxchg.h)0
-rw-r--r--criu/arch/x86/include/asm/cpu.h (renamed from arch/x86/include/asm/cpu.h)0
-rw-r--r--criu/arch/x86/include/asm/dump.h (renamed from arch/x86/include/asm/dump.h)0
-rw-r--r--criu/arch/x86/include/asm/fpu.h (renamed from arch/x86/include/asm/fpu.h)0
-rw-r--r--criu/arch/x86/include/asm/int.h (renamed from arch/x86/include/asm/int.h)0
-rw-r--r--criu/arch/x86/include/asm/linkage.h (renamed from arch/x86/include/asm/linkage.h)0
-rw-r--r--criu/arch/x86/include/asm/page.h (renamed from arch/x86/include/asm/page.h)0
-rw-r--r--criu/arch/x86/include/asm/parasite-syscall.h (renamed from arch/x86/include/asm/parasite-syscall.h)0
-rw-r--r--criu/arch/x86/include/asm/parasite.h (renamed from arch/x86/include/asm/parasite.h)0
-rw-r--r--criu/arch/x86/include/asm/prlimit.h (renamed from arch/x86/include/asm/prlimit.h)0
-rw-r--r--criu/arch/x86/include/asm/processor-flags.h (renamed from arch/x86/include/asm/processor-flags.h)0
-rw-r--r--criu/arch/x86/include/asm/restore.h (renamed from arch/x86/include/asm/restore.h)0
-rw-r--r--criu/arch/x86/include/asm/restorer.h (renamed from arch/x86/include/asm/restorer.h)0
-rw-r--r--criu/arch/x86/include/asm/string.h (renamed from arch/x86/include/asm/string.h)0
-rw-r--r--criu/arch/x86/include/asm/syscall32.h (renamed from arch/x86/include/asm/syscall32.h)0
-rw-r--r--criu/arch/x86/include/asm/types.h (renamed from arch/x86/include/asm/types.h)0
-rw-r--r--criu/arch/x86/include/asm/vdso.h (renamed from arch/x86/include/asm/vdso.h)0
-rw-r--r--criu/arch/x86/parasite-head.S (renamed from arch/x86/parasite-head.S)0
-rw-r--r--criu/arch/x86/prlimit.c (renamed from arch/x86/prlimit.c)0
-rw-r--r--criu/arch/x86/restorer.c (renamed from arch/x86/restorer.c)0
-rw-r--r--criu/arch/x86/syscalls/syscall-common-x86-32.S (renamed from arch/x86/syscalls/syscall-common-x86-32.S)0
-rw-r--r--criu/arch/x86/syscalls/syscall-common-x86-64.S (renamed from arch/x86/syscalls/syscall-common-x86-64.S)0
-rw-r--r--criu/arch/x86/syscalls/syscall32.c (renamed from arch/x86/syscalls/syscall32.c)0
-rw-r--r--criu/arch/x86/syscalls/syscall_32.tbl (renamed from arch/x86/syscalls/syscall_32.tbl)0
-rw-r--r--criu/arch/x86/syscalls/syscall_64.tbl (renamed from arch/x86/syscalls/syscall_64.tbl)0
-rw-r--r--criu/arch/x86/vdso-pie.c (renamed from arch/x86/vdso-pie.c)0
-rw-r--r--criu/bfd.c (renamed from bfd.c)0
-rw-r--r--criu/bitmap.c (renamed from bitmap.c)0
-rw-r--r--criu/cgroup.c (renamed from cgroup.c)0
-rw-r--r--criu/cr-check.c (renamed from cr-check.c)0
-rw-r--r--criu/cr-dedup.c (renamed from cr-dedup.c)0
-rw-r--r--criu/cr-dump.c (renamed from cr-dump.c)0
-rw-r--r--criu/cr-errno.c (renamed from cr-errno.c)0
-rw-r--r--criu/cr-exec.c (renamed from cr-exec.c)0
-rw-r--r--criu/cr-restore.c (renamed from cr-restore.c)0
-rw-r--r--criu/cr-service.c (renamed from cr-service.c)0
-rw-r--r--criu/cr-show.c (renamed from cr-show.c)0
-rw-r--r--criu/crtools.c (renamed from crtools.c)0
-rw-r--r--criu/eventfd.c (renamed from eventfd.c)0
-rw-r--r--criu/eventpoll.c (renamed from eventpoll.c)0
-rw-r--r--criu/fault-injection.c (renamed from fault-injection.c)0
-rw-r--r--criu/fifo.c (renamed from fifo.c)0
-rw-r--r--criu/file-ids.c (renamed from file-ids.c)0
-rw-r--r--criu/file-lock.c (renamed from file-lock.c)0
-rw-r--r--criu/files-ext.c (renamed from files-ext.c)0
-rw-r--r--criu/files-reg.c (renamed from files-reg.c)0
-rw-r--r--criu/files.c (renamed from files.c)0
-rw-r--r--criu/fsnotify.c (renamed from fsnotify.c)0
-rw-r--r--criu/image-desc.c (renamed from image-desc.c)0
-rw-r--r--criu/image.c (renamed from image.c)0
-rw-r--r--criu/include/action-scripts.h (renamed from include/action-scripts.h)0
-rw-r--r--criu/include/aio.h (renamed from include/aio.h)0
-rw-r--r--criu/include/asm-generic/bitops.h (renamed from include/asm-generic/bitops.h)0
-rw-r--r--criu/include/asm-generic/int.h (renamed from include/asm-generic/int.h)0
-rw-r--r--criu/include/asm-generic/string.h (renamed from include/asm-generic/string.h)0
-rw-r--r--criu/include/asm-generic/vdso.h (renamed from include/asm-generic/vdso.h)0
-rw-r--r--criu/include/bfd.h (renamed from include/bfd.h)0
-rw-r--r--criu/include/bitmap.h (renamed from include/bitmap.h)0
-rw-r--r--criu/include/bug.h (renamed from include/bug.h)0
-rw-r--r--criu/include/cgroup.h (renamed from include/cgroup.h)0
-rw-r--r--criu/include/compiler.h (renamed from include/compiler.h)0
-rw-r--r--criu/include/config-base.h (renamed from include/config-base.h)0
-rw-r--r--criu/include/cpu.h (renamed from include/cpu.h)0
-rw-r--r--criu/include/cr-errno.h (renamed from include/cr-errno.h)0
-rw-r--r--criu/include/cr-service-const.h (renamed from include/cr-service-const.h)0
-rw-r--r--criu/include/cr-service.h (renamed from include/cr-service.h)0
-rw-r--r--criu/include/cr-show.h (renamed from include/cr-show.h)0
-rw-r--r--criu/include/cr_options.h (renamed from include/cr_options.h)0
-rw-r--r--criu/include/criu-log.h (renamed from include/criu-log.h)0
-rw-r--r--criu/include/criu-plugin.h (renamed from include/criu-plugin.h)0
-rw-r--r--criu/include/crtools.h (renamed from include/crtools.h)0
-rw-r--r--criu/include/err.h (renamed from include/err.h)0
-rw-r--r--criu/include/errno.h (renamed from include/errno.h)0
-rw-r--r--criu/include/eventfd.h (renamed from include/eventfd.h)0
-rw-r--r--criu/include/eventpoll.h (renamed from include/eventpoll.h)0
-rw-r--r--criu/include/fault-injection.h (renamed from include/fault-injection.h)0
-rw-r--r--criu/include/fcntl.h (renamed from include/fcntl.h)0
-rw-r--r--criu/include/fifo.h (renamed from include/fifo.h)0
-rw-r--r--criu/include/file-ids.h (renamed from include/file-ids.h)0
-rw-r--r--criu/include/file-lock.h (renamed from include/file-lock.h)0
-rw-r--r--criu/include/files-reg.h (renamed from include/files-reg.h)0
-rw-r--r--criu/include/files.h (renamed from include/files.h)0
-rw-r--r--criu/include/fs-magic.h (renamed from include/fs-magic.h)0
-rw-r--r--criu/include/fsnotify.h (renamed from include/fsnotify.h)0
-rw-r--r--criu/include/image-desc.h (renamed from include/image-desc.h)0
-rw-r--r--criu/include/image.h (renamed from include/image.h)0
-rw-r--r--criu/include/imgset.h (renamed from include/imgset.h)0
-rw-r--r--criu/include/inet_diag.h (renamed from include/inet_diag.h)0
-rw-r--r--criu/include/ipc_ns.h (renamed from include/ipc_ns.h)0
-rw-r--r--criu/include/irmap.h (renamed from include/irmap.h)0
-rw-r--r--criu/include/kcmp-ids.h (renamed from include/kcmp-ids.h)0
-rw-r--r--criu/include/kcmp.h (renamed from include/kcmp.h)0
-rw-r--r--criu/include/kerndat.h (renamed from include/kerndat.h)0
-rw-r--r--criu/include/libnetlink.h (renamed from include/libnetlink.h)0
-rw-r--r--criu/include/list.h (renamed from include/list.h)0
-rw-r--r--criu/include/lock.h (renamed from include/lock.h)0
-rw-r--r--criu/include/log.h (renamed from include/log.h)0
-rw-r--r--criu/include/lsm.h (renamed from include/lsm.h)0
-rw-r--r--criu/include/magic.h (renamed from include/magic.h)0
-rw-r--r--criu/include/mem.h (renamed from include/mem.h)0
-rw-r--r--criu/include/mman.h (renamed from include/mman.h)0
-rw-r--r--criu/include/mount.h (renamed from include/mount.h)0
-rw-r--r--criu/include/namespaces.h (renamed from include/namespaces.h)0
-rw-r--r--criu/include/net.h (renamed from include/net.h)0
-rw-r--r--criu/include/netfilter.h (renamed from include/netfilter.h)0
-rw-r--r--criu/include/netlink_diag.h (renamed from include/netlink_diag.h)0
-rw-r--r--criu/include/packet_diag.h (renamed from include/packet_diag.h)0
-rw-r--r--criu/include/page-pipe.h (renamed from include/page-pipe.h)0
-rw-r--r--criu/include/page-read.h (renamed from include/page-read.h)0
-rw-r--r--criu/include/page-xfer.h (renamed from include/page-xfer.h)0
-rw-r--r--criu/include/pagemap-cache.h (renamed from include/pagemap-cache.h)0
-rw-r--r--criu/include/parasite-syscall.h (renamed from include/parasite-syscall.h)0
-rw-r--r--criu/include/parasite-vdso.h (renamed from include/parasite-vdso.h)0
-rw-r--r--criu/include/parasite.h (renamed from include/parasite.h)0
-rw-r--r--criu/include/pid.h (renamed from include/pid.h)0
-rw-r--r--criu/include/pipes.h (renamed from include/pipes.h)0
-rw-r--r--criu/include/plugin.h (renamed from include/plugin.h)0
-rw-r--r--criu/include/posix-timer.h (renamed from include/posix-timer.h)0
-rw-r--r--criu/include/prctl.h (renamed from include/prctl.h)0
-rw-r--r--criu/include/proc_parse.h (renamed from include/proc_parse.h)0
-rw-r--r--criu/include/protobuf-desc.h (renamed from include/protobuf-desc.h)0
-rw-r--r--criu/include/protobuf.h (renamed from include/protobuf.h)0
-rw-r--r--criu/include/pstree.h (renamed from include/pstree.h)0
-rw-r--r--criu/include/ptrace.h (renamed from include/ptrace.h)0
-rw-r--r--criu/include/rbtree.h (renamed from include/rbtree.h)0
-rw-r--r--criu/include/restorer.h (renamed from include/restorer.h)0
-rw-r--r--criu/include/rst-malloc.h (renamed from include/rst-malloc.h)0
-rw-r--r--criu/include/rst_info.h (renamed from include/rst_info.h)0
-rw-r--r--criu/include/seccomp.h (renamed from include/seccomp.h)0
-rw-r--r--criu/include/seize.h (renamed from include/seize.h)0
-rw-r--r--criu/include/servicefd.h (renamed from include/servicefd.h)0
-rw-r--r--criu/include/setproctitle.h (renamed from include/setproctitle.h)0
-rw-r--r--criu/include/shmem.h (renamed from include/shmem.h)0
-rw-r--r--criu/include/sigframe.h (renamed from include/sigframe.h)0
-rw-r--r--criu/include/signalfd.h (renamed from include/signalfd.h)0
-rw-r--r--criu/include/sk-inet.h (renamed from include/sk-inet.h)0
-rw-r--r--criu/include/sk-packet.h (renamed from include/sk-packet.h)0
-rw-r--r--criu/include/sk-queue.h (renamed from include/sk-queue.h)0
-rw-r--r--criu/include/sockets.h (renamed from include/sockets.h)0
-rw-r--r--criu/include/stats.h (renamed from include/stats.h)0
-rw-r--r--criu/include/string.h (renamed from include/string.h)0
-rw-r--r--criu/include/syscall-types.h (renamed from include/syscall-types.h)0
-rw-r--r--criu/include/sysctl.h (renamed from include/sysctl.h)0
-rw-r--r--criu/include/sysfs_parse.h (renamed from include/sysfs_parse.h)0
-rw-r--r--criu/include/timerfd.h (renamed from include/timerfd.h)0
-rw-r--r--criu/include/tty.h (renamed from include/tty.h)0
-rw-r--r--criu/include/tun.h (renamed from include/tun.h)0
-rw-r--r--criu/include/unix_diag.h (renamed from include/unix_diag.h)0
-rw-r--r--criu/include/util-pie.h (renamed from include/util-pie.h)0
-rw-r--r--criu/include/util-vdso.h (renamed from include/util-vdso.h)0
-rw-r--r--criu/include/util.h (renamed from include/util.h)0
-rw-r--r--criu/include/uts_ns.h (renamed from include/uts_ns.h)0
-rw-r--r--criu/include/vdso.h (renamed from include/vdso.h)0
-rw-r--r--criu/include/vma.h (renamed from include/vma.h)0
-rw-r--r--criu/include/xmalloc.h (renamed from include/xmalloc.h)0
-rw-r--r--criu/ipc_ns.c (renamed from ipc_ns.c)0
-rw-r--r--criu/irmap.c (renamed from irmap.c)0
-rw-r--r--criu/kcmp-ids.c (renamed from kcmp-ids.c)0
-rw-r--r--criu/kerndat.c (renamed from kerndat.c)0
-rw-r--r--criu/libnetlink.c (renamed from libnetlink.c)0
-rw-r--r--criu/log.c (renamed from log.c)0
-rw-r--r--criu/lsm.c (renamed from lsm.c)0
-rw-r--r--criu/mem.c (renamed from mem.c)0
-rw-r--r--criu/mount.c (renamed from mount.c)0
-rw-r--r--criu/namespaces.c (renamed from namespaces.c)0
-rw-r--r--criu/net.c (renamed from net.c)0
-rw-r--r--criu/netfilter.c (renamed from netfilter.c)0
-rw-r--r--criu/page-pipe.c (renamed from page-pipe.c)0
-rw-r--r--criu/page-read.c (renamed from page-read.c)0
-rw-r--r--criu/page-xfer.c (renamed from page-xfer.c)0
-rw-r--r--criu/pagemap-cache.c (renamed from pagemap-cache.c)0
-rw-r--r--criu/parasite-syscall.c (renamed from parasite-syscall.c)0
l---------criu/pie-util-fd.c1
l---------criu/pie-util-vdso.c1
l---------criu/pie-util.c1
-rw-r--r--criu/pie/Makefile (renamed from pie/Makefile)91
-rw-r--r--criu/pie/Makefile.library43
-rw-r--r--criu/pie/log-simple.c (renamed from pie/log-simple.c)0
-rw-r--r--criu/pie/parasite-vdso.c (renamed from pie/parasite-vdso.c)0
-rw-r--r--criu/pie/parasite.c (renamed from pie/parasite.c)0
-rw-r--r--criu/pie/pie-reloc.lds.S.in (renamed from pie/pie-reloc.lds.S.in)0
-rw-r--r--criu/pie/pie-relocs.c (renamed from pie/pie-relocs.c)0
-rw-r--r--criu/pie/pie-relocs.h (renamed from pie/pie-relocs.h)0
-rw-r--r--criu/pie/pie.lds.S.in (renamed from pie/pie.lds.S.in)0
-rw-r--r--criu/pie/piegen/Makefile (renamed from pie/piegen/Makefile)0
-rw-r--r--criu/pie/piegen/elf-ppc64.c (renamed from pie/piegen/elf-ppc64.c)0
-rw-r--r--criu/pie/piegen/elf-x86-32.c (renamed from pie/piegen/elf-x86-32.c)0
-rw-r--r--criu/pie/piegen/elf-x86-64.c (renamed from pie/piegen/elf-x86-64.c)0
-rw-r--r--criu/pie/piegen/elf.c (renamed from pie/piegen/elf.c)0
-rw-r--r--criu/pie/piegen/main.c (renamed from pie/piegen/main.c)0
-rw-r--r--criu/pie/piegen/piegen.h (renamed from pie/piegen/piegen.h)0
-rw-r--r--criu/pie/piegen/uapi/types.h (renamed from pie/piegen/uapi/types.h)0
-rw-r--r--criu/pie/restorer.c (renamed from pie/restorer.c)0
-rw-r--r--criu/pie/util-fd.c (renamed from pie/util-fd.c)0
-rw-r--r--criu/pie/util-vdso.c (renamed from pie/util-vdso.c)0
-rw-r--r--criu/pie/util.c (renamed from pie/util.c)0
-rw-r--r--criu/pipes.c (renamed from pipes.c)0
-rw-r--r--criu/plugin.c (renamed from plugin.c)0
-rw-r--r--criu/proc_parse.c (renamed from proc_parse.c)0
-rw-r--r--criu/protobuf-desc.c (renamed from protobuf-desc.c)0
-rw-r--r--criu/protobuf.c (renamed from protobuf.c)0
-rw-r--r--criu/pstree.c (renamed from pstree.c)0
-rw-r--r--criu/ptrace.c (renamed from ptrace.c)0
-rw-r--r--criu/rbtree.c (renamed from rbtree.c)0
-rw-r--r--criu/rst-malloc.c (renamed from rst-malloc.c)0
-rw-r--r--criu/seccomp.c (renamed from seccomp.c)0
-rw-r--r--criu/seize.c (renamed from seize.c)0
-rw-r--r--criu/shmem.c (renamed from shmem.c)0
-rw-r--r--criu/sigframe.c (renamed from sigframe.c)0
-rw-r--r--criu/signalfd.c (renamed from signalfd.c)0
-rw-r--r--criu/sk-inet.c (renamed from sk-inet.c)0
-rw-r--r--criu/sk-netlink.c (renamed from sk-netlink.c)0
-rw-r--r--criu/sk-packet.c (renamed from sk-packet.c)0
-rw-r--r--criu/sk-queue.c (renamed from sk-queue.c)0
-rw-r--r--criu/sk-tcp.c (renamed from sk-tcp.c)0
-rw-r--r--criu/sk-unix.c (renamed from sk-unix.c)0
-rw-r--r--criu/sockets.c (renamed from sockets.c)0
-rw-r--r--criu/stats.c (renamed from stats.c)0
-rw-r--r--criu/string.c (renamed from string.c)0
-rw-r--r--criu/sysctl.c (renamed from sysctl.c)0
-rw-r--r--criu/sysfs_parse.c (renamed from sysfs_parse.c)0
-rw-r--r--criu/timerfd.c (renamed from timerfd.c)0
-rw-r--r--criu/tty.c (renamed from tty.c)0
-rw-r--r--criu/tun.c (renamed from tun.c)0
-rw-r--r--criu/util.c (renamed from util.c)0
-rw-r--r--criu/uts_ns.c (renamed from uts_ns.c)0
-rw-r--r--criu/vdso.c (renamed from vdso.c)0
l---------crtools1
-rw-r--r--images/Makefile5
-rw-r--r--lib/Makefile6
-rw-r--r--lib/c/Makefile10
-rw-r--r--lib/py/Makefile2
-rw-r--r--lib/py/images/Makefile19
-rw-r--r--scripts/Makefile.build251
-rw-r--r--scripts/Makefile.rules52
349 files changed, 761 insertions, 1124 deletions
diff --git a/.gitignore b/.gitignore
index d1ee8415e..c46bc5f75 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,31 +6,15 @@
*.out
*.swp
*.swo
-*-blob.h
*.so
.git-ignore
*.patch
*.pyc
-criu
cscope*
tags
TAGS
-Makefile.local
-syscall-x86-64.S
-include/syscall.h
-include/syscall-codes.h
-protobuf/*.c
-protobuf/*.h
-protobuf/google/protobuf/*.c
-protobuf/google/protobuf/*.h
-include/version.h
-arch/x86/sys-exec-tbl.c
-arch/x86/syscalls.S
-pie/pie.lds.S
-pie/piegen/piegen
-include/config.h
-protobuf-desc-gen.h
-criu.pc
-build
+images/*.c
+images/*.h
+images/google/protobuf/*.c
+images/google/protobuf/*.h
.gitid
-usr/
diff --git a/Documentation/Makefile b/Documentation/Makefile
index e236635e5..77e3a26bb 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -1,4 +1,5 @@
--include ../Makefile.inc
+include $(__nmk_dir)/include.mk
+include $(__nmk_dir)/macro.mk
ASCIIDOC := asciidoc
A2X := a2x
@@ -9,10 +10,9 @@ XMLS := $(patsubst %.txt,%.xml,$(SRC))
MANS := $(patsubst %.txt,%.8,$(SRC))
MAN8DIR := $(MANDIR)/man8
-GROFF=groff
-PAPER=$(shell paperconf 2>/dev/null || echo letter)
-GROFF_OPTS := -Tps -t -dpaper=$(PAPER) -P-p$(PAPER) \
- -man -msafer -rC1 -rD1 -rS11
+GROFF :=groff
+PAPER :=$(shell paperconf 2>/dev/null || echo letter)
+GROFF_OPTS := -Tps -t -dpaper=$(PAPER) -P-p$(PAPER) -man -msafer -rC1 -rD1 -rS11
PSS := $(MANS:%.8=%.ps)
PDFS := $(MANS:%.8=%.pdf)
@@ -27,20 +27,20 @@ check:
done
%.8: %.txt
- $(E) " GEN " $@
+ $(call msg-gen, $@)
$(Q) $(ASCIIDOC) -b docbook -d manpage -o $(patsubst %.8,%.xml,$@) $<
$(Q) $(XMLTO) man --skip-validation $(patsubst %.8,%.xml,$@) 2>/dev/null
%.ps: %.8
- $(E) " GEN " $@
+ $(call msg-gen, $@)
$(Q) $(GROFF) $(GROFF_OPTS) $^ > $@
%.pdf: %.ps
- $(E) " GEN " $@
+ $(call msg-gen, $@)
$(Q) ps2pdf $< $@
clean:
- $(E) " CLEAN "
+ $(call msg-clean, "Documentation")
$(Q) rm -f $(XMLS) $(MANS) $(PSS) $(PDFS)
install: $(MANS)
diff --git a/Makefile b/Makefile
index 18956b455..9f113cccd 100644
--- a/Makefile
+++ b/Makefile
@@ -1,98 +1,52 @@
+#
# Import the build engine first
__nmk_dir=$(CURDIR)/scripts/nmk/scripts/
export __nmk_dir
include $(__nmk_dir)/include.mk
-
-VERSION_MAJOR := 1
-VERSION_MINOR := 8
-VERSION_SUBLEVEL :=
-VERSION_EXTRA :=
-VERSION_NAME :=
-VERSION_SO_MAJOR := 1
-VERSION_SO_MINOR := 0
-
-export VERSION_MAJOR VERSION_MINOR VERSION_SUBLEVEL VERSION_EXTRA VERSION_NAME
-export VERSION_SO_MAJOR VERSION_SO_MINOR
-
-#
-# FIXME zdtm building procedure requires implicit rules
-# so I can't use strict make file mode and drop completely
-# all of implicit rules, so I tuned only .SUFFIXES:
-#
-# In future zdtm makefiles need to be fixed and the line below
-# may be uncommented.
-#
-#MAKEFLAGS := -r -R
+include $(__nmk_dir)/macro.mk
#
-# Common definitions
-#
-
-FIND := find
-CSCOPE := cscope
-RM := rm -f
-LD := $(CROSS_COMPILE)ld
-CC := $(CROSS_COMPILE)gcc
-NM := $(CROSS_COMPILE)nm
-SH := bash
-MAKE := make
-OBJCOPY := $(CROSS_COMPILE)objcopy
+# To build host helpers.
HOSTCC ?= gcc
HOSTLD ?= ld
+export HOSTCC HOSTLD
CFLAGS += $(USERCFLAGS)
-HOSTCFLAGS ?= $(CFLAGS)
+export CFLAGS
-export HOSTCC
-export HOSTLD
+HOSTCFLAGS ?= $(CFLAGS)
export HOSTCFLAGS
+#
+# Where we live.
+SRC_DIR := $(CURDIR)
+export SRC_DIR
-ifeq ($(ARCH),x86_64)
- ARCH := x86
-endif
-
-ifeq ($(ARCH),x86)
- SRCARCH := x86
- DEFINES := -DCONFIG_X86_64
- LDARCH := i386:x86-64
- VDSO := y
-endif
-ifeq ($(ARCH),ia32)
- SRCARCH := x86
- DEFINES := -DCONFIG_X86_32
- LDARCH := i386
- ldflags-y += -m elf_i386
- VDSO := y
- USERCFLAGS += -m32
- PROTOUFIX := y
- export PROTOUFIX ldflags-y
-endif
+#
+# General architecture specific options.
+UNAME-M := $(shell uname -m)
+export UNAME-M
-ifeq ($(GCOV),1)
- LDFLAGS += -lgcov
- DEBUG := 1 # disable optimization if we want to measure code coverage
-%.o $(PROGRAM): override CFLAGS += --coverage -fno-exceptions -fno-inline
-endif
+ifeq ($(ARCH),arm)
+ ARMV := $(shell echo $(UNAME-M) | sed -nr 's/armv([[:digit:]]).*/\1/p; t; i7')
+ DEFINES := -DCONFIG_ARMV$(ARMV)
-ifeq ($(shell echo $(ARCH) | sed -e 's/arm.*/arm/'),arm)
- ARMV := $(shell echo $(ARCH) | sed -nr 's/armv([[:digit:]]).*/\1/p; t; i7')
- SRCARCH := arm
- DEFINES := -DCONFIG_ARMV$(ARMV)
+ USERCFLAGS += -Wa,-mimplicit-it=always
- USERCFLAGS += -Wa,-mimplicit-it=always
+ ifeq ($(ARMV),6)
+ USERCFLAGS += -march=armv6
+ endif
- ifeq ($(ARMV),6)
- USERCFLAGS += -march=armv6
- endif
+ ifeq ($(ARMV),7)
+ USERCFLAGS += -march=armv7-a
+ endif
- ifeq ($(ARMV),7)
- USERCFLAGS += -march=armv7-a
- endif
+ PROTOUFIX := y
+endif
- PROTOUFIX := y
- export PROTOUFIX
+ifeq ($(ARCH),x86)
+ DEFINES := -DCONFIG_X86_64
endif
ifeq ($(ARCH),aarch64)
@@ -103,239 +57,138 @@ endif
# The PowerPC 64 bits architecture could be big or little endian.
# They are handled in the same way.
#
-ifeq ($(shell echo $(ARCH) | sed -e 's/ppc64.*/ppc64/'),ppc64)
- ifeq ($(ARCH),ppc64)
- error := $(error ppc64 big endian not yet supported)
- endif
- SRCARCH := ppc64
- DEFINES := -DCONFIG_PPC64
- LDARCH := powerpc:common64
- VDSO := y
-endif
-
-LDARCH ?= $(SRCARCH)
+ifeq ($(ARCH),powerpc)
+ ifeq ($(UNAME-M),ppc64)
+ error := $(error ppc64 big endian not yet supported)
+ endif
-SRC_DIR ?= $(CURDIR)
-ARCH_DIR := arch/$(SRCARCH)
-
-$(if $(wildcard $(ARCH_DIR)),,$(error "The architecture $(ARCH) isn't supported"))
-
-#
-# piegen might be disabled by hands. Don't use it until
-# you know what you're doing.
-ifneq ($(filter ia32 x86 ppc64le, $(ARCH)),)
-ifneq ($(PIEGEN),no)
- piegen-y := y
- export piegen-y
-endif
+ DEFINES := -DCONFIG_PPC64
endif
-cflags-y += -iquote include -iquote pie -iquote . -I/usr/include/libnl3
-cflags-y += -iquote $(ARCH_DIR) -iquote $(ARCH_DIR)/include
-cflags-y += -fno-strict-aliasing
-export cflags-y
+export PROTOUFIX DEFINES USERCFLAGS
-LIBS := -lrt -lpthread -lprotobuf-c -ldl -lnl-3
+#
+# Independent options for all tools.
+DEFINES += -D_FILE_OFFSET_BITS=64
+DEFINES += -D_GNU_SOURCE
-DEFINES += -D_FILE_OFFSET_BITS=64
-DEFINES += -D_GNU_SOURCE
+CFLAGS += $(USERCFLAGS)
-WARNINGS := -Wall
+WARNINGS := -Wall
ifneq ($(WERROR),0)
- WARNINGS += -Werror
+ WARNINGS += -Werror
endif
ifeq ($(DEBUG),1)
- DEFINES += -DCR_DEBUG
- CFLAGS += -O0 -ggdb3
+ DEFINES += -DCR_DEBUG
+ CFLAGS += -O0 -ggdb3
else
- CFLAGS += -O2 -g
-endif
-
-ifeq ($(GMON),1)
- CFLAGS += -pg
- GMONLDOPT := -pg
-endif
-
-CFLAGS += $(WARNINGS) $(DEFINES)
-SYSCALL-LIB := $(ARCH_DIR)/syscalls.built-in.o
-ARCH-LIB := $(ARCH_DIR)/crtools.built-in.o
-CRIU-SO := libcriu
-CRIU-LIB := lib/c/$(CRIU-SO).so
-CRIU-INC := lib/criu.h include/criu-plugin.h include/criu-log.h protobuf/rpc.proto
-ifeq ($(piegen-y),y)
-piegen := pie/piegen/piegen
+ CFLAGS += -O2 -g
endif
-export CC MAKE CFLAGS LIBS SRCARCH DEFINES MAKEFLAGS CRIU-SO
-export SRC_DIR SYSCALL-LIB SH RM ARCH_DIR OBJCOPY LDARCH LD
-export USERCFLAGS
-export cflags-y
-export VDSO
-
-include Makefile.inc
-include Makefile.config
-include scripts/Makefile.version
-include scripts/Makefile.rules
-
-.SUFFIXES:
+CFLAGS += $(WARNINGS) $(DEFINES)
#
-# shorthand
-build-old := -r -R -f scripts/Makefile.build makefile=Makefile obj
-build-old-crtools := -r -R -f scripts/Makefile.build makefile=Makefile.crtools obj
-
-PROGRAM := criu
-
-.PHONY: all zdtm test rebuild clean distclean tags cscope \
- docs help pie protobuf $(ARCH_DIR) clean-built lib crit
-
-all: config pie $(VERSION_HEADER) $(CRIU-LIB)
- $(Q) $(MAKE) $(PROGRAM)
- $(Q) $(MAKE) crit
-
-protobuf/%::
- $(Q) $(MAKE) $(build-old)=protobuf $@
-protobuf:
- $(Q) $(MAKE) $(build-old)=protobuf all
-
-$(ARCH_DIR)/%:: protobuf config
- $(Q) $(MAKE) $(build-old)=$(ARCH_DIR) $@
-$(ARCH_DIR): protobuf config
- $(Q) $(MAKE) $(build-old)=$(ARCH_DIR) all
-
-ifeq ($(piegen-y),y)
-pie/piegen/%: config
- $(Q) CC=$(HOSTCC) LD=$(HOSTLD) CFLAGS="$(HOSTCFLAGS)" $(MAKE) $(build-old)=pie/piegen $@
-pie/piegen: config
- $(Q) CC=$(HOSTCC) LD=$(HOSTLD) CFLAGS="$(HOSTCFLAGS)" $(MAKE) $(build-old)=pie/piegen all
-$(piegen): pie/piegen/built-in.o
- $(E) " LINK " $@
- $(Q) $(HOSTCC) $(HOSTCFLAGS) $^ $(LDFLAGS) -o $@
-.PHONY: pie/piegen
-endif
+# Protobuf images first, they are not depending
+# on anything else.
+$(eval $(call gen-built-in,images))
+PHONY += images
-pie: $(ARCH_DIR) $(piegen)
- $(Q) $(MAKE) $(build-old)=pie all
-
-%.o %.i %.s %.d: $(VERSION_HEADER) pie
- $(Q) $(MAKE) $(build-old-crtools)=. $@
-built-in.o: $(VERSION_HEADER) pie
- $(Q) $(MAKE) $(build-old-crtools)=. $@
+#
+# CRIU building done in own directory
+# with slightly different rules so we
+# can't use nmk engine directly (we
+# build syscalls library and such).
+#
+# But note that we're already included
+# the nmk so we can reuse it there.
+criu/%: images/built-in.o
+ $(Q) $(MAKE) -C criu $@
+criu: images/built-in.o
+ $(Q) $(MAKE) -C criu all
+criu/criu: criu
+PHONY += criu
-lib/%:: $(VERSION_HEADER) config built-in.o
+#
+# Libraries next once criu it ready
+# (we might generate headers and such
+# when building criu itself).
+lib/%: criu
$(Q) $(MAKE) -C lib $@
-lib: $(VERSION_HEADER) config built-in.o
+lib: criu
$(Q) $(MAKE) -C lib all
+PHONY += lib
-$(CRIU-LIB): lib
- @true
-crit: lib
- @true
+all: criu lib
+PHONY += all
+clean-built:
+ $(Q) $(MAKE) $(build)=images clean
+ $(Q) $(MAKE) -C criu clean
+ $(Q) $(MAKE) -C lib clean
+PHONY += clean-built
-PROGRAM-BUILTINS += protobuf/built-in.o
-PROGRAM-BUILTINS += built-in.o
+clean: clean-built
+ $(call msg-clean, criu)
+PHONY += clean
-$(SYSCALL-LIB) $(ARCH-LIB) $(PROGRAM-BUILTINS): config
+#
+# Non-CRIU stuff.
+#
-$(PROGRAM): $(ARCH-LIB) $(PROGRAM-BUILTINS)
- $(E) " LINK " $@
- $(Q) $(CC) $(CFLAGS) $^ $(LIBS) $(LDFLAGS) $(GMONLDOPT) -rdynamic -o $@
+docs:
+ $(Q) $(MAKE) -s -C Documentation all
+PHONY += docs
zdtm: all
$(Q) $(MAKE) -C test/zdtm all
+PHONY += zdtm
test: zdtm
$(Q) $(MAKE) -C test
+PHONY += test
-clean-built:
- $(Q) $(RM) $(VERSION_HEADER)
- $(Q) $(MAKE) $(build-old)=$(ARCH_DIR) clean
- $(Q) $(MAKE) $(build-old)=protobuf clean
- $(Q) $(MAKE) $(build-old)=pie/piegen clean
- $(Q) $(MAKE) $(build-old)=pie clean
- $(Q) $(MAKE) -C lib clean
- $(Q) $(MAKE) $(build-old-crtools)=. clean
- $(Q) $(MAKE) -C Documentation clean
- $(Q) $(RM) ./include/config.h
- $(Q) $(RM) ./$(PROGRAM)
-
-rebuild: clean-built
- $(E) " FORCE-REBUILD"
- $(Q) $(MAKE)
-
-clean: clean-built
- $(E) " CLEAN"
- $(Q) $(RM) ./*.img
- $(Q) $(RM) ./*.out
- $(Q) $(RM) ./*.bin
- $(Q) $(RM) ./*.{gcda,gcno,gcov} ./test/`pwd`/*.{gcda,gcno,gcov}
- $(Q) $(RM) ./pie/*.{gcda,gcno,gcov} ./pie/piegen/*.{gcda,gcno,gcov}
- $(Q) $(RM) -r ./gcov
- $(Q) $(RM) protobuf-desc-gen.h
- $(Q) $(MAKE) -C test $@
- $(Q) $(RM) ./*.pyc
- $(Q) $(RM) -r build
- $(Q) $(RM) -r usr
-
-distclean: clean
- $(E) " DISTCLEAN"
- $(Q) $(RM) ./tags
- $(Q) $(RM) ./cscope*
+dist: tar
+tar: criu-$(CRTOOLSVERSION).tar.bz2
+criu-$(CRTOOLSVERSION).tar.bz2:
+ git archive --format tar --prefix 'criu-$(CRTOOLSVERSION)/' \
+ v$(CRTOOLSVERSION) | bzip2 > $@
+.PHONY: dist tar
tags:
- $(E) " GEN " $@
+ $(call msg-gen, $@)
$(Q) $(RM) tags
$(Q) $(FIND) . -name '*.[hcS]' ! -path './.*' ! -path './test/*' -print | xargs ctags -a
+PHONY += tags
cscope:
- $(E) " GEN " $@
+ $(call msg-gen, $@)
$(Q) $(FIND) . -name '*.[hcS]' ! -path './.*' ! -path './test/*' ! -type l -print > cscope.files
$(Q) $(CSCOPE) -bkqu
+PHONY += cscope
-docs:
- $(Q) $(MAKE) -s -C Documentation all
+gcov:
+ $(E) " GCOV"
+ $(Q) test -d gcov || mkdir gcov && \
+ cp *.{gcno,c} test/`pwd`/ && \
+ geninfo --output-filename gcov/crtools.h.info --no-recursion . && \
+ geninfo --output-filename gcov/crtools.ns.info --no-recursion test/`pwd`/ && \
+ sed -i 's#/test/`pwd`##' gcov/crtools.ns.info && \
+ cd gcov && \
+ lcov --rc lcov_branch_coverage=1 --add-tracefile crtools.h.info \
+ --add-tracefile crtools.ns.info --output-file criu.info && \
+ genhtml --rc lcov_branch_coverage=1 --output-directory html criu.info
+ @echo "Code coverage report is in `pwd`/gcov/html/ directory."
+PHONY += gcov
-dist: tar
-tar: criu-$(CRTOOLSVERSION).tar.bz2
-criu-$(CRTOOLSVERSION).tar.bz2:
- git archive --format tar --prefix 'criu-$(CRTOOLSVERSION)/' \
- v$(CRTOOLSVERSION) | bzip2 > $@
-.PHONY: dist tar
+docker-build:
+ docker build -t criu .
+PHONY += docker-build
-install: install-criu install-man
-
-install-criu: all $(CRIU-LIB) install-crit
- $(E) " INSTALL " $(PROGRAM)
- $(Q) mkdir -p $(DESTDIR)$(SBINDIR)
- $(Q) install -m 755 $(PROGRAM) $(DESTDIR)$(SBINDIR)
- $(Q) mkdir -p $(DESTDIR)$(LIBDIR)
- $(Q) install -m 755 $(CRIU-LIB) \
- $(DESTDIR)$(LIBDIR)/$(CRIU-SO).so.$(VERSION_SO_MAJOR).$(VERSION_SO_MINOR)
- $(Q) ln -fns $(CRIU-SO).so.$(VERSION_SO_MAJOR).$(VERSION_SO_MINOR) \
- $(DESTDIR)$(LIBDIR)/$(CRIU-SO).so.$(VERSION_SO_MAJOR)
- $(Q) ln -fns $(CRIU-SO).so.$(VERSION_SO_MAJOR).$(VERSION_SO_MINOR) \
- $(DESTDIR)$(LIBDIR)/$(CRIU-SO).so
- $(Q) mkdir -p $(DESTDIR)$(INCLUDEDIR)
- $(Q) install -m 644 $(CRIU-INC) $(DESTDIR)$(INCLUDEDIR)
- $(Q) mkdir -p $(DESTDIR)$(SYSTEMDUNITDIR)
- $(Q) sed -e 's,@version@,$(CRTOOLSVERSION),' \
- -e 's,@libdir@,$(LIBDIR),' \
- -e 's,@includedir@,$(dir $(INCLUDEDIR)),' \
- lib/criu.pc.in > criu.pc
- $(Q) mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig
- $(Q) install -m 644 criu.pc $(DESTDIR)$(LIBDIR)/pkgconfig
-
-install-man:
- $(Q) $(MAKE) -C Documentation install
-
-install-crit: crit
- $(E) " INSTALL crit"
- $(Q) python scripts/crit-setup.py install --root=$(DESTDIR) --prefix=$(PREFIX)
-
-.PHONY: install install-man install-crit install-criu
+docker-test:
+ docker run --rm -it --privileged criu ./test/zdtm.sh -C -x tcp6 -x tcpbuf6 -x static/rtc -x cgroup -x mountpoint
+PHONY += docker-test
help:
@echo ' Targets:'
@@ -350,28 +203,15 @@ help:
@echo ' cscope - Generate cscope database'
@echo ' rebuild - Force-rebuild of [*] targets'
@echo ' test - Run zdtm test-suite'
- @echo ' gcov - Make code coverage report'
-
-gcov:
- $(E) " GCOV"
- $(Q) test -d gcov || mkdir gcov && \
- cp *.{gcno,c} test/`pwd`/ && \
- geninfo --output-filename gcov/crtools.h.info --no-recursion . && \
- geninfo --output-filename gcov/crtools.ns.info --no-recursion test/`pwd`/ && \
- sed -i 's#/test/`pwd`##' gcov/crtools.ns.info && \
- cd gcov && \
- lcov --rc lcov_branch_coverage=1 --add-tracefile crtools.h.info --add-tracefile crtools.ns.info --output-file criu.info && \
- genhtml --rc lcov_branch_coverage=1 --output-directory html criu.info
- @echo "Code coverage report is in `pwd`/gcov/html/ directory."
-.PHONY: gcov
+ @echo ' gcov - Make code coverage report'
+PHONY += help
-docker-build:
- docker build -t criu .
+include Makefile.install
-docker-test:
- docker run --rm -it --privileged criu ./test/zdtm.sh -C -x tcp6 -x tcpbuf6 -x static/rtc -x cgroup -x mountpoint
+.PHONY: $(PHONY)
-.DEFAULT_GOAL := all
+.DEFAULT_GOAL := all
-# include optional local rules
+#
+# Optional local include.
-include Makefile.local
diff --git a/Makefile.crtools b/Makefile.crtools
deleted file mode 100644
index 5788ef030..000000000
--- a/Makefile.crtools
+++ /dev/null
@@ -1,94 +0,0 @@
-obj-y += parasite-syscall.o
-obj-y += mem.o
-obj-y += rst-malloc.o
-obj-y += cr-restore.o
-obj-y += crtools.o
-obj-y += image.o
-obj-y += image-desc.o
-obj-y += net.o
-obj-y += tun.o
-obj-y += proc_parse.o
-obj-y += sysfs_parse.o
-obj-y += cr-dump.o
-obj-y += cr-show.o
-obj-y += cr-check.o
-obj-y += cr-dedup.o
-obj-y += util.o
-obj-y += bfd.o
-obj-y += action-scripts.o
-obj-y += sysctl.o
-obj-y += ptrace.o
-obj-y += kcmp-ids.o
-obj-y += rbtree.o
-obj-y += log.o
-obj-y += libnetlink.o
-obj-y += sockets.o
-obj-y += sk-inet.o
-obj-y += sk-tcp.o
-obj-y += sk-unix.o
-obj-y += sk-packet.o
-obj-y += sk-netlink.o
-obj-y += sk-queue.o
-obj-y += files.o
-obj-y += files-reg.o
-obj-y += files-ext.o
-obj-y += pipes.o
-obj-y += fifo.o
-obj-y += file-ids.o
-obj-y += namespaces.o
-obj-y += uts_ns.o
-obj-y += ipc_ns.o
-obj-y += netfilter.o
-obj-y += shmem.o
-obj-y += eventfd.o
-obj-y += eventpoll.o
-obj-y += mount.o
-obj-y += fsnotify.o
-obj-y += irmap.o
-obj-y += signalfd.o
-obj-y += pstree.o
-obj-y += bitmap.o
-obj-y += protobuf.o
-obj-y += protobuf-desc.o
-obj-y += tty.o
-obj-y += cr-exec.o
-obj-y += file-lock.o
-obj-y += page-pipe.o
-obj-y += page-xfer.o
-obj-y += page-read.o
-obj-y += pagemap-cache.o
-obj-y += kerndat.o
-obj-y += stats.o
-obj-y += cgroup.o
-obj-y += timerfd.o
-obj-y += aio.o
-obj-y += string.o
-obj-y += sigframe.o
-obj-y += lsm.o
-ifeq ($(VDSO),y)
-obj-y += vdso.o
-obj-y += pie/util-vdso.o
-endif
-obj-y += cr-service.o
-obj-y += plugin.o
-obj-y += cr-errno.o
-obj-y += pie/pie-relocs.o
-obj-y += seize.o
-obj-y += fault-injection.o
-obj-y += pie/util-fd.o
-obj-y += pie/util.o
-obj-y += seccomp.o
-
-ifneq ($(MAKECMDGOALS),clean)
-incdeps := y
-endif
-
-PROTOBUF_GEN := scripts/protobuf-gen.sh
-
-protobuf-desc.c: protobuf-desc-gen.h
-
-protobuf-desc-gen.h: $(PROTOBUF_GEN) include/protobuf-desc.h
- $(E) " GEN " $@
- $(Q) $(SH) $(obj)/$(PROTOBUF_GEN) > $@
-
-cleanup-y += protobuf-desc-gen.h
diff --git a/Makefile.inc b/Makefile.inc
deleted file mode 100644
index 4782ea239..000000000
--- a/Makefile.inc
+++ /dev/null
@@ -1,18 +0,0 @@
-# Installation paths
-PREFIX ?= /usr/local
-SBINDIR ?= $(PREFIX)/sbin
-MANDIR ?= $(PREFIX)/share/man
-SYSTEMDUNITDIR ?= $(PREFIX)/lib/systemd/system/
-LOGROTATEDIR ?= $(PREFIX)/etc/logrotate.d/
-LIBDIR ?= $(PREFIX)/lib
-# For recent Debian/Ubuntu with multiarch support
-DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture \
- -qDEB_HOST_MULTIARCH 2>/dev/null)
-ifneq "$(DEB_HOST_MULTIARCH)" ""
-LIBDIR ?= $(PREFIX)/lib/$(DEB_HOST_MULTIARCH)
-# For most other systems
-else ifeq "$(shell uname -m)" "x86_64"
-LIBDIR ?= $(PREFIX)/lib64
-endif
-
-INCLUDEDIR ?= $(PREFIX)/include/criu
diff --git a/Makefile.install b/Makefile.install
new file mode 100644
index 000000000..4f3b57fb0
--- /dev/null
+++ b/Makefile.install
@@ -0,0 +1,31 @@
+install: install-criu install-man
+
+install-criu: all $(CRIU-LIB) install-crit
+ $(E) " INSTALL " $(PROGRAM)
+ $(Q) mkdir -p $(DESTDIR)$(SBINDIR)
+ $(Q) install -m 755 $(PROGRAM) $(DESTDIR)$(SBINDIR)
+ $(Q) mkdir -p $(DESTDIR)$(LIBDIR)
+ $(Q) install -m 755 $(CRIU-LIB) \
+ $(DESTDIR)$(LIBDIR)/$(CRIU-SO).so.$(VERSION_SO_MAJOR).$(VERSION_SO_MINOR)
+ $(Q) ln -fns $(CRIU-SO).so.$(VERSION_SO_MAJOR).$(VERSION_SO_MINOR) \
+ $(DESTDIR)$(LIBDIR)/$(CRIU-SO).so.$(VERSION_SO_MAJOR)
+ $(Q) ln -fns $(CRIU-SO).so.$(VERSION_SO_MAJOR).$(VERSION_SO_MINOR) \
+ $(DESTDIR)$(LIBDIR)/$(CRIU-SO).so
+ $(Q) mkdir -p $(DESTDIR)$(INCLUDEDIR)
+ $(Q) install -m 644 $(CRIU-INC) $(DESTDIR)$(INCLUDEDIR)
+ $(Q) mkdir -p $(DESTDIR)$(SYSTEMDUNITDIR)
+ $(Q) sed -e 's,@version@,$(CRTOOLSVERSION),' \
+ -e 's,@libdir@,$(LIBDIR),' \
+ -e 's,@includedir@,$(dir $(INCLUDEDIR)),' \
+ lib/criu.pc.in > criu.pc
+ $(Q) mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig
+ $(Q) install -m 644 criu.pc $(DESTDIR)$(LIBDIR)/pkgconfig
+
+install-man:
+ $(Q) $(MAKE) -C Documentation install
+
+install-crit: crit
+ $(E) " INSTALL crit"
+ $(Q) python scripts/crit-setup.py install --root=$(DESTDIR) --prefix=$(PREFIX)
+
+.PHONY: install install-man install-crit install-criu
diff --git a/arch/aarch64/Makefile b/arch/aarch64/Makefile
deleted file mode 100644
index 200d37c72..000000000
--- a/arch/aarch64/Makefile
+++ /dev/null
@@ -1,59 +0,0 @@
-targets += syscalls
-targets += crtools
-
-SYS-ASM := syscalls.S
-
-syscalls-asm-y += $(SYS-ASM:.S=).o
-crtools-obj-y += crtools.o
-crtools-obj-y += cpu.o
-
-SYS-DEF := ../arm/syscall.def
-SYS-ASM-COMMON := syscall-common.S
-SYS-TYPES := include/syscall-types.h
-
-SYS-CODES := include/syscall-codes.h
-SYS-PROTO := include/syscall.h
-
-SYS-GEN := ../scripts/arm/gen-syscalls.pl
-SYS-GEN-TBL := ../scripts/arm/gen-sys-exec-tbl.pl
-
-SYS-EXEC-TBL := sys-exec-tbl.c
-
-syscalls-asm-y-asmflags += -fpie -Wstrict-prototypes -Wa,--noexecstack
-syscalls-asm-y-asmflags += -nostdlib -fomit-frame-pointer -I$(obj)
-ASMFLAGS += -D__ASSEMBLY__
-
-ARCH_BITS := 64
-
-$(obj)/$(SYS-ASM): $(obj)/$(SYS-GEN) $(obj)/$(SYS-DEF) $(obj)/$(SYS-ASM-COMMON) $(SYS-TYPES)
- $(E) " GEN " $@
- $(Q) perl \
- $(obj)/$(SYS-GEN) \
- $(obj)/$(SYS-DEF) \
- $(SYS-CODES) \
- $(SYS-PROTO) \
- $(obj)/$(SYS-ASM) \
- $(SYS-ASM-COMMON) \
- $(SYS-TYPES) \
- $(ARCH_BITS)
-
-$(obj)/syscalls.o: $(obj)/$(SYS-ASM)
-
-$(obj)/$(SYS-EXEC-TBL): $(obj)/$(SYS-GEN-TBL) $(obj)/$(SYS-DEF)
- $(E) " GEN " $@
- $(Q) perl \
- $(obj)/$(SYS-GEN-TBL) \
- $(obj)/$(SYS-DEF) \
- $(obj)/$(SYS-EXEC-TBL) \
- $(ARCH_BITS)
-
-_all += $(obj)/$(SYS-EXEC-TBL)
-
-cleanup-y += $(obj)/$(SYS-EXEC-TBL) $(obj)/$(SYS-ASM)
-cleanup-y += $(SYS-CODES)
-cleanup-y += $(SYS-PROTO)
-
-ifneq ($(MAKECMDGOALS),clean)
-deps-after := $(obj)/$(SYS-ASM)
-incdeps := y
-endif
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
deleted file mode 100644
index 2359a2c0e..000000000
--- a/arch/arm/Makefile
+++ /dev/null
@@ -1,59 +0,0 @@
-targets += syscalls
-targets += crtools
-
-SYS-ASM := syscalls.S
-
-syscalls-asm-y += $(SYS-ASM:.S=).o
-crtools-obj-y += crtools.o
-crtools-obj-y += cpu.o
-
-SYS-DEF := syscall.def
-SYS-ASM-COMMON := syscall-common.S
-SYS-TYPES := include/syscall-types.h
-
-SYS-CODES := include/syscall-codes.h
-SYS-PROTO := include/syscall.h
-
-SYS-GEN := ../scripts/arm/gen-syscalls.pl
-SYS-GEN-TBL := ../scripts/arm/gen-sys-exec-tbl.pl
-
-SYS-EXEC-TBL := sys-exec-tbl.c
-
-syscalls-asm-y-asmflags += -fpie -Wstrict-prototypes -Wa,--noexecstack
-syscalls-asm-y-asmflags += -nostdlib -fomit-frame-pointer -I$(obj)
-ASMFLAGS += -D__ASSEMBLY__
-
-ARCH_BITS := 32
-
-$(obj)/$(SYS-ASM): $(obj)/$(SYS-GEN) $(obj)/$(SYS-DEF) $(obj)/$(SYS-ASM-COMMON) $(SYS-TYPES)
- $(E) " GEN " $@
- $(Q) perl \
- $(obj)/$(SYS-GEN) \
- $(obj)/$(SYS-DEF) \
- $(SYS-CODES) \
- $(SYS-PROTO) \
- $(obj)/$(SYS-ASM) \
- $(SYS-ASM-COMMON) \
- $(SYS-TYPES) \
- $(ARCH_BITS)
-
-$(obj)/syscalls.o: $(obj)/$(SYS-ASM)
-
-$(obj)/$(SYS-EXEC-TBL): $(obj)/$(SYS-GEN-TBL) $(obj)/$(SYS-DEF)
- $(E) " GEN " $@
- $(Q) perl \
- $(obj)/$(SYS-GEN-TBL) \
- $(obj)/$(SYS-DEF) \
- $(obj)/$(SYS-EXEC-TBL) \
- $(ARCH_BITS)
-
-_all += $(obj)/$(SYS-EXEC-TBL)
-
-cleanup-y += $(obj)/$(SYS-EXEC-TBL) $(obj)/$(SYS-ASM)
-cleanup-y += $(SYS-CODES)
-cleanup-y += $(SYS-PROTO)
-
-ifneq ($(MAKECMDGOALS),clean)
-deps-after := $(obj)/$(SYS-ASM)
-incdeps := y
-endif
diff --git a/arch/ppc64/Makefile b/arch/ppc64/Makefile
deleted file mode 100644
index c5d332364..000000000
--- a/arch/ppc64/Makefile
+++ /dev/null
@@ -1,55 +0,0 @@
-targets += syscalls
-targets += crtools
-
-SYS-ASM := syscalls.S
-
-syscalls-asm-y += $(SYS-ASM:.S=).o
-crtools-obj-y += crtools.o
-crtools-obj-y += cpu.o
-
-SYS-DEF := syscall-ppc64.def
-SYS-ASM-COMMON := syscall-common-ppc64.S
-
-SYS-TYPES := include/syscall-types.h
-SYS-CODES := include/syscall-codes.h
-SYS-PROTO := include/syscall.h
-
-SYS-GEN := syscalls-ppc64.sh
-
-SYS-EXEC-TBL := sys-exec-tbl.c
-
-syscalls-asm-y-asmflags := -fpie -Wstrict-prototypes -Wa,--noexecstack
-syscalls-asm-y-asmflags += -nostdlib -fomit-frame-pointer -I$(obj)
-
-ASMFLAGS += -D__ASSEMBLY__
-
-$(obj)/$(SYS-ASM): $(obj)/$(SYS-GEN) $(obj)/$(SYS-DEF) $(obj)/$(SYS-ASM-COMMON) $(SYS-TYPES)
- $(E) " GEN " $@
- $(Q) $(SH) \
- $(obj)/$(SYS-GEN) --asm \
- $(obj)/$(SYS-DEF) \
- $(SYS-CODES) \
- $(SYS-PROTO) \
- $(obj)/$(SYS-ASM) \
- $(SYS-ASM-COMMON) \
- $(SYS-TYPES)
-
-$(obj)/syscalls.o: $(obj)/$(SYS-ASM)
-
-$(obj)/$(SYS-EXEC-TBL): $(obj)/$(SYS-GEN) $(obj)/$(SYS-DEF)
- $(E) " GEN " $@
- $(Q) $(SH) \
- $(obj)/$(SYS-GEN) --exec \
- $(obj)/$(SYS-DEF) \
- $(obj)/$(SYS-EXEC-TBL)
-
-_all += $(obj)/$(SYS-EXEC-TBL)
-
-cleanup-y += $(obj)/$(SYS-EXEC-TBL) $(obj)/$(SYS-ASM)
-cleanup-y += $(SYS-CODES)
-cleanup-y += $(SYS-PROTO)
-
-ifneq ($(MAKECMDGOALS),clean)
-deps-after := $(obj)/$(SYS-ASM)
-incdeps := y
-endif
diff --git a/arch/ppc64/syscalls-ppc64.sh b/arch/ppc64/syscalls-ppc64.sh
deleted file mode 100644
index 871895efa..000000000
--- a/arch/ppc64/syscalls-ppc64.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/sh
-
-gen_asm() {
- in=$1
- codesout=$2
- codesinc=`echo $2 | sed -e 's/.*include\///g'`
- protosout=$3
- asmout=$4
- asmcommon=`echo $5 | sed -e 's/.*include\///g'`
- prototypes=`echo $6 | sed -e 's/.*include\///g'`
-
- codesdef=`echo $codesout | sed -e 's/.*include\///g' | tr "[[:space:]].-" _`
- protosdef=`echo $protosout | sed -e 's/.*include\///g' | tr "[[:space:]].-" _`
-
- echo "/* Autogenerated, don't edit */" > $codesout
- echo "#ifndef $codesdef" >> $codesout
- echo "#define $codesdef" >> $codesout
-
- echo "/* Autogenerated, don't edit */" > $protosout
- echo "#ifndef $protosdef" >> $protosout
- echo "#define $protosdef" >> $protosout
- echo "#ifndef CR_NOGLIBC" >> $protosout
- echo "#error This file should only be used in the parasite code" >> $protosout
- echo "#endif" >> $protosout
- echo "#include \"$prototypes\"" >> $protosout
- echo "#include \"$codesinc\"" >> $protosout
-
- echo "/* Autogenerated, don't edit */" > $asmout
- echo "#include \"$codesinc\"" >> $asmout
- echo "#include \"$asmcommon\"" >> $asmout
-
- cat $in | egrep -v '^#' | sed -e 's/\t\{1,\}/|/g' | awk -F '|' '{print "#define", $1, $2}' >> $codesout
- cat $in | egrep -v '^#' | sed -e 's/\t\{1,\}/|/g' | awk -F '|' '{print "extern long ", $3, $4, ";"}' >> $protosout
- cat $in | egrep -v '^#' | sed -e 's/\t\{1,\}/|/g' | awk -F '|' '{print "SYSCALL(", $3, ",", $2, ")"}' >> $asmout
-
- echo "#endif /* $codesdef */" >> $codesout
- echo "#endif /* $protosdef */" >> $protosout
-}
-
-gen_exec() {
- in=$1
- codecout=$2
-
- echo "/* Autogenerated, don't edit */" > $codecout
-
- cat $in | egrep -v '^#' | sed -e 's/\t\{1,\}/|/g' | awk -F '|' '{print "SYSCALL(", substr($3, 5), ",", $2, ")"}' >> $codecout
-}
-
-if [ "$1" = "--asm" ]; then
- shift
- gen_asm $@
-fi
-
-if [ "$1" = "--exec" ]; then
- shift
- gen_exec $@
-fi
diff --git a/criu/Makefile b/criu/Makefile
new file mode 100644
index 000000000..e4e2afb15
--- /dev/null
+++ b/criu/Makefile
@@ -0,0 +1,173 @@
+#
+# CRIU version.
+VERSION_MAJOR := 2
+VERSION_MINOR := 0
+VERSION_SUBLEVEL :=
+VERSION_EXTRA :=
+VERSION_NAME :=
+
+export VERSION_MAJOR VERSION_MINOR
+export VERSION_SUBLEVEL VERSION_EXTRA VERSION_NAME
+
+#
+# HOST part is needed to build helper
+# tools such as piegen.
+HOSTCC ?= gcc
+HOSTLD ?= ld
+HOSTCFLAGS ?= $(CFLAGS)
+CFLAGS += $(USERCFLAGS)
+
+export HOSTCC HOSTLD HOSTCFLAGS
+
+ifeq ($(ARCH),x86)
+ SRCARCH := x86
+ LDARCH := i386:x86-64
+ VDSO := y
+endif
+
+ifeq ($(ARCH),arm)
+ SRCARCH := arm
+endif
+
+ifeq ($(ARCH),arm64)
+ ARCH := aarch64
+ SRCARCH := aarch64
+ VDSO := y
+endif
+
+ifeq ($(ARCH),powerpc)
+ ARCH := ppc64
+ SRCARCH := ppc64
+ LDARCH := powerpc:common64
+ VDSO := y
+endif
+
+LDARCH ?= $(SRCARCH)
+
+export SRCARCH LDARCH VDSO
+
+SRCARCH ?= $(ARCH)
+LDARCH ?= $(SRCARCH)
+ARCH_DIR := arch/$(SRCARCH)
+
+export SRCARCH LDARCH ARCH_DIR VDSO
+
+$(if $(wildcard $(ARCH_DIR)),,$(error "The architecture $(ARCH) isn't supported"))
+
+#
+# General flags.
+ccflags-y += -fno-strict-aliasing
+ccflags-y += -iquote $(SRC_DIR)/criu/include
+ccflags-y += -iquote $(SRC_DIR)/images
+ccflags-y += -iquote $(SRC_DIR)/criu/pie
+ccflags-y += -iquote $(SRC_DIR)/criu/$(ARCH_DIR)
+ccflags-y += -iquote $(SRC_DIR)/criu/$(ARCH_DIR)/include
+ccflags-y += -iquote $(SRC_DIR)/
+ccflags-y += -I/usr/include/libnl3
+
+export ccflags-y
+
+LIBS := -lrt -lpthread -lprotobuf-c -ldl -lnl-3
+
+ifeq ($(GMON),1)
+ CFLAGS += -pg
+ GMONLDOPT := -pg
+endif
+
+#
+# piegen tool might be disabled by hands. Don't use it until
+# you know what you're doing.
+ifneq ($(filter ia32 x86 ppc64,$(ARCH)),)
+ ifneq ($(PIEGEN),no)
+ piegen-y := y
+ export piegen-y
+ endif
+endif
+
+#
+# Version header file.
+include Makefile.version
+
+#
+# Configure variables.
+include Makefile.config
+config: $(VERSION_HEADER)
+
+#
+# System calls library.
+SYSCALL-LIB := $(ARCH_DIR)/syscalls.built-in.o
+$(SYSCALL-LIB): config
+ $(Q) $(MAKE) $(call build-as,Makefile.syscalls,$(ARCH_DIR)) all
+PHONY += $(SYSCALL-LIB)
+
+#
+# Architecture dependant part.
+ARCH-LIB := $(ARCH_DIR)/crtools.built-in.o
+$(ARCH-LIB): config $(SYSCALL-LIB)
+ $(Q) $(MAKE) $(call build-as,Makefile,$(ARCH_DIR)) $@
+PHONY += $(ARCH-LIB)
+
+#
+# piegen tool needed for PIE code.
+ifeq ($(piegen-y),y)
+piegen := pie/piegen/piegen
+
+pie/piegen/%: config
+ $(Q) CC=$(HOSTCC) LD=$(HOSTLD) CFLAGS="$(HOSTCFLAGS) $(WARNINGS) $(DEFINES)" $(MAKE) $(build)=pie/piegen $@
+pie/piegen: config
+ $(Q) CC=$(HOSTCC) LD=$(HOSTLD) CFLAGS="$(HOSTCFLAGS) $(WARNINGS) $(DEFINES)" $(MAKE) $(build)=pie/piegen all
+$(piegen): pie/piegen/built-in.o
+ $(call msg-link, $@)
+ $(Q) $(HOSTCC) $(HOSTCFLAGS) $^ $(LDFLAGS) -o $@
+PHONY += pie/piegen
+endif
+
+#
+# PIE library code.
+pie/lib.a: $(ARCH-LIB)
+ $(Q) $(MAKE) $(call build-as,Makefile.library,pie) all
+
+#
+# PIE code blobs themseves.
+pie: $(ARCH_DIR) $(piegen) pie/lib.a
+ $(Q) $(MAKE) $(build)=pie all
+PHONY += pie
+
+#
+# CRIU executable
+PROGRAM-BUILTINS += ../images/built-in.o
+PROGRAM-BUILTINS += built-in.o
+PROGRAM-BUILTINS += pie/lib.a
+PROGRAM-BUILTINS += $(SYSCALL-LIB)
+
+LIBS += arch/$(ARCH)/crtools.built-in.o
+
+built-in.o: pie/lib.a
+ $(Q) $(MAKE) $(call build-as,Makefile.crtools,.) all
+
+criu: $(PROGRAM-BUILTINS) built-in.o
+ $(call msg-link, $@)
+ $(Q) $(CC) $(CFLAGS) $^ $(LIBS) $(LDFLAGS) $(GMONLDOPT) -rdynamic -o $@
+PHONY += criu
+
+#
+# Cleanup everything.
+clean:
+ $(Q) $(MAKE) $(call build-as,Makefile.syscalls,$(ARCH_DIR)) $@
+ $(Q) $(MAKE) $(call build-as,Makefile.library,pie) $@
+ $(Q) $(MAKE) $(call build-as,Makefile.crtools,.) $@
+ $(Q) $(MAKE) $(build)=pie/piegen $@
+ $(Q) $(MAKE) $(build)=pie $@
+ $(Q) $(RM) ./*.{gcda,gcno,gcov}
+ $(Q) $(RM) ./pie/*.{gcda,gcno,gcov}
+ $(Q) $(RM) ./pie/piegen/*.{gcda,gcno,gcov}
+ $(Q) $(RM) -r ./gcov
+ $(Q) $(RM) $(VERSION_HEADER)
+ $(Q) $(RM) $(CONFIG_HEADER)
+
+#
+# Final @all target.
+all: $(PHONY)
+ @true
+
+.PHONY: $(PHONY) clean
diff --git a/Makefile.config b/criu/Makefile.config
index 26d581bfa..a39f4cd91 100644
--- a/Makefile.config
+++ b/criu/Makefile.config
@@ -1,54 +1,61 @@
-include scripts/utilities.mak
-include scripts/feature-tests.mak
+include $(__nmk_dir)/utils.mk
+include ../scripts/feature-tests.mak
-CONFIG := include/config.h
+CONFIG_HEADER := include/config.h
ifeq ($(call try-cc,$(LIBBSD_DEV_TEST),-lbsd),y)
- LIBS += -lbsd
- DEFINES += -DCONFIG_HAS_LIBBSD
+ LIBS += -lbsd
+ DEFINES += -DCONFIG_HAS_LIBBSD
endif
ifeq ($(call pkg-config-check,libselinux),y)
- LIBS := -lselinux $(LIBS)
- DEFINES += -DCONFIG_HAS_SELINUX
+ LIBS += -lselinux $(LIBS)
+ DEFINES += -DCONFIG_HAS_SELINUX
endif
-$(CONFIG): scripts/utilities.mak scripts/feature-tests.mak include/config-base.h
- $(E) " GEN " $@
+$(CONFIG_HEADER): include/config-base.h
+ $(call msg-gen, $@)
$(Q) @echo '#ifndef __CR_CONFIG_H__' > $@
$(Q) @echo '#define __CR_CONFIG_H__' >> $@
$(Q) @echo '' >> $@
$(Q) @echo '#include "config-base.h"' >> $@
$(Q) @echo '' >> $@
-ifeq ($(call try-cc,$(TCP_REPAIR_TEST),),y)
+ifeq ($(call try-cc,$(TCP_REPAIR_TEST),,$(DEFINES)),y)
$(Q) @echo '#define CONFIG_HAS_TCP_REPAIR' >> $@
+ $(Q) @echo '' >> $@
endif
-ifeq ($(call try-cc,$(PRLIMIT_TEST),),y)
+ifeq ($(call try-cc,$(PRLIMIT_TEST),,$(DEFINES)),y)
$(Q) @echo '#define CONFIG_HAS_PRLIMIT' >> $@
+ $(Q) @echo '' >> $@
endif
-ifeq ($(call try-cc,$(STRLCPY_TEST),$(LIBS)),y)
+ifeq ($(call try-cc,$(STRLCPY_TEST),$(LIBS),$(DEFINES)),y)
$(Q) @echo '#define CONFIG_HAS_STRLCPY' >> $@
+ $(Q) @echo '' >> $@
endif
-ifeq ($(call try-cc,$(STRLCAT_TEST),$(LIBS)),y)
+ifeq ($(call try-cc,$(STRLCAT_TEST),$(LIBS),$(DEFINES)),y)
$(Q) @echo '#define CONFIG_HAS_STRLCAT' >> $@
+ $(Q) @echo '' >> $@
endif
-ifeq ($(call try-cc,$(PTRACE_PEEKSIGINFO_TEST),),y)
+ifeq ($(call try-cc,$(PTRACE_PEEKSIGINFO_TEST),,$(DEFINES)),y)
$(Q) @echo '#define CONFIG_HAS_PEEKSIGINFO_ARGS' >> $@
+ $(Q) @echo '' >> $@
endif
ifeq ($(VDSO),y)
$(Q) @echo '#define CONFIG_VDSO' >> $@
+ $(Q) @echo '' >> $@
endif
-ifeq ($(call try-cc,$(SETPROCTITLE_INIT_TEST),-lbsd),y)
+ifeq ($(call try-cc,$(SETPROCTITLE_INIT_TEST),-lbsd,$(DEFINES)),y)
$(Q) @echo '#define CONFIG_HAS_SETPROCTITLE_INIT' >> $@
+ $(Q) @echo '' >> $@
endif
ifeq ($(call try-cc,$(MEMFD_TEST),),y)
$(Q) @echo '#define CONFIG_HAS_MEMFD' >> $@
endif
ifeq ($(piegen-y),y)
$(Q) @echo '#define CONFIG_PIEGEN' >> $@
+ $(Q) @echo '' >> $@
endif
$(Q) @echo '#endif /* __CR_CONFIG_H__ */' >> $@
-config: $(CONFIG)
-
-.PHONY: config
+config: $(CONFIG_HEADER)
+PHONY += config
diff --git a/criu/Makefile.crtools b/criu/Makefile.crtools
new file mode 100644
index 000000000..5c3f65cad
--- /dev/null
+++ b/criu/Makefile.crtools
@@ -0,0 +1,92 @@
+ccflags-y += -iquote $(ARCH)
+obj-y += action-scripts.o
+obj-y += aio.o
+obj-y += bfd.o
+obj-y += bitmap.o
+obj-y += cgroup.o
+obj-y += cr-check.o
+obj-y += cr-dedup.o
+obj-y += cr-dump.o
+obj-y += cr-errno.o
+obj-y += cr-exec.o
+obj-y += cr-restore.o
+obj-y += cr-service.o
+obj-y += cr-show.o
+obj-y += crtools.o
+obj-y += eventfd.o
+obj-y += eventpoll.o
+obj-y += fault-injection.o
+obj-y += fifo.o
+obj-y += file-ids.o
+obj-y += file-lock.o
+obj-y += files-ext.o
+obj-y += files.o
+obj-y += files-reg.o
+obj-y += fsnotify.o
+obj-y += image-desc.o
+obj-y += image.o
+obj-y += ipc_ns.o
+obj-y += irmap.o
+obj-y += kcmp-ids.o
+obj-y += kerndat.o
+obj-y += libnetlink.o
+obj-y += log.o
+obj-y += lsm.o
+obj-y += mem.o
+obj-y += mount.o
+obj-y += namespaces.o
+obj-y += netfilter.o
+obj-y += net.o
+obj-y += pagemap-cache.o
+obj-y += page-pipe.o
+obj-y += page-read.o
+obj-y += page-xfer.o
+obj-y += parasite-syscall.o
+obj-y += pie/pie-relocs.o
+obj-y += pie-util-fd.o
+obj-y += pie-util.o
+obj-y += pipes.o
+obj-y += plugin.o
+obj-y += proc_parse.o
+obj-y += protobuf-desc.o
+obj-y += protobuf.o
+obj-y += pstree.o
+obj-y += ptrace.o
+obj-y += rbtree.o
+obj-y += rst-malloc.o
+obj-y += seccomp.o
+obj-y += seize.o
+obj-y += shmem.o
+obj-y += sigframe.o
+obj-y += signalfd.o
+obj-y += sk-inet.o
+obj-y += sk-netlink.o
+obj-y += sk-packet.o
+obj-y += sk-queue.o
+obj-y += sk-tcp.o
+obj-y += sk-unix.o
+obj-y += sockets.o
+obj-y += stats.o
+obj-y += string.o
+obj-y += sysctl.o
+obj-y += sysfs_parse.o
+obj-y += timerfd.o
+obj-y += tty.o
+obj-y += tun.o
+obj-y += util.o
+obj-y += uts_ns.o
+
+ifeq ($(VDSO),y)
+obj-y += pie-util-vdso.o
+obj-y += vdso.o
+endif
+
+PROTOBUF_GEN := $(SRC_DIR)/scripts/protobuf-gen.sh
+
+protobuf-desc.c: protobuf-desc-gen.h
+
+protobuf-desc-gen.h: $(PROTOBUF_GEN) include/protobuf-desc.h
+ $(call msg-gen, $@)
+ $(Q) $(SH) $(PROTOBUF_GEN) > $@
+
+cleanup-y += protobuf-desc-gen.h
diff --git a/scripts/Makefile.version b/criu/Makefile.version
index 8905bd9b6..44dad6c14 100644
--- a/scripts/Makefile.version
+++ b/criu/Makefile.version
@@ -1,24 +1,23 @@
CRTOOLSVERSION := $(VERSION_MAJOR)$(if $(VERSION_MINOR),.$(VERSION_MINOR))$(if $(VERSION_SUBLEVEL),.$(VERSION_SUBLEVEL))
-
-VERSION_HEADER := include/version.h
-GITID_FILE := .gitid
-GITID := $(shell if [ -d ".git" ]; then git describe; fi)
+VERSION_HEADER := include/version.h
+GITID_FILE := ../.gitid
+GITID := $(shell if [ -d "../.git" ]; then cd .. && git describe; fi)
ifeq ($(GITID),)
- GITID := 0
+ GITID := 0
else
- GITID_FILE_VALUE := $(shell if [ -f '.gitid' ]; then if [ `cat .gitid` = $(GITID) ]; then echo y; fi; fi)
+ GITID_FILE_VALUE := $(shell if [ -f '$(GITID_FILE)' ]; then if [ `cat '$(GITID_FILE)'` = $(GITID) ]; then echo y; fi; fi)
ifneq ($(GITID_FILE_VALUE),y)
.PHONY: $(GITID_FILE)
endif
endif
$(GITID_FILE):
- $(E) " GEN " $@
+ $(call msg-gen, $@)
$(Q) echo "$(GITID)" > $(GITID_FILE)
-$(VERSION_HEADER): Makefile scripts/Makefile.version $(GITID_FILE)
- $(E) " GEN " $@
+$(VERSION_HEADER): Makefile.version $(GITID_FILE)
+ $(call msg-gen, $@)
$(Q) echo "/* Autogenerated, do not edit */" > $(VERSION_HEADER)
$(Q) echo "#ifndef __CR_VERSION_H__" >> $(VERSION_HEADER)
$(Q) echo "#define __CR_VERSION_H__" >> $(VERSION_HEADER)
@@ -28,9 +27,5 @@ $(VERSION_HEADER): Makefile scripts/Makefile.version $(GITID_FILE)
$(Q) echo "#define CRIU_GITID \"$(GITID)\"" >> $(VERSION_HEADER)
$(Q) echo "#endif /* __CR_VERSION_H__ */" >> $(VERSION_HEADER)
-##
-## In case if someone add last resort rule
-## together with .SUFFIXES not cleaned, this
-## will slow down the build procedure
-scripts/Makefile.version::
+Makefile.version:
@true
diff --git a/action-scripts.c b/criu/action-scripts.c
index 05aa9d013..05aa9d013 100644
--- a/action-scripts.c
+++ b/criu/action-scripts.c
diff --git a/aio.c b/criu/aio.c
index 9965efd8c..9965efd8c 100644
--- a/aio.c
+++ b/criu/aio.c
diff --git a/criu/arch/aarch64/Makefile b/criu/arch/aarch64/Makefile
new file mode 100644
index 000000000..652d4821b
--- /dev/null
+++ b/criu/arch/aarch64/Makefile
@@ -0,0 +1,7 @@
+builtin-name := crtools.built-in.o
+
+ccflags-y += -iquote $(obj) -iquote $(SRC_DIR)
+ccflags-y += -iquote $(obj)/include -iquote $(SRC_DIR)/criu/include
+
+obj-y += cpu.o
+obj-y += crtools.o
diff --git a/criu/arch/aarch64/Makefile.syscalls b/criu/arch/aarch64/Makefile.syscalls
new file mode 100644
index 000000000..9b3b5387b
--- /dev/null
+++ b/criu/arch/aarch64/Makefile.syscalls
@@ -0,0 +1,50 @@
+builtin-name := syscalls.built-in.o
+
+SYS-TYPES := ../../include/syscall-types.h
+SYS-CODES := ../../include/syscall-codes.h
+SYS-PROTO := ../../include/syscall.h
+
+SYS-DEF := syscall.def
+SYS-ASM-COMMON := syscall-common.S
+
+SYS-GEN := ../scripts/arm/gen-syscalls.pl
+SYS-GEN-TBL := ../scripts/arm/gen-sys-exec-tbl.pl
+
+asflags-y += -D__ASSEMBLY__ -nostdlib -fomit-frame-pointer
+asflags-y += -fpie -Wstrict-prototypes -Wa,--noexecstack
+asflags-y += -iquote $(obj) -iquote $(obj)/include -iquote $(SRC_DIR)/criu/include
+
+SYS-ASM := syscalls.S
+obj-y += $(SYS-ASM:.S=).o
+
+ARCH_BITS := 64
+
+SYS-EXEC-TBL := sys-exec-tbl.c
+
+$(obj)/$(SYS-ASM): $(obj)/$(SYS-GEN) $(obj)/syscalls/$(SYS-DEF) $(obj)/syscalls/$(SYS-ASM-COMMON)
+ $(E) " GEN " $@
+ $(Q) perl \
+ $(obj)/$(SYS-GEN) \
+ $(obj)/syscalls/$(SYS-DEF) \
+ $(obj)/$(SYS-CODES) \
+ $(obj)/$(SYS-PROTO) \
+ $(obj)/$(SYS-ASM) \
+ syscalls/$(SYS-ASM-COMMON) \
+ $(obj)/$(SYS-TYPES) \
+ $(ARCH_BITS)
+
+$(obj)/syscalls.o: $(obj)/$(SYS-ASM)
+
+$(obj)/$(SYS-EXEC-TBL): $(obj)/$(SYS-GEN-TBL) $(obj)/syscalls/$(SYS-DEF)
+ $(E) " GEN " $@
+ $(Q) perl \
+ $(obj)/$(SYS-GEN-TBL) \
+ $(obj)/syscalls/$(SYS-DEF) \
+ $(obj)/$(SYS-EXEC-TBL) \
+ $(ARCH_BITS)
+
+all-y += $(obj)/$(SYS-EXEC-TBL)
+
+cleanup-y += $(obj)/$(SYS-EXEC-TBL) $(obj)/$(SYS-ASM)
+cleanup-y += $(obj)/$(SYS-CODES)
+cleanup-y += $(obj)/$(SYS-PROTO)
diff --git a/arch/aarch64/cpu.c b/criu/arch/aarch64/cpu.c
index 040fe14fc..040fe14fc 100644
--- a/arch/aarch64/cpu.c
+++ b/criu/arch/aarch64/cpu.c
diff --git a/arch/aarch64/crtools.c b/criu/arch/aarch64/crtools.c
index 5df7f1d5f..5df7f1d5f 100644
--- a/arch/aarch64/crtools.c
+++ b/criu/arch/aarch64/crtools.c
diff --git a/arch/aarch64/include/asm/atomic.h b/criu/arch/aarch64/include/asm/atomic.h
index 0e1c04f5a..0e1c04f5a 100644
--- a/arch/aarch64/include/asm/atomic.h
+++ b/criu/arch/aarch64/include/asm/atomic.h
diff --git a/arch/aarch64/include/asm/bitops.h b/criu/arch/aarch64/include/asm/bitops.h
index 5a750447f..5a750447f 100644
--- a/arch/aarch64/include/asm/bitops.h
+++ b/criu/arch/aarch64/include/asm/bitops.h
diff --git a/arch/aarch64/include/asm/bitsperlong.h b/criu/arch/aarch64/include/asm/bitsperlong.h
index d95727d19..d95727d19 100644
--- a/arch/aarch64/include/asm/bitsperlong.h
+++ b/criu/arch/aarch64/include/asm/bitsperlong.h
diff --git a/arch/aarch64/include/asm/cpu.h b/criu/arch/aarch64/include/asm/cpu.h
index 59118c211..59118c211 100644
--- a/arch/aarch64/include/asm/cpu.h
+++ b/criu/arch/aarch64/include/asm/cpu.h
diff --git a/arch/aarch64/include/asm/dump.h b/criu/arch/aarch64/include/asm/dump.h
index 671c424da..671c424da 100644
--- a/arch/aarch64/include/asm/dump.h
+++ b/criu/arch/aarch64/include/asm/dump.h
diff --git a/arch/aarch64/include/asm/fpu.h b/criu/arch/aarch64/include/asm/fpu.h
index 7f476d541..7f476d541 100644
--- a/arch/aarch64/include/asm/fpu.h
+++ b/criu/arch/aarch64/include/asm/fpu.h
diff --git a/arch/aarch64/include/asm/int.h b/criu/arch/aarch64/include/asm/int.h
index 642804e9b..642804e9b 100644
--- a/arch/aarch64/include/asm/int.h
+++ b/criu/arch/aarch64/include/asm/int.h
diff --git a/arch/aarch64/include/asm/linkage.h b/criu/arch/aarch64/include/asm/linkage.h
index 738064233..738064233 100644
--- a/arch/aarch64/include/asm/linkage.h
+++ b/criu/arch/aarch64/include/asm/linkage.h
diff --git a/arch/aarch64/include/asm/page.h b/criu/arch/aarch64/include/asm/page.h
index de1fe5428..de1fe5428 100644
--- a/arch/aarch64/include/asm/page.h
+++ b/criu/arch/aarch64/include/asm/page.h
diff --git a/arch/aarch64/include/asm/parasite-syscall.h b/criu/arch/aarch64/include/asm/parasite-syscall.h
index 0c07121da..0c07121da 100644
--- a/arch/aarch64/include/asm/parasite-syscall.h
+++ b/criu/arch/aarch64/include/asm/parasite-syscall.h
diff --git a/arch/aarch64/include/asm/parasite.h b/criu/arch/aarch64/include/asm/parasite.h
index 2a1e1c12e..2a1e1c12e 100644
--- a/arch/aarch64/include/asm/parasite.h
+++ b/criu/arch/aarch64/include/asm/parasite.h
diff --git a/arch/aarch64/include/asm/processor-flags.h b/criu/arch/aarch64/include/asm/processor-flags.h
index c1888af36..c1888af36 100644
--- a/arch/aarch64/include/asm/processor-flags.h
+++ b/criu/arch/aarch64/include/asm/processor-flags.h
diff --git a/arch/aarch64/include/asm/restore.h b/criu/arch/aarch64/include/asm/restore.h
index 69404b0e8..69404b0e8 100644
--- a/arch/aarch64/include/asm/restore.h
+++ b/criu/arch/aarch64/include/asm/restore.h
diff --git a/arch/aarch64/include/asm/restorer.h b/criu/arch/aarch64/include/asm/restorer.h
index 583f9583b..583f9583b 100644
--- a/arch/aarch64/include/asm/restorer.h
+++ b/criu/arch/aarch64/include/asm/restorer.h
diff --git a/arch/aarch64/include/asm/string.h b/criu/arch/aarch64/include/asm/string.h
index 2c3a34fbb..2c3a34fbb 100644
--- a/arch/aarch64/include/asm/string.h
+++ b/criu/arch/aarch64/include/asm/string.h
diff --git a/arch/aarch64/include/asm/syscall-aux.S b/criu/arch/aarch64/include/asm/syscall-aux.S
index 00ccf79c3..00ccf79c3 100644
--- a/arch/aarch64/include/asm/syscall-aux.S
+++ b/criu/arch/aarch64/include/asm/syscall-aux.S
diff --git a/arch/aarch64/include/asm/syscall-aux.h b/criu/arch/aarch64/include/asm/syscall-aux.h
index 814c7a9dd..814c7a9dd 100644
--- a/arch/aarch64/include/asm/syscall-aux.h
+++ b/criu/arch/aarch64/include/asm/syscall-aux.h
diff --git a/arch/aarch64/include/asm/types.h b/criu/arch/aarch64/include/asm/types.h
index d6c890dc0..d6c890dc0 100644
--- a/arch/aarch64/include/asm/types.h
+++ b/criu/arch/aarch64/include/asm/types.h
diff --git a/arch/aarch64/include/asm/vdso.h b/criu/arch/aarch64/include/asm/vdso.h
index d015c6387..d015c6387 100644
--- a/arch/aarch64/include/asm/vdso.h
+++ b/criu/arch/aarch64/include/asm/vdso.h
diff --git a/arch/aarch64/intraprocedure.S b/criu/arch/aarch64/intraprocedure.S
index e139dc8b5..e139dc8b5 100644
--- a/arch/aarch64/intraprocedure.S
+++ b/criu/arch/aarch64/intraprocedure.S
diff --git a/arch/aarch64/parasite-head.S b/criu/arch/aarch64/parasite-head.S
index 7a359061c..7a359061c 100644
--- a/arch/aarch64/parasite-head.S
+++ b/criu/arch/aarch64/parasite-head.S
diff --git a/arch/aarch64/restorer.c b/criu/arch/aarch64/restorer.c
index 2c61e2d03..2c61e2d03 100644
--- a/arch/aarch64/restorer.c
+++ b/criu/arch/aarch64/restorer.c
diff --git a/arch/aarch64/syscall-common.S b/criu/arch/aarch64/syscalls/syscall-common.S
index 81ec20f55..81ec20f55 100644
--- a/arch/aarch64/syscall-common.S
+++ b/criu/arch/aarch64/syscalls/syscall-common.S
diff --git a/criu/arch/aarch64/syscalls/syscall.def b/criu/arch/aarch64/syscalls/syscall.def
new file mode 120000
index 000000000..e9370a6e5
--- /dev/null
+++ b/criu/arch/aarch64/syscalls/syscall.def
@@ -0,0 +1 @@
+../../arm/syscalls/syscall.def \ No newline at end of file
diff --git a/arch/aarch64/vdso-pie.c b/criu/arch/aarch64/vdso-pie.c
index 0f06c2d19..0f06c2d19 100644
--- a/arch/aarch64/vdso-pie.c
+++ b/criu/arch/aarch64/vdso-pie.c
diff --git a/criu/arch/arm/Makefile b/criu/arch/arm/Makefile
new file mode 100644
index 000000000..5db577340
--- /dev/null
+++ b/criu/arch/arm/Makefile
@@ -0,0 +1,6 @@
+builtin-name := crtools.built-in.o
+
+ccflags-y += -iquote $(obj) -iquote $(SRC_DIR) -iquote $(obj)/include -iquote $(SRC_DIR)/criu/include
+
+obj-y += cpu.o
+obj-y += crtools.o
diff --git a/criu/arch/arm/Makefile.syscalls b/criu/arch/arm/Makefile.syscalls
new file mode 100644
index 000000000..527960602
--- /dev/null
+++ b/criu/arch/arm/Makefile.syscalls
@@ -0,0 +1,50 @@
+builtin-name := syscalls.built-in.o
+
+SYS-TYPES := ../../include/syscall-types.h
+SYS-CODES := ../../include/syscall-codes.h
+SYS-PROTO := ../../include/syscall.h
+
+SYS-DEF := syscall.def
+SYS-ASM-COMMON := syscall-common.S
+
+SYS-GEN := ../scripts/arm/gen-syscalls.pl
+SYS-GEN-TBL := ../scripts/arm/gen-sys-exec-tbl.pl
+
+asflags-y += -D__ASSEMBLY__ -nostdlib -fomit-frame-pointer
+asflags-y += -fpie -Wstrict-prototypes -Wa,--noexecstack
+asflags-y += -iquote $(obj) -iquote $(obj)/include -iquote $(SRC_DIR)/criu/include
+
+SYS-ASM := syscalls.S
+obj-y += $(SYS-ASM:.S=).o
+
+ARCH_BITS := 32
+
+SYS-EXEC-TBL := sys-exec-tbl.c
+
+$(obj)/$(SYS-ASM): $(obj)/$(SYS-GEN) $(obj)/syscalls/$(SYS-DEF) $(obj)/syscalls/$(SYS-ASM-COMMON)
+ $(E) " GEN " $@
+ $(Q) perl \
+ $(obj)/$(SYS-GEN) \
+ $(obj)/syscalls/$(SYS-DEF) \
+ $(obj)/$(SYS-CODES) \
+ $(obj)/$(SYS-PROTO) \
+ $(obj)/$(SYS-ASM) \
+ syscalls/$(SYS-ASM-COMMON) \
+ $(obj)/$(SYS-TYPES) \
+ $(ARCH_BITS)
+
+$(obj)/syscalls.o: $(obj)/$(SYS-ASM)
+
+$(obj)/$(SYS-EXEC-TBL): $(obj)/$(SYS-GEN-TBL) $(obj)/syscalls/$(SYS-DEF)
+ $(E) " GEN " $@
+ $(Q) perl \
+ $(obj)/$(SYS-GEN-TBL) \
+ $(obj)/syscalls/$(SYS-DEF) \
+ $(obj)/$(SYS-EXEC-TBL) \
+ $(ARCH_BITS)
+
+all-y += $(obj)/$(SYS-EXEC-TBL)
+
+cleanup-y += $(obj)/$(SYS-EXEC-TBL) $(obj)/$(SYS-ASM)
+cleanup-y += $(obj)/$(SYS-CODES)
+cleanup-y += $(obj)/$(SYS-PROTO)
diff --git a/arch/arm/cpu.c b/criu/arch/arm/cpu.c
index 040fe14fc..040fe14fc 100644
--- a/arch/arm/cpu.c
+++ b/criu/arch/arm/cpu.c
diff --git a/arch/arm/crtools.c b/criu/arch/arm/crtools.c
index 8ce889463..8ce889463 100644
--- a/arch/arm/crtools.c
+++ b/criu/arch/arm/crtools.c
diff --git a/arch/arm/include/asm/atomic.h b/criu/arch/arm/include/asm/atomic.h
index cd0df3772..cd0df3772 100644
--- a/arch/arm/include/asm/atomic.h
+++ b/criu/arch/arm/include/asm/atomic.h
diff --git a/arch/arm/include/asm/bitops.h b/criu/arch/arm/include/asm/bitops.h
index 5a750447f..5a750447f 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/criu/arch/arm/include/asm/bitops.h
diff --git a/arch/arm/include/asm/bitsperlong.h b/criu/arch/arm/include/asm/bitsperlong.h
index 43858b765..43858b765 100644
--- a/arch/arm/include/asm/bitsperlong.h
+++ b/criu/arch/arm/include/asm/bitsperlong.h
diff --git a/arch/arm/include/asm/cpu.h b/criu/arch/arm/include/asm/cpu.h
index 59118c211..59118c211 100644
--- a/arch/arm/include/asm/cpu.h
+++ b/criu/arch/arm/include/asm/cpu.h
diff --git a/arch/arm/include/asm/dump.h b/criu/arch/arm/include/asm/dump.h
index ae1588da8..ae1588da8 100644
--- a/arch/arm/include/asm/dump.h
+++ b/criu/arch/arm/include/asm/dump.h
diff --git a/arch/arm/include/asm/fpu.h b/criu/arch/arm/include/asm/fpu.h
index 7f476d541..7f476d541 100644
--- a/arch/arm/include/asm/fpu.h
+++ b/criu/arch/arm/include/asm/fpu.h
diff --git a/arch/arm/include/asm/int.h b/criu/arch/arm/include/asm/int.h
index 642804e9b..642804e9b 100644
--- a/arch/arm/include/asm/int.h
+++ b/criu/arch/arm/include/asm/int.h
diff --git a/arch/arm/include/asm/linkage.h b/criu/arch/arm/include/asm/linkage.h
index 738064233..738064233 100644
--- a/arch/arm/include/asm/linkage.h
+++ b/criu/arch/arm/include/asm/linkage.h
diff --git a/arch/arm/include/asm/page.h b/criu/arch/arm/include/asm/page.h
index 134835556..134835556 100644
--- a/arch/arm/include/asm/page.h
+++ b/criu/arch/arm/include/asm/page.h
diff --git a/arch/arm/include/asm/parasite-syscall.h b/criu/arch/arm/include/asm/parasite-syscall.h
index 0c66bf992..0c66bf992 100644
--- a/arch/arm/include/asm/parasite-syscall.h
+++ b/criu/arch/arm/include/asm/parasite-syscall.h
diff --git a/arch/arm/include/asm/parasite.h b/criu/arch/arm/include/asm/parasite.h
index 7f62bb9d2..7f62bb9d2 100644
--- a/arch/arm/include/asm/parasite.h
+++ b/criu/arch/arm/include/asm/parasite.h
diff --git a/arch/arm/include/asm/processor-flags.h b/criu/arch/arm/include/asm/processor-flags.h
index fc00a9e64..fc00a9e64 100644
--- a/arch/arm/include/asm/processor-flags.h
+++ b/criu/arch/arm/include/asm/processor-flags.h
diff --git a/arch/arm/include/asm/processor.h b/criu/arch/arm/include/asm/processor.h
index a390cfd32..a390cfd32 100644
--- a/arch/arm/include/asm/processor.h
+++ b/criu/arch/arm/include/asm/processor.h
diff --git a/arch/arm/include/asm/restore.h b/criu/arch/arm/include/asm/restore.h
index a1e66a5d5..a1e66a5d5 100644
--- a/arch/arm/include/asm/restore.h
+++ b/criu/arch/arm/include/asm/restore.h
diff --git a/arch/arm/include/asm/restorer.h b/criu/arch/arm/include/asm/restorer.h
index 8acb2d3e7..8acb2d3e7 100644
--- a/arch/arm/include/asm/restorer.h
+++ b/criu/arch/arm/include/asm/restorer.h
diff --git a/arch/arm/include/asm/string.h b/criu/arch/arm/include/asm/string.h
index 2c3a34fbb..2c3a34fbb 100644
--- a/arch/arm/include/asm/string.h
+++ b/criu/arch/arm/include/asm/string.h
diff --git a/arch/arm/include/asm/syscall-aux.S b/criu/arch/arm/include/asm/syscall-aux.S
index 8bc01c3ec..8bc01c3ec 100644
--- a/arch/arm/include/asm/syscall-aux.S
+++ b/criu/arch/arm/include/asm/syscall-aux.S
diff --git a/arch/arm/include/asm/syscall-aux.h b/criu/arch/arm/include/asm/syscall-aux.h
index ec8c2d383..ec8c2d383 100644
--- a/arch/arm/include/asm/syscall-aux.h
+++ b/criu/arch/arm/include/asm/syscall-aux.h
diff --git a/arch/arm/include/asm/types.h b/criu/arch/arm/include/asm/types.h
index d1d6cc3a2..d1d6cc3a2 100644
--- a/arch/arm/include/asm/types.h
+++ b/criu/arch/arm/include/asm/types.h
diff --git a/arch/arm/parasite-head.S b/criu/arch/arm/parasite-head.S
index b15fcbae2..b15fcbae2 100644
--- a/arch/arm/parasite-head.S
+++ b/criu/arch/arm/parasite-head.S
diff --git a/arch/arm/restorer.c b/criu/arch/arm/restorer.c
index 786feeeb3..786feeeb3 100644
--- a/arch/arm/restorer.c
+++ b/criu/arch/arm/restorer.c
diff --git a/arch/arm/syscall-common.S b/criu/arch/arm/syscalls/syscall-common.S
index c3cbf7105..c3cbf7105 100644
--- a/arch/arm/syscall-common.S
+++ b/criu/arch/arm/syscalls/syscall-common.S
diff --git a/arch/arm/syscall.def b/criu/arch/arm/syscalls/syscall.def
index 5d57169ac..5d57169ac 100644
--- a/arch/arm/syscall.def
+++ b/criu/arch/arm/syscalls/syscall.def
diff --git a/arch/arm/uidiv.S b/criu/arch/arm/uidiv.S
index e77f6100c..e77f6100c 100644
--- a/arch/arm/uidiv.S
+++ b/criu/arch/arm/uidiv.S
diff --git a/criu/arch/ppc64/Makefile b/criu/arch/ppc64/Makefile
new file mode 100644
index 000000000..5db577340
--- /dev/null
+++ b/criu/arch/ppc64/Makefile
@@ -0,0 +1,6 @@
+builtin-name := crtools.built-in.o
+
+ccflags-y += -iquote $(obj) -iquote $(SRC_DIR) -iquote $(obj)/include -iquote $(SRC_DIR)/criu/include
+
+obj-y += cpu.o
+obj-y += crtools.o
diff --git a/criu/arch/ppc64/Makefile.syscalls b/criu/arch/ppc64/Makefile.syscalls
new file mode 100644
index 000000000..1b28ce7dc
--- /dev/null
+++ b/criu/arch/ppc64/Makefile.syscalls
@@ -0,0 +1,50 @@
+builtin-name := syscalls.built-in.o
+
+SYS-TYPES := ../../include/syscall-types.h
+SYS-CODES := ../../include/syscall-codes.h
+SYS-PROTO := ../../include/syscall.h
+SYS-DEF := syscall-ppc64.tbl
+SYS-ASM-COMMON := syscall-common-ppc64.S
+
+asflags-y += -D__ASSEMBLY__ -nostdlib -fomit-frame-pointer
+asflags-y += -fpie -Wstrict-prototypes -Wa,--noexecstack
+asflags-y += -iquote $(obj) -iquote $(obj)/include -iquote $(SRC_DIR)/criu/include
+
+SYS-ASM := syscalls.S
+obj-y += $(SYS-ASM:.S=).o
+
+$(obj)/$(SYS-CODES): $(obj)/syscalls/$(SYS-DEF)
+ $(E) " GEN " $@
+ $(Q) echo "/* Autogenerated, don't edit */" > $@
+ $(Q) echo "#ifndef __ASM_CR_SYSCALL_CODES_H__" >> $@
+ $(Q) echo "#define __ASM_CR_SYSCALL_CODES_H__" >> $@
+ $(Q) cat $< | awk '/^__NR/{print "#define", $$1, $$2}' >> $@
+ $(Q) echo "#endif /* __ASM_CR_SYSCALL_CODES_H__ */" >> $@
+cleanup-y += $(obj)/$(SYS-CODES)
+
+$(obj)/$(SYS-PROTO): $(obj)/syscalls/$(SYS-DEF)
+ $(E) " GEN " $@
+ $(Q) echo "/* Autogenerated, don't edit */" > $@
+ $(Q) echo "#ifndef __ASM_CR_SYSCALL_PROTO_H__" >> $@
+ $(Q) echo "#define __ASM_CR_SYSCALL_PROTO_H__" >> $@
+ $(Q) echo "#include \"syscall-codes.h\"" >> $@
+ $(Q) echo "#include \"syscall-types.h\"" >> $@
+ $(Q) cat $< | awk '/^__NR/{print "extern long", $$3, substr($$0, index($$0,$$4)), ";"}' >> $@
+ $(Q) echo "#endif /* __ASM_CR_SYSCALL_PROTO_H__ */" >> $@
+cleanup-y += $(obj)/$(SYS-PROTO)
+
+$(obj)/$(SYS-ASM): $(obj)/syscalls/$(SYS-DEF) $(obj)/syscalls/$(SYS-ASM-COMMON) $(obj)/$(SYS-CODES) $(obj)/$(SYS-PROTO)
+ $(E) " GEN " $@
+ $(Q) echo "/* Autogenerated, don't edit */" > $@
+ $(Q) echo "#include \"syscall-codes.h\"" >> $@
+ $(Q) echo "#include \"syscalls/$(SYS-ASM-COMMON)\"" >> $@
+ $(Q) cat $< | awk '/^__NR/{print "SYSCALL(", $$3, ",", $$2, ")"}' >> $@
+cleanup-y += $(obj)/$(SYS-ASM)
+
+SYS-EXEC-TBL := sys-exec-tbl.c
+$(obj)/$(SYS-EXEC-TBL): $(obj)/syscalls/$(SYS-DEF) $(obj)/$(SYS-CODES) $(obj)/$(SYS-PROTO)
+ $(E) " GEN " $@
+ $(Q) echo "/* Autogenerated, don't edit */" > $@
+ $(Q) cat $< | awk '/^__NR/{print "SYSCALL(", substr($$3, 5), ",", $$2, ")"}' >> $@
+cleanup-y += $(obj)/$(SYS-EXEC-TBL)
+all-y += $(obj)/$(SYS-EXEC-TBL)
diff --git a/arch/ppc64/cpu.c b/criu/arch/ppc64/cpu.c
index d84a782c9..d84a782c9 100644
--- a/arch/ppc64/cpu.c
+++ b/criu/arch/ppc64/cpu.c
diff --git a/arch/ppc64/crtools.c b/criu/arch/ppc64/crtools.c
index b1f4f6381..b1f4f6381 100644
--- a/arch/ppc64/crtools.c
+++ b/criu/arch/ppc64/crtools.c
diff --git a/arch/ppc64/include/asm/atomic.h b/criu/arch/ppc64/include/asm/atomic.h
index 4fa33b1c7..4fa33b1c7 100644
--- a/arch/ppc64/include/asm/atomic.h
+++ b/criu/arch/ppc64/include/asm/atomic.h
diff --git a/arch/ppc64/include/asm/bitops.h b/criu/arch/ppc64/include/asm/bitops.h
index 910971981..910971981 100644
--- a/arch/ppc64/include/asm/bitops.h
+++ b/criu/arch/ppc64/include/asm/bitops.h
diff --git a/arch/ppc64/include/asm/bitsperlong.h b/criu/arch/ppc64/include/asm/bitsperlong.h
index d95727d19..d95727d19 100644
--- a/arch/ppc64/include/asm/bitsperlong.h
+++ b/criu/arch/ppc64/include/asm/bitsperlong.h
diff --git a/arch/ppc64/include/asm/cmpxchg.h b/criu/arch/ppc64/include/asm/cmpxchg.h
index b93fbdef0..b93fbdef0 100644
--- a/arch/ppc64/include/asm/cmpxchg.h
+++ b/criu/arch/ppc64/include/asm/cmpxchg.h
diff --git a/arch/ppc64/include/asm/cpu.h b/criu/arch/ppc64/include/asm/cpu.h
index 59118c211..59118c211 100644
--- a/arch/ppc64/include/asm/cpu.h
+++ b/criu/arch/ppc64/include/asm/cpu.h
diff --git a/arch/ppc64/include/asm/dump.h b/criu/arch/ppc64/include/asm/dump.h
index 1505fd298..1505fd298 100644
--- a/arch/ppc64/include/asm/dump.h
+++ b/criu/arch/ppc64/include/asm/dump.h
diff --git a/arch/ppc64/include/asm/fpu.h b/criu/arch/ppc64/include/asm/fpu.h
index 7f476d541..7f476d541 100644
--- a/arch/ppc64/include/asm/fpu.h
+++ b/criu/arch/ppc64/include/asm/fpu.h
diff --git a/arch/ppc64/include/asm/int.h b/criu/arch/ppc64/include/asm/int.h
index 642804e9b..642804e9b 100644
--- a/arch/ppc64/include/asm/int.h
+++ b/criu/arch/ppc64/include/asm/int.h
diff --git a/arch/ppc64/include/asm/linkage.h b/criu/arch/ppc64/include/asm/linkage.h
index 506edc711..506edc711 100644
--- a/arch/ppc64/include/asm/linkage.h
+++ b/criu/arch/ppc64/include/asm/linkage.h
diff --git a/arch/ppc64/include/asm/page.h b/criu/arch/ppc64/include/asm/page.h
index 9d10455f1..9d10455f1 100644
--- a/arch/ppc64/include/asm/page.h
+++ b/criu/arch/ppc64/include/asm/page.h
diff --git a/arch/ppc64/include/asm/parasite-syscall.h b/criu/arch/ppc64/include/asm/parasite-syscall.h
index 7665e207b..7665e207b 100644
--- a/arch/ppc64/include/asm/parasite-syscall.h
+++ b/criu/arch/ppc64/include/asm/parasite-syscall.h
diff --git a/arch/ppc64/include/asm/parasite.h b/criu/arch/ppc64/include/asm/parasite.h
index fdbc340b0..fdbc340b0 100644
--- a/arch/ppc64/include/asm/parasite.h
+++ b/criu/arch/ppc64/include/asm/parasite.h
diff --git a/arch/ppc64/include/asm/prlimit.h b/criu/arch/ppc64/include/asm/prlimit.h
index 6746ba0e6..6746ba0e6 100644
--- a/arch/ppc64/include/asm/prlimit.h
+++ b/criu/arch/ppc64/include/asm/prlimit.h
diff --git a/arch/ppc64/include/asm/processor-flags.h b/criu/arch/ppc64/include/asm/processor-flags.h
index c1888af36..c1888af36 100644
--- a/arch/ppc64/include/asm/processor-flags.h
+++ b/criu/arch/ppc64/include/asm/processor-flags.h
diff --git a/arch/ppc64/include/asm/restore.h b/criu/arch/ppc64/include/asm/restore.h
index 325ff96e1..325ff96e1 100644
--- a/arch/ppc64/include/asm/restore.h
+++ b/criu/arch/ppc64/include/asm/restore.h
diff --git a/arch/ppc64/include/asm/restorer.h b/criu/arch/ppc64/include/asm/restorer.h
index e728f1335..e728f1335 100644
--- a/arch/ppc64/include/asm/restorer.h
+++ b/criu/arch/ppc64/include/asm/restorer.h
diff --git a/arch/ppc64/include/asm/string.h b/criu/arch/ppc64/include/asm/string.h
index 4531b3ba6..4531b3ba6 100644
--- a/arch/ppc64/include/asm/string.h
+++ b/criu/arch/ppc64/include/asm/string.h
diff --git a/arch/ppc64/include/asm/types.h b/criu/arch/ppc64/include/asm/types.h
index 3412dc75d..3412dc75d 100644
--- a/arch/ppc64/include/asm/types.h
+++ b/criu/arch/ppc64/include/asm/types.h
diff --git a/arch/ppc64/include/asm/vdso.h b/criu/arch/ppc64/include/asm/vdso.h
index ed94e4cf0..ed94e4cf0 100644
--- a/arch/ppc64/include/asm/vdso.h
+++ b/criu/arch/ppc64/include/asm/vdso.h
diff --git a/arch/ppc64/memcmp_64.S b/criu/arch/ppc64/memcmp_64.S
index 16c2b0cd8..16c2b0cd8 100644
--- a/arch/ppc64/memcmp_64.S
+++ b/criu/arch/ppc64/memcmp_64.S
diff --git a/arch/ppc64/memcpy_power7.S b/criu/arch/ppc64/memcpy_power7.S
index a29d0e8f2..a29d0e8f2 100644
--- a/arch/ppc64/memcpy_power7.S
+++ b/criu/arch/ppc64/memcpy_power7.S
diff --git a/arch/ppc64/misc.S b/criu/arch/ppc64/misc.S
index 4ee188d55..4ee188d55 100644
--- a/arch/ppc64/misc.S
+++ b/criu/arch/ppc64/misc.S
diff --git a/arch/ppc64/parasite-head.S b/criu/arch/ppc64/parasite-head.S
index a1c189fe9..a1c189fe9 100644
--- a/arch/ppc64/parasite-head.S
+++ b/criu/arch/ppc64/parasite-head.S
diff --git a/arch/ppc64/restorer.c b/criu/arch/ppc64/restorer.c
index 665676045..665676045 100644
--- a/arch/ppc64/restorer.c
+++ b/criu/arch/ppc64/restorer.c
diff --git a/arch/ppc64/syscall-common-ppc64.S b/criu/arch/ppc64/syscalls/syscall-common-ppc64.S
index e18d6adf4..e18d6adf4 100644
--- a/arch/ppc64/syscall-common-ppc64.S
+++ b/criu/arch/ppc64/syscalls/syscall-common-ppc64.S
diff --git a/arch/ppc64/syscall-ppc64.def b/criu/arch/ppc64/syscalls/syscall-ppc64.tbl
index 331937973..331937973 100644
--- a/arch/ppc64/syscall-ppc64.def
+++ b/criu/arch/ppc64/syscalls/syscall-ppc64.tbl
diff --git a/arch/ppc64/vdso-pie.c b/criu/arch/ppc64/vdso-pie.c
index 30437d5cc..30437d5cc 100644
--- a/arch/ppc64/vdso-pie.c
+++ b/criu/arch/ppc64/vdso-pie.c
diff --git a/arch/ppc64/vdso-trampoline.S b/criu/arch/ppc64/vdso-trampoline.S
index e910e7ab9..e910e7ab9 100644
--- a/arch/ppc64/vdso-trampoline.S
+++ b/criu/arch/ppc64/vdso-trampoline.S
diff --git a/arch/scripts/arm/gen-sys-exec-tbl.pl b/criu/arch/scripts/arm/gen-sys-exec-tbl.pl
index a3037b78c..a3037b78c 100755
--- a/arch/scripts/arm/gen-sys-exec-tbl.pl
+++ b/criu/arch/scripts/arm/gen-sys-exec-tbl.pl
diff --git a/arch/scripts/arm/gen-syscalls.pl b/criu/arch/scripts/arm/gen-syscalls.pl
index 6fb8f3bf2..6fb8f3bf2 100755
--- a/arch/scripts/arm/gen-syscalls.pl
+++ b/criu/arch/scripts/arm/gen-syscalls.pl
diff --git a/criu/arch/x86/Makefile b/criu/arch/x86/Makefile
new file mode 100644
index 000000000..369b41f28
--- /dev/null
+++ b/criu/arch/x86/Makefile
@@ -0,0 +1,7 @@
+builtin-name := crtools.built-in.o
+
+ccflags-y += -iquote $(obj) -iquote $(SRC_DIR) -iquote $(obj)/include -iquote $(SRC_DIR)/criu/include
+
+obj-y += cpu.o
+obj-y += crtools.o
+obj-y += prlimit.o
diff --git a/arch/x86/Makefile b/criu/arch/x86/Makefile.syscalls
index 2304915c7..24841797b 100644
--- a/arch/x86/Makefile
+++ b/criu/arch/x86/Makefile.syscalls
@@ -1,41 +1,27 @@
-targets += syscalls
-targets += crtools
+builtin-name := syscalls.built-in.o
-SYS-ASM := syscalls.S
-
-syscalls-asm-y += $(SYS-ASM:.S=).o
-crtools-obj-y += crtools.o
-crtools-obj-y += cpu.o
-crtools-obj-y += prlimit.o
-
-ifeq ($(ARCH),x86)
-SYS-DEF := syscall_64.tbl
-SYS-ASM-COMMON := syscall-common-x86-64.S
-else
-SYS-DEF := syscall_32.tbl
-SYS-ASM-COMMON := syscall-common-x86-32.S
-endif
-
-SYS-TYPES := ../../include/syscall-types.h
-SYS-CODES := ../../include/syscall-codes.h
-SYS-PROTO := ../../include/syscall.h
-
-SYS-EXEC-TBL := sys-exec-tbl.c
+SYS-TYPES := ../../include/syscall-types.h
+SYS-CODES := ../../include/syscall-codes.h
+SYS-PROTO := ../../include/syscall.h
ifeq ($(ARCH),x86)
-syscalls-asm-y-asmflags := -fpie -Wstrict-prototypes -Wa,--noexecstack
+ SYS-DEF := syscall_64.tbl
+ SYS-ASM-COMMON := syscall-common-x86-64.S
+ asflags-y += -fpie -Wstrict-prototypes -Wa,--noexecstack
else
-syscalls-asm-y-asmflags := -fno-pic -Wstrict-prototypes -Wa,--noexecstack
-endif
-syscalls-asm-y-asmflags += -nostdlib -fomit-frame-pointer -I$(obj)
+ SYS-DEF := syscall_32.tbl
+ SYS-ASM-COMMON := syscall-common-x86-32.S
+ asflags-y += -fno-pic -Wstrict-prototypes -Wa,--noexecstack
+ obj-y += syscalls/syscall32.o
-ifneq ($(ARCH),x86)
-syscalls-obj-y += syscalls/syscall32.o
$(obj)/syscalls/syscall32.o: $(obj)/$(SYS-CODES) $(obj)/$(SYS-PROTO)
endif
-cleanup-y += $(obj)/syscalls/*.o $(obj)/syscalls/*.d
-ASMFLAGS += -D__ASSEMBLY__
+asflags-y += -D__ASSEMBLY__ -nostdlib -fomit-frame-pointer
+asflags-y += -iquote $(obj) -iquote $(obj)/include -iquote $(SRC_DIR)/criu/include
+
+SYS-ASM := syscalls.S
+obj-y += $(SYS-ASM:.S=).o
$(obj)/$(SYS-CODES): $(obj)/syscalls/$(SYS-DEF)
$(E) " GEN " $@
@@ -44,8 +30,7 @@ $(obj)/$(SYS-CODES): $(obj)/syscalls/$(SYS-DEF)
$(Q) echo "#define __ASM_CR_SYSCALL_CODES_H__" >> $@
$(Q) cat $< | awk '/^__NR/{print "#define", $$1, $$2}' >> $@
$(Q) echo "#endif /* __ASM_CR_SYSCALL_CODES_H__ */" >> $@
-_all += $(obj)/$(SYS-CODES)
-cleanup-y += $(obj)/$(SYS-CODES)
+cleanup-y += $(obj)/$(SYS-CODES)
$(obj)/$(SYS-PROTO): $(obj)/syscalls/$(SYS-DEF)
$(E) " GEN " $@
@@ -53,7 +38,7 @@ $(obj)/$(SYS-PROTO): $(obj)/syscalls/$(SYS-DEF)
$(Q) echo "#ifndef __ASM_CR_SYSCALL_PROTO_H__" >> $@
$(Q) echo "#define __ASM_CR_SYSCALL_PROTO_H__" >> $@
$(Q) echo "#ifndef CR_NOGLIBC" >> $@
- $(Q) echo "#error This file should only be used in the parasite code" >> $@
+ $(Q) echo "# error This file should only be used in the parasite code" >> $@
$(Q) echo "#endif" >> $@
$(Q) echo "#include \"syscall-codes.h\"" >> $@
$(Q) echo "#include \"syscall-types.h\"" >> $@
@@ -62,8 +47,7 @@ ifneq ($(ARCH),x86)
endif
$(Q) cat $< | awk '/^__NR/{print "extern long", $$3, substr($$0, index($$0,$$4)), ";"}' >> $@
$(Q) echo "#endif /* __ASM_CR_SYSCALL_PROTO_H__ */" >> $@
-_all += $(obj)/$(SYS-PROTO)
-cleanup-y += $(obj)/$(SYS-PROTO)
+cleanup-y += $(obj)/$(SYS-PROTO)
$(obj)/$(SYS-ASM): $(obj)/syscalls/$(SYS-DEF) $(obj)/syscalls/$(SYS-ASM-COMMON) $(obj)/$(SYS-CODES) $(obj)/$(SYS-PROTO)
$(E) " GEN " $@
@@ -71,21 +55,12 @@ $(obj)/$(SYS-ASM): $(obj)/syscalls/$(SYS-DEF) $(obj)/syscalls/$(SYS-ASM-COMMON)
$(Q) echo "#include \"syscall-codes.h\"" >> $@
$(Q) echo "#include \"syscalls/$(SYS-ASM-COMMON)\"" >> $@
$(Q) cat $< | awk '/^__NR/{print "SYSCALL(", $$3, ",", $$2, ")"}' >> $@
-_all += $(obj)/$(SYS-ASM)
-cleanup-y += $(obj)/$(SYS-ASM)
-
-$(obj)/syscalls.o: $(obj)/$(SYS-ASM)
+cleanup-y += $(obj)/$(SYS-ASM)
+SYS-EXEC-TBL := sys-exec-tbl.c
$(obj)/$(SYS-EXEC-TBL): $(obj)/syscalls/$(SYS-DEF) $(obj)/$(SYS-CODES) $(obj)/$(SYS-PROTO)
$(E) " GEN " $@
$(Q) echo "/* Autogenerated, don't edit */" > $@
$(Q) cat $< | awk '/^__NR/{print "SYSCALL(", substr($$3, 5), ",", $$2, ")"}' >> $@
-_all += $(obj)/$(SYS-EXEC-TBL)
-cleanup-y += $(obj)/$(SYS-EXEC-TBL)
-
-$(obj)/crtools.built-in.o: | $(obj)/$(SYS-CODES) $(obj)/$(SYS-PROTO)
-
-ifneq ($(MAKECMDGOALS),clean)
-deps-after := $(obj)/$(SYS-ASM)
-incdeps := y
-endif
+cleanup-y += $(obj)/$(SYS-EXEC-TBL)
+all-y += $(obj)/$(SYS-EXEC-TBL)
diff --git a/arch/x86/cpu.c b/criu/arch/x86/cpu.c
index d703e68e3..d703e68e3 100644
--- a/arch/x86/cpu.c
+++ b/criu/arch/x86/cpu.c
diff --git a/arch/x86/crtools.c b/criu/arch/x86/crtools.c
index f713b0d3f..f713b0d3f 100644
--- a/arch/x86/crtools.c
+++ b/criu/arch/x86/crtools.c
diff --git a/arch/x86/include/asm/atomic.h b/criu/arch/x86/include/asm/atomic.h
index d447b65cb..d447b65cb 100644
--- a/arch/x86/include/asm/atomic.h
+++ b/criu/arch/x86/include/asm/atomic.h
diff --git a/arch/x86/include/asm/bitops.h b/criu/arch/x86/include/asm/bitops.h
index 7d6283183..7d6283183 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/criu/arch/x86/include/asm/bitops.h
diff --git a/arch/x86/include/asm/bitsperlong.h b/criu/arch/x86/include/asm/bitsperlong.h
index 7e0a71e8d..7e0a71e8d 100644
--- a/arch/x86/include/asm/bitsperlong.h
+++ b/criu/arch/x86/include/asm/bitsperlong.h
diff --git a/arch/x86/include/asm/cmpxchg.h b/criu/arch/x86/include/asm/cmpxchg.h
index 600d0a7ff..600d0a7ff 100644
--- a/arch/x86/include/asm/cmpxchg.h
+++ b/criu/arch/x86/include/asm/cmpxchg.h
diff --git a/arch/x86/include/asm/cpu.h b/criu/arch/x86/include/asm/cpu.h
index 6f49229d6..6f49229d6 100644
--- a/arch/x86/include/asm/cpu.h
+++ b/criu/arch/x86/include/asm/cpu.h
diff --git a/arch/x86/include/asm/dump.h b/criu/arch/x86/include/asm/dump.h
index 1505fd298..1505fd298 100644
--- a/arch/x86/include/asm/dump.h
+++ b/criu/arch/x86/include/asm/dump.h
diff --git a/arch/x86/include/asm/fpu.h b/criu/arch/x86/include/asm/fpu.h
index be168324b..be168324b 100644
--- a/arch/x86/include/asm/fpu.h
+++ b/criu/arch/x86/include/asm/fpu.h
diff --git a/arch/x86/include/asm/int.h b/criu/arch/x86/include/asm/int.h
index 642804e9b..642804e9b 100644
--- a/arch/x86/include/asm/int.h
+++ b/criu/arch/x86/include/asm/int.h
diff --git a/arch/x86/include/asm/linkage.h b/criu/arch/x86/include/asm/linkage.h
index 5e0948f07..5e0948f07 100644
--- a/arch/x86/include/asm/linkage.h
+++ b/criu/arch/x86/include/asm/linkage.h
diff --git a/arch/x86/include/asm/page.h b/criu/arch/x86/include/asm/page.h
index 134835556..134835556 100644
--- a/arch/x86/include/asm/page.h
+++ b/criu/arch/x86/include/asm/page.h
diff --git a/arch/x86/include/asm/parasite-syscall.h b/criu/arch/x86/include/asm/parasite-syscall.h
index 4d56cb072..4d56cb072 100644
--- a/arch/x86/include/asm/parasite-syscall.h
+++ b/criu/arch/x86/include/asm/parasite-syscall.h
diff --git a/arch/x86/include/asm/parasite.h b/criu/arch/x86/include/asm/parasite.h
index 669ae63e2..669ae63e2 100644
--- a/arch/x86/include/asm/parasite.h
+++ b/criu/arch/x86/include/asm/parasite.h
diff --git a/arch/x86/include/asm/prlimit.h b/criu/arch/x86/include/asm/prlimit.h
index 6746ba0e6..6746ba0e6 100644
--- a/arch/x86/include/asm/prlimit.h
+++ b/criu/arch/x86/include/asm/prlimit.h
diff --git a/arch/x86/include/asm/processor-flags.h b/criu/arch/x86/include/asm/processor-flags.h
index 9f1bccdbe..9f1bccdbe 100644
--- a/arch/x86/include/asm/processor-flags.h
+++ b/criu/arch/x86/include/asm/processor-flags.h
diff --git a/arch/x86/include/asm/restore.h b/criu/arch/x86/include/asm/restore.h
index 9d39b2bba..9d39b2bba 100644
--- a/arch/x86/include/asm/restore.h
+++ b/criu/arch/x86/include/asm/restore.h
diff --git a/arch/x86/include/asm/restorer.h b/criu/arch/x86/include/asm/restorer.h
index 2021c41f5..2021c41f5 100644
--- a/arch/x86/include/asm/restorer.h
+++ b/criu/arch/x86/include/asm/restorer.h
diff --git a/arch/x86/include/asm/string.h b/criu/arch/x86/include/asm/string.h
index e1d875e45..e1d875e45 100644
--- a/arch/x86/include/asm/string.h
+++ b/criu/arch/x86/include/asm/string.h
diff --git a/arch/x86/include/asm/syscall32.h b/criu/arch/x86/include/asm/syscall32.h
index b0d5cb71d..b0d5cb71d 100644
--- a/arch/x86/include/asm/syscall32.h
+++ b/criu/arch/x86/include/asm/syscall32.h
diff --git a/arch/x86/include/asm/types.h b/criu/arch/x86/include/asm/types.h
index b2d018983..b2d018983 100644
--- a/arch/x86/include/asm/types.h
+++ b/criu/arch/x86/include/asm/types.h
diff --git a/arch/x86/include/asm/vdso.h b/criu/arch/x86/include/asm/vdso.h
index a1cc9bb97..a1cc9bb97 100644
--- a/arch/x86/include/asm/vdso.h
+++ b/criu/arch/x86/include/asm/vdso.h
diff --git a/arch/x86/parasite-head.S b/criu/arch/x86/parasite-head.S
index 5fb00a5c8..5fb00a5c8 100644
--- a/arch/x86/parasite-head.S
+++ b/criu/arch/x86/parasite-head.S
diff --git a/arch/x86/prlimit.c b/criu/arch/x86/prlimit.c
index 8bc4aba9f..8bc4aba9f 100644
--- a/arch/x86/prlimit.c
+++ b/criu/arch/x86/prlimit.c
diff --git a/arch/x86/restorer.c b/criu/arch/x86/restorer.c
index 364b156be..364b156be 100644
--- a/arch/x86/restorer.c
+++ b/criu/arch/x86/restorer.c
diff --git a/arch/x86/syscalls/syscall-common-x86-32.S b/criu/arch/x86/syscalls/syscall-common-x86-32.S
index ae6d594dc..ae6d594dc 100644
--- a/arch/x86/syscalls/syscall-common-x86-32.S
+++ b/criu/arch/x86/syscalls/syscall-common-x86-32.S
diff --git a/arch/x86/syscalls/syscall-common-x86-64.S b/criu/arch/x86/syscalls/syscall-common-x86-64.S
index b93c31288..b93c31288 100644
--- a/arch/x86/syscalls/syscall-common-x86-64.S
+++ b/criu/arch/x86/syscalls/syscall-common-x86-64.S
diff --git a/arch/x86/syscalls/syscall32.c b/criu/arch/x86/syscalls/syscall32.c
index b68ef0957..b68ef0957 100644
--- a/arch/x86/syscalls/syscall32.c
+++ b/criu/arch/x86/syscalls/syscall32.c
diff --git a/arch/x86/syscalls/syscall_32.tbl b/criu/arch/x86/syscalls/syscall_32.tbl
index 04d10d119..04d10d119 100644
--- a/arch/x86/syscalls/syscall_32.tbl
+++ b/criu/arch/x86/syscalls/syscall_32.tbl
diff --git a/arch/x86/syscalls/syscall_64.tbl b/criu/arch/x86/syscalls/syscall_64.tbl
index 5c32d4c46..5c32d4c46 100644
--- a/arch/x86/syscalls/syscall_64.tbl
+++ b/criu/arch/x86/syscalls/syscall_64.tbl
diff --git a/arch/x86/vdso-pie.c b/criu/arch/x86/vdso-pie.c
index b1e087cd8..b1e087cd8 100644
--- a/arch/x86/vdso-pie.c
+++ b/criu/arch/x86/vdso-pie.c
diff --git a/bfd.c b/criu/bfd.c
index 66c318c6e..66c318c6e 100644
--- a/bfd.c
+++ b/criu/bfd.c
diff --git a/bitmap.c b/criu/bitmap.c
index 65a501e72..65a501e72 100644
--- a/bitmap.c
+++ b/criu/bitmap.c
diff --git a/cgroup.c b/criu/cgroup.c
index 704f144f0..704f144f0 100644
--- a/cgroup.c
+++ b/criu/cgroup.c
diff --git a/cr-check.c b/criu/cr-check.c
index 2bb0d9a2e..2bb0d9a2e 100644
--- a/cr-check.c
+++ b/criu/cr-check.c
diff --git a/cr-dedup.c b/criu/cr-dedup.c
index b453c3e61..b453c3e61 100644
--- a/cr-dedup.c
+++ b/criu/cr-dedup.c
diff --git a/cr-dump.c b/criu/cr-dump.c
index 385b7bb7b..385b7bb7b 100644
--- a/cr-dump.c
+++ b/criu/cr-dump.c
diff --git a/cr-errno.c b/criu/cr-errno.c
index b62bb545a..b62bb545a 100644
--- a/cr-errno.c
+++ b/criu/cr-errno.c
diff --git a/cr-exec.c b/criu/cr-exec.c
index 8beb80f88..8beb80f88 100644
--- a/cr-exec.c
+++ b/criu/cr-exec.c
diff --git a/cr-restore.c b/criu/cr-restore.c
index 0985b8675..0985b8675 100644
--- a/cr-restore.c
+++ b/criu/cr-restore.c
diff --git a/cr-service.c b/criu/cr-service.c
index a1987e713..a1987e713 100644
--- a/cr-service.c
+++ b/criu/cr-service.c
diff --git a/cr-show.c b/criu/cr-show.c
index 91d4d095a..91d4d095a 100644
--- a/cr-show.c
+++ b/criu/cr-show.c
diff --git a/crtools.c b/criu/crtools.c
index 44060293e..44060293e 100644
--- a/crtools.c
+++ b/criu/crtools.c
diff --git a/eventfd.c b/criu/eventfd.c
index 21b5c9d7b..21b5c9d7b 100644
--- a/eventfd.c
+++ b/criu/eventfd.c
diff --git a/eventpoll.c b/criu/eventpoll.c
index c414c35b9..c414c35b9 100644
--- a/eventpoll.c
+++ b/criu/eventpoll.c
diff --git a/fault-injection.c b/criu/fault-injection.c
index f239fd9db..f239fd9db 100644
--- a/fault-injection.c
+++ b/criu/fault-injection.c
diff --git a/fifo.c b/criu/fifo.c
index bd06da9c1..bd06da9c1 100644
--- a/fifo.c
+++ b/criu/fifo.c
diff --git a/file-ids.c b/criu/file-ids.c
index f23924a05..f23924a05 100644
--- a/file-ids.c
+++ b/criu/file-ids.c
diff --git a/file-lock.c b/criu/file-lock.c
index 8e4e48192..8e4e48192 100644
--- a/file-lock.c
+++ b/criu/file-lock.c
diff --git a/files-ext.c b/criu/files-ext.c
index b196b2590..b196b2590 100644
--- a/files-ext.c
+++ b/criu/files-ext.c
diff --git a/files-reg.c b/criu/files-reg.c
index 7911d6673..7911d6673 100644
--- a/files-reg.c
+++ b/criu/files-reg.c
diff --git a/files.c b/criu/files.c
index db15527e9..db15527e9 100644
--- a/files.c
+++ b/criu/files.c
diff --git a/fsnotify.c b/criu/fsnotify.c
index 59259c13e..59259c13e 100644
--- a/fsnotify.c
+++ b/criu/fsnotify.c
diff --git a/image-desc.c b/criu/image-desc.c
index 677067538..677067538 100644
--- a/image-desc.c
+++ b/criu/image-desc.c
diff --git a/image.c b/criu/image.c
index a164722bb..a164722bb 100644
--- a/image.c
+++ b/criu/image.c
diff --git a/include/action-scripts.h b/criu/include/action-scripts.h
index 8ffc2c58b..8ffc2c58b 100644
--- a/include/action-scripts.h
+++ b/criu/include/action-scripts.h
diff --git a/include/aio.h b/criu/include/aio.h
index e839ec693..e839ec693 100644
--- a/include/aio.h
+++ b/criu/include/aio.h
diff --git a/include/asm-generic/bitops.h b/criu/include/asm-generic/bitops.h
index 190e1ab63..190e1ab63 100644
--- a/include/asm-generic/bitops.h
+++ b/criu/include/asm-generic/bitops.h
diff --git a/include/asm-generic/int.h b/criu/include/asm-generic/int.h
index ac3088d5a..ac3088d5a 100644
--- a/include/asm-generic/int.h
+++ b/criu/include/asm-generic/int.h
diff --git a/include/asm-generic/string.h b/criu/include/asm-generic/string.h
index 0a545e659..0a545e659 100644
--- a/include/asm-generic/string.h
+++ b/criu/include/asm-generic/string.h
diff --git a/include/asm-generic/vdso.h b/criu/include/asm-generic/vdso.h
index bb7460554..bb7460554 100644
--- a/include/asm-generic/vdso.h
+++ b/criu/include/asm-generic/vdso.h
diff --git a/include/bfd.h b/criu/include/bfd.h
index e9b4d53a4..e9b4d53a4 100644
--- a/include/bfd.h
+++ b/criu/include/bfd.h
diff --git a/include/bitmap.h b/criu/include/bitmap.h
index 9e701b66c..9e701b66c 100644
--- a/include/bitmap.h
+++ b/criu/include/bitmap.h
diff --git a/include/bug.h b/criu/include/bug.h
index a479c673b..a479c673b 100644
--- a/include/bug.h
+++ b/criu/include/bug.h
diff --git a/include/cgroup.h b/criu/include/cgroup.h
index 393ee3d9c..393ee3d9c 100644
--- a/include/cgroup.h
+++ b/criu/include/cgroup.h
diff --git a/include/compiler.h b/criu/include/compiler.h
index 6bce93562..6bce93562 100644
--- a/include/compiler.h
+++ b/criu/include/compiler.h
diff --git a/include/config-base.h b/criu/include/config-base.h
index 5e2685965..5e2685965 100644
--- a/include/config-base.h
+++ b/criu/include/config-base.h
diff --git a/include/cpu.h b/criu/include/cpu.h
index e94525a9e..e94525a9e 100644
--- a/include/cpu.h
+++ b/criu/include/cpu.h
diff --git a/include/cr-errno.h b/criu/include/cr-errno.h
index 1f94988cf..1f94988cf 100644
--- a/include/cr-errno.h
+++ b/criu/include/cr-errno.h
diff --git a/include/cr-service-const.h b/criu/include/cr-service-const.h
index c6d2e398f..c6d2e398f 100644
--- a/include/cr-service-const.h
+++ b/criu/include/cr-service-const.h
diff --git a/include/cr-service.h b/criu/include/cr-service.h
index 621cedbe7..621cedbe7 100644
--- a/include/cr-service.h
+++ b/criu/include/cr-service.h
diff --git a/include/cr-show.h b/criu/include/cr-show.h
index 6ebdb4c2a..6ebdb4c2a 100644
--- a/include/cr-show.h
+++ b/criu/include/cr-show.h
diff --git a/include/cr_options.h b/criu/include/cr_options.h
index 5c0e6332e..5c0e6332e 100644
--- a/include/cr_options.h
+++ b/criu/include/cr_options.h
diff --git a/include/criu-log.h b/criu/include/criu-log.h
index fd5d6349d..fd5d6349d 100644
--- a/include/criu-log.h
+++ b/criu/include/criu-log.h
diff --git a/include/criu-plugin.h b/criu/include/criu-plugin.h
index b76f5f839..b76f5f839 100644
--- a/include/criu-plugin.h
+++ b/criu/include/criu-plugin.h
diff --git a/include/crtools.h b/criu/include/crtools.h
index eaa70dcf4..eaa70dcf4 100644
--- a/include/crtools.h
+++ b/criu/include/crtools.h
diff --git a/include/err.h b/criu/include/err.h
index c5b6165a5..c5b6165a5 100644
--- a/include/err.h
+++ b/criu/include/err.h
diff --git a/include/errno.h b/criu/include/errno.h
index 5c2322e9f..5c2322e9f 100644
--- a/include/errno.h
+++ b/criu/include/errno.h
diff --git a/include/eventfd.h b/criu/include/eventfd.h
index 65e0af7cd..65e0af7cd 100644
--- a/include/eventfd.h
+++ b/criu/include/eventfd.h
diff --git a/include/eventpoll.h b/criu/include/eventpoll.h
index 96a77bc98..96a77bc98 100644
--- a/include/eventpoll.h
+++ b/criu/include/eventpoll.h
diff --git a/include/fault-injection.h b/criu/include/fault-injection.h
index 989f654b2..989f654b2 100644
--- a/include/fault-injection.h
+++ b/criu/include/fault-injection.h
diff --git a/include/fcntl.h b/criu/include/fcntl.h
index 6f85c5ee6..6f85c5ee6 100644
--- a/include/fcntl.h
+++ b/criu/include/fcntl.h
diff --git a/include/fifo.h b/criu/include/fifo.h
index 776265450..776265450 100644
--- a/include/fifo.h
+++ b/criu/include/fifo.h
diff --git a/include/file-ids.h b/criu/include/file-ids.h
index 2da4ceffd..2da4ceffd 100644
--- a/include/file-ids.h
+++ b/criu/include/file-ids.h
diff --git a/include/file-lock.h b/criu/include/file-lock.h
index e771c0ee5..e771c0ee5 100644
--- a/include/file-lock.h
+++ b/criu/include/file-lock.h
diff --git a/include/files-reg.h b/criu/include/files-reg.h
index e2f611535..e2f611535 100644
--- a/include/files-reg.h
+++ b/criu/include/files-reg.h
diff --git a/include/files.h b/criu/include/files.h
index 9ea234440..9ea234440 100644
--- a/include/files.h
+++ b/criu/include/files.h
diff --git a/include/fs-magic.h b/criu/include/fs-magic.h
index d6e9e54d1..d6e9e54d1 100644
--- a/include/fs-magic.h
+++ b/criu/include/fs-magic.h
diff --git a/include/fsnotify.h b/criu/include/fsnotify.h
index 48e3982cf..48e3982cf 100644
--- a/include/fsnotify.h
+++ b/criu/include/fsnotify.h
diff --git a/include/image-desc.h b/criu/include/image-desc.h
index 532ced8b4..532ced8b4 100644
--- a/include/image-desc.h
+++ b/criu/include/image-desc.h
diff --git a/include/image.h b/criu/include/image.h
index 305febf5a..305febf5a 100644
--- a/include/image.h
+++ b/criu/include/image.h
diff --git a/include/imgset.h b/criu/include/imgset.h
index 04be917e2..04be917e2 100644
--- a/include/imgset.h
+++ b/criu/include/imgset.h
diff --git a/include/inet_diag.h b/criu/include/inet_diag.h
index 95be2c19d..95be2c19d 100644
--- a/include/inet_diag.h
+++ b/criu/include/inet_diag.h
diff --git a/include/ipc_ns.h b/criu/include/ipc_ns.h
index c89098926..c89098926 100644
--- a/include/ipc_ns.h
+++ b/criu/include/ipc_ns.h
diff --git a/include/irmap.h b/criu/include/irmap.h
index 033f71e37..033f71e37 100644
--- a/include/irmap.h
+++ b/criu/include/irmap.h
diff --git a/include/kcmp-ids.h b/criu/include/kcmp-ids.h
index afe68d6d3..afe68d6d3 100644
--- a/include/kcmp-ids.h
+++ b/criu/include/kcmp-ids.h
diff --git a/include/kcmp.h b/criu/include/kcmp.h
index 76f557bff..76f557bff 100644
--- a/include/kcmp.h
+++ b/criu/include/kcmp.h
diff --git a/include/kerndat.h b/criu/include/kerndat.h
index a02d15bc1..a02d15bc1 100644
--- a/include/kerndat.h
+++ b/criu/include/kerndat.h
diff --git a/include/libnetlink.h b/criu/include/libnetlink.h
index 92eded420..92eded420 100644
--- a/include/libnetlink.h
+++ b/criu/include/libnetlink.h
diff --git a/include/list.h b/criu/include/list.h
index ce3a3c0cd..ce3a3c0cd 100644
--- a/include/list.h
+++ b/criu/include/list.h
diff --git a/include/lock.h b/criu/include/lock.h
index 1678d10ef..1678d10ef 100644
--- a/include/lock.h
+++ b/criu/include/lock.h
diff --git a/include/log.h b/criu/include/log.h
index fe53a7c92..fe53a7c92 100644
--- a/include/log.h
+++ b/criu/include/log.h
diff --git a/include/lsm.h b/criu/include/lsm.h
index bd13ef70b..bd13ef70b 100644
--- a/include/lsm.h
+++ b/criu/include/lsm.h
diff --git a/include/magic.h b/criu/include/magic.h
index b11a70edd..b11a70edd 100644
--- a/include/magic.h
+++ b/criu/include/magic.h
diff --git a/include/mem.h b/criu/include/mem.h
index 5269cad02..5269cad02 100644
--- a/include/mem.h
+++ b/criu/include/mem.h
diff --git a/include/mman.h b/criu/include/mman.h
index 340d36927..340d36927 100644
--- a/include/mman.h
+++ b/criu/include/mman.h
diff --git a/include/mount.h b/criu/include/mount.h
index b3bbdcea5..b3bbdcea5 100644
--- a/include/mount.h
+++ b/criu/include/mount.h
diff --git a/include/namespaces.h b/criu/include/namespaces.h
index 4ce5a3470..4ce5a3470 100644
--- a/include/namespaces.h
+++ b/criu/include/namespaces.h
diff --git a/include/net.h b/criu/include/net.h
index 900b13656..900b13656 100644
--- a/include/net.h
+++ b/criu/include/net.h
diff --git a/include/netfilter.h b/criu/include/netfilter.h
index f3667fc81..f3667fc81 100644
--- a/include/netfilter.h
+++ b/criu/include/netfilter.h
diff --git a/include/netlink_diag.h b/criu/include/netlink_diag.h
index 14ca403b8..14ca403b8 100644
--- a/include/netlink_diag.h
+++ b/criu/include/netlink_diag.h
diff --git a/include/packet_diag.h b/criu/include/packet_diag.h
index e5d9193a8..e5d9193a8 100644
--- a/include/packet_diag.h
+++ b/criu/include/packet_diag.h
diff --git a/include/page-pipe.h b/criu/include/page-pipe.h
index a2dc26852..a2dc26852 100644
--- a/include/page-pipe.h
+++ b/criu/include/page-pipe.h
diff --git a/include/page-read.h b/criu/include/page-read.h
index 827e4acd5..827e4acd5 100644
--- a/include/page-read.h
+++ b/criu/include/page-read.h
diff --git a/include/page-xfer.h b/criu/include/page-xfer.h
index 8492daaff..8492daaff 100644
--- a/include/page-xfer.h
+++ b/criu/include/page-xfer.h
diff --git a/include/pagemap-cache.h b/criu/include/pagemap-cache.h
index e0880906d..e0880906d 100644
--- a/include/pagemap-cache.h
+++ b/criu/include/pagemap-cache.h
diff --git a/include/parasite-syscall.h b/criu/include/parasite-syscall.h
index 57612df74..57612df74 100644
--- a/include/parasite-syscall.h
+++ b/criu/include/parasite-syscall.h
diff --git a/include/parasite-vdso.h b/criu/include/parasite-vdso.h
index d4dc89b47..d4dc89b47 100644
--- a/include/parasite-vdso.h
+++ b/criu/include/parasite-vdso.h
diff --git a/include/parasite.h b/criu/include/parasite.h
index 063903b84..063903b84 100644
--- a/include/parasite.h
+++ b/criu/include/parasite.h
diff --git a/include/pid.h b/criu/include/pid.h
index d073944ce..d073944ce 100644
--- a/include/pid.h
+++ b/criu/include/pid.h
diff --git a/include/pipes.h b/criu/include/pipes.h
index c8786164c..c8786164c 100644
--- a/include/pipes.h
+++ b/criu/include/pipes.h
diff --git a/include/plugin.h b/criu/include/plugin.h
index 285583620..285583620 100644
--- a/include/plugin.h
+++ b/criu/include/plugin.h
diff --git a/include/posix-timer.h b/criu/include/posix-timer.h
index 568bf4a27..568bf4a27 100644
--- a/include/posix-timer.h
+++ b/criu/include/posix-timer.h
diff --git a/include/prctl.h b/criu/include/prctl.h
index b48d95286..b48d95286 100644
--- a/include/prctl.h
+++ b/criu/include/prctl.h
diff --git a/include/proc_parse.h b/criu/include/proc_parse.h
index 33cd07712..33cd07712 100644
--- a/include/proc_parse.h
+++ b/criu/include/proc_parse.h
diff --git a/include/protobuf-desc.h b/criu/include/protobuf-desc.h
index bb66a8689..bb66a8689 100644
--- a/include/protobuf-desc.h
+++ b/criu/include/protobuf-desc.h
diff --git a/include/protobuf.h b/criu/include/protobuf.h
index 3d76b13ed..3d76b13ed 100644
--- a/include/protobuf.h
+++ b/criu/include/protobuf.h
diff --git a/include/pstree.h b/criu/include/pstree.h
index 47ce676a9..47ce676a9 100644
--- a/include/pstree.h
+++ b/criu/include/pstree.h
diff --git a/include/ptrace.h b/criu/include/ptrace.h
index 047b1e2ab..047b1e2ab 100644
--- a/include/ptrace.h
+++ b/criu/include/ptrace.h
diff --git a/include/rbtree.h b/criu/include/rbtree.h
index f60821032..f60821032 100644
--- a/include/rbtree.h
+++ b/criu/include/rbtree.h
diff --git a/include/restorer.h b/criu/include/restorer.h
index 4c4377cda..4c4377cda 100644
--- a/include/restorer.h
+++ b/criu/include/restorer.h
diff --git a/include/rst-malloc.h b/criu/include/rst-malloc.h
index 001fa4183..001fa4183 100644
--- a/include/rst-malloc.h
+++ b/criu/include/rst-malloc.h
diff --git a/include/rst_info.h b/criu/include/rst_info.h
index b72e5d0c8..b72e5d0c8 100644
--- a/include/rst_info.h
+++ b/criu/include/rst_info.h
diff --git a/include/seccomp.h b/criu/include/seccomp.h
index b5b26c809..b5b26c809 100644
--- a/include/seccomp.h
+++ b/criu/include/seccomp.h
diff --git a/include/seize.h b/criu/include/seize.h
index 315fab2d3..315fab2d3 100644
--- a/include/seize.h
+++ b/criu/include/seize.h
diff --git a/include/servicefd.h b/criu/include/servicefd.h
index a9e35a223..a9e35a223 100644
--- a/include/servicefd.h
+++ b/criu/include/servicefd.h
diff --git a/include/setproctitle.h b/criu/include/setproctitle.h
index bc634331b..bc634331b 100644
--- a/include/setproctitle.h
+++ b/criu/include/setproctitle.h
diff --git a/include/shmem.h b/criu/include/shmem.h
index 47dd0fd3b..47dd0fd3b 100644
--- a/include/shmem.h
+++ b/criu/include/shmem.h
diff --git a/include/sigframe.h b/criu/include/sigframe.h
index 5ab09b1fd..5ab09b1fd 100644
--- a/include/sigframe.h
+++ b/criu/include/sigframe.h
diff --git a/include/signalfd.h b/criu/include/signalfd.h
index c7af81977..c7af81977 100644
--- a/include/signalfd.h
+++ b/criu/include/signalfd.h
diff --git a/include/sk-inet.h b/criu/include/sk-inet.h
index 5b5fca638..5b5fca638 100644
--- a/include/sk-inet.h
+++ b/criu/include/sk-inet.h
diff --git a/include/sk-packet.h b/criu/include/sk-packet.h
index 6c4398c60..6c4398c60 100644
--- a/include/sk-packet.h
+++ b/criu/include/sk-packet.h
diff --git a/include/sk-queue.h b/criu/include/sk-queue.h
index 9044de0b0..9044de0b0 100644
--- a/include/sk-queue.h
+++ b/criu/include/sk-queue.h
diff --git a/include/sockets.h b/criu/include/sockets.h
index b726e2f7a..b726e2f7a 100644
--- a/include/sockets.h
+++ b/criu/include/sockets.h
diff --git a/include/stats.h b/criu/include/stats.h
index e417636e6..e417636e6 100644
--- a/include/stats.h
+++ b/criu/include/stats.h
diff --git a/include/string.h b/criu/include/string.h
index b469bfe55..b469bfe55 100644
--- a/include/string.h
+++ b/criu/include/string.h
diff --git a/include/syscall-types.h b/criu/include/syscall-types.h
index e3a114d6c..e3a114d6c 100644
--- a/include/syscall-types.h
+++ b/criu/include/syscall-types.h
diff --git a/include/sysctl.h b/criu/include/sysctl.h
index b949a409e..b949a409e 100644
--- a/include/sysctl.h
+++ b/criu/include/sysctl.h
diff --git a/include/sysfs_parse.h b/criu/include/sysfs_parse.h
index 4d74c4ee5..4d74c4ee5 100644
--- a/include/sysfs_parse.h
+++ b/criu/include/sysfs_parse.h
diff --git a/include/timerfd.h b/criu/include/timerfd.h
index 67b918717..67b918717 100644
--- a/include/timerfd.h
+++ b/criu/include/timerfd.h
diff --git a/include/tty.h b/criu/include/tty.h
index c8b620992..c8b620992 100644
--- a/include/tty.h
+++ b/criu/include/tty.h
diff --git a/include/tun.h b/criu/include/tun.h
index d70f8f210..d70f8f210 100644
--- a/include/tun.h
+++ b/criu/include/tun.h
diff --git a/include/unix_diag.h b/criu/include/unix_diag.h
index 3f2468330..3f2468330 100644
--- a/include/unix_diag.h
+++ b/criu/include/unix_diag.h
diff --git a/include/util-pie.h b/criu/include/util-pie.h
index cbaed4224..cbaed4224 100644
--- a/include/util-pie.h
+++ b/criu/include/util-pie.h
diff --git a/include/util-vdso.h b/criu/include/util-vdso.h
index c8dfa054f..c8dfa054f 100644
--- a/include/util-vdso.h
+++ b/criu/include/util-vdso.h
diff --git a/include/util.h b/criu/include/util.h
index a64782783..a64782783 100644
--- a/include/util.h
+++ b/criu/include/util.h
diff --git a/include/uts_ns.h b/criu/include/uts_ns.h
index ab054ffe8..ab054ffe8 100644
--- a/include/uts_ns.h
+++ b/criu/include/uts_ns.h
diff --git a/include/vdso.h b/criu/include/vdso.h
index ea6bfabbf..ea6bfabbf 100644
--- a/include/vdso.h
+++ b/criu/include/vdso.h
diff --git a/include/vma.h b/criu/include/vma.h
index 6c2813661..6c2813661 100644
--- a/include/vma.h
+++ b/criu/include/vma.h
diff --git a/include/xmalloc.h b/criu/include/xmalloc.h
index e5ce279fa..e5ce279fa 100644
--- a/include/xmalloc.h
+++ b/criu/include/xmalloc.h
diff --git a/ipc_ns.c b/criu/ipc_ns.c
index 9abb40311..9abb40311 100644
--- a/ipc_ns.c
+++ b/criu/ipc_ns.c
diff --git a/irmap.c b/criu/irmap.c
index 81d245c3e..81d245c3e 100644
--- a/irmap.c
+++ b/criu/irmap.c
diff --git a/kcmp-ids.c b/criu/kcmp-ids.c
index 853879fe0..853879fe0 100644
--- a/kcmp-ids.c
+++ b/criu/kcmp-ids.c
diff --git a/kerndat.c b/criu/kerndat.c
index eb296033e..eb296033e 100644
--- a/kerndat.c
+++ b/criu/kerndat.c
diff --git a/libnetlink.c b/criu/libnetlink.c
index 49c804fd7..49c804fd7 100644
--- a/libnetlink.c
+++ b/criu/libnetlink.c
diff --git a/log.c b/criu/log.c
index 1435401ab..1435401ab 100644
--- a/log.c
+++ b/criu/log.c
diff --git a/lsm.c b/criu/lsm.c
index 158caf073..158caf073 100644
--- a/lsm.c
+++ b/criu/lsm.c
diff --git a/mem.c b/criu/mem.c
index 332f1928b..332f1928b 100644
--- a/mem.c
+++ b/criu/mem.c
diff --git a/mount.c b/criu/mount.c
index 05cf6cf0a..05cf6cf0a 100644
--- a/mount.c
+++ b/criu/mount.c
diff --git a/namespaces.c b/criu/namespaces.c
index 9a7836bca..9a7836bca 100644
--- a/namespaces.c
+++ b/criu/namespaces.c
diff --git a/net.c b/criu/net.c
index 9f62cd0c6..9f62cd0c6 100644
--- a/net.c
+++ b/criu/net.c
diff --git a/netfilter.c b/criu/netfilter.c
index 95e18aa97..95e18aa97 100644
--- a/netfilter.c
+++ b/criu/netfilter.c
diff --git a/page-pipe.c b/criu/page-pipe.c
index db58f6a59..db58f6a59 100644
--- a/page-pipe.c
+++ b/criu/page-pipe.c
diff --git a/page-read.c b/criu/page-read.c
index 28ecd5bdb..28ecd5bdb 100644
--- a/page-read.c
+++ b/criu/page-read.c
diff --git a/page-xfer.c b/criu/page-xfer.c
index eee8f5f17..eee8f5f17 100644
--- a/page-xfer.c
+++ b/criu/page-xfer.c
diff --git a/pagemap-cache.c b/criu/pagemap-cache.c
index c2e467b67..c2e467b67 100644
--- a/pagemap-cache.c
+++ b/criu/pagemap-cache.c
diff --git a/parasite-syscall.c b/criu/parasite-syscall.c
index feb77b53b..feb77b53b 100644
--- a/parasite-syscall.c
+++ b/criu/parasite-syscall.c
diff --git a/criu/pie-util-fd.c b/criu/pie-util-fd.c
new file mode 120000
index 000000000..4af261ede
--- /dev/null
+++ b/criu/pie-util-fd.c
@@ -0,0 +1 @@
+pie/util-fd.c \ No newline at end of file
diff --git a/criu/pie-util-vdso.c b/criu/pie-util-vdso.c
new file mode 120000
index 000000000..6e56238c2
--- /dev/null
+++ b/criu/pie-util-vdso.c
@@ -0,0 +1 @@
+pie/util-vdso.c \ No newline at end of file
diff --git a/criu/pie-util.c b/criu/pie-util.c
new file mode 120000
index 000000000..238f297c8
--- /dev/null
+++ b/criu/pie-util.c
@@ -0,0 +1 @@
+pie/util.c \ No newline at end of file
diff --git a/pie/Makefile b/criu/pie/Makefile
index fd48da92e..5197e1b2d 100644
--- a/pie/Makefile
+++ b/criu/pie/Makefile
@@ -1,38 +1,13 @@
-targets += parasite
-targets += restorer
-
-# used by obj-x to identify shared files built for parasite/restorer binaries
-xsuffix := -pie-build
-
-obj-y += log-simple.o
-obj-x += util.o
-obj-x += util-fd.o
-
-ifeq ($(VDSO),y)
-obj-x += util-vdso.o
-obj-y += parasite-vdso.o
-obj-e += $(ARCH_DIR)/vdso-pie.o
-ifeq ($(SRCARCH),aarch64)
-asm-e += $(ARCH_DIR)/intraprocedure.o
-endif
-ifeq ($(SRCARCH), ppc64)
-asm-e += $(ARCH_DIR)/vdso-trampoline.o
-endif
-endif
-
-ifeq ($(SRCARCH), ppc64)
-asm-e += $(ARCH_DIR)/memcpy_power7.o
-asm-e += $(ARCH_DIR)/memcmp_64.o
-asm-e += $(ARCH_DIR)/misc.o
-endif
+target += parasite
+target += restorer
parasite-obj-y += parasite.o
-parasite-asm-e += $(ARCH_DIR)/parasite-head.o
-parasite-libs-e += $(SYSCALL-LIB)
+parasite-obj-y += ./$(ARCH_DIR)/parasite-head.o
+parasite-obj-e += ./$(ARCH_DIR)/syscalls.built-in.o
restorer-obj-y += restorer.o
-restorer-obj-e += $(ARCH_DIR)/restorer.o
-restorer-libs-e += $(SYSCALL-LIB)
+restorer-obj-y += ./$(ARCH_DIR)/restorer.o
+restorer-obj-e += ./$(ARCH_DIR)/syscalls.built-in.o
#
# We can't provide proper mount implementation
@@ -40,20 +15,21 @@ restorer-libs-e += $(SYSCALL-LIB)
# applications, which is not the target of the
# project.
#
-CFLAGS := $(filter-out -pg,$(CFLAGS)) -iquote pie/piegen
+CFLAGS := $(filter-out -pg,$(CFLAGS)) -iquote pie/piegen -iquote arch/$(ARCH)/include -iquote $(SRC_DIR) -iquote $(SRC_DIR)/criu/include
-ifneq ($(filter-out i386 ia32, $(ARCH)),)
-cflags-y += -DCR_NOGLIBC -fpie -Wa,--noexecstack -fno-stack-protector
+ifneq ($(filter-out ia32,$(ARCH)),)
+ ccflags-y += -DCR_NOGLIBC -fpie -Wa,--noexecstack -fno-stack-protector
else
-cflags-y += -DCR_NOGLIBC -fno-pic -Wa,--noexecstack -fno-stack-protector
+ ccflags-y += -DCR_NOGLIBC -fno-pic -Wa,--noexecstack -fno-stack-protector
endif
-ifeq ($(SRCARCH), arm)
- cflags-y += -marm
+ifeq ($(SRCARCH),arm)
+ ccflags-y += -marm
endif
-ASMFLAGS += -D__ASSEMBLY__
-GEN-OFFSETS := ../scripts/gen-offsets.sh
+asflags-y += -D__ASSEMBLY__
+
+GEN-OFFSETS := $(obj)/../../scripts/gen-offsets.sh
BLOBS := $(obj)/parasite-blob.h $(obj)/restorer-blob.h
PIELDS := pie.lds.S
@@ -61,24 +37,23 @@ PIELDS := pie.lds.S
.SECONDARY:
ifeq ($(piegen-y),y)
-ldflags-y += -r
target-name = $(patsubst pie/%-blob.h,%,$(1))
ifeq ($(SRCARCH),ppc64)
$(obj)/$(PIELDS): $(obj)/pie-reloc.lds.S.in
- $(E) " GEN " $@
+ $(call msg-gen, $@)
$(Q) echo "OUTPUT_ARCH($(LDARCH))" > $(obj)/$(PIELDS)
$(Q) cat $< >> $(obj)/$(PIELDS)
else
ifeq ($(ARCH),x86)
$(obj)/$(PIELDS): $(obj)/pie-reloc.lds.S.in
- $(E) " GEN " $@
+ $(call msg-gen, $@)
$(Q) echo "OUTPUT_ARCH(i386:x86-64)" > $(obj)/$(PIELDS)
$(Q) echo "TARGET(elf64-x86-64)" >> $(obj)/$(PIELDS)
$(Q) cat $< >> $(obj)/$(PIELDS)
else # i386 ia32
$(obj)/$(PIELDS): $(obj)/pie-reloc.lds.S.in
- $(E) " GEN " $@
+ $(call msg-gen, $@)
$(Q) echo "OUTPUT_ARCH(i386)" > $(obj)/$(PIELDS)
$(Q) echo "TARGET(elf32-i386)" >> $(obj)/$(PIELDS)
$(Q) cat $< >> $(obj)/$(PIELDS)
@@ -86,47 +61,43 @@ endif
endif
ifeq ($(strip $(V)),)
-piegen_stdout = >/dev/null
+ piegen_stdout := >/dev/null
endif
-$(obj)/%.built-in.bin.o: $(obj)/%.built-in.o $(obj)/$(PIELDS)
- $(E) " GEN " $@
- $(Q) $(LD) $(ldflags-y) -T $(obj)/$(PIELDS) -o $@ $<
+$(obj)/%.built-in.bin.o: $(obj)/%.built-in.o $(obj)/lib.a $(obj)/$(PIELDS)
+ $(call msg-gen, $@)
+ $(Q) $(LD) -r -T $(obj)/$(PIELDS) -o $@ $< $(obj)/lib.a
$(obj)/%-blob.h: $(obj)/%.built-in.bin.o $(obj)/$(PIELDS) pie/piegen
- $(E) " GEN " $@
+ $(call msg-gen, $@)
$(Q) pie/piegen/piegen -f $< -v $(call target-name,$@)_relocs -p $(call target-name,$@)_blob_offset__ -s $(call target-name,$@)_blob -o $@ $(piegen_stdout)
else
$(obj)/$(PIELDS): $(obj)/$(PIELDS).in
- $(E) " GEN " $@
+ $(call msg-gen, $@)
$(Q) $(SH) -c "echo 'OUTPUT_ARCH($(LDARCH))' > $(obj)/$(PIELDS)"
$(Q) $(SH) -c "cat $(obj)/$(PIELDS).in >> $(obj)/$(PIELDS)"
$(obj)/%.built-in.bin.o: $(obj)/%.built-in.o $(obj)/$(PIELDS)
- $(E) " GEN " $@
- $(Q) $(LD) $(ldflags-y) -T $(obj)/$(PIELDS) -o $@ $<
+ $(call msg-gen, $@)
+ $(Q) $(LD) -r -T $(obj)/$(PIELDS) -o $@ $<
$(obj)/%.built-in.bin: $(obj)/%.built-in.bin.o
- $(E) " GEN " $@
+ $(call msg-gen, $@)
$(Q) $(OBJCOPY) -O binary $^ $@
-$(obj)/%-blob.h: $(obj)/%.built-in.bin $(obj)/$(GEN-OFFSETS)
- $(E) " GEN " $@
- $(Q) $(SH) $(obj)/$(GEN-OFFSETS) $(@:-blob.h=) $(notdir $(@:-blob.h=)) $(CROSS_COMPILE) > $@
+$(obj)/%-blob.h: $(obj)/%.built-in.bin $(GEN-OFFSETS)
+ $(call msg-gen, $@)
+ $(Q) $(SH) $(GEN-OFFSETS) $(@:-blob.h=) $(notdir $(@:-blob.h=)) $(CROSS_COMPILE) > $@
endif
$(BLOBS): $(obj)/$(PIELDS)
-_all += $(BLOBS)
+all-y += $(BLOBS)
cleanup-y += $(obj)/$(PIELDS)
cleanup-y += $(obj)/*.bin
cleanup-y += $(BLOBS)
cleanup-y += $(obj)/*.built-in.bin.o
cleanup-y += $(obj)/*.built-in.bin
-
-ifneq ($(MAKECMDGOALS),clean)
-incdeps := y
-endif
diff --git a/criu/pie/Makefile.library b/criu/pie/Makefile.library
new file mode 100644
index 000000000..b96d2f05b
--- /dev/null
+++ b/criu/pie/Makefile.library
@@ -0,0 +1,43 @@
+lib-y += log-simple.o
+lib-y += util-fd.o
+lib-y += util.o
+
+ifeq ($(VDSO),y)
+ lib-y += util-vdso.o
+ lib-y += parasite-vdso.o
+ lib-y += ./$(ARCH_DIR)/vdso-pie.o
+
+ ifeq ($(SRCARCH),aarch64)
+ lib-y += ./$(ARCH_DIR)/intraprocedure.o
+ endif
+
+ ifeq ($(SRCARCH),ppc64)
+ lib-y += ./$(ARCH_DIR)/vdso-trampoline.o
+ endif
+endif
+
+ifeq ($(SRCARCH),ppc64)
+ lib-y += ./$(ARCH_DIR)/memcpy_power7.o
+ lib-y += ./$(ARCH_DIR)/memcmp_64.o
+ lib-y += ./$(ARCH_DIR)/misc.o
+endif
+
+#
+# We can't provide proper mount implementation
+# in parasite code -- it requires run-time rellocation
+# applications, which is not the target of the
+# project.
+#
+iquotes := -iquote pie/piegen -iquote arch/$(ARCH)/include -iquote $(SRC_DIR) -iquote $(SRC_DIR)/criu/include
+ccflags-y := $(filter-out -pg,$(CFLAGS)) $(iquotes)
+asflags-y := -D__ASSEMBLY__ $(iquotes)
+
+ifeq ($(SRCARCH),arm)
+ ccflags-y += -marm
+endif
+
+ifneq ($(filter-out ia32,$(ARCH)),)
+ ccflags-y += -DCR_NOGLIBC -fpie -Wa,--noexecstack -fno-stack-protector
+else
+ ccflags-y += -DCR_NOGLIBC -fno-pic -Wa,--noexecstack -fno-stack-protector
+endif
diff --git a/pie/log-simple.c b/criu/pie/log-simple.c
index 1cc877d28..1cc877d28 100644
--- a/pie/log-simple.c
+++ b/criu/pie/log-simple.c
diff --git a/pie/parasite-vdso.c b/criu/pie/parasite-vdso.c
index 9ee42e528..9ee42e528 100644
--- a/pie/parasite-vdso.c
+++ b/criu/pie/parasite-vdso.c
diff --git a/pie/parasite.c b/criu/pie/parasite.c
index 7b1e324c0..7b1e324c0 100644
--- a/pie/parasite.c
+++ b/criu/pie/parasite.c
diff --git a/pie/pie-reloc.lds.S.in b/criu/pie/pie-reloc.lds.S.in
index 051d1d427..051d1d427 100644
--- a/pie/pie-reloc.lds.S.in
+++ b/criu/pie/pie-reloc.lds.S.in
diff --git a/pie/pie-relocs.c b/criu/pie/pie-relocs.c
index 7e825b232..7e825b232 100644
--- a/pie/pie-relocs.c
+++ b/criu/pie/pie-relocs.c
diff --git a/pie/pie-relocs.h b/criu/pie/pie-relocs.h
index 1449ca630..1449ca630 100644
--- a/pie/pie-relocs.h
+++ b/criu/pie/pie-relocs.h
diff --git a/pie/pie.lds.S.in b/criu/pie/pie.lds.S.in
index 9e9c97f00..9e9c97f00 100644
--- a/pie/pie.lds.S.in
+++ b/criu/pie/pie.lds.S.in
diff --git a/pie/piegen/Makefile b/criu/pie/piegen/Makefile
index 5c3d68b84..5c3d68b84 100644
--- a/pie/piegen/Makefile
+++ b/criu/pie/piegen/Makefile
diff --git a/pie/piegen/elf-ppc64.c b/criu/pie/piegen/elf-ppc64.c
index 472725f9f..472725f9f 100644
--- a/pie/piegen/elf-ppc64.c
+++ b/criu/pie/piegen/elf-ppc64.c
diff --git a/pie/piegen/elf-x86-32.c b/criu/pie/piegen/elf-x86-32.c
index 413113ef3..413113ef3 100644
--- a/pie/piegen/elf-x86-32.c
+++ b/criu/pie/piegen/elf-x86-32.c
diff --git a/pie/piegen/elf-x86-64.c b/criu/pie/piegen/elf-x86-64.c
index 8ba26672b..8ba26672b 100644
--- a/pie/piegen/elf-x86-64.c
+++ b/criu/pie/piegen/elf-x86-64.c
diff --git a/pie/piegen/elf.c b/criu/pie/piegen/elf.c
index c6b97257b..c6b97257b 100644
--- a/pie/piegen/elf.c
+++ b/criu/pie/piegen/elf.c
diff --git a/pie/piegen/main.c b/criu/pie/piegen/main.c
index d3ad82333..d3ad82333 100644
--- a/pie/piegen/main.c
+++ b/criu/pie/piegen/main.c
diff --git a/pie/piegen/piegen.h b/criu/pie/piegen/piegen.h
index 8488c0abb..8488c0abb 100644
--- a/pie/piegen/piegen.h
+++ b/criu/pie/piegen/piegen.h
diff --git a/pie/piegen/uapi/types.h b/criu/pie/piegen/uapi/types.h
index 34696e8c6..34696e8c6 100644
--- a/pie/piegen/uapi/types.h
+++ b/criu/pie/piegen/uapi/types.h
diff --git a/pie/restorer.c b/criu/pie/restorer.c
index 8cec7f9c4..8cec7f9c4 100644
--- a/pie/restorer.c
+++ b/criu/pie/restorer.c
diff --git a/pie/util-fd.c b/criu/pie/util-fd.c
index d90fd12b2..d90fd12b2 100644
--- a/pie/util-fd.c
+++ b/criu/pie/util-fd.c
diff --git a/pie/util-vdso.c b/criu/pie/util-vdso.c
index e93b110fe..e93b110fe 100644
--- a/pie/util-vdso.c
+++ b/criu/pie/util-vdso.c
diff --git a/pie/util.c b/criu/pie/util.c
index 354667294..354667294 100644
--- a/pie/util.c
+++ b/criu/pie/util.c
diff --git a/pipes.c b/criu/pipes.c
index a15521278..a15521278 100644
--- a/pipes.c
+++ b/criu/pipes.c
diff --git a/plugin.c b/criu/plugin.c
index f764ae7d3..f764ae7d3 100644
--- a/plugin.c
+++ b/criu/plugin.c
diff --git a/proc_parse.c b/criu/proc_parse.c
index c7c577554..c7c577554 100644
--- a/proc_parse.c
+++ b/criu/proc_parse.c
diff --git a/protobuf-desc.c b/criu/protobuf-desc.c
index c80ebb794..c80ebb794 100644
--- a/protobuf-desc.c
+++ b/criu/protobuf-desc.c
diff --git a/protobuf.c b/criu/protobuf.c
index ae003da44..ae003da44 100644
--- a/protobuf.c
+++ b/criu/protobuf.c
diff --git a/pstree.c b/criu/pstree.c
index 06bc5f84b..06bc5f84b 100644
--- a/pstree.c
+++ b/criu/pstree.c
diff --git a/ptrace.c b/criu/ptrace.c
index 25970fc4e..25970fc4e 100644
--- a/ptrace.c
+++ b/criu/ptrace.c
diff --git a/rbtree.c b/criu/rbtree.c
index 64a38ea76..64a38ea76 100644
--- a/rbtree.c
+++ b/criu/rbtree.c
diff --git a/rst-malloc.c b/criu/rst-malloc.c
index d39499729..d39499729 100644
--- a/rst-malloc.c
+++ b/criu/rst-malloc.c
diff --git a/seccomp.c b/criu/seccomp.c
index 9fd545d67..9fd545d67 100644
--- a/seccomp.c
+++ b/criu/seccomp.c
diff --git a/seize.c b/criu/seize.c
index 7d1f77c46..7d1f77c46 100644
--- a/seize.c
+++ b/criu/seize.c
diff --git a/shmem.c b/criu/shmem.c
index ad3cdbbde..ad3cdbbde 100644
--- a/shmem.c
+++ b/criu/shmem.c
diff --git a/sigframe.c b/criu/sigframe.c
index 448749320..448749320 100644
--- a/sigframe.c
+++ b/criu/sigframe.c
diff --git a/signalfd.c b/criu/signalfd.c
index 6d686d44c..6d686d44c 100644
--- a/signalfd.c
+++ b/criu/signalfd.c
diff --git a/sk-inet.c b/criu/sk-inet.c
index 4d1110767..4d1110767 100644
--- a/sk-inet.c
+++ b/criu/sk-inet.c
diff --git a/sk-netlink.c b/criu/sk-netlink.c
index a98b26dc8..a98b26dc8 100644
--- a/sk-netlink.c
+++ b/criu/sk-netlink.c
diff --git a/sk-packet.c b/criu/sk-packet.c
index a296dfa16..a296dfa16 100644
--- a/sk-packet.c
+++ b/criu/sk-packet.c
diff --git a/sk-queue.c b/criu/sk-queue.c
index 6a39c4b35..6a39c4b35 100644
--- a/sk-queue.c
+++ b/criu/sk-queue.c
diff --git a/sk-tcp.c b/criu/sk-tcp.c
index f653446a3..f653446a3 100644
--- a/sk-tcp.c
+++ b/criu/sk-tcp.c
diff --git a/sk-unix.c b/criu/sk-unix.c
index 608eb3eb3..608eb3eb3 100644
--- a/sk-unix.c
+++ b/criu/sk-unix.c
diff --git a/sockets.c b/criu/sockets.c
index d8d09aae2..d8d09aae2 100644
--- a/sockets.c
+++ b/criu/sockets.c
diff --git a/stats.c b/criu/stats.c
index 2a80bb31b..2a80bb31b 100644
--- a/stats.c
+++ b/criu/stats.c
diff --git a/string.c b/criu/string.c
index 543c64291..543c64291 100644
--- a/string.c
+++ b/criu/string.c
diff --git a/sysctl.c b/criu/sysctl.c
index 21ae4cef1..21ae4cef1 100644
--- a/sysctl.c
+++ b/criu/sysctl.c
diff --git a/sysfs_parse.c b/criu/sysfs_parse.c
index 6497d5349..6497d5349 100644
--- a/sysfs_parse.c
+++ b/criu/sysfs_parse.c
diff --git a/timerfd.c b/criu/timerfd.c
index 019de69ef..019de69ef 100644
--- a/timerfd.c
+++ b/criu/timerfd.c
diff --git a/tty.c b/criu/tty.c
index ef82583dd..ef82583dd 100644
--- a/tty.c
+++ b/criu/tty.c
diff --git a/tun.c b/criu/tun.c
index dcee704e4..dcee704e4 100644
--- a/tun.c
+++ b/criu/tun.c
diff --git a/util.c b/criu/util.c
index 00c327396..00c327396 100644
--- a/util.c
+++ b/criu/util.c
diff --git a/uts_ns.c b/criu/uts_ns.c
index ed64d77ec..ed64d77ec 100644
--- a/uts_ns.c
+++ b/criu/uts_ns.c
diff --git a/vdso.c b/criu/vdso.c
index bccf11cc1..bccf11cc1 100644
--- a/vdso.c
+++ b/criu/vdso.c
diff --git a/crtools b/crtools
deleted file mode 120000
index 33c504fed..000000000
--- a/crtools
+++ /dev/null
@@ -1 +0,0 @@
-criu \ No newline at end of file
diff --git a/images/Makefile b/images/Makefile
index 12089a219..16ecb6ab5 100644
--- a/images/Makefile
+++ b/images/Makefile
@@ -59,7 +59,7 @@ proto-obj-y += seccomp.o
proto-obj-y += binfmt-misc.o
proto-obj-y += time.o
-CFLAGS += -I$(obj)/
+CFLAGS += -iquote $(obj)/
#
# Generates a set of names from protobuf "import" directive.
@@ -101,8 +101,6 @@ $(obj)/built-in.o: $(addprefix $(obj)/,$(proto-obj-y))
$(E) " LINK " $@
$(Q) $(LD) $(ldflags-y) -r -o $@ $^
-_all += $(obj)/built-in.o
-
ifneq ($(MAKECMDGOALS),clean)
-include $(addprefix $(obj)/,$(proto-obj-y:.o=.pb-c.d))
endif
@@ -112,4 +110,3 @@ cleanup-y += $(obj)/google/protobuf/*.d
cleanup-y += $(obj)/google/protobuf/*.h
cleanup-y += $(obj)/google/protobuf/*.c
cleanup-y += $(obj)/google/protobuf/*.o
-cleanup-y += $(obj)/*.d $(obj)/*.i $(obj)/*.s $(obj)/*.o
diff --git a/lib/Makefile b/lib/Makefile
index f07e07b90..d1b045059 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -15,11 +15,11 @@ c/built-in.o:
$(call msg-gen, $@)
$(Q) $(MAKE) $(build)=c all
-ccflags-so += $(CFLAGS) -rdynamic -Wl,-soname,$(lib-so).so.$(VERSION_SO_MAJOR)
+cflags-so += $(CFLAGS) -rdynamic -Wl,-soname,$(lib-so).so.$(VERSION_SO_MAJOR)
ldflags-so += -lprotobuf-c
c/$(CRIU_SO): c/built-in.o
$(call msg-link, $@)
- $(Q) $(CC) -shared $(ccflags-so) -o $@ $^ $(ldflags-so) $(LDFLAGS)
+ $(Q) $(CC) -shared $(cflags-so) -o $@ $^ $(ldflags-so) $(LDFLAGS)
lib-c: c/$(CRIU_SO)
PHONY += lib-c
@@ -40,3 +40,5 @@ clean:
all: $(PHONY)
@true
PHONY += all
+
+.PHONY: $(PHONY) clean
diff --git a/lib/c/Makefile b/lib/c/Makefile
index 16b4ef194..21bf85614 100644
--- a/lib/c/Makefile
+++ b/lib/c/Makefile
@@ -1,13 +1,7 @@
obj-y += criu.o
obj-y += $(SRC_DIR)/images/rpc.pb-c.o
-ccflags-y += -iquote $(SRC_DIR)/crtools/$(ARCH_DIR)/include
-ccflags-y += -iquote $(SRC_DIR)/crtools/include -iquote $(obj)/..
+ccflags-y += -iquote $(SRC_DIR)/criu/$(ARCH_DIR)/include
+ccflags-y += -iquote $(SRC_DIR)/criu/include -iquote $(obj)/..
ccflags-y += -iquote $(SRC_DIR)/images
ccflags-y += -fPIC -Wa,--noexecstack -fno-stack-protector
-
-#
-# Remove once criu moved into proper place.
-ccflags-y += -iquote $(SRC_DIR)/$(ARCH_DIR)/include
-ccflags-y += -iquote $(SRC_DIR)/include -iquote $(obj)/..
-ccflags-y += -iquote $(SRC_DIR)/images
diff --git a/lib/py/Makefile b/lib/py/Makefile
index 135fe1c01..582cc93de 100644
--- a/lib/py/Makefile
+++ b/lib/py/Makefile
@@ -8,7 +8,7 @@ images:
# rpc_pb2.py doesn't depend on any other file, so
# it is safe to rename it, dropping ugly _pb2 suffix.
rpc.py:
- $(Q) protoc -I=$(SRC_DIR)/protobuf/ --python_out=./ $(SRC_DIR)/protobuf/$(@:.py=.proto)
+ $(Q) protoc -I=$(SRC_DIR)/images/ --python_out=./ $(SRC_DIR)/images/$(@:.py=.proto)
$(Q) mv $(@:.py=_pb2.py) $@
clean:
diff --git a/lib/py/images/Makefile b/lib/py/images/Makefile
index 98a450065..c8a748e5c 100644
--- a/lib/py/images/Makefile
+++ b/lib/py/images/Makefile
@@ -1,22 +1,21 @@
-all: pb.py protobuf magic.py
+all: pb.py images magic.py
-.PHONY: all protobuf clean pb.py
+.PHONY: all images clean pb.py
-proto := $(filter-out $(SRC_DIR)/protobuf/rpc.proto, $(sort $(wildcard $(SRC_DIR)/protobuf/*.proto)))
+proto := $(filter-out $(SRC_DIR)/images/rpc.proto, $(sort $(wildcard $(SRC_DIR)/images/*.proto)))
proto-py-modules := $(foreach m,$(proto),$(subst -,_,$(notdir $(m:.proto=_pb2))))
-# We don't need rpc_pb2.py here, as it is not related to the
-# images.
+# We don't need rpc_pb2.py here, as it is not related to the images.
# Unfortunately, we can't drop ugly _pb2 suffixes here, because
# some _pb2 files depend on others _pb2 files.
-protobuf:
- $(Q) protoc -I=$(SRC_DIR)/protobuf -I=/usr/include/ --python_out=./ $(proto)
+images:
+ $(Q) protoc -I=$(SRC_DIR)/images -I=/usr/include/ --python_out=./ $(proto)
-magic.py: $(SRC_DIR)/scripts/magic-gen.py $(SRC_DIR)/include/magic.h
- $(E) " GEN " $@
+magic.py: $(SRC_DIR)/scripts/magic-gen.py $(SRC_DIR)/criu/include/magic.h
+ $(call msg-gen, $@)
$(Q) python $^ $@
-pb.py: protobuf
+pb.py: images
$(Q) echo "# Autogenerated. Do not edit!" > $@
$(Q) for m in $(proto-py-modules); do \
echo "from $$m import *" >> $@ ;\
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
deleted file mode 100644
index ee0b80006..000000000
--- a/scripts/Makefile.build
+++ /dev/null
@@ -1,251 +0,0 @@
-##
-## General helpers for simplified Makefiles.
-##
-MAKEFLAGS := -r -R --no-print-directory
-
-targets :=
-deps :=
-deps-after :=
-all-objs :=
-incdeps :=
-_all :=
-_cleanup-y :=
-
-include scripts/Makefile.rules
-include $(obj)/$(makefile)
-
-##
-## Append targets to be auto-cleanuped
-define add-cleanup-obj-c-by-name
-_cleanup-y+= $(1).o
-_cleanup-y+= $(1).i
-_cleanup-y+= $(1).d
-_cleanup-y+= $(1).s
-endef
-
-define add-cleanup-obj-S-by-name
-_cleanup-y+= $(1).o
-_cleanup-y+= $(1).d
-_cleanup-y+= $(1).i
-endef
-
-##
-##
-## Generate a bundle of rules for C files
-define gen-target-c-bundle
-$(eval $(call gen-rule-o-from-c-by-name,$(1),$(2),$(3)))
-$(eval $(call gen-rule-i-from-c-by-name,$(1),$(2),$(3)))
-$(eval $(call gen-rule-d-from-c-by-name,$(1),$(2),$(3)))
-$(eval $(call gen-rule-s-from-c-by-name,$(1),$(2),$(3)))
-$(eval $(call add-cleanup-obj-c-by-name,$(1)))
-endef
-
-##
-##
-## Generate a bundle of rules for S files
-define gen-target-S-bundle
-$(eval $(call gen-rule-o-from-S-by-name,$(1),$(2),$(3)))
-$(eval $(call gen-rule-d-from-S-by-name,$(1),$(2),$(3)))
-$(eval $(call gen-rule-i-from-S-by-name,$(1),$(2),$(3)))
-$(eval $(call add-cleanup-obj-S-by-name,$(1)))
-endef
-
-##
-##
-## Shared or standalone targets
-ifneq ($(obj-y),)
-obj-y := $(addprefix $(obj)/, $(obj-y))
-$(foreach file, \
- $(obj-y), \
- $(eval \
- $(call gen-target-c-bundle, \
- $(file:.o=),$(file:.o=))))
-all-objs += $(obj-y)
-deps += $(obj-y:.o=.d)
-endif
-
-ifneq ($(obj-x),)
-obj-x := $(addprefix $(obj)/, $(obj-x))
-obj-x := $(addsuffix $(xsuffix).o, $(obj-x:.o=))
-$(foreach file, \
- $(obj-x), \
- $(eval \
- $(call gen-target-c-bundle, \
- $(file:$(xsuffix).o=),$(file:.o=))))
-all-objs += $(obj-x)
-deps += $(obj-x:.o=.d)
-cleanup-y += $(obj-x) $(obj-x:.o=.d)
-endif
-
-ifneq ($(obj-e),)
-$(foreach file, \
- $(obj-e), \
- $(eval \
- $(call gen-target-c-bundle, \
- $(file:.o=),$(file:.o=))))
-all-objs += $(obj-e)
-deps += $(obj-e:.o=.d)
-endif
-
-ifneq ($(asm-y),)
-asm-y := $(addprefix $(obj)/, $(asm-y))
-$(foreach file, \
- $(asm-y), \
- $(eval \
- $(call gen-target-S-bundle, \
- $(file:.o=),$(file:.o=))))
-all-objs += $(asm-y)
-deps += $(asm-y:.o=.d)
-endif
-
-ifneq ($(asm-e),)
-$(foreach file, \
- $(asm-e), \
- $(eval \
- $(call gen-target-S-bundle, \
- $(file:.o=),$(file:.o=))))
-all-objs += $(asm-e)
-deps += $(asm-e:.o=.d)
-endif
-
-##
-##
-## Standalone files where sources are kept in external
-## directories. Usually needed when same source files
-## are compiled with different flags.
-ifneq ($(obj-ext-src-y),)
-__obj-ext-src-y := $(addprefix $(obj)/, $(notdir $(obj-ext-src-y)))
-$(foreach file, \
- $(obj-ext-src-y), \
- $(eval \
- $(call gen-target-c-bundle, \
- $(file:.o=), \
- $(addprefix $(obj)/,$(notdir $(file:.o=))))))
-all-objs += $(__obj-ext-src-y)
-deps += $(__obj-ext-src-y:.o=.d)
-cleanup-y += $(__obj-ext-src-y) $(__obj-ext-src-y:.o=.d)
-endif
-
-##
-##
-## Generate rules for a target
-define gen-target-rules
-
-$(1)-all-objs :=
-
-ifneq ($($(1)-obj-y),)
- $(foreach file, \
- $($(1)-obj-y), \
- $(eval \
- $(call gen-target-c-bundle, \
- $(obj)/$(file:.o=), \
- $(obj)/$(file:.o=), \
- $($(1)-obj-y-cflags))))
- $(1)-all-objs += $$(addprefix $(obj)/, $($(1)-obj-y))
- deps += $$(addprefix $(obj)/, $($(1)-obj-y:.o=.d))
-endif
-
-ifneq ($($(1)-obj-e),)
- $(foreach file, \
- $($(1)-obj-e), \
- $(eval \
- $(call gen-target-c-bundle, \
- $(file:.o=), \
- $(file:.o=), \
- $($(1)-obj-e-cflags))))
- $(1)-all-objs += $$($(1)-obj-e)
- deps += $$($(1)-obj-e:.o=.d)
-endif
-
-ifneq ($($(1)-asm-y),)
- $(foreach file, \
- $($(1)-asm-y), \
- $(eval \
- $(call gen-target-S-bundle, \
- $(obj)/$(file:.o=), \
- $(obj)/$(file:.o=), \
- $($(1)-asm-y-asmflags))))
- $(1)-all-objs += $$(addprefix $(obj)/, $($(1)-asm-y))
- deps += $$($(1)-asm-y:.o=.d)
-endif
-
-ifneq ($($(1)-asm-e),)
- $(foreach file, \
- $($(1)-asm-e), \
- $(eval \
- $(call gen-target-S-bundle, \
- $(file:.o=), \
- $(file:.o=), \
- $($(1)-asm-e-asmflags))))
- $(1)-all-objs += $$($(1)-asm-e)
- deps += $$($(1)-asm-e:.o=.d)
-endif
-
-$(1)-all-objs += $(all-objs)
-
-$$(obj)/$(1).built-in.o: $$($(1)-all-objs) $$($(1)-libs-e) $(libs-e)
- $$(E) " LINK " $$@
- $$(Q) $$(LD) $$(ldflags-y) -r -o $$@ $$^
-
-_all += $$(obj)/$(1).built-in.o
-cleanup-y += $$(obj)/$(1).built-in.o
-endef
-
-##
-##
-## Walk over all targets and generate rules they require
-$(foreach target, \
- $(targets), \
- $(eval \
- $(call gen-target-rules,$(target))))
-
-##
-##
-## No targets -- just builtin default one
-ifeq ($(targets),)
-ifneq ($(all-objs),)
-$(obj)/built-in.o: $(all-objs) $(libs-e)
- $(E) " LINK " $@
- $(Q) $(LD) $(ldflags-y) -r -o $@ $^
-
-_all += $(obj)/built-in.o
-cleanup-y += $(obj)/built-in.o
-endif
-endif
-
-##
-## A rule for building library.
-ifneq ($(lib-so),)
-$(obj)/$(lib-so).so: $(all-objs) $(libs-e)
- $(E) " LINK " $@
- $(Q) $(CC) -shared $(cflags-so) -o $@ $^ $(ldflags-so) $(LDFLAGS)
-
-_all += $(obj)/$(lib-so).so
-cleanup-y += $(obj)/$(lib-so).so
-endif
-
-##
-##
-## Include deps if requested
-ifneq ($(incdeps),)
-ifneq ($(deps-after),)
-$(deps): | $(deps-after)
-endif
--include $(deps)
-endif
-
-##
-##
-## Autocomplete cleanups
-cleanup-y += $(_cleanup-y)
-
-##
-## Predefined .PHONY targets
-.PHONY: all clean
-
-all: $(_all)
- @true
-
-clean:
- $(E) " CLEANUP " $(obj)
- $(Q) $(RM) $(cleanup-y)
diff --git a/scripts/Makefile.rules b/scripts/Makefile.rules
deleted file mode 100644
index 229131091..000000000
--- a/scripts/Makefile.rules
+++ /dev/null
@@ -1,52 +0,0 @@
-##
-##
-## These are per-file generators.
-##
-define gen-rule-o-from-c-by-name
-$(2).o: $(1).c
- $$(E) " CC " $$@
- $$(Q) $$(CC) -c $$(CFLAGS) $$(cflags-y) $(3) $$< -o $$@
-endef
-
-define gen-rule-i-from-c-by-name
-$(2).i: $(1).c
- $$(E) " CC " $$@
- $$(Q) $$(CC) -E $$(CFLAGS) $$(cflags-y) $(3) $$< -o $$@
-endef
-
-define gen-rule-s-from-c-by-name
-$(2).s: $(1).c
- $$(E) " CC " $$@
- $$(Q) $$(CC) -S $$(CFLAGS) $$(cflags-y) $(3) -fverbose-asm $$< -o $$@
-endef
-
-define gen-rule-o-from-S-by-name
-$(2).o: $(1).S
- $$(E) " CC " $$@
- $$(Q) $$(CC) -c $$(CFLAGS) $$(cflags-y) $(3) $$(ASMFLAGS) $(4) $$< -o $$@
-endef
-
-define gen-rule-d-from-c-by-name
-$(2).d: $(1).c
- $$(E) " DEP " $$@
- $$(Q) $$(CC) -M -MT $$@ -MT $$(patsubst %.d,%.o,$$@) $$(CFLAGS) $$(cflags-y) $(3) $$< -o $$@
-endef
-
-define gen-rule-d-from-S-by-name
-$(2).d: $(1).S
- $$(E) " DEP " $$@
- $$(Q) $$(CC) -M -MT $$@ -MT $$(patsubst %.d,%.o,$$@) $$(CFLAGS) $$(cflags-y) $(3) $$< -o $$@
-endef
-
-define gen-rule-i-from-S-by-name
-$(2).i: $(1).S
- $$(E) " CC " $$@
- $$(Q) $$(CC) -E $$(CFLAGS) $$(cflags-y) $(3) $$< -o $$@
-endef
-
-##
-## In case if someone add last resort rule
-## together with .SUFFIXES not cleaned, this
-## will slow down the build procedure
-scripts/Makefile.rules::
- @true