<div dir="ltr">If I checkout your branch locally and try to build (e.g. make -C scripts/travis alpine or make -C scripts/build alpine), I end up with a ton of errors. Am I missing a step somewhere?</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jun 29, 2016 at 8:36 PM Andrew Vagin &lt;<a href="mailto:avagin@virtuozzo.com">avagin@virtuozzo.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Here is my five cents <a href="https://github.com/avagin/criu/commits/alpine" rel="noreferrer" target="_blank">https://github.com/avagin/criu/commits/alpine</a><br>
<br>
<a href="https://travis-ci.org/avagin/criu/jobs/141226345" rel="noreferrer" target="_blank">https://travis-ci.org/avagin/criu/jobs/141226345</a><br>
<br>
On Tue, Jun 28, 2016 at 03:10:32PM +0200, Adrian Reber wrote:<br>
&gt; From: Adrian Reber &lt;<a href="mailto:areber@redhat.com" target="_blank">areber@redhat.com</a>&gt;<br>
&gt;<br>
&gt; It seems that the different libc (musl) which Alpine Linux uses produces<br>
&gt; different errors than the usual glibc. This patch fixes most include<br>
&gt; errors. Two errors are not yet resolved on Alpine Linux&#39;s libc (musl):<br>
&gt;<br>
&gt;  * proc_parse.c: In function &#39;parse_posix_timers&#39;:<br>
&gt;    proc_parse.c:2125:34: error: &#39;SIGEV_THREAD_ID&#39; undeclared (first use in this function)<br>
&gt;         timer-&gt;spt.it_sigev_notify = SIGEV_THREAD_ID;<br>
&gt;<br>
&gt;    proc_parse.c:2125:34: note: each undeclared identifier is reported only once for each function it appears in<br>
&gt;<br>
&gt;    Seems difficult to fix as including &lt;linux/signal.h&gt;, which provides<br>
&gt;    this #define, generates more different error messages related to<br>
&gt;    time.h and linux/time.h collisions. It is not yet clear if additional<br>
&gt;    guards would help in the header files.<br>
&gt;<br>
&gt;  * fsnotify.c: In function &#39;open_by_handle&#39;:<br>
&gt;    fsnotify.c:107:9: error: implicit declaration of function &#39;open_by_handle_at&#39; [-Werror=implicit-function-declaration]<br>
&gt;      return open_by_handle_at(fd, arg, O_PATH);<br>
&gt;<br>
&gt;    The function open_by_handle_at() is not provided by Alpine Linux&#39;s<br>
&gt;    libc (musl).<br>
&gt;<br>
&gt; This patch resolves the following errors/warnings and has been tested on<br>
&gt; RHEL7(x86_64/powerpc64le) and Fedora 24:<br>
&gt;<br>
&gt; cr-service.c: In function &#39;cr_service&#39;:<br>
&gt; cr-service.c:1082:26: error: passing argument 2 of &#39;accept&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>
&gt;    sk = accept(server_fd, &amp;client_addr, &amp;client_addr_len);<br>
&gt;                         ^<br>
&gt; In file included from /usr/include/fortify/sys/socket.h:20:0,<br>
&gt;                  from cr-service.c:11:<br>
&gt; /usr/include/sys/socket.h:301:5: note: expected &#39;struct sockaddr * restrict&#39; but argument is of type &#39;struct sockaddr_un *&#39;<br>
&gt;  int accept (int, struct sockaddr *__restrict, socklen_t *__restrict);<br>
&gt;      ^<br>
&gt; cc1: all warnings being treated as errors<br>
&gt;<br>
&gt; files.c: In function &#39;open_transport_fd&#39;:<br>
&gt; files.c:845:19: error: passing argument 2 of &#39;bind&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>
&gt;   ret = bind(sock, &amp;saddr, sun_len);<br>
&gt;                    ^<br>
&gt; In file included from /usr/include/fortify/sys/socket.h:20:0,<br>
&gt;                  from files.c:12:<br>
&gt; /usr/include/sys/socket.h:298:5: note: expected &#39;const struct sockaddr *&#39; but argument is of type &#39;struct sockaddr_un *&#39;<br>
&gt;  int bind (int, const struct sockaddr *, socklen_t);<br>
&gt;      ^<br>
&gt; cc1: all warnings being treated as errors<br>
&gt;<br>
&gt; In file included from fsnotify.c:18:0:<br>
&gt; /usr/include/sys/poll.h:1:2: error: #warning redirecting incorrect #include &lt;sys/poll.h&gt; to &lt;poll.h&gt; [-Werror=cpp]<br>
&gt;  #warning redirecting incorrect #include &lt;sys/poll.h&gt; to &lt;poll.h&gt;<br>
&gt;   ^<br>
&gt; cc1: all warnings being treated as errors<br>
&gt;<br>
&gt; In file included from /root/criu/criu/include/timerfd.h:7:0,<br>
&gt;                  from /root/criu/criu/include/restorer.h:18,<br>
&gt;                  from arch/x86/crtools.c:16:<br>
&gt; /root/criu/criu/include/files.h:43:14: error: field &#39;stat&#39; has incomplete type<br>
&gt;   struct stat stat;<br>
&gt;<br>
&gt; In file included from arch/x86/vdso-pie.c:6:0:<br>
&gt; /root/criu/criu/include/syscall.h:22:66: error: unknown type name &#39;loff_t&#39;<br>
&gt;  extern long sys_pread (unsigned int fd, char *buf, size_t count, loff_t pos) ;<br>
&gt;                                                                   ^<br>
&gt; /root/criu/criu/include/syscall.h:83:31: error: unknown type name &#39;clockid_t&#39;<br>
&gt;  extern long sys_timer_create (clockid_t which_clock, struct sigevent *timer_event_spec, kernel_timer_t *created_timer_id<br>
&gt;                                ^<br>
&gt; /root/criu/criu/include/syscall.h:88:38: error: unknown type name &#39;clockid_t&#39;<br>
&gt;  extern long sys_clock_gettime (const clockid_t which_clock, const struct timespec *tp) ;<br>
&gt;                                       ^<br>
&gt;<br>
&gt; In file included from netfilter.c:5:0:<br>
&gt; /usr/include/wait.h:1:2: error: #warning redirecting incorrect #include &lt;wait.h&gt; to &lt;sys/wait.h&gt; [-Werror=cpp]<br>
&gt;  #warning redirecting incorrect #include &lt;wait.h&gt; to &lt;sys/wait.h&gt;<br>
&gt;   ^<br>
&gt; cc1: all warnings being treated as errors<br>
&gt;<br>
&gt; pie/restorer.c: In function &#39;__export_restore_task&#39;:<br>
&gt; pie/restorer.c:1276:23: error: &#39;LOCK_EX&#39; undeclared (first use in this function)<br>
&gt;    ret = sys_flock(fd, LOCK_EX);<br>
&gt;                        ^<br>
&gt; pie/restorer.c:1276:23: note: each undeclared identifier is reported only once for each function it appears in<br>
&gt; pie/restorer.c:1310:23: error: &#39;LOCK_UN&#39; undeclared (first use in this function)<br>
&gt;    ret = sys_flock(fd, LOCK_UN);<br>
&gt;                        ^<br>
&gt;<br>
&gt; sk-unix.c: In function &#39;open_unixsk_standalone&#39;:<br>
&gt; sk-unix.c:1169:19: error: passing argument 2 of &#39;connect&#39; from incompatible pointer type [-Werror=incompatible-pointer-types]<br>
&gt;    if (connect(sk, &amp;addr, sizeof(addr.sun_family))) {<br>
&gt;                    ^<br>
&gt; In file included from /usr/include/fortify/sys/socket.h:20:0,<br>
&gt;                  from sk-unix.c:1:<br>
&gt; /usr/include/sys/socket.h:299:5: note: expected &#39;const struct sockaddr *&#39; but argument is of type &#39;struct sockaddr_un *&#39;<br>
&gt;  int connect (int, const struct sockaddr *, socklen_t);<br>
&gt;      ^<br>
&gt; cc1: all warnings being treated as errors<br>
&gt;<br>
&gt; c/criu.c: In function &#39;criu_local_set_parent_images&#39;:<br>
&gt; c/criu.c:169:26: error: implicit declaration of function &#39;strdup&#39; [-Werror=implicit-function-declaration]<br>
&gt;   opts-&gt;rpc-&gt;parent_img = strdup(path);<br>
&gt;<br>
&gt; Signed-off-by: Adrian Reber &lt;<a href="mailto:areber@redhat.com" target="_blank">areber@redhat.com</a>&gt;<br>
&gt; ---<br>
&gt;  criu/cr-service.c            | 2 +-<br>
&gt;  criu/files.c                 | 2 +-<br>
&gt;  criu/fsnotify.c              | 2 +-<br>
&gt;  criu/include/files.h         | 2 ++<br>
&gt;  criu/include/syscall-types.h | 2 ++<br>
&gt;  criu/netfilter.c             | 2 +-<br>
&gt;  criu/pie/restorer.c          | 1 +<br>
&gt;  criu/sk-unix.c               | 2 +-<br>
&gt;  lib/c/criu.c                 | 1 +<br>
&gt;  9 files changed, 11 insertions(+), 5 deletions(-)<br>
&gt;<br>
&gt; diff --git a/criu/cr-service.c b/criu/cr-service.c<br>
&gt; index 64ab8b7..797d704 100644<br>
&gt; --- a/criu/cr-service.c<br>
&gt; +++ b/criu/cr-service.c<br>
&gt; @@ -1103,7 +1103,7 @@ int cr_service(bool daemon_mode)<br>
&gt;<br>
&gt;               pr_info(&quot;Waiting for connection...\n&quot;);<br>
&gt;<br>
&gt; -             sk = accept(server_fd, &amp;client_addr, &amp;client_addr_len);<br>
&gt; +             sk = accept(server_fd, (struct sockaddr *)&amp;client_addr, &amp;client_addr_len);<br>
&gt;               if (sk == -1) {<br>
&gt;                       pr_perror(&quot;Can&#39;t accept connection&quot;);<br>
&gt;                       goto err;<br>
&gt; diff --git a/criu/files.c b/criu/files.c<br>
&gt; index 719d0be..54d087c 100644<br>
&gt; --- a/criu/files.c<br>
&gt; +++ b/criu/files.c<br>
&gt; @@ -910,7 +910,7 @@ static int open_transport_fd(int pid, struct fdinfo_list_entry *fle)<br>
&gt;               pr_perror(&quot;Can&#39;t create socket&quot;);<br>
&gt;               return -1;<br>
&gt;       }<br>
&gt; -     ret = bind(sock, &amp;saddr, sun_len);<br>
&gt; +     ret = bind(sock, (struct sockaddr *)&amp;saddr, sun_len);<br>
&gt;       if (ret &lt; 0) {<br>
&gt;               pr_perror(&quot;Can&#39;t bind unix socket %s&quot;, saddr.sun_path + 1);<br>
&gt;               goto err;<br>
&gt; diff --git a/criu/fsnotify.c b/criu/fsnotify.c<br>
&gt; index 4035506..aafffae 100644<br>
&gt; --- a/criu/fsnotify.c<br>
&gt; +++ b/criu/fsnotify.c<br>
&gt; @@ -15,7 +15,7 @@<br>
&gt;  #include &lt;sys/vfs.h&gt;<br>
&gt;  #include &lt;linux/magic.h&gt;<br>
&gt;  #include &lt;sys/wait.h&gt;<br>
&gt; -#include &lt;sys/poll.h&gt;<br>
&gt; +#include &lt;poll.h&gt;<br>
&gt;  #include &lt;sys/mman.h&gt;<br>
&gt;  #include &lt;sys/mount.h&gt;<br>
&gt;  #include &lt;aio.h&gt;<br>
&gt; diff --git a/criu/include/files.h b/criu/include/files.h<br>
&gt; index 5e3d6dc..e0b853d 100644<br>
&gt; --- a/criu/include/files.h<br>
&gt; +++ b/criu/include/files.h<br>
&gt; @@ -1,6 +1,8 @@<br>
&gt;  #ifndef __CR_FILES_H__<br>
&gt;  #define __CR_FILES_H__<br>
&gt;<br>
&gt; +#include &lt;sys/stat.h&gt;<br>
&gt; +<br>
&gt;  #include &quot;compiler.h&quot;<br>
&gt;  #include &quot;asm/types.h&quot;<br>
&gt;  #include &quot;fcntl.h&quot;<br>
&gt; diff --git a/criu/include/syscall-types.h b/criu/include/syscall-types.h<br>
&gt; index 49798fa..db0dbc0 100644<br>
&gt; --- a/criu/include/syscall-types.h<br>
&gt; +++ b/criu/include/syscall-types.h<br>
&gt; @@ -11,6 +11,8 @@<br>
&gt;  #include &lt;sys/time.h&gt;<br>
&gt;  #include &lt;arpa/inet.h&gt;<br>
&gt;  #include &lt;sched.h&gt;<br>
&gt; +#include &lt;time.h&gt;<br>
&gt; +#include &lt;fcntl.h&gt;<br>
&gt;<br>
&gt;  #include &quot;asm/types.h&quot;<br>
&gt;<br>
&gt; diff --git a/criu/netfilter.c b/criu/netfilter.c<br>
&gt; index a105ed7..000f167 100644<br>
&gt; --- a/criu/netfilter.c<br>
&gt; +++ b/criu/netfilter.c<br>
&gt; @@ -2,7 +2,7 @@<br>
&gt;  #include &lt;arpa/inet.h&gt;<br>
&gt;  #include &lt;unistd.h&gt;<br>
&gt;  #include &lt;string.h&gt;<br>
&gt; -#include &lt;wait.h&gt;<br>
&gt; +#include &lt;sys/wait.h&gt;<br>
&gt;  #include &lt;stdlib.h&gt;<br>
&gt;<br>
&gt;  #include &quot;asm/types.h&quot;<br>
&gt; diff --git a/criu/pie/restorer.c b/criu/pie/restorer.c<br>
&gt; index 5910fd0..0da167f 100644<br>
&gt; --- a/criu/pie/restorer.c<br>
&gt; +++ b/criu/pie/restorer.c<br>
&gt; @@ -6,6 +6,7 @@<br>
&gt;  #include &lt;linux/aio_abi.h&gt;<br>
&gt;  #include &lt;sys/types.h&gt;<br>
&gt;  #include &lt;sys/mman.h&gt;<br>
&gt; +#include &lt;sys/file.h&gt;<br>
&gt;  #include &lt;sys/stat.h&gt;<br>
&gt;  #include &lt;sys/wait.h&gt;<br>
&gt;  #include &lt;sys/time.h&gt;<br>
&gt; diff --git a/criu/sk-unix.c b/criu/sk-unix.c<br>
&gt; index ca6673e..5498718 100644<br>
&gt; --- a/criu/sk-unix.c<br>
&gt; +++ b/criu/sk-unix.c<br>
&gt; @@ -1166,7 +1166,7 @@ static int open_unixsk_standalone(struct unix_sk_info *ui)<br>
&gt;                * The below is hack: we use that connect with AF_UNSPEC<br>
&gt;                * clears socket&#39;s peer.<br>
&gt;                */<br>
&gt; -             if (connect(sk, &amp;addr, sizeof(addr.sun_family))) {<br>
&gt; +             if (connect(sk, (struct sockaddr *)&amp;addr, sizeof(addr.sun_family))) {<br>
&gt;                       pr_perror(&quot;Can&#39;t clear socket&#39;s peer&quot;);<br>
&gt;                       return -1;<br>
&gt;               }<br>
&gt; diff --git a/lib/c/criu.c b/lib/c/criu.c<br>
&gt; index e75268c..5c65d9f 100644<br>
&gt; --- a/lib/c/criu.c<br>
&gt; +++ b/lib/c/criu.c<br>
&gt; @@ -10,6 +10,7 @@<br>
&gt;  #include &lt;stdlib.h&gt;<br>
&gt;  #include &lt;errno.h&gt;<br>
&gt;  #include &lt;signal.h&gt;<br>
&gt; +#include &lt;string.h&gt;<br>
&gt;<br>
&gt;  #include &quot;criu.h&quot;<br>
&gt;  #include &quot;rpc.pb-c.h&quot;<br>
&gt; --<br>
&gt; 2.7.4<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; CRIU mailing list<br>
&gt; <a href="mailto:CRIU@openvz.org" target="_blank">CRIU@openvz.org</a><br>
&gt; <a href="https://lists.openvz.org/mailman/listinfo/criu" rel="noreferrer" target="_blank">https://lists.openvz.org/mailman/listinfo/criu</a><br>
</blockquote></div>