• Kir Kolyshkin's avatar
    criu/pie/Makefile: simplify and fix · 37904cc9
    Kir Kolyshkin authored
    The way criu/pie/Makefile is currently written, ld is run twice:
    
     1. link $(NAME-obj-y) objects to NAME.built-in.o
    
     2. link NAME.built-in.o, pie.lib.a, and compel plugins
        to NAME.built-in.bin.o (with compel ldflags and linker script)
    
    There is absolutely no need for such two-stage linking, but it was OK.
    It is not OK now, as "compel ldflags" for ARM doesn't need -r, and we
    can't run the first stage with -r and the second stage without it.
    
    So, let's simplify linking using a single ld invocation. This is my
    third attempt in doing it, I think I nailed it this time -- it is now
    clean and (relatively) simple.
    
    While at it:
     - fix compel linker script dependency (it was not working);
     - rearrange the Makefile so variables goes first, then rules;
     - remove a comment about mount implementation in restorer.
    
    NOTE that compel is called with ./ prefix so the file paths it prints
    are also prefixed with ./, which is needed for objectify macro to ignore
    those.
    Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
    Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
    Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
    37904cc9
Makefile 1.26 KB