[4/6] criu: Remove CONFIG_HAS_LIBBSD

Submitted by Dmitry Safonov on Nov. 23, 2019, 11:46 p.m.

Details

Message ID 20191123234627.483372-5-dima@arista.com
State New
Series "criu: dlopen() optional libraries"
Headers show

Commit Message

Dmitry Safonov Nov. 23, 2019, 11:46 p.m.
Moving libbsd.so from compile-time linkage to optional libraries.
Remove all not needed anymore compile feature tests.

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

Patch hide | download patch | download mbox

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)             \