[CRIU] [PATCH 4/6] criu: Remove CONFIG_HAS_LIBBSD

Dmitry Safonov dima at arista.com
Sun Nov 24 02:46:25 MSK 2019


Moving libbsd.so from compile-time linkage to optional libraries.
Remove all not needed anymore compile feature tests.

Signed-off-by: Dmitry Safonov <dima at arista.com>
---
 Makefile.config           | 11 +--------
 scripts/feature-tests.mak | 50 ---------------------------------------
 2 files changed, 1 insertion(+), 60 deletions(-)

diff --git a/Makefile.config b/Makefile.config
index 1e4352b9de2a..56775e77daa4 100644
--- a/Makefile.config
+++ b/Makefile.config
@@ -2,14 +2,6 @@ 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
@@ -46,8 +38,7 @@ endif
 export DEFINES += $(FEATURE_DEFINES)
 export CFLAGS += $(FEATURE_DEFINES)
 
-FEATURES_LIST	:= TCP_REPAIR STRLCPY STRLCAT PTRACE_PEEKSIGINFO \
-	SETPROCTITLE_INIT MEMFD TCP_REPAIR_WINDOW
+FEATURES_LIST	:= TCP_REPAIR PTRACE_PEEKSIGINFO MEMFD TCP_REPAIR_WINDOW
 
 # $1 - config name
 define gen-feature-test
diff --git a/scripts/feature-tests.mak b/scripts/feature-tests.mak
index e39d97bb113e..2915a21591c6 100644
--- a/scripts/feature-tests.mak
+++ b/scripts/feature-tests.mak
@@ -26,43 +26,6 @@ int main(void)
 }
 endef
 
-define FEATURE_TEST_LIBBSD_DEV
-#include <bsd/string.h>
-
-int main(void)
-{
-	return 0;
-}
-endef
-
-define FEATURE_TEST_STRLCPY
-
-#include <string.h>
-
-#ifdef CONFIG_HAS_LIBBSD
-# include <bsd/string.h>
-#endif
-
-int main(void)
-{
-	return strlcpy(NULL, NULL, 0);
-}
-endef
-
-define FEATURE_TEST_STRLCAT
-
-#include <string.h>
-
-#ifdef CONFIG_HAS_LIBBSD
-# include <bsd/string.h>
-#endif
-
-int main(void)
-{
-	return strlcat(NULL, NULL, 0);
-}
-endef
-
 define FEATURE_TEST_PTRACE_PEEKSIGINFO
 
 #include <sys/ptrace.h>
@@ -76,19 +39,6 @@ int main(void)
 
 endef
 
-define FEATURE_TEST_SETPROCTITLE_INIT
-
-#include <bsd/unistd.h>
-
-int main(int argc, char *argv[], char *envp[])
-{
-	setproctitle_init(argc, argv, envp);
-
-	return 0;
-}
-
-endef
-
 define FEATURE_TEST_X86_COMPAT
 #define __ALIGN         .align 4, 0x90
 #define ENTRY(name)             \
-- 
2.24.0



More information about the CRIU mailing list