criu/Makefile.config
Dmitry Safonov de53191179 criu/vdso: Purge CONFIG_VDSO
Vigorously remove the config ifdef.
The config option *never* had any excuse to exist:
- for x86 we were grand
- for ppc64/arm64 patches to support mremap() on vdso were long ago
accepted, but regardless - it's not possible to disable CONFIG_VDSO for
those platforms in kernel
- for s390 - patches were mainstreamed not that long ago, but it's not
possible to disable the kernel config
- for arm32 it's possible to disable the kernel config, but kernel
returns to userspace historically through sigpage, not vdso.
That's the only platform that criu disallows to have CONFIG_VDSO=y in
kernel, but that's just meaningles. A kernel patch for sigpage mremap()
has gone into v4.13: commit 280e87e98c09 ("ARM: 8683/1: ARM32: Support
mremap() for sigpage/vDSO").

So, removing the config was long-lived item on my TODO list that bligted
arm32 users and made changes to vdso more complex by all "needed"
iffdeferry. Get rid of it with fire.

Fixes: #446

Signed-off-by: Dmitry Safonov <dima@arista.com>
2019-09-07 15:59:52 +03:00

63 lines
2 KiB
Text

include $(__nmk_dir)utils.mk
include $(__nmk_dir)msg.mk
include scripts/feature-tests.mak
ifeq ($(call try-cc,$(FEATURE_TEST_LIBBSD_DEV),-lbsd),true)
LIBS_FEATURES += -lbsd
FEATURE_DEFINES += -DCONFIG_HAS_LIBBSD
else
$(info Note: Building without setproctitle() and strlcpy() support.)
$(info $(info) To enable these features, please install libbsd-devel (RPM) / libbsd-dev (DEB).)
endif
ifeq ($(call pkg-config-check,libselinux),y)
LIBS_FEATURES += -lselinux
FEATURE_DEFINES += -DCONFIG_HAS_SELINUX
endif
export LIBS += $(LIBS_FEATURES)
CONFIG_FILE = .config
$(CONFIG_FILE):
touch $(CONFIG_FILE)
ifeq ($(SRCARCH),x86)
# CONFIG_COMPAT is only for x86 now, no need for compile-test other archs
ifeq ($(call try-asm,$(FEATURE_TEST_X86_COMPAT)),true)
export CONFIG_COMPAT := y
FEATURE_DEFINES += -DCONFIG_COMPAT
else
$(info Note: Building without ia32 C/R, missed ia32 support in gcc)
$(info $(info) That may be related to missing gcc-multilib in your)
$(info $(info) distribution or you may have Debian with buggy toolchain)
$(info $(info) (issue https://github.com/xemul/criu/issues/315))
endif
endif
export DEFINES += $(FEATURE_DEFINES)
export CFLAGS += $(FEATURE_DEFINES)
FEATURES_LIST := TCP_REPAIR STRLCPY STRLCAT PTRACE_PEEKSIGINFO \
SETPROCTITLE_INIT MEMFD TCP_REPAIR_WINDOW
# $1 - config name
define gen-feature-test
ifeq ($$(call try-cc,$$(FEATURE_TEST_$(1)),$$(LIBS_FEATURES),$$(DEFINES)),true)
$(Q) echo '#define CONFIG_HAS_$(1)' >> $$@
$(Q) echo '' >> $$@
endif
endef
define config-header-rule
$(CONFIG_HEADER): scripts/feature-tests.mak $(CONFIG_FILE)
$(call msg-gen, $$@)
$(Q) echo '#ifndef __CR_CONFIG_H__' > $$@
$(Q) echo '#define __CR_CONFIG_H__' >> $$@
$(Q) echo '' >> $$@
$(call map,gen-feature-test,$(FEATURES_LIST))
$(Q) cat $(CONFIG_FILE) | sed -n -e '/^[^#]/s/^/#define CONFIG_/p' >> $$@
$(Q) echo '#endif /* __CR_CONFIG_H__ */' >> $$@
endef
$(eval $(config-header-rule))