2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

feature-test: add CONFIG_COMPAT compile option

I'll wrap all compatible code in this CONFIG_COMPAT define.
As I'll wrap also compatible parasite generation in this,
it's also makefile variable, rather than just C define.
The test itself consists of including stubs-32.h, which is
glibc6-i686 presence test and is compiled with -m32 option,
which is test for gcc-multilib.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Cc: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Dmitry Safonov
2016-08-08 15:57:15 +03:00
committed by Andrei Vagin
parent b6b2290f87
commit 31d394bc55
2 changed files with 20 additions and 0 deletions

View File

@@ -19,6 +19,14 @@ CONFIG_FILE = $(SRC_DIR)/.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-cc,$(FEATURE_TEST_X86_COMPAT),-m32),true)
export CONFIG_COMPAT := y
FEATURE_DEFINES += -DCONFIG_COMPAT
endif
endif
export DEFINES += $(FEATURE_DEFINES)
export CFLAGS += $(FEATURE_DEFINES)

View File

@@ -88,3 +88,15 @@ int main(int argc, char *argv[], char *envp[])
}
endef
define FEATURE_TEST_X86_COMPAT
/* Test for glibc-devel.i686 presence */
#include <gnu/stubs-32.h>
int main(int argc, char **argv)
{
return 0;
}
endef