10000 addons, refactor: fix addon test on ubuntu 10.04. · fibjs/fibjs@53e4756 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 53e4756

Browse files
committed
addons, refactor: fix addon test on ubuntu 10.04.
1 parent 050512c commit 53e4756

File tree

3 files changed

+131
-4
lines changed
< 10000 span class="prc-TooltipV2-Tooltip-cYMVY" data-direction="se" aria-hidden="true" id=":R12plab:">Collapse file tree

3 files changed

+131
-4
lines changed

.github/workflows/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if [[ $HOST_OS == 'Linux' ]]; then
88

99
if [[ "$BUILD_TARGET" == "linux" ]]; then
1010
if [[ $BUILD_ARCH == 'x64' ]]; then
11-
docker run -t --rm -v ${CUR}:${CUR} ubuntu:12.04 bash -c "cd ${CUR}; ${DIST_EXEC} test"
11+
docker run -t --rm -v ${CUR}:${CUR} ubuntu:10.04 bash -c "cd ${CUR}; ${DIST_EXEC} test"
1212
else
1313
docker run -t --rm -v ${CUR}:${CUR} fibjs/${BUILD_TARGET}-build-env:${BUILD_ARCH} bash -c "cd ${CUR}; ${DIST_EXEC} test"
1414
fi

fibjs/addons/common.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ project(${name})
44

55
include(${CMAKE_CURRENT_LIST_DIR}/../../vender/build_tools/cmake/option.cmake)
66

7-
file(GLOB_RECURSE src_list "*.c*" "../win_delay_load_hook.cpp")
8-
7+
file(GLOB src_list "*.c*" "../*.c*")
98
add_library(${name} SHARED ${src_list})
109

1110
include_directories(
1211
"${PROJECT_SOURCE_DIR}/../../include/addons"
1312
"${PROJECT_SOURCE_DIR}/../../../vender/uv/include"
14-
"${PROJECT_SOURCE_DIR}/../")
13+
"${PROJECT_SOURCE_DIR}/../"
14+
"${CMAKE_CURRENT_BINARY_DIR}")
1515

1616
if(MSVC)
1717
target_link_libraries(${name} "${PROJECT_SOURCE_DIR}/../lib/node_${BUILD_ARCH}.lib")

fibjs/addons/fuck_sym.cpp

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
#ifdef __linux__
2+
3+
#include "config.h"
4+
5+
#include <string.h>
6+
#include <stdarg.h>
7+
#include <stdlib.h>
8+
#include <stdio.h>
9+
10+
#ifdef NDEBUG
11+
12+
extern "C" {
13+
14+
// GLIBC_2.14
15+
#ifdef GLIB_C_MEMCPY
16+
__asm__(".symver _memcpy,memcpy@GLIBC_" GLIB_C_MEMCPY);
17+
void* _memcpy(void* dest, const void* src, size_t n);
18+
void* memcpy(void* dest, const void* src, size_t n)
19+
{
20+
return _memcpy(dest, src, n);
21+
}
22+
#endif
23+
24+
// GLIBC_2.17
25+
#ifdef GLIB_C_TIME
26+
__asm__(".symver _clock_gettime,clock_gettime@GLIBC_" GLIB_C_TIME);
27+
int _clock_gettime(clockid_t clk_id, struct timespec* tp);
28+
int clock_gettime(clockid_t clk_id, struct timespec* tp)
29+
{
30+
return _clock_gettime(clk_id, tp);
31+
}
32+
33+
__asm__(".symver _clock_getres,clock_getres@GLIBC_" GLIB_C_TIME);
34+
int _clock_getres(clockid_t clk_id, struct timespec* tp);
35+
int clock_getres(clockid_t clk_id, struct timespec* tp)
36+
{
37+
return _clock_getres(clk_id, tp);
38+
}
39+
#endif
40+
41+
// GLIBC_2.28
42+
#ifdef GLIB_C_FCNTL
43+
__asm__(".symver _fcntl,fcntl@GLIBC_" GLIB_C_FCNTL);
44+
int _fcntl(int fd, int cmd, ...);
45+
int fcntl64(int fd, int cmd, ...)
46+
{
47+
int result;
48+
va_list va;
49+
50+
va_start(va, cmd);
51+
result = _fcntl(fd, cmd, va_arg(va, void*));
52+
va_end(va);
53+
54+
return result;
55+
}
56+
57+
int fcntl(int fd, int cmd, ...)
58+
{
59+
int result;
60+
va_list va;
61+
62+
va_start(va, cmd);
63+
result = _fcntl(fd, cmd, va_arg(va, void*));
64+
va_end(va);
65+
66+
return result;
67+
}
68+
#endif
69+
70+
// GLIBC_2.29
71+
#ifdef GLIB_C_MATH
72+
__asm__(".symver _exp,exp@GLIBC_" GLIB_C_MATH);
73+
double _exp(double x);
74+
double exp(double x)
75+
{
76+
return _exp(x);
77+
}
78+
79+
__asm__(".symver _expf,expf@GLIBC_" GLIB_C_MATH);
80+
float _expf(float x);
81+
float expf(float x)
82+
{
83+
return _expf(x);
84+
}
85+
86+
__asm__(".symver _log,log@GLIBC_" GLIB_C_MATH);
87+
double _log(double x);
88+
double log(double x)
89+
{
90+
return _log(x);
91+
}
92+
93+
__asm__(".symver _logf,logf@GLIBC_" GLIB_C_MATH);
94+
float _logf(float x);
95+
float logf(float x)
96+
{
97+
return _logf(x);
98+
}
99+
100+
__asm__(".symver _pow,pow@GLIBC_" GLIB_C_MATH);
101+
double _pow(double x, double y);
102+
double pow(double x, double y)
103+
{
104+
return _pow(x, y);
105+
}
106+
107+
__asm__(".symver _powf,powf@GLIBC_" GLIB_C_MATH);
108+
float _powf(float x, float y);
109+
float powf(float x, float y)
110+
{
111+
return _powf(x, y);
112+
}
113+
#endif
114+
115+
#ifdef GLIB_C_MATH2
116+
__asm__(".symver _log2,log2@GLIBC_" GLIB_C_MATH);
117+
double _log2(double x);
118+
double log2(double x)
119+
{
120+
return _log2(x);
121+
}
122+
#endif
123+
}
124+
125+
#endif
126+
127+
#endif

0 commit comments

Comments
 (0)
0