Commit 31d394bc authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Andrei Vagin

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: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Reviewed-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent b6b2290f
...@@ -19,6 +19,14 @@ CONFIG_FILE = $(SRC_DIR)/.config ...@@ -19,6 +19,14 @@ CONFIG_FILE = $(SRC_DIR)/.config
$(CONFIG_FILE): $(CONFIG_FILE):
touch $(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 DEFINES += $(FEATURE_DEFINES)
export CFLAGS += $(FEATURE_DEFINES) export CFLAGS += $(FEATURE_DEFINES)
......
...@@ -88,3 +88,15 @@ int main(int argc, char *argv[], char *envp[]) ...@@ -88,3 +88,15 @@ int main(int argc, char *argv[], char *envp[])
} }
endef 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment