Couldn't build c extention on joyent smartos(solaris based system) #36

Open
sawanoboly opened this Issue Feb 21, 2013 · 0 comments

Comments

Projects
None yet
1 participant

I tried rake build In ext directory.
Error occurred at getpwuid_r systemcall.

make  all-am
make[1]: Entering directory `/root/zk/zookeeper/ext/c'
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.  -I./include -I./tests -I./generated  -Wall -Werror  -g -O2 -D_GNU_SOURCE -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -D_GNU_SOURCE -c src/zookeeper.c  -fPIC -DPIC -o .libs/zookeeper.o
In file included from /usr/include/netinet/in.h:72:0,
                 from /usr/include/sys/socket.h:49,
                 from src/zookeeper.c:39:
/usr/include/sys/byteorder.h:96:17: error: conflicting types for 'htonll'
In file included from ./include/zookeeper.h:28:0,
                 from src/zookeeper.c:27:
./include/recordio.h:70:9: note: previous declaration of 'htonll' was here
src/zookeeper.c: In function 'log_env':
src/zookeeper.c:686:3: error: too many arguments to function 'getpwuid_r'
In file included from src/zookeeper.c:59:0:
/usr/include/pwd.h:191:23: note: declared here
make[1]: *** [zookeeper.lo] Error 1
make[1]: Leaving directory `/root/zk/zookeeper/ext/c'
make: *** [all] Error 2
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Next, I tried using '-D_POSIX_C_SOURCE=199506L' to CPPFLAGS to avoid this.
Error didn't seen at getpwuid_r systemcall, but other several errors has occurred.

make  2>&1
make  all-am
make[1]: Entering directory `/root/zk/zookeeper/ext/c'
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.  -I./include -I./tests -I./generated -D_POSIX_C_SOURCE=199506L -Wall -Werror  -g -O2 -D_GNU_SOURCE -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -D_POSIX_C_SOURCE=199506L -Wall -Werror -g -O2 -D_GNU_SOURCE -c src/zookeeper.c  -fPIC -DPIC -o .libs/zookeeper.o
In file included from src/zookeeper.c:27:0:
./include/zookeeper.h:390:9: error: 'struct timeval' declared inside parameter list [-Werror]
./include/zookeeper.h:390:9: error: its scope is only this definition or declaration, which is probably not what you want [-Werror]
In file included from src/zookeeper.c:30:0:
src/zk_adaptor.h:180:20: error: field 'last_recv' has incomplete type
src/zk_adaptor.h:181:20: error: field 'last_send' has incomplete type
src/zk_adaptor.h:182:20: error: field 'last_ping' has incomplete type
src/zk_adaptor.h:183:20: error: field 'next_deadline' has incomplete type
src/zk_adaptor.h:210:20: error: field 'socket_readable' has incomplete type
In file included from /usr/include/netinet/in.h:72:0,
                 from /usr/include/sys/socket.h:49,
                 from src/zookeeper.c:39:
/usr/include/sys/byteorder.h:96:17: error: conflicting types for 'htonll'
In file included from ./include/zookeeper.h:28:0,
                 from src/zookeeper.c:27:
./include/recordio.h:70:9: note: previous declaration of 'htonll' was here
src/zookeeper.c: In function 'setup_random':
src/zookeeper.c:403:5: error: implicit declaration of function 'srandom' [-Werror=implicit-function-declaration]
src/zookeeper.c: In function 'getaddrs':
src/zookeeper.c:432:5: error: implicit declaration of function 'strdup' [-Werror=implicit-function-declaration]
src/zookeeper.c:432:19: error: incompatible implicit declaration of built-in function 'strdup' [-Werror]
src/zookeeper.c:607:20: error: implicit declaration of function 'random' [-Werror=implicit-function-declaration]
src/zookeeper.c: In function 'log_env':
src/zookeeper.c:661:3: error: implicit declaration of function 'gethostname' [-Werror=implicit-function-declaration]
src/zookeeper.c: In function 'zookeeper_init':
src/zookeeper.c:751:22: error: incompatible implicit declaration of built-in function 'strdup' [-Werror]
src/zookeeper.c:764:24: error: incompatible implicit declaration of built-in function 'strdup' [-Werror]
src/zookeeper.c: In function 'prepend_string':
src/zookeeper.c:825:16: error: incompatible implicit declaration of built-in function 'strdup' [-Werror]
src/zookeeper.c: In function 'sub_string':
src/zookeeper.c:847:19: error: incompatible implicit declaration of built-in function 'strdup' [-Werror]
src/zookeeper.c:850:15: error: incompatible implicit declaration of built-in function 'strdup' [-Werror]
src/zookeeper.c: In function 'handle_socket_error_msg':
src/zookeeper.c:1162:9: error: implicit declaration of function 'vsnprintf' [-Werror=implicit-function-declaration]
src/zookeeper.c: In function 'calculate_interval':
src/zookeeper.c:1409:12: error: variable 'i' has initializer but incomplete type
src/zookeeper.c:1409:24: error: dereferencing pointer to incomplete type
src/zookeeper.c:1409:20: error: storage size of 'i' isn't known
src/zookeeper.c:1410:22: error: dereferencing pointer to incomplete type
src/zookeeper.c:1411:23: error: dereferencing pointer to incomplete type
src/zookeeper.c:1409:20: error: unused variable 'i' [-Werror=unused-variable]
src/zookeeper.c: At top level:
src/zookeeper.c:1416:23: error: return type is an incomplete type
src/zookeeper.c: In function 'get_timeval':
src/zookeeper.c:1418:20: error: storage size of 'tv' isn't known
src/zookeeper.c:1424:5: error: 'return' with a value, in function returning void [-Werror]
src/zookeeper.c:1418:20: error: unused variable 'tv' [-Werror=unused-variable]
src/zookeeper.c: In function 'send_ping':
src/zookeeper.c:1440:5: error: implicit declaration of function 'gettimeofday' [-Werror=implicit-function-declaration]
src/zookeeper.c: At top level:
src/zookeeper.c:1449:6: error: conflicting types for 'zookeeper_interest'
In file included from src/zookeeper.c:27:0:
./include/zookeeper.h:389:12: note: previous declaration of 'zookeeper_interest' was here
src/zookeeper.c: In function 'zookeeper_interest':
src/zookeeper.c:1452:20: error: storage size of 'now' isn't known
src/zookeeper.c:1466:7: error: dereferencing pointer to incomplete type
src/zookeeper.c:1467:7: error: dereferencing pointer to incomplete type
src/zookeeper.c:1510:9: error: dereferencing pointer to incomplete type
src/zookeeper.c:1526:13: error: dereferencing pointer to incomplete type
src/zookeeper.c:1547:9: error: dereferencing pointer to incomplete type
src/zookeeper.c:1548:51: error: dereferencing pointer to incomplete type
src/zookeeper.c:1549:53: error: dereferencing pointer to incomplete type
src/zookeeper.c:1452:20: error: unused variable 'now' [-Werror=unused-variable]
src/zookeeper.c: In function 'checkResponseLatency':
src/zookeeper.c:1869:20: error: storage size of 'now' isn't known
src/zookeeper.c:1869:20: error: unused variable 'now' [-Werror=unused-variable]
src/zookeeper.c: In function 'zookeeper_process':
src/zookeeper.c:1980:36: error: storage size of 'now' isn't known
src/zookeeper.c:1980:36: error: unused variable 'now' [-Werror=unused-variable]
src/zookeeper.c: In function 'create_watcher_registration':
src/zookeeper.c:2123:14: error: incompatible implicit declaration of built-in function 'strdup' [-Werror]
src/zookeeper.c: In function 'flush_send_queue':
src/zookeeper.c:2822:20: error: storage size of 'started' isn't known
src/zookeeper.c:2833:28: error: storage size of 'now' isn't known
src/zookeeper.c:2833:28: error: unused variable 'now' [-Werror=unused-variable]
src/zookeeper.c:2822:20: error: unused variable 'started' [-Werror=unused-variable]
src/zookeeper.c: In function 'zoo_add_auth':
src/zookeeper.c:2960:22: error: incompatible implicit declaration of built-in function 'strdup' [-Werror]
cc1: all warnings being treated as errors
make[1]: *** [zookeeper.lo] Error 1
make[1]: Leaving directory `/root/zk/zookeeper/ext/c'
make: *** [all] Error 2
*** extconf.rb failed ***

What should I do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment