mailing list of musl libc
 help / color / mirror / code / Atom feed
* Issues when building libcxx libcxxabi with MUSL
@ 2016-06-22 19:24 Zhao, Weiming
  2016-06-22 19:34 ` Rich Felker
  2016-06-22 19:38 ` Julien Ramseier
  0 siblings, 2 replies; 11+ messages in thread
From: Zhao, Weiming @ 2016-06-22 19:24 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 482 bytes --]

Hi,

I tried to build libcxx/libcxxabi using MUSL. Compiler is clang.

The build issues I got:

1) In libcxx, it complains that some pthread structure is not completely 
initialized.

2) Some types like max_align_t are already defined in clang's include.

3) libcxx can't find it's own math.h

A patch is attached. Please review if the changes are correct.


Thank,

Weiming




-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation


[-- Attachment #2: build_libcxx.patch --]
[-- Type: text/plain, Size: 1230 bytes --]

diff --git a/include/math.h b/include/math.h
index 6ac91da..7c7e4aa 100644
--- a/include/math.h
+++ b/include/math.h
@@ -427,4 +427,8 @@ long double pow10l(long double);
 }
 #endif
 
+#ifdef __cplusplus
+#include_next <math.h>
+#endif
+
 #endif
diff --git a/include/pthread.h b/include/pthread.h
index af70b73..2995846 100644
--- a/include/pthread.h
+++ b/include/pthread.h
@@ -55,7 +55,7 @@ extern "C" {
 #define PTHREAD_PROCESS_SHARED 1
 
 
-#define PTHREAD_MUTEX_INITIALIZER {{{0}}}
+#define PTHREAD_MUTEX_INITIALIZER {{{0, 0, 0, 0, 0, 0 }}}
 #define PTHREAD_RWLOCK_INITIALIZER {{{0}}}
 #define PTHREAD_COND_INITIALIZER {{{0}}}
 #define PTHREAD_ONCE_INIT 0
diff --git a/tools/mkalltypes.sed b/tools/mkalltypes.sed
index fa15efc..f03f6a4 100644
--- a/tools/mkalltypes.sed
+++ b/tools/mkalltypes.sed
@@ -1,6 +1,7 @@
-/^TYPEDEF/s/TYPEDEF \(.*\) \([^ ]*\);$/#if defined(__NEED_\2) \&\& !defined(__DEFINED_\2)\
+/^TYPEDEF/s/TYPEDEF \(.*\) \([^ ]*\);$/#if defined(__NEED_\2) \&\& !defined(__DEFINED_\2) \&\& !defined(__CLANG_\U\2\E_DEFINED)\
 typedef \1 \2;\
 #define __DEFINED_\2\
+#define __CLANG_\U\2\E_DEFINED\
 #endif\
 /
 /^STRUCT/s/STRUCT * \([^ ]*\) \(.*\);$/#if defined(__NEED_struct_\1) \&\& !defined(__DEFINED_struct_\1)\

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-06-30 14:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-22 19:24 Issues when building libcxx libcxxabi with MUSL Zhao, Weiming
2016-06-22 19:34 ` Rich Felker
2016-06-22 19:38 ` Julien Ramseier
2016-06-22 19:41   ` Rich Felker
2016-06-30 12:50     ` Julien Ramseier
2016-06-30 13:15       ` Szabolcs Nagy
2016-06-30 13:38         ` Szabolcs Nagy
2016-06-30 13:45           ` Rich Felker
2016-06-30 13:38       ` Rich Felker
2016-06-30 14:36         ` Julien Ramseier
2016-06-30 14:58           ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).