Skip to content

Commit

Permalink
libzycorec: Core library needed by Zyan libraries
Browse files Browse the repository at this point in the history
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@neclab.eu>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
  • Loading branch information
skuenzer authored and felipehuici committed Apr 2, 2020
1 parent 8643821 commit caee38d
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Config.uk
Original file line number Diff line number Diff line change
@@ -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
35 changes: 35 additions & 0 deletions Makefile.uk
Original file line number Diff line number Diff line change
@@ -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
42 changes: 42 additions & 0 deletions include/ZycoreExportConfig.h
Original file line number Diff line number Diff line change
@@ -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 */

0 comments on commit caee38d

Please sign in to comment.