[llvm-commits] Build failure with musl libc
ojab
ojab at ojab.ru
Tue Jan 1 11:12:34 PST 2013
Hello list,
currently LLVM fails to build on linux with musl libc [1] due to two
issues, patch can be found in the attached file:
1) stderr/out/in are 'const void*' in musl, which leads to:
> /root/llvm/lib/Support/DynamicLibrary.cpp: In static member function 'static void* llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(const char*)':
> /root/llvm/lib/Support/DynamicLibrary.cpp:165:5: error: invalid conversion from 'const void*' to 'void*'
> /root/llvm/lib/Support/DynamicLibrary.cpp:166:5: error: invalid conversion from 'const void*' to 'void*'
> /root/llvm/lib/Support/DynamicLibrary.cpp:167:5: error: invalid conversion from 'const void*' to 'void*'
> rm: can't remove '/root/llvm-build/lib/Support/Release+Asserts/DynamicLibrary.d.tmp': No such file or directory
Adding explicit cast to (void *) solves the issue.
2) googletest isn't including sys/socket.h where it should. Issue
reported upstream [2], no answer so far. Maybe a record should be added
to utils/unittest/googletest/README.LLVM?
[1] http://www.musl-libc.org/
[2]
https://groups.google.com/forum/?fromgroups=&hl=en#!topic/googletestframework/jS7LPQIR9ts
//wbr ojab
-------------- next part --------------
Index: lib/Support/DynamicLibrary.cpp
===================================================================
--- lib/Support/DynamicLibrary.cpp (revision 170294)
+++ lib/Support/DynamicLibrary.cpp (working copy)
@@ -155,7 +155,7 @@
// This macro returns the address of a well-known, explicit symbol
#define EXPLICIT_SYMBOL(SYM) \
- if (!strcmp(symbolName, #SYM)) return &SYM
+ if (!strcmp(symbolName, #SYM)) return (void *) &SYM
// On linux we have a weird situation. The stderr/out/in symbols are both
// macros and global variables because of standards requirements. So, we
Index: utils/unittest/googletest/gtest.cc
===================================================================
--- utils/unittest/googletest/gtest.cc (revision 170294)
+++ utils/unittest/googletest/gtest.cc (working copy)
@@ -120,6 +120,7 @@
#if GTEST_CAN_STREAM_RESULTS_
# include <arpa/inet.h> // NOLINT
+# include <sys/socket.h> // NOLINT
# include <netdb.h> // NOLINT
#endif
More information about the llvm-commits
mailing list