* [PATCH][user-cr] Create libeclone.a
@ 2010-02-06 20:07 Sukadev Bhattiprolu
[not found] ` <20100206200751.GA28083-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Sukadev Bhattiprolu @ 2010-02-06 20:07 UTC (permalink / raw)
To: Oren Laadan; +Cc: Containers
Tested the changes on x86_32 with a stub to simulate the special case for
powerpc below. Appreciate if it could be tested on other architectures
specially powerpc.
Also, can we push genstack.o into libeclone.a to simplify the Makefile ?
thanks,
Sukadev
---
From: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Date: Sat, 6 Feb 2010 10:45:10 -0800
Subject: [PATCH][user-cr] Create libeclone.a
The user-api to the eclone() system call is architecture dependent.
Besides checkpoint/restart code, this api could be used by eclone() test
cases (see cr-tests.git tree) and possibly other users of eclone().
To avoid duplication of the arch dependent code, move the api into
libeclone.a (as suggested by Serge Hallyn).
Signed-off-by: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
---
Makefile | 28 +++++++++++++++++++---------
1 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile
index 35188f9..eb39b1f 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,7 @@ CKPT_HEADERS = include/linux/checkpoint.h \
include/linux/checkpoint_hdr.h \
include/asm/checkpoint_hdr.h
-# detect architecture (for clone_with_pids)
+# detect architecture (for eclone)
SUBARCH = $(patsubst i%86,x86_32,$(shell uname -m))
# compile with debug ?
@@ -19,8 +19,11 @@ CFLAGS += -g $(WARNS) $(CKPT_INCLUDE) $(DEBUG)
# install dir
INSTALL_DIR = /bin
+LIB_INSTALL_DIR = /lib
-PROGS = checkpoint restart ckptinfo nsexeccwp
+ECLONE_PROGS = restart nsexeccwp
+PROGS = checkpoint ckptinfo $(ECLONE_PROGS)
+LIB_ECLONE = libeclone.a
# other cleanup
OTHER = ckptinfo_types.c
@@ -32,21 +35,26 @@ LDLIBS = -lm
all: $(PROGS)
@make -C test
+$(LIB_ECLONE):
+ ar ruv $(LIB_ECLONE) $^
+
# restart needs to be thread-safe
restart: CFLAGS += -D__REENTRANT -pthread
# eclone() is architecture specific
+#
+# TODO: We could push genstack.o also into $(LIB_ECLONE), but it would make
+# the 'genstack()' symbol public and not sure if it will cause problems
+# for other applications.
ifneq ($(SUBARCH),)
-restart: clone_$(SUBARCH).o genstack.o
-restart: CFLAGS += -DARCH_HAS_ECLONE
-nsexeccwp: clone_$(SUBARCH).o genstack.o
-nsexeccwp: CFLAGS += -DARCH_HAS_ECLONE
+$(ECLONE_PROGS): $(LIB_ECLONE) genstack.o
+$(ECLONE_PROGS): CFLAGS += -DARCH_HAS_ECLONE
+$(LIB_ECLONE): clone_$(SUBARCH).o
endif
# on powerpc, need also assembly file
ifeq ($(SUBARCH),ppc)
-restart: clone_$(SUBARCH)_.o
-nsexeccwp: clone_$(SUBARCH)_.o
+$(LIB_ECLONE): clone_$(SUBARCH)_.o
endif
# ckptinfo dependencies
@@ -56,6 +64,8 @@ ckptinfo_types.c: $(CKPT_HEADERS) ckptinfo.py
cat $(CKPT_HEADERS) | ./ckptinfo.py > ckptinfo_types.c
install:
+ @echo /usr/bin/install -m 755 $(LIB_ECLONE) $(LIB_INSTALL_DIR)
+ @/usr/bin/install -m 755 $(LIB_ECLONE) $(LIB_INSTALL_DIR)
@echo /usr/bin/install -m 755 checkpoint restart ckptinfo $(INSTALL_DIR)
@/usr/bin/install -m 755 checkpoint restart ckptinfo $(INSTALL_DIR)
@@ -68,5 +78,5 @@ distclean: clean
@rm -f $(CKPT_HEADERS)
clean:
- @rm -f $(PROGS) $(OTHER) *~ *.o headers.h
+ @rm -f $(PROGS) $(OTHER) $(LIB_ECLONE) *~ *.o headers.h
@make -C test clean
--
1.6.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <20100206200751.GA28083-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH][user-cr] Create libeclone.a [not found] ` <20100206200751.GA28083-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> @ 2010-02-08 1:05 ` Serge E. Hallyn 2010-02-08 16:20 ` Oren Laadan 1 sibling, 0 replies; 3+ messages in thread From: Serge E. Hallyn @ 2010-02-08 1:05 UTC (permalink / raw) To: Sukadev Bhattiprolu; +Cc: Containers Quoting Sukadev Bhattiprolu (sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org): > > Tested the changes on x86_32 with a stub to simulate the special case for > powerpc below. Appreciate if it could be tested on other architectures > specially powerpc. > > Also, can we push genstack.o into libeclone.a to simplify the Makefile ? > > thanks, > > Sukadev > > --- > > From: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> > Date: Sat, 6 Feb 2010 10:45:10 -0800 > Subject: [PATCH][user-cr] Create libeclone.a > > The user-api to the eclone() system call is architecture dependent. > > Besides checkpoint/restart code, this api could be used by eclone() test > cases (see cr-tests.git tree) and possibly other users of eclone(). > > To avoid duplication of the arch dependent code, move the api into > libeclone.a (as suggested by Serge Hallyn). > > Signed-off-by: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> Thanks, Suka, this looks good to me, and will be useful to cr_tests. Acked-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> > --- > Makefile | 28 +++++++++++++++++++--------- > 1 files changed, 19 insertions(+), 9 deletions(-) > > diff --git a/Makefile b/Makefile > index 35188f9..eb39b1f 100644 > --- a/Makefile > +++ b/Makefile > @@ -5,7 +5,7 @@ CKPT_HEADERS = include/linux/checkpoint.h \ > include/linux/checkpoint_hdr.h \ > include/asm/checkpoint_hdr.h > > -# detect architecture (for clone_with_pids) > +# detect architecture (for eclone) > SUBARCH = $(patsubst i%86,x86_32,$(shell uname -m)) > > # compile with debug ? > @@ -19,8 +19,11 @@ CFLAGS += -g $(WARNS) $(CKPT_INCLUDE) $(DEBUG) > > # install dir > INSTALL_DIR = /bin > +LIB_INSTALL_DIR = /lib > > -PROGS = checkpoint restart ckptinfo nsexeccwp > +ECLONE_PROGS = restart nsexeccwp > +PROGS = checkpoint ckptinfo $(ECLONE_PROGS) > +LIB_ECLONE = libeclone.a > > # other cleanup > OTHER = ckptinfo_types.c > @@ -32,21 +35,26 @@ LDLIBS = -lm > all: $(PROGS) > @make -C test > > +$(LIB_ECLONE): > + ar ruv $(LIB_ECLONE) $^ > + > # restart needs to be thread-safe > restart: CFLAGS += -D__REENTRANT -pthread > > # eclone() is architecture specific > +# > +# TODO: We could push genstack.o also into $(LIB_ECLONE), but it would make > +# the 'genstack()' symbol public and not sure if it will cause problems > +# for other applications. > ifneq ($(SUBARCH),) > -restart: clone_$(SUBARCH).o genstack.o > -restart: CFLAGS += -DARCH_HAS_ECLONE > -nsexeccwp: clone_$(SUBARCH).o genstack.o > -nsexeccwp: CFLAGS += -DARCH_HAS_ECLONE > +$(ECLONE_PROGS): $(LIB_ECLONE) genstack.o > +$(ECLONE_PROGS): CFLAGS += -DARCH_HAS_ECLONE > +$(LIB_ECLONE): clone_$(SUBARCH).o > endif > > # on powerpc, need also assembly file > ifeq ($(SUBARCH),ppc) > -restart: clone_$(SUBARCH)_.o > -nsexeccwp: clone_$(SUBARCH)_.o > +$(LIB_ECLONE): clone_$(SUBARCH)_.o > endif > > # ckptinfo dependencies > @@ -56,6 +64,8 @@ ckptinfo_types.c: $(CKPT_HEADERS) ckptinfo.py > cat $(CKPT_HEADERS) | ./ckptinfo.py > ckptinfo_types.c > > install: > + @echo /usr/bin/install -m 755 $(LIB_ECLONE) $(LIB_INSTALL_DIR) > + @/usr/bin/install -m 755 $(LIB_ECLONE) $(LIB_INSTALL_DIR) > @echo /usr/bin/install -m 755 checkpoint restart ckptinfo $(INSTALL_DIR) > @/usr/bin/install -m 755 checkpoint restart ckptinfo $(INSTALL_DIR) > > @@ -68,5 +78,5 @@ distclean: clean > @rm -f $(CKPT_HEADERS) > > clean: > - @rm -f $(PROGS) $(OTHER) *~ *.o headers.h > + @rm -f $(PROGS) $(OTHER) $(LIB_ECLONE) *~ *.o headers.h > @make -C test clean > -- > 1.6.0.4 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH][user-cr] Create libeclone.a [not found] ` <20100206200751.GA28083-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> 2010-02-08 1:05 ` Serge E. Hallyn @ 2010-02-08 16:20 ` Oren Laadan 1 sibling, 0 replies; 3+ messages in thread From: Oren Laadan @ 2010-02-08 16:20 UTC (permalink / raw) To: Sukadev Bhattiprolu; +Cc: Containers Sukadev Bhattiprolu wrote: > Tested the changes on x86_32 with a stub to simulate the special case for > powerpc below. Appreciate if it could be tested on other architectures > specially powerpc. Look good, I'll add it. > > Also, can we push genstack.o into libeclone.a to simplify the Makefile ? That too. Oren. > > thanks, > > Sukadev > > --- > > From: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> > Date: Sat, 6 Feb 2010 10:45:10 -0800 > Subject: [PATCH][user-cr] Create libeclone.a > > The user-api to the eclone() system call is architecture dependent. > > Besides checkpoint/restart code, this api could be used by eclone() test > cases (see cr-tests.git tree) and possibly other users of eclone(). > > To avoid duplication of the arch dependent code, move the api into > libeclone.a (as suggested by Serge Hallyn). > > Signed-off-by: Sukadev Bhattiprolu <sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org> > --- > Makefile | 28 +++++++++++++++++++--------- > 1 files changed, 19 insertions(+), 9 deletions(-) > > diff --git a/Makefile b/Makefile > index 35188f9..eb39b1f 100644 > --- a/Makefile > +++ b/Makefile > @@ -5,7 +5,7 @@ CKPT_HEADERS = include/linux/checkpoint.h \ > include/linux/checkpoint_hdr.h \ > include/asm/checkpoint_hdr.h > > -# detect architecture (for clone_with_pids) > +# detect architecture (for eclone) > SUBARCH = $(patsubst i%86,x86_32,$(shell uname -m)) > > # compile with debug ? > @@ -19,8 +19,11 @@ CFLAGS += -g $(WARNS) $(CKPT_INCLUDE) $(DEBUG) > > # install dir > INSTALL_DIR = /bin > +LIB_INSTALL_DIR = /lib > > -PROGS = checkpoint restart ckptinfo nsexeccwp > +ECLONE_PROGS = restart nsexeccwp > +PROGS = checkpoint ckptinfo $(ECLONE_PROGS) > +LIB_ECLONE = libeclone.a > > # other cleanup > OTHER = ckptinfo_types.c > @@ -32,21 +35,26 @@ LDLIBS = -lm > all: $(PROGS) > @make -C test > > +$(LIB_ECLONE): > + ar ruv $(LIB_ECLONE) $^ > + > # restart needs to be thread-safe > restart: CFLAGS += -D__REENTRANT -pthread > > # eclone() is architecture specific > +# > +# TODO: We could push genstack.o also into $(LIB_ECLONE), but it would make > +# the 'genstack()' symbol public and not sure if it will cause problems > +# for other applications. > ifneq ($(SUBARCH),) > -restart: clone_$(SUBARCH).o genstack.o > -restart: CFLAGS += -DARCH_HAS_ECLONE > -nsexeccwp: clone_$(SUBARCH).o genstack.o > -nsexeccwp: CFLAGS += -DARCH_HAS_ECLONE > +$(ECLONE_PROGS): $(LIB_ECLONE) genstack.o > +$(ECLONE_PROGS): CFLAGS += -DARCH_HAS_ECLONE > +$(LIB_ECLONE): clone_$(SUBARCH).o > endif > > # on powerpc, need also assembly file > ifeq ($(SUBARCH),ppc) > -restart: clone_$(SUBARCH)_.o > -nsexeccwp: clone_$(SUBARCH)_.o > +$(LIB_ECLONE): clone_$(SUBARCH)_.o > endif > > # ckptinfo dependencies > @@ -56,6 +64,8 @@ ckptinfo_types.c: $(CKPT_HEADERS) ckptinfo.py > cat $(CKPT_HEADERS) | ./ckptinfo.py > ckptinfo_types.c > > install: > + @echo /usr/bin/install -m 755 $(LIB_ECLONE) $(LIB_INSTALL_DIR) > + @/usr/bin/install -m 755 $(LIB_ECLONE) $(LIB_INSTALL_DIR) > @echo /usr/bin/install -m 755 checkpoint restart ckptinfo $(INSTALL_DIR) > @/usr/bin/install -m 755 checkpoint restart ckptinfo $(INSTALL_DIR) > > @@ -68,5 +78,5 @@ distclean: clean > @rm -f $(CKPT_HEADERS) > > clean: > - @rm -f $(PROGS) $(OTHER) *~ *.o headers.h > + @rm -f $(PROGS) $(OTHER) $(LIB_ECLONE) *~ *.o headers.h > @make -C test clean ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-02-08 16:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-06 20:07 [PATCH][user-cr] Create libeclone.a Sukadev Bhattiprolu
[not found] ` <20100206200751.GA28083-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-02-08 1:05 ` Serge E. Hallyn
2010-02-08 16:20 ` Oren Laadan
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.