1. 02 Nov, 2016 1 commit
    • 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 38 commits