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

Re: [Minios-devel] [UNIKRAFT/ZYDIS PATCH 2/3] libzycorec: Core library needed by Zyan libraries



Reviewed-by: Felipe Huici <felipe.huici@xxxxxxxxx>

On Tue, Mar 31, 2020 at 12:07 PM Simon Kuenzer <simon.kuenzer@xxxxxxxxx> wrote:
>
> The ZyCoreC library provides platform independent types and macros
> used by for Zyan libraries. We use this library only to provide the
> data type definitions for libzydis. Since we have a libc (including
> nolibc) in Unikraft, the source files are not required to be
> compiled in our use case. Because libzydis will be the only library
> so far that needs these headers, we hide libzycorec from the menu.
>
> Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
> ---
>  Config.uk                    |  7 ++++++
>  Makefile.uk                  | 35 ++++++++++++++++++++++++++++++
>  include/ZycoreExportConfig.h | 42 ++++++++++++++++++++++++++++++++++++
>  3 files changed, 84 insertions(+)
>  create mode 100644 Config.uk
>  create mode 100644 Makefile.uk
>  create mode 100644 include/ZycoreExportConfig.h
>
> diff --git a/Config.uk b/Config.uk
> new file mode 100644
> index 0000000..508b8f2
> --- /dev/null
> +++ b/Config.uk
> @@ -0,0 +1,7 @@
> +# Invisible library configuration for libzycore-c, the Zyan Core Library for 
> C
> +config LIBZYCOREC
> +       bool
> +       default n
> +       depends on ARCH_X86_32 || ARCH_X86_64
> +       select LIBNOLIBC if !HAVE_LIBC
> +       select LIBUKTIME if !HAVE_LIBC
> diff --git a/Makefile.uk b/Makefile.uk
> new file mode 100644
> index 0000000..caa3d09
> --- /dev/null
> +++ b/Makefile.uk
> @@ -0,0 +1,35 @@
> +# -------------------------------------------------------
> +#  ZycoreC
> +# -------------------------------------------------------
> +
> +$(eval $(call addlib_s,libzycorec,$(CONFIG_LIBZYCOREC)))
> +
> +LIBZYCOREC_COMMIT=482298aecb59072f617fe8c53b91afd252ef1058
> +LIBZYCOREC_URL=https://github.com/zyantific/zycore-c/archive/$(LIBZYCOREC_COMMIT).tar.gz
> +
> +$(eval $(call fetch,libzycorec,$(LIBZYCOREC_URL)))
> +
> +LIBZYCOREC_EXTRACTED=$(LIBZYCOREC_ORIGIN)/zycore-c-$(LIBZYCOREC_COMMIT)
> +LIBZYCOREC_SOURCES=$(LIBZYCOREC_EXTRACTED)/src
> +LIBZYCOREC_INCLUDES=$(LIBZYCOREC_EXTRACTED)/include
> +LIBZYCOREC_COMPFLAGS-y=-Wno-implicit-fallthrough
> +
> +CINCLUDES-$(CONFIG_LIBZYCOREC) += -I$(LIBZYCOREC_BASE)/include
> +CINCLUDES-$(CONFIG_LIBZYCOREC) += -I$(LIBZYCOREC_INCLUDES)
> +
> +#
> +# NOTE: We use the only headers of this library for now
> +#
> +
> +#LIBZYCOREC_SRCS-y += $(LIBZYCOREC_SOURCES)/Allocator.c
> +#LIBZYCOREC_SRCS-y += $(LIBZYCOREC_SOURCES)/ArgParse.c
> +#LIBZYCOREC_SRCS-y += $(LIBZYCOREC_SOURCES)/Bitset.c
> +#LIBZYCOREC_SRCS-y += $(LIBZYCOREC_SOURCES)/Format.c
> +#LIBZYCOREC_SRCS-y += $(LIBZYCOREC_SOURCES)/List.c
> +#LIBZYCOREC_SRCS-y += $(LIBZYCOREC_SOURCES)/String.c
> +#LIBZYCOREC_SRCS-y += $(LIBZYCOREC_SOURCES)/Vector.c
> +#LIBZYCOREC_SRCS-y += $(LIBZYCOREC_SOURCES)/Zycore.c
> +#LIBZYCOREC_SRCS-y += $(LIBZYCOREC_SOURCES)/API/Memory.c
> +#LIBZYCOREC_SRCS-$(CONFIG_LIBPTHREAD_EMBEDDED) += 
> $(LIBZYCOREC_SOURCES)/API/Synchronization.c
> +#LIBZYCOREC_SRCS-$(CONFIG_LIBPTHREAD_EMBEDDED) += 
> $(LIBZYCOREC_SOURCES)/API/Thread.c
> +#LIBZYCOREC_SRCS-$(CONFIG_LIBVFSCORE) += $(LIBZYCOREC_SOURCES)/API/Terminal.c
> diff --git a/include/ZycoreExportConfig.h b/include/ZycoreExportConfig.h
> new file mode 100644
> index 0000000..9d155a7
> --- /dev/null
> +++ b/include/ZycoreExportConfig.h
> @@ -0,0 +1,42 @@
> +
> +#ifndef ZYCORE_EXPORT_H
> +#define ZYCORE_EXPORT_H
> +
> +#ifdef ZYCORE_STATIC_DEFINE
> +#  define ZYCORE_EXPORT
> +#  define ZYCORE_NO_EXPORT
> +#else
> +#  ifndef ZYCORE_EXPORT
> +#    ifdef Zycore_EXPORTS
> +        /* We are building this library */
> +#      define ZYCORE_EXPORT
> +#    else
> +        /* We are using this library */
> +#      define ZYCORE_EXPORT
> +#    endif
> +#  endif
> +
> +#  ifndef ZYCORE_NO_EXPORT
> +#    define ZYCORE_NO_EXPORT
> +#  endif
> +#endif
> +
> +#ifndef ZYCORE_DEPRECATED
> +#  define ZYCORE_DEPRECATED __attribute__ ((__deprecated__))
> +#endif
> +
> +#ifndef ZYCORE_DEPRECATED_EXPORT
> +#  define ZYCORE_DEPRECATED_EXPORT ZYCORE_EXPORT ZYCORE_DEPRECATED
> +#endif
> +
> +#ifndef ZYCORE_DEPRECATED_NO_EXPORT
> +#  define ZYCORE_DEPRECATED_NO_EXPORT ZYCORE_NO_EXPORT ZYCORE_DEPRECATED
> +#endif
> +
> +#if 0 /* DEFINE_NO_DEPRECATED */
> +#  ifndef ZYCORE_NO_DEPRECATED
> +#    define ZYCORE_NO_DEPRECATED
> +#  endif
> +#endif
> +
> +#endif /* ZYCORE_EXPORT_H */
> --
> 2.20.1
>
>
> _______________________________________________
> Minios-devel mailing list
> Minios-devel@xxxxxxxxxxxxxxxxxxxx
> https://lists.xenproject.org/mailman/listinfo/minios-devel

_______________________________________________
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®.