criu/protobuf/Makefile
Laurent Dufour 303b875892 arch/ppc64: Add PowerPC 64 LE support
This patch initiates the ppc64le architecture support in CRIU.

Note that ppc64 (Big Endian) architecture is not yet supported since there
are still several issues to address with this architecture. However, in the
long term, the two architectures should be addressed using the almost the
same code, so sharing the ppc64 directory.

Major ppc64 issues:

Loader is not involved when the parasite code is loaded. So no relocation
is done for the parasite code. As a consequence r2 must be set manually
when entering the parasite code, and GOT is not filled.

Furthermore, the r2 fixup code at the services's global address which has
not been fixed by the loader should not be run. Branching at local address,
as the assembly code does is jumping over it.

On the long term, relocation should be done when loading the parasite code.

We are introducing 2 trampolines for the 2 entry points of the restorer
blob.  These entry points are dealing with r2. These ppc64 specific entry
points are overwritting the standard one in sigreturn_restore() from
cr-restore.c.  Instead of using #ifdef, we may introduce a per arch wrapper
here.

CRIU needs 2 kernel patches to be run powerpc which are not yet upstream:
 - Tracking the vDSO remapping
 - Enabling the kcmp system call on powerpc

Feature not yet supported:
- Altivec registers C/R
- VSX registers C/R
- TM support
- all lot of things I missed..

Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2015-04-30 09:57:49 +03:00

112 lines
3.4 KiB
Makefile

proto-obj-y += stats.o
proto-obj-y += core.o
proto-obj-y += core-x86.o
proto-obj-y += core-arm.o
proto-obj-y += core-aarch64.o
proto-obj-y += core-ppc64.o
proto-obj-y += cpuinfo.o
proto-obj-y += inventory.o
proto-obj-y += fdinfo.o
proto-obj-y += fown.o
proto-obj-y += ns.o
proto-obj-y += regfile.o
proto-obj-y += ghost-file.o
proto-obj-y += fifo.o
proto-obj-y += remap-file-path.o
proto-obj-y += eventfd.o
proto-obj-y += eventpoll.o
proto-obj-y += fh.o
proto-obj-y += fsnotify.o
proto-obj-y += signalfd.o
proto-obj-y += fs.o
proto-obj-y += pstree.o
proto-obj-y += pipe.o
proto-obj-y += tcp-stream.o
proto-obj-y += sk-packet.o
proto-obj-y += mnt.o
proto-obj-y += pipe-data.o
proto-obj-y += sa.o
proto-obj-y += timer.o
proto-obj-y += timerfd.o
proto-obj-y += mm.o
proto-obj-y += sk-opts.o
proto-obj-y += sk-unix.o
proto-obj-y += sk-inet.o
proto-obj-y += tun.o
proto-obj-y += sk-netlink.o
proto-obj-y += packet-sock.o
proto-obj-y += ipc-var.o
proto-obj-y += ipc-desc.o
proto-obj-y += ipc-shm.o
proto-obj-y += ipc-msg.o
proto-obj-y += ipc-sem.o
proto-obj-y += utsns.o
proto-obj-y += creds.o
proto-obj-y += vma.o
proto-obj-y += netdev.o
proto-obj-y += tty.o
proto-obj-y += file-lock.o
proto-obj-y += rlimit.o
proto-obj-y += pagemap.o
proto-obj-y += siginfo.o
proto-obj-y += rpc.o
proto-obj-y += ext-file.o
proto-obj-y += cgroup.o
proto-obj-y += userns.o
proto-obj-y += google/protobuf/descriptor.o # To make protoc-c happy and compile opts.proto
proto-obj-y += opts.o
CFLAGS += -I$(obj)/
#
# Generates a set of names from protobuf "import" directive.
# The names are bare, ie no suffixes.
define gen-proto-dep-names
$(shell grep "^[[:blank:]]*import[[:blank:]]" $(1) | \
sed -e 's/[[:blank:]]*import[[:blank:]]*//' \
-e 's/[\";]//g' \
-e 's/\.proto//g' | \
sort | uniq)
endef
#
# Generates rules needed to compile protobuf files.
define gen-proto-rules
$(obj)/$(1).pb-c.c $(obj)/$(1).pb-c.h: $(obj)/$(1).proto $(addsuffix .pb-c.c,$(addprefix $(obj)/,$(2)))
$$(E) " PBCC " $$@
$$(Q) protoc-c --proto_path=$(obj)/ --c_out=$(obj)/ $$<
ifeq ($(PROTOUFIX),y)
$$(Q) sed -i -e 's/4294967295/0xFFFFFFFF/g' $$@
$$(Q) sed -i -e 's/4294967295/0xFFFFFFFF/g' $$(patsubst %.c,%.h,$$@)
$$(Q) sed -i -e 's/4294967295/0xFFFFFFFF/g' $$(patsubst %.h,%.c,$$@)
endif
$(obj)/$(1).pb-c.d: $(obj)/$(1).pb-c.c $(addsuffix .pb-c.d,$(addprefix $(obj)/,$(2)))
$$(E) " DEP " $$@
$$(Q) $$(CC) -M -MT $$@ -MT $(patsubst %.d,%.o,$$@) $$(CFLAGS) $$< -o $$@
endef
$(foreach file, $(proto-obj-y), \
$(eval $(call gen-proto-rules,$(file:.o=), \
$(call gen-proto-dep-names, \
$(addprefix $(obj)/,$(file:.o=.proto))))))
$(obj)/%.o: $(obj)/%.pb-c.c $(obj)/%.pb-c.h
$(E) " CC " $@
$(Q) $(CC) -c $(CFLAGS) $< -o $@
$(obj)/built-in.o: $(addprefix $(obj)/,$(proto-obj-y))
$(E) " LINK " $@
$(Q) $(LD) $(ldflags-y) -r -o $@ $^
_all += $(obj)/built-in.o
ifneq ($(MAKECMDGOALS),clean)
-include $(addprefix $(obj)/,$(proto-obj-y:.o=.pb-c.d))
endif
cleanup-y += $(obj)/*.c.d $(obj)/*.pb-c.c $(obj)/*.pb-c.h
cleanup-y += $(obj)/google/protobuf/*.d
cleanup-y += $(obj)/google/protobuf/*.h
cleanup-y += $(obj)/google/protobuf/*.c
cleanup-y += $(obj)/google/protobuf/*.o
cleanup-y += $(obj)/*.d $(obj)/*.i $(obj)/*.s $(obj)/*.o