[PATCH] user-cr: fix powerpc build

Oren Laadan orenl at librato.com
Tue Sep 29 16:33:30 PDT 2009


Applied on ckpt-v18-dev, thanks.

Nathan Lynch wrote:
> Several warnings and a link error in current build on powerpc:
> 
> make SUBARCH=ppc CPPFLAGS=-I$PWD/../linux-2.6.git/usr/include
> cc -g -Wall -Wstrict-prototypes -Wno-trigraphs -I../linux/include -I../linux/arch//include -DCHECKPOINT_DEBUG -D__REENTRANT -pthread -DARCH_HAS_CLONE_WITH_PID -I/home/nathanl/devel/user-cr.git/../linux-2.6.git/usr/include  -c -o clone_ppc.o clone_ppc.c
> clone_ppc.c:28: warning: ‘struct target_pid_set’ declared inside parameter list
> clone_ppc.c:28: warning: its scope is only this definition or declaration, which is probably not what you want
> clone_ppc.c: In function ‘clone_with_pids’:
> clone_ppc.c:35: warning: implicit declaration of function ‘__clone_with_pids’
> clone_ppc.c: At top level:
> clone_ppc.c:29: warning: ‘clone_with_pids’ defined but not used
> cc -g -Wall -Wstrict-prototypes -Wno-trigraphs -I../linux/include -I../linux/arch//include -DCHECKPOINT_DEBUG -D__REENTRANT -pthread -DARCH_HAS_CLONE_WITH_PID -I/home/nathanl/devel/user-cr.git/../linux-2.6.git/usr/include   restart.c clone_ppc.o clone_ppc_.o  -lm -o restart
> /tmp/ccUL0PH0.o: In function `ckpt_fork_child':
> /home/nathanl/devel/user-cr.git/restart.c:1659: undefined reference to `clone_with_pids'
> 
> Declare struct target_pid_set and __clone_with_pids; make
> clone_with_pids extern.
> 
> Signed-off-by: Nathan Lynch <ntl at pobox.com>
> ---
>  clone_ppc.c |   13 ++++++++++++-
>  1 files changed, 12 insertions(+), 1 deletions(-)
> 
> diff --git a/clone_ppc.c b/clone_ppc.c
> index 209f00b..09b51b5 100644
> --- a/clone_ppc.c
> +++ b/clone_ppc.c
> @@ -16,6 +16,17 @@
>  #include <sys/syscall.h>
>  #include <asm/unistd.h>
>  
> +struct target_pid_set;
> +
> +extern int __clone_with_pids(int (*fn)(void *arg),
> +			     void *child_stack ,
> +			     int flags,
> +			     void *arg,
> +			     void *parent_tid,
> +			     void *tls,
> +			     void *child_tid,
> +			     struct target_pid_set *setp);
> +
>  /*
>   * libc doesn't support clone_with_pid() yet...
>   * below is arch-dependent code to use the syscall
> @@ -24,7 +35,7 @@
>  
>  /* (see: http://lkml.indiana.edu/hypermail/linux/kernel/9604.3/0204.html) */
>  
> -static int clone_with_pids(int (*fn)(void *), void *child_stack, int flags,
> +int clone_with_pids(int (*fn)(void *), void *child_stack, int flags,
>  			   struct target_pid_set *target_pids, void *arg)
>  {
>  	void *parent_tid = NULL;


More information about the Containers mailing list