Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issues #1

Closed
asbjornenge opened this issue Aug 30, 2016 · 3 comments
Closed

Build issues #1

asbjornenge opened this issue Aug 30, 2016 · 3 comments

Comments

@asbjornenge
Copy link

Hi! Finally found some time to try out the SDK 😁 I get this while trying to build on linux:

libztintercept.so SDK_Sockets.c SDK_Intercept.c SDK_Debug.c SDK_RPC.c -ldl
SDK_Sockets.c: In function ‘zts_recvfrom’:
SDK_Sockets.c:290:41: warning: passing argument 3 of ‘memcpy’ makes integer from pointer without a cast
                 memcpy(address, buffer, address_len);
                                         ^
In file included from /usr/include/features.h:364:0,
                 from /usr/include/unistd.h:25,
                 from SDK_Sockets.c:37:
/usr/include/x86_64-linux-gnu/bits/string3.h:50:1: note: expected ‘size_t’ but argument is of type ‘socklen_t *’
 __NTH (memcpy (void *__restrict __dest, const void *__restrict __src,
 ^
SDK_Sockets.c: In function ‘zts_accept4’:
SDK_Sockets.c:613:23: warning: initialization makes integer from pointer without a cast
             int len = !addr ? 0 : addrlen;
                       ^
SDK_Sockets.c:614:41: warning: passing argument 3 of ‘accept’ makes pointer from integer without a cast
             return accept(sockfd, addr, len);
                                         ^
In file included from /usr/include/netinet/in.h:23:0,
                 from /usr/include/netdb.h:27,
                 from SDK_Sockets.c:45:
/usr/include/x86_64-linux-gnu/sys/socket.h:243:12: note: expected ‘socklen_t *’ but argument is of type ‘int’
 extern int accept (int __fd, __SOCKADDR_ARG __addr,
            ^
SDK_Sockets.c: In function ‘zts_getsockname’:
SDK_Sockets.c:768:17: warning: assignment makes pointer from integer without a cast
         addrlen = sizeof(struct sockaddr_in);
                 ^
SDK_Sockets.c: In function ‘zts_getpeername’:
SDK_Sockets.c:831:17: warning: assignment makes pointer from integer without a cast
         addrlen = sizeof(struct sockaddr_in);
                 ^
SDK_Sockets.c: In function ‘zts_recvfrom’:
SDK_Sockets.c:296:13: warning: ‘tmpsz’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             return tmpsz;
             ^
SDK_Intercept.c: In function ‘setsockopt’:
SDK_Intercept.c:236:50: error: ‘option_name’ undeclared (first use in this function)
             return realsetsockopt(socket, level, option_name, option_value, option_len);
                                                  ^
SDK_Intercept.c:236:50: note: each undeclared identifier is reported only once for each function it appears in
SDK_Intercept.c:236:63: error: ‘option_value’ undeclared (first use in this function)
             return realsetsockopt(socket, level, option_name, option_value, option_len);
                                                               ^
SDK_Intercept.c:236:77: error: ‘option_len’ undeclared (first use in this function)
             return realsetsockopt(socket, level, option_name, option_value, option_len);
                                                                             ^
SDK_Intercept.c:248:5: warning: control reaches end of non-void function [-Wreturn-type]
     }
     ^
SDK_RPC.c: In function ‘sock_fd_write’:
SDK_RPC.c:289:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
       *((int *) CMSG_DATA(cmsg)) = fd;
       ^
SDK_RPC.c: In function ‘sock_fd_read’:
SDK_RPC.c:337:7: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
       *fd = *((int *) CMSG_DATA(cmsg));
       ^
make-linux.mk:83: recipe for target 'linux_shared_lib' failed
make: *** [linux_shared_lib] Error 1

Am I missing some buildflags or something? I'm on Ubuntu 15.04 with gcc 4.9.2.

@asbjornenge
Copy link
Author

Seems to be related to option_name, option_value and option_len being undeclared in setsockopt() ?

@joseph-henry
Copy link
Contributor

joseph-henry commented Aug 30, 2016

Hello Asbjorn, you are indeed correct, it was a name change in the function signature. I've issued a fix for that function.

Also note the makefile's target names are undergoing a change: linux_service_and_intercept will build the intercept library and the service executable, and a future linux_shared_lib will build the entire system in one binary. The docs haven't been updated to reflect this yet, but this will be completed in the next update.

@asbjornenge
Copy link
Author

By checking out bde675c I can build and get the docker demo up and running (which is what I need for now), so thanks 😁 🚀

Trying to build latest master (66dda33) I get some other compilation errors. But seems like your currently rearranging things, so I'll just close this issue for now and play with the docker demo while things stabilize.

joseph-henry pushed a commit that referenced this issue Dec 3, 2020
joseph-henry added a commit that referenced this issue May 31, 2021
These are some things I noticed while working in this tree:
ChlodAlejandro referenced this issue in ChlodAlejandro/libzt Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants