]> xenbits.xensource.com Git - unikraft/libs/libcxx.git/commitdiff
glue.c: Remove multiple definitions when using Musl
authorStefan Jumarea <stefanjumarea02@gmail.com>
Sat, 29 Oct 2022 10:05:50 +0000 (13:05 +0300)
committerUnikraft <monkey@unikraft.io>
Fri, 18 Nov 2022 08:25:19 +0000 (08:25 +0000)
Musl provides the `catclose`, `catopen` and `catgets` functions, so when
building `libcxx` with Musl the linking fails.

This commit only defines the needed functions when `LIBMUSL` is not selected.

Signed-off-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Maria Sfiraiala <maria.sfiraiala@gmail.com>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #17

glue.c

diff --git a/glue.c b/glue.c
index b65464bf194f55e26d96a5ef39e0682f17594659..6c60a7a0e921ba3317ff61a1197911d068f14d7a 100644 (file)
--- a/glue.c
+++ b/glue.c
@@ -20,7 +20,9 @@
  */
 
 #include <nl_types.h>
+#include <uk/config.h>
 
+#ifndef CONFIG_LIBMUSL
 int catclose(nl_catd catalog)
 {
        return 0;
@@ -36,5 +38,6 @@ char *catgets(nl_catd catalog, int set_number, int message_number,
 {
        return 0;
 }
+#endif
 
 void *__dso_handle = (void *) &__dso_handle;