提交 44d9b48e 编写于 作者: C chenzhiyu

add musl changes

上级 7c8e980a
...@@ -92,7 +92,7 @@ if(NOT APPLE AND NOT WIN32) ...@@ -92,7 +92,7 @@ if(NOT APPLE AND NOT WIN32)
set_target_properties(paddle_fluid_shared PROPERTIES LINK_FLAGS "${LINK_FLAGS}") set_target_properties(paddle_fluid_shared PROPERTIES LINK_FLAGS "${LINK_FLAGS}")
# check symbol hidden # check symbol hidden
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/check_symbol.cmake FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/check_symbol.cmake
"execute_process(COMMAND bash -c \"${CMAKE_CURRENT_SOURCE_DIR}/check_symbol.sh" "execute_process(COMMAND sh -c \"${CMAKE_CURRENT_SOURCE_DIR}/check_symbol.sh"
" ${CMAKE_CURRENT_BINARY_DIR}/libpaddle_fluid.so\" RESULT_VARIABLE symbol_res)\n" " ${CMAKE_CURRENT_BINARY_DIR}/libpaddle_fluid.so\" RESULT_VARIABLE symbol_res)\n"
"if(NOT \"\${symbol_res}\" STREQUAL \"0\")\n" "if(NOT \"\${symbol_res}\" STREQUAL \"0\")\n"
" message(FATAL_ERROR \"Check symbol failed.\")\n" " message(FATAL_ERROR \"Check symbol failed.\")\n"
......
#!/bin/bash #!/bin/sh
lib=$1 lib=$1
if [ $# -ne 1 ]; then echo "No input library"; exit -1 ; fi if [ $# -ne 1 ]; then echo "No input library"; exit -1 ; fi
......
...@@ -230,13 +230,13 @@ inline std::string SimplifyDemangleStr(std::string str) { ...@@ -230,13 +230,13 @@ inline std::string SimplifyDemangleStr(std::string str) {
} }
inline std::string GetCurrentTraceBackString() { inline std::string GetCurrentTraceBackString() {
static constexpr int TRACE_STACK_LIMIT = 100; //static constexpr int TRACE_STACK_LIMIT = 100;
std::ostringstream sout; std::ostringstream sout;
sout << "\n\n--------------------------------------\n"; sout << "\n\n--------------------------------------\n";
sout << "C++ Traceback (most recent call last):"; sout << "C++ Traceback (most recent call last):";
sout << "\n--------------------------------------\n"; sout << "\n--------------------------------------\n";
#if !defined(_WIN32) #if !defined(_WIN32) && 0
void* call_stack[TRACE_STACK_LIMIT]; void* call_stack[TRACE_STACK_LIMIT];
auto size = backtrace(call_stack, TRACE_STACK_LIMIT); auto size = backtrace(call_stack, TRACE_STACK_LIMIT);
auto symbols = backtrace_symbols(call_stack, size); auto symbols = backtrace_symbols(call_stack, size);
......
...@@ -25,6 +25,6 @@ limitations under the License. */ ...@@ -25,6 +25,6 @@ limitations under the License. */
classname& operator=(classname&&) = delete classname& operator=(classname&&) = delete
#endif #endif
#if defined(__FLT_MAX__) //#if defined(__FLT_MAX__)
#define FLT_MAX __FLT_MAX__ //#define FLT_MAX __FLT_MAX__
#endif // __FLT_MAX__ //#endif // __FLT_MAX__
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#if !defined(_WIN32) #if !defined(_WIN32)
#include <dlfcn.h> // dladdr #include <dlfcn.h> // dladdr
#include <execinfo.h> // backtrace //#include <execinfo.h> // backtrace
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/time.h> #include <sys/time.h>
#include <algorithm> // std::accumulate #include <algorithm> // std::accumulate
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册