当我尝试编译 ppc_85xxDP 的 redis 源代码时,出现以下错误。有人能帮我解决这个错误吗?
export TNAME=ppx_85xxDP
export ARCH=powerpc
export CROSS_COMPILE=${TNAME}-
export SAVE_PATH=${PATH}
export PATH=/opt/eldk/ppc-v42-1/usr/bin:/opt/eldk/ppc-v42-1/bin:${PATH}
export CC=ppc-linux-gcc
make distclean
cd src && make distclean
make[1]: Entering directory `/home/open_source/redis/redis-5.0.5/src'
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html Makefile.dep dict-benchmark
(cd ../deps && make distclean)
make[2]: Entering directory `/home/open_source/redis/redis-5.0.5/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
make[2]: Leaving directory `/home/open_source/redis/redis-5.0.5/deps'
(rm -f .make-*)
make[1]: Leaving directory `/home/open_source/redis/redis-5.0.5/src'
make MALLOC=libc CFLAGS=-DGIMO_PPC
cd src && make all
make[1]: Entering directory `/home/open_source/redis/redis-5.0.5/src'
CC Makefile.dep
make[1]: Leaving directory `/home/open_source/redis/redis-5.0.5/src'
make[1]: Entering directory `/home/open_source/redis/redis-5.0.5/src'
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html Makefile.dep dict-benchmark
(cd ../deps && make distclean)
make[2]: Entering directory `/home/open_source/redis/redis-5.0.5/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
make[2]: Leaving directory `/home/open_source/redis/redis-5.0.5/deps'
(rm -f .make-*)
echo STD=-std=c99 -pedantic -DREDIS_STATIC='' >> .make-settings
echo WARN=-Wall -W -Wno-missing-field-initializers >> .make-settings
echo OPT=-O2 >> .make-settings
echo MALLOC=libc >> .make-settings
echo CFLAGS=-DGIMO_PPC >> .make-settings
echo LDFLAGS= >> .make-settings
echo REDIS_CFLAGS= >> .make-settings
echo REDIS_LDFLAGS= >> .make-settings
echo PREV_FINAL_CFLAGS=-std=c99 -pedantic -DREDIS_STATIC='' -Wall -W -Wno-missing-field-initializers -O2 -g -ggdb -DGIMO_PPC -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src >> .make-settings
echo PREV_FINAL_LDFLAGS= -g -ggdb -rdynamic >> .make-settings
(cd ../deps && make hiredis linenoise lua)
make[2]: Entering directory `/home/open_source/redis/redis-5.0.5/deps'
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
(echo "" > .make-ldflags)
(echo "-DGIMO_PPC" > .make-cflags)
MAKE hiredis
cd hiredis && make static
make[3]: Entering directory `/home/open_source/redis/redis-5.0.5/deps/hiredis'
ppc-linux-gcc -std=c99 -pedantic -c -O3 -fPIC -DGIMO_PPC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
net.c:36:23: error: sys/types.h: No such file or directory
net.c:37:24: error: sys/socket.h: No such file or directory
net.c:38:24: error: sys/select.h: No such file or directory
net.c:39:20: error: sys/un.h: No such file or directory
net.c:40:24: error: netinet/in.h: No such file or directory
net.c:41:25: error: netinet/tcp.h: No such file or directory
net.c:42:23: error: arpa/inet.h: No such file or directory
net.c:43:20: error: unistd.h: No such file or directory
net.c:44:19: error: fcntl.h: No such file or directory
net.c:45:20: error: string.h: No such file or directory
net.c:46:19: error: netdb.h: No such file or directory
net.c:47:19: error: errno.h: No such file or directory
net.c:49:19: error: stdio.h: No such file or directory
net.c:50:18: error: poll.h: No such file or directory
In file included from /opt/eldk/ppc-v42-1/usr/bin/../lib/gcc/powerpc-linux/4.2.2/include/syslimits.h:7,
from /opt/eldk/ppc-v42-1/usr/bin/../lib/gcc/powerpc-linux/4.2.2/include/limits.h:11,
from net.c:51:
/opt/eldk/ppc-v42-1/usr/bin/../lib/gcc/powerpc-linux/4.2.2/include/limits.h:122:61: error: no include path in which to search for limits.h
net.c:52:20: error: stdlib.h: No such file or directory
In file included from hiredis.h:36,
from net.h:38,
from net.c:54:
read.h:73: error: expected declaration specifiers or '...' before 'size_t'
read.h:85: error: expected specifier-qualifier-list before 'size_t'
read.h:100: error: expected declaration specifiers or '...' before 'size_t'
In file included from net.h:38,
from net.c:54:
hiredis.h:38:47: error: sys/time.h: No such file or directory
hiredis.h:39:40: error: stdint.h: No such file or directory
In file included from hiredis.h:40,
from net.h:38,
from net.c:54:
sds.h:51: error: expected specifier-qualifier-list before 'uint8_t'
sds.h:55: warning: struct has no members
sds.h:57: error: expected specifier-qualifier-list before 'uint16_t'
sds.h:61: warning: struct has no members
sds.h:63: error: expected specifier-qualifier-list before 'uint32_t'
sds.h:67: warning: struct has no members
sds.h:69: error: expected specifier-qualifier-list before 'uint64_t'
sds.h:73: warning: struct has no members
sds.h:86: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sdslen'
sds.h:103: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sdsavail'
sds.h:129: error: expected declaration specifiers or '...' before 'size_t'
sds.h: In function 'sdssetlen':
sds.h:135: error: 'newlen' undeclared (first use in this function)
sds.h:135: error: (Each undeclared identifier is reported only once
sds.h:135: error: for each function it appears in.)
sds.h:139: error: 'struct sdshdr8' has no member named 'len'
sds.h:142: error: 'struct sdshdr16' has no member named 'len'
sds.h:145: error: 'struct sdshdr32' has no member named 'len'
sds.h:148: error: 'struct sdshdr64' has no member named 'len'
sds.h: At top level:
sds.h:153: error: expected declaration specifiers or '...' before 'size_t'
sds.h: In function 'sdsinclen':
sds.h:159: error: 'inc' undeclared (first use in this function)
sds.h:164: error: 'struct sdshdr8' has no member named 'len'
sds.h:167: error: 'struct sdshdr16' has no member named 'len'
sds.h:170: error: 'struct sdshdr32' has no member named 'len'
sds.h:173: error: 'struct sdshdr64' has no member named 'len'
sds.h: At top level:
sds.h:179: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sdsalloc'
sds.h:196: error: expected declaration specifiers or '...' before 'size_t'
sds.h: In function 'sdssetalloc':
sds.h:203: error: 'struct sdshdr8' has no member named 'alloc'
sds.h:203: error: 'newlen' undeclared (first use in this function)
sds.h:206: error: 'struct sdshdr16' has no member named 'alloc'
sds.h:209: error: 'struct sdshdr32' has no member named 'alloc'
sds.h:212: error: 'struct sdshdr64' has no member named 'alloc'
sds.h: At top level:
sds.h:217: error: expected declaration specifiers or '...' before 'size_t'
sds.h:222: error: expected declaration specifiers or '...' before 'size_t'
sds.h:223: error: expected declaration specifiers or '...' before 'size_t'
sds.h:226: error: expected declaration specifiers or '...' before 'size_t'
sds.h:248: error: expected declaration specifiers or '...' before 'size_t'
sds.h:250: error: expected declaration specifiers or '...' before 'size_t'
sds.h:252: error: expected declaration specifiers or '...' before 'size_t'
sds.h:255: error: expected declaration specifiers or '...' before 'size_t'
sds.h:258: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sdsAllocSize'
sds.h:265: error: expected ')' before 'size'
sds.h:266: error: expected declaration specifiers or '...' before 'size_t'
In file included from net.h:38,
from net.c:54:
hiredis.h:115: error: expected specifier-qualifier-list before 'size_t'
hiredis.h:129: warning: type defaults to 'int' in declaration of 'size_t'
hiredis.h:129: error: expected ';', ',' or ')' before '*' token
hiredis.h:130: warning: type defaults to 'int' in declaration of 'size_t'
hiredis.h:130: error: expected ';', ',' or ')' before '*' token
hiredis.h:202: error: expected declaration specifiers or '...' before 'size_t'
hiredis.h:208: warning: type defaults to 'int' in declaration of 'size_t'
hiredis.h:208: error: expected ';', ',' or ')' before '*' token
hiredis.h:217: warning: type defaults to 'int' in declaration of 'size_t'
hiredis.h:217: error: expected ';', ',' or ')' before '*' token
net.c: In function 'redisContextCloseFd':
net.c:62: warning: implicit declaration of function 'close'
net.c: In function '__redisSetErrorFromErrno':
net.c:69: error: 'size_t' undeclared (first use in this function)
net.c:69: error: expected ';' before 'len'
net.c:71: error: 'NULL' undeclared (first use in this function)
net.c:72: error: 'len' undeclared (first use in this function)
net.c:72: warning: implicit declaration of function 'snprintf'
net.c:72: warning: incompatible implicit declaration of built-in function 'snprintf'
net.c:73: warning: implicit declaration of function 'strerror_r'
net.c:73: error: 'errno' undeclared (first use in this function)
net.c: In function 'redisSetReuseAddr':
net.c:79: warning: implicit declaration of function 'setsockopt'
net.c:79: error: 'SOL_SOCKET' undeclared (first use in this function)
net.c:79: error: 'SO_REUSEADDR' undeclared (first use in this function)
net.c:80: error: 'NULL' undeclared (first use in this function)
net.c: In function 'redisCreateSocket':
net.c:89: warning: implicit declaration of function 'socket'
net.c:89: error: 'SOCK_STREAM' undeclared (first use in this function)
net.c:90: error: 'NULL' undeclared (first use in this function)
net.c:94: error: 'AF_INET' undeclared (first use in this function)
net.c: In function 'redisSetBlocking':
net.c:108: warning: implicit declaration of function 'fcntl'
net.c:108: error: 'F_GETFL' undeclared (first use in this function)
net.c:115: error: 'O_NONBLOCK' undeclared (first use in this function)
net.c:119: error: 'F_SETFL' undeclared (first use in this function)
net.c: In function 'redisKeepAlive':
net.c:131: error: 'SOL_SOCKET' undeclared (first use in this function)
net.c:131: error: 'SO_KEEPALIVE' undeclared (first use in this function)
net.c:132: warning: implicit declaration of function 'strerror'
net.c:132: error: 'errno' undeclared (first use in this function)
net.c:132: warning: passing argument 3 of '__redisSetError' makes pointer from integer without a cast
net.c: In function 'redisSetTcpNoDelay':
net.c:171: error: 'IPPROTO_TCP' undeclared (first use in this function)
net.c:171: error: 'TCP_NODELAY' undeclared (first use in this function)
net.c: In function 'redisContextTimeoutMsec':
net.c:187: error: 'NULL' undeclared (first use in this function)
net.c:188: error: dereferencing pointer to incomplete type
net.c:188: error: dereferencing pointer to incomplete type
net.c:193: error: dereferencing pointer to incomplete type
net.c:193: error: dereferencing pointer to incomplete type
net.c: In function 'redisContextWaitReady':
net.c:205: error: array type has incomplete element type
net.c:208: error: 'POLLOUT' undeclared (first use in this function)
net.c:210: error: 'errno' undeclared (first use in this function)
net.c:210: error: 'EINPROGRESS' undeclared (first use in this function)
net.c:213: warning: implicit declaration of function 'poll'
net.c:218: error: 'ETIMEDOUT' undeclared (first use in this function)
net.c:219: error: 'NULL' undeclared (first use in this function)
net.c:205: warning: unused variable 'wfd'
net.c: In function 'redisCheckSocketError':
net.c:237: error: 'socklen_t' undeclared (first use in this function)
net.c:237: error: expected ';' before 'errlen'
net.c:239: warning: implicit declaration of function 'getsockopt'
net.c:239: error: 'SOL_SOCKET' undeclared (first use in this function)
net.c:239: error: 'SO_ERROR' undeclared (first use in this function)
net.c:239: error: 'errlen' undeclared (first use in this function)
net.c:245: error: 'errno' undeclared (first use in this function)
net.c:246: error: 'NULL' undeclared (first use in this function)
net.c: At top level:
net.c:253: error: parameter 2 ('tv') has incomplete type
net.c: In function 'redisContextSetTimeout':
net.c:254: error: 'SOL_SOCKET' undeclared (first use in this function)
net.c:254: error: 'SO_RCVTIMEO' undeclared (first use in this function)
net.c:258: error: 'SO_SNDTIMEO' undeclared (first use in this function)
net.c:253: warning: unused parameter 'tv'
net.c: In function '_redisContextConnectTcp':
net.c:270: error: storage size of 'hints' isn't known
net.c:276: error: 'NULL' undeclared (first use in this function)
net.c:289: warning: implicit declaration of function 'free'
net.c:291: warning: implicit declaration of function 'strdup'
net.c:291: warning: assignment makes pointer from integer without a cast
net.c:297: warning: implicit declaration of function 'malloc'
net.c:297: warning: incompatible implicit declaration of built-in function 'malloc'
net.c:297: error: invalid application of 'sizeof' to incomplete type 'struct timeval'
net.c:299: warning: implicit declaration of function 'memcpy'
net.c:299: warning: incompatible implicit declaration of built-in function 'memcpy'
net.c:299: error: invalid application of 'sizeof' to incomplete type 'struct timeval'
net.c:317: warning: assignment makes pointer from integer without a cast
net.c:320: warning: incompatible implicit declaration of built-in function 'snprintf'
net.c:321: warning: implicit declaration of function 'memset'
net.c:321: warning: incompatible implicit declaration of built-in function 'memset'
net.c:322: error: 'AF_INET' undeclared (first use in this function)
net.c:323: error: 'SOCK_STREAM' undeclared (first use in this function)
net.c:330: warning: implicit declaration of function 'getaddrinfo'
net.c:331: error: 'AF_INET6' undeclared (first use in this function)
net.c:333: warning: implicit declaration of function 'gai_strerror'
net.c:333: warning: passing argument 3 of '__redisSetError' makes pointer from integer without a cast
net.c:337: error: dereferencing pointer to incomplete type
net.c:339: error: dereferencing pointer to incomplete type
net.c:339: error: dereferencing pointer to incomplete type
net.c:339: error: dereferencing pointer to incomplete type
net.c:350: warning: format '%s' expects type 'char *', but argument 4 has type 'int'
net.c:357: error: 'SOL_SOCKET' undeclared (first use in this function)
net.c:357: error: 'SO_REUSEADDR' undeclared (first use in this function)
net.c:363: error: dereferencing pointer to incomplete type
net.c:364: warning: implicit declaration of function 'bind'
net.c:364: error: dereferencing pointer to incomplete type
net.c:364: error: dereferencing pointer to incomplete type
net.c:369: warning: implicit declaration of function 'freeaddrinfo'
net.c:372: error: 'errno' undeclared (first use in this function)
net.c:372: warning: format '%s' expects type 'char *', but argument 4 has type 'int'
net.c:377: warning: implicit declaration of function 'connect'
net.c:377: error: dereferencing pointer to incomplete type
net.c:377: error: dereferencing pointer to incomplete type
net.c:378: error: 'EHOSTUNREACH' undeclared (first use in this function)
net.c:381: error: 'EINPROGRESS' undeclared (first use in this function)
net.c:383: error: 'EADDRNOTAVAIL' undeclared (first use in this function)
net.c:406: warning: format '%s' expects type 'char *', but argument 4 has type 'int'
net.c:270: warning: unused variable 'hints'
net.c: In function 'redisContextConnectTcp':
net.c:420: error: 'NULL' undeclared (first use in this function)
net.c: In function 'redisContextConnectUnix':
net.c:431: error: storage size of 'sa' isn't known
net.c:434: error: 'AF_LOCAL' undeclared (first use in this function)
net.c:441: warning: assignment makes pointer from integer without a cast
net.c:445: error: 'NULL' undeclared (first use in this function)
net.c:446: warning: incompatible implicit declaration of built-in function 'malloc'
net.c:446: error: invalid application of 'sizeof' to incomplete type 'struct timeval'
net.c:448: warning: incompatible implicit declaration of built-in function 'memcpy'
net.c:448: error: invalid application of 'sizeof' to incomplete type 'struct timeval'
net.c:460: warning: implicit declaration of function 'strncpy'
net.c:460: warning: incompatible implicit declaration of built-in function 'strncpy'
net.c:462: error: 'errno' undeclared (first use in this function)
net.c:462: error: 'EINPROGRESS' undeclared (first use in this function)
net.c:431: warning: unused variable 'sa'
make[3]: *** [net.o] Error 1
make[3]: Leaving directory `/home/open_source/redis/redis-5.0.5/deps/hiredis'
make[2]: *** [hiredis] Error 2
make[2]: Leaving directory `/home/open_source/redis/redis-5.0.5/deps'
make[1]: [persist-settings] Error 2 (ignored)
CC adlist.o
adlist.c:32:20: error: stdlib.h: No such file or directory
In file included from adlist.c:34:
zmalloc.h:80: error: expected ')' before 'size'
zmalloc.h:81: error: expected ')' before 'size'
zmalloc.h:82: error: expected declaration specifiers or '...' before 'size_t'
zmalloc.h:85: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'zmalloc_used_memory'
zmalloc.h:86: warning: parameter names (without types) in function declaration
zmalloc.h:87: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'zmalloc_get_rss'
zmalloc.h:88: error: expected ')' before '*' token
zmalloc.h:89: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'zmalloc_get_private_dirty'
zmalloc.h:90: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'zmalloc_get_smap_bytes_by_field'
zmalloc.h:91: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'zmalloc_get_memory_size'
zmalloc.h:100: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'zmalloc_size'
zmalloc.h:101: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'zmalloc_usable'
adlist.c: In function 'listCreate':
adlist.c:45: warning: implicit declaration of function 'zmalloc'
adlist.c:45: warning: assignment makes pointer from integer without a cast
adlist.c:45: error: 'NULL' undeclared (first use in this function)
adlist.c:45: error: (Each undeclared identifier is reported only once
adlist.c:45: error: for each function it appears in.)
adlist.c: In function 'listEmpty':
adlist.c:69: error: 'NULL' undeclared (first use in this function)
adlist.c: In function 'listAddNodeHead':
adlist.c:92: warning: assignment makes pointer from integer without a cast
adlist.c:92: error: 'NULL' undeclared (first use in this function)
adlist.c: In function 'listAddNodeTail':
adlist.c:118: warning: assignment makes pointer from integer without a cast
adlist.c:118: error: 'NULL' undeclared (first use in this function)
adlist.c: In function 'listInsertNode':
adlist.c:137: warning: assignment makes pointer from integer without a cast
adlist.c:137: error: 'NULL' undeclared (first use in this function)
adlist.c: In function 'listGetIterator':
adlist.c:190: warning: assignment makes pointer from integer without a cast
adlist.c:190: error: 'NULL' undeclared (first use in this function)
adlist.c: In function 'listNext':
adlist.c:233: error: 'NULL' undeclared (first use in this function)
adlist.c: In function 'listDup':
adlist.c:256: error: 'NULL' undeclared (first use in this function)
adlist.c: In function 'listSearchKey':
adlist.c:296: error: 'NULL' undeclared (first use in this function)
adlist.c: In function 'listRotate':
adlist.c:337: error: 'NULL' undeclared (first use in this function)
adlist.c: In function 'listJoin':
adlist.c:360: error: 'NULL' undeclared (first use in this function)
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/home/open_source/redis/redis-5.0.5/src'
make: *** [all] Error 2