[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH 3/3] lib/posix-crypt: Adapt imported musl code to Unikraft


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Tue, 26 Nov 2019 00:37:21 +0200
  • Delivery-date: Mon, 25 Nov 2019 22:37:38 +0000
  • Ironport-sdr: YNiy0jCoD8w4//n0cHHwxY+Z0IQvWT7MljLDJy2svYtbOODe1uRnNM39u+veMLeiwQqfUeD32E 8vk1Xs0LZU5w==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

The only thing worth mentioning here is that we tried to keep the changes to a
minimum. That is why we use the C preprocessor in order to disable the 'hidden'
musl qualifier.

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 lib/posix-crypt/Makefile.uk                   | 19 +++++++++++++++++++
 .../musl-imported/src/crypt/crypt_r.c         |  2 +-
 .../musl-imported/src/include/crypt.h         |  2 +-
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/lib/posix-crypt/Makefile.uk b/lib/posix-crypt/Makefile.uk
index 3ac8b855..8539195c 100644
--- a/lib/posix-crypt/Makefile.uk
+++ b/lib/posix-crypt/Makefile.uk
@@ -1 +1,20 @@
 $(eval $(call addlib_s,libposix_crypt,$(CONFIG_LIBPOSIX_CRYPT)))
+
+LIBPOSIX_CRYPT_GLOBAL_INCLUDES-y     += -I$(LIBPOSIX_CRYPT_BASE)/include
+CINCLUDES-$(CONFIG_LIBPOSIX_CRYPT)   += $(LIBPOSIX_CRYPT_GLOBAL_INCLUDES-y)
+CXXINCLUDES-$(CONFIG_LIBPOSIX_CRYPT) += $(LIBPOSIX_CRYPT_GLOBAL_INCLUDES-y)
+
+LIBPOSIX_CRYPT_CINCLUDES-y += 
-I$(LIBPOSIX_CRYPT_BASE)/musl-imported/src/include
+
+LIBPOSIX_CRYPT_SUPPRESS_FLAGS-y   += -Wno-missing-braces -Wno-sign-compare
+LIBPOSIX_CRYPT_CFLAGS-y           += $(LIBPOSIX_CRYPT_SUPPRESS_FLAGS-y)
+LIBPOSIX_CRYPT_CFLAGS-y           += -Dhidden=
+
+LIBPOSIX_CRYPT_SRCS-y += 
$(LIBPOSIX_CRYPT_BASE)/musl-imported/src/crypt/crypt_blowfish.c
+LIBPOSIX_CRYPT_SRCS-y += $(LIBPOSIX_CRYPT_BASE)/musl-imported/src/crypt/crypt.c
+LIBPOSIX_CRYPT_SRCS-y += 
$(LIBPOSIX_CRYPT_BASE)/musl-imported/src/crypt/crypt_des.c
+LIBPOSIX_CRYPT_SRCS-y += 
$(LIBPOSIX_CRYPT_BASE)/musl-imported/src/crypt/crypt_md5.c
+LIBPOSIX_CRYPT_SRCS-y += 
$(LIBPOSIX_CRYPT_BASE)/musl-imported/src/crypt/crypt_r.c
+LIBPOSIX_CRYPT_SRCS-y += 
$(LIBPOSIX_CRYPT_BASE)/musl-imported/src/crypt/crypt_sha256.c
+LIBPOSIX_CRYPT_SRCS-y += 
$(LIBPOSIX_CRYPT_BASE)/musl-imported/src/crypt/crypt_sha512.c
+LIBPOSIX_CRYPT_SRCS-y += 
$(LIBPOSIX_CRYPT_BASE)/musl-imported/src/crypt/encrypt.c
diff --git a/lib/posix-crypt/musl-imported/src/crypt/crypt_r.c 
b/lib/posix-crypt/musl-imported/src/crypt/crypt_r.c
index db6015e2..fdc3b0c4 100644
--- a/lib/posix-crypt/musl-imported/src/crypt/crypt_r.c
+++ b/lib/posix-crypt/musl-imported/src/crypt/crypt_r.c
@@ -20,4 +20,4 @@ char *__crypt_r(const char *key, const char *salt, struct 
crypt_data *data)
        return __crypt_des(key, salt, output);
 }
 
-weak_alias(__crypt_r, crypt_r);
+/* TODO weak_alias(__crypt_r, crypt_r); */
diff --git a/lib/posix-crypt/musl-imported/src/include/crypt.h 
b/lib/posix-crypt/musl-imported/src/include/crypt.h
index f6c63095..c3dad717 100644
--- a/lib/posix-crypt/musl-imported/src/include/crypt.h
+++ b/lib/posix-crypt/musl-imported/src/include/crypt.h
@@ -3,7 +3,7 @@
 
 #include "../../include/crypt.h"
 
-#include <features.h>
+/* TODO #include <features.h> */
 
 hidden char *__crypt_r(const char *, const char *, struct crypt_data *);
 
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.