1. 02 Nov, 2016 11 commits
    • Kir Kolyshkin's avatar
      Dockerfile: do make mrproper before build · f571f92b
      Kir Kolyshkin authored
      I just spent some considerable time trying to figure out the source
      of errors like this:
      
      	make -C scripts/build ppc64
      	...
      	  DEP      images/autofs.pb-c.d
      	In file included from images/autofs.pb-c.c:9:0:
      	images/autofs.pb-c.h:7:35: fatal error: protobuf-c/protobuf-c.h:
      	No such	file or directory
      	 #include <protobuf-c/protobuf-c.h>
      					   ^
      	compilation terminated.
      
      It appears that we copy the complete tree to a docker container, and it
      is not cleaned properly before the build. In particular, images/*.pb-c.{c,h}
      are not removed/rebuilt. The problem is not noticeable until version of
      protobuf-c differs between the host and container, and they use different
      include paths (/usr/include/google/protobuf-c/ vs /usr/include/protobuf-c).
      
      As I don't want anyone else to spend so much time figuring this out,
      here is the patch.
      
      travis-ci: success for QEMU+Dockerfile improvements + clang build
      Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
      Acked-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      f571f92b
    • Kir Kolyshkin's avatar
      Dockerfile.alpine: add git and coretuils · d86a3a0e
      Kir Kolyshkin authored
      git is needed as the top-level Makefile calls it. Strictly speaking
      git is not required to build CRIU, but it's better to have it than
      to see some error messages.
      
      coreutils is needed for nproc utility which is called from Dockerfile:
      
      	make -j $(nproc)
      
      Before this patch, it was equivalent to "make -j" (plus an error
      message) which is not the best thing to do.
      
      travis-ci: success for QEMU+Dockerfile improvements + clang build
      Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
      Acked-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      d86a3a0e
    • Tycho Andersen's avatar
      pstree.h: mark dmpi's arg as const · e53d353e
      Tycho Andersen authored
      We'll need this for the next bits and the series, and since dmpi doesn't
      modify this or even use it the structure, it's safe.
      Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      e53d353e
    • Tycho Andersen's avatar
      b24df599
    • Tycho Andersen's avatar
    • Andrei Vagin's avatar
      cr-check: fill up a root task mount namespace · 4d5d46d9
      Andrei Vagin authored
      A root mount namespace list is used to resolve paths to
      unix sockets if they are placed on btrfs.
      
      This patch fixes a crash:
       #0 mount_resolve_path at criu/mount.c:213
       #1 phys_stat_resolve_dev at criu/mount.c:240
       #2 phys_stat_dev_match at criu/mount.c:256
       #3 unix_process_name at criu/sk-unix.c:565
       #4 unix_collect_one at criu/sk-unix.c:620
       #5 unix_receive_one at criu/sk-unix.c:692
       #6 nlmsg_receive at criu/libnetlink.c:45
       #7 do_rtnl_req at criu/libnetlink.c:119
       #8 do_collect_req at criu/sockets.c:610
       #9 collect_sockets at criu/sockets.c:636
      
      travis-ci: success for cr-check: fill up a root task mount namespace
      https://bugzilla.redhat.com/show_bug.cgi?id=1381351Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      4d5d46d9
    • Kir Kolyshkin's avatar
      travis.yml: fix GCOV setting · 0be53ee1
      Kir Kolyshkin authored
      1. GCOV=0 is wrong, it should be left unset (or set to empty value)
      2. GCOV=1 only makes sense for TR_ARCH=local, others are not using it
      Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      0be53ee1
    • Dmitry Safonov's avatar
      criu: get rid of config-base.h · b76b5279
      Dmitry Safonov authored
      It contained definitions for F_{SET,GET}PIPE_SZ, which
      we already have in "fcntl.h" - it's not big, can be included instead.
      Also it has pipe-size specific definitions, which are used only
      in page-pipe.c -- moved them to page-pipe.h.
      
      This will simplify include for config.h from subprojects.
      
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Cc: Pavel Emelyanov <xemul@virtuozzo.com>
      Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
      Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      b76b5279
    • Dmitry Safonov's avatar
      build: generate config.h in the top-make · ab115f7e
      Dmitry Safonov authored
      So, we need CONFIG_HAS_* feature-defines in compel, libsoccr
      tools. Let's move this tests upper.
      
      It also reverts commit 411cde8815a4 ("make, soccr: let CRIU depend on
      libsoccr"), as we don't need -lsoccr to build feature tests now.
      To eliminate any races here, I added $(LIB_FEATURES).
      
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      ab115f7e
    • Dmitry Safonov's avatar
      make: remove implicit rules from top-make · 20231a39
      Dmitry Safonov authored
      Otherwise, on some environments, GNU/Make may try to expand
      implicit rules right in the top Makefile.
      
      Fixes:
      [criu]$ make criu/parasite-syscall.o
      ...
      make -r -R -f /criu/scripts/nmk/scripts/main.mk makefile=Makefile obj=criu criu/parasite-syscall.c
      make[1]: Entering directory `/criu'
      make[1]: Nothing to be done for `criu/parasite-syscall.c'.
      make[1]: Leaving directory `/criu'
      gcc   -O2 -g -Wall -Wformat-security -Werror  -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE   -c -o criu/parasite-syscall.o criu/parasite-syscall.c
      criu/parasite-syscall.c:8:22: fatal error: protobuf.h: No such file or directory
       #include "protobuf.h"
                            ^
      compilation terminated.
      
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      20231a39
    • Dmitry Safonov's avatar
      make: fix CONFIG_HEADER dependency for make criu/%.o · 9b50b9d6
      Dmitry Safonov authored
      Removed `config' target, as it only has $(CONFIG_HEADER) dependency.
      $(VERSION_HEADER) dependency is in top-make for CRIU's files:
      >  criu/%: images/built-in.o compel/compel $(VERSION_HEADER) .FORCE
      Introduced pattern-specific target for CRIU files, so it
      got as dependency pie (and config header as pie's deps).
      As we're building from NMK and including source Makefile from there,
      it adds Makefile dependency - tell GNU/Make, that it's all right,
      up-to-date by introducing Makefile target (otherwise, Makefile
      would fit pattern-specific rule).
      For any PIE's object I just rebuild/regenerate all pie, it may
      be smarter - but we have now Makefile.library and Makefile
      for PIE, so need to know, who should rebuild it.
      
      Fixes:
      [criu]$ make criu/log.o
      make[1]: Entering directory '/home/japdoll/tools/criu'
      make[1]: Leaving directory '/home/japdoll/tools/criu'
      make[1]: Entering directory '/home/japdoll/tools/criu'
      make[1]: 'images/built-in.o' is up to date.
      make[1]: Leaving directory '/home/japdoll/tools/criu'
      make[1]: Entering directory '/home/japdoll/tools/criu'
      make[1]: 'compel/compel' is up to date.
      make[1]: Leaving directory '/home/japdoll/tools/criu'
      make[1]: Entering directory '/home/japdoll/tools/criu'
        DEP      criu/log.d
      In file included from criu/log.c:22:0:
      /home/japdoll/tools/criu/criu/include/string.h:11:20: fatal error: config.h: No such file or directory
       #include "config.h"
                          ^
      compilation terminated.
        CC       criu/log.o
      In file included from criu/log.c:22:0:
      /home/japdoll/tools/criu/criu/include/string.h:11:20: fatal error: config.h: No such file or directory
       #include "config.h"
                          ^
      compilation terminated.
      make[1]: *** [/home/japdoll/tools/criu/scripts/nmk/scripts/build.mk:104: criu/log.o] Error 1
      make[1]: Leaving directory '/home/japdoll/tools/criu'
      make: *** [Makefile:200: criu/log.o] Error 2
      
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      9b50b9d6
  2. 27 Oct, 2016 1 commit
    • Kir Kolyshkin's avatar
      pie: provide own memcpy for x86 · ba7ee44b
      Kir Kolyshkin authored
      When compiling criu with clang, I discovered compilation fails like
      this:
      
          GEN      criu/pie/restorer-blob.h
       restorer_blob: Error (compel/src/lib/handle-elf-host.c:328): Unexpected
       undefined symbol: `memcpy'. External symbol in PIE?
      
      This happens because clang emits a call to memcpy for struct
      initialization (specifically, struct vdso_symtable in vdso_proxify()).
      Naturally, as pie is complied without libc there is no memcpy()
      so "compel piegen" rightfully complains.
      
      There are a number of possible solutions to that:
       1. Write our own vdso_init_symtable() function instead of using =
       2. Use some compiler flags that disables using memcpy
       3. Provide own version of memcpy
      
      Now, (1) looks ugly, (2) I was not able to find such flags. Another
      argument in favor of (3) is we already have implementation of
      builtin_memcpy() optimized for x86.
      
      The only problem is it is not named memcpy(). Using assembler file (.S)
      we can have a function with two names (entry points).
      
      For a similar issue in ppc, see commits 0570dd81 and 1ad78171. Ultimately,
      we should get rid of builtin_mem* names and just use memcpy(), memcmp()
      etc, which in case of non-libc linked objects are to be provided by us.
      
      Cc: Laurent Dufour <ldufour@linux.vnet.ibm.com>
      Cc: Cyrill Gorcunov <gorcunov@openvz.org>
      Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
      Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
      Acked-by: 's avatarLaurent Dufour <ldufour@linux.vnet.ibm.com>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      (cherry picked from commit 214e28089e832d30e381b3780862d3309df17fb8)
      Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
      Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
      ba7ee44b
  3. 24 Oct, 2016 28 commits