uNetworking / uSockets

Miniscule cross-platform eventing, networking & crypto for async applications
Apache License 2.0
1.29k stars 268 forks source link

Building WITH_OPENSSL is broken #108

Closed epsilon-0 closed 4 years ago

epsilon-0 commented 4 years ago

Currently building HEAD with openssl results in this error log

===>  Building for usockets-0.4.0p0
rm -f *.o
cc -fPIC -c src/*.c src/eventing/*.c src/crypto/*.c -O2 -pipe   -I/usr/local/include -DLIBUS_USE_OPENSSL -DLIBUS_USE_LIBUV -std=c11 -Isrc
In file included from src/context.c:19:
src/internal/internal.h:124:55: warning: declaration of 'struct us_internal_ssl_socket_t' will not be visible outside of this function [-Wvisibility]
void *us_internal_ssl_socket_get_native_handle(struct us_internal_ssl_socket_t *s);
                                                      ^
src/internal/internal.h:125:63: warning: declaration of 'struct us_internal_ssl_socket_context_t' will not be visible outside of this function [-Wvisibility]
void *us_internal_ssl_socket_context_get_native_handle(struct us_internal_ssl_socket_context_t *context);
                                                              ^
src/context.c:99:65: warning: incompatible pointer types passing 'struct us_socket_context_t *' to parameter of type 'struct us_internal_ssl_socket_context_t *' [-Wincompatible-pointer-types]
        return us_internal_ssl_socket_context_get_native_handle(context);
                                                                ^~~~~~~
src/internal/internal.h:125:97: note: passing argument to parameter 'context' here
void *us_internal_ssl_socket_context_get_native_handle(struct us_internal_ssl_socket_context_t *context);
                                                                                                ^
3 warnings generated.
In file included from src/loop.c:19:
src/internal/internal.h:124:55: warning: declaration of 'struct us_internal_ssl_socket_t' will not be visible outside of this function [-Wvisibility]
void *us_internal_ssl_socket_get_native_handle(struct us_internal_ssl_socket_t *s);
                                                      ^
src/internal/internal.h:125:63: warning: declaration of 'struct us_internal_ssl_socket_context_t' will not be visible outside of this function [-Wvisibility]
void *us_internal_ssl_socket_context_get_native_handle(struct us_internal_ssl_socket_context_t *context);
                                                              ^
2 warnings generated.
In file included from src/socket.c:19:
src/internal/internal.h:124:55: warning: declaration of 'struct us_internal_ssl_socket_t' will not be visible outside of this function [-Wvisibility]
void *us_internal_ssl_socket_get_native_handle(struct us_internal_ssl_socket_t *s);
                                                      ^
src/internal/internal.h:125:63: warning: declaration of 'struct us_internal_ssl_socket_context_t' will not be visible outside of this function [-Wvisibility]
void *us_internal_ssl_socket_context_get_native_handle(struct us_internal_ssl_socket_context_t *context);
                                                              ^
src/socket.c:62:57: warning: incompatible pointer types passing 'struct us_internal_ssl_socket_t *' to parameter of type 'struct us_internal_ssl_socket_t *' [-Wincompatible-pointer-types]
        return us_internal_ssl_socket_get_native_handle((struct us_internal_ssl_socket_t *) s);
                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/internal/internal.h:124:81: note: passing argument to parameter 's' here
void *us_internal_ssl_socket_get_native_handle(struct us_internal_ssl_socket_t *s);
                                                                                ^
3 warnings generated.
In file included from src/eventing/epoll_kqueue.c:19:
src/internal/internal.h:124:55: warning: declaration of 'struct us_internal_ssl_socket_t' will not be visible outside of this function [-Wvisibility]
void *us_internal_ssl_socket_get_native_handle(struct us_internal_ssl_socket_t *s);
                                                      ^
src/internal/internal.h:125:63: warning: declaration of 'struct us_internal_ssl_socket_context_t' will not be visible outside of this function [-Wvisibility]
void *us_internal_ssl_socket_context_get_native_handle(struct us_internal_ssl_socket_context_t *context);
                                                              ^
2 warnings generated.
In file included from src/eventing/gcd.c:19:
src/internal/internal.h:124:55: warning: declaration of 'struct us_internal_ssl_socket_t' will not be visible outside of this function [-Wvisibility]
void *us_internal_ssl_socket_get_native_handle(struct us_internal_ssl_socket_t *s);
                                                      ^
src/internal/internal.h:125:63: warning: declaration of 'struct us_internal_ssl_socket_context_t' will not be visible outside of this function [-Wvisibility]
void *us_internal_ssl_socket_context_get_native_handle(struct us_internal_ssl_socket_context_t *context);
                                                              ^
2 warnings generated.
In file included from src/eventing/libuv.c:19:
src/internal/internal.h:124:55: warning: declaration of 'struct us_internal_ssl_socket_t' will not be visible outside of this function [-Wvisibility]
void *us_internal_ssl_socket_get_native_handle(struct us_internal_ssl_socket_t *s);
                                                      ^
src/internal/internal.h:125:63: warning: declaration of 'struct us_internal_ssl_socket_context_t' will not be visible outside of this function [-Wvisibility]
void *us_internal_ssl_socket_context_get_native_handle(struct us_internal_ssl_socket_context_t *context);
                                                              ^
2 warnings generated.
In file included from src/crypto/openssl.c:21:
src/internal/internal.h:124:55: warning: declaration of 'struct us_internal_ssl_socket_t' will not be visible outside of this function [-Wvisibility]
void *us_internal_ssl_socket_get_native_handle(struct us_internal_ssl_socket_t *s);
                                                      ^
src/internal/internal.h:125:63: warning: declaration of 'struct us_internal_ssl_socket_context_t' will not be visible outside of this function [-Wvisibility]
void *us_internal_ssl_socket_context_get_native_handle(struct us_internal_ssl_socket_context_t *context);
                                                              ^
src/crypto/openssl.c:374:7: error: conflicting types for 'us_internal_ssl_socket_context_get_native_handle'
void *us_internal_ssl_socket_context_get_native_handle(struct us_internal_ssl_socket_context_t *context) {
      ^
src/internal/internal.h:125:7: note: previous declaration is here
void *us_internal_ssl_socket_context_get_native_handle(struct us_internal_ssl_socket_context_t *context);
      ^
src/crypto/openssl.c:526:7: error: conflicting types for 'us_internal_ssl_socket_get_native_handle'
void *us_internal_ssl_socket_get_native_handle(struct us_internal_ssl_socket_t *s) {
      ^
src/internal/internal.h:124:7: note: previous declaration is here
void *us_internal_ssl_socket_get_native_handle(struct us_internal_ssl_socket_t *s);
      ^
2 warnings and 2 errors generated.
gmake: *** [Makefile:50: default] Error 1
*** Error 2 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2922 '/usr/obj/ports/usockets-0.4.0/.build_done': @cd /usr/obj/ports/usockets-0.4...)
*** Error 2 in /usr/ports/net/usockets (/usr/ports/infrastructure/mk/bsd.port.mk:2581 'build': @lock=usockets-0.4.0p0;  export _LOCKS_HELD="...)

Without openssl it is building fine.

ghost commented 4 years ago

Yes apparently I forgot it's not WITH_SSL, it's WITH_OPENSSL. This is fixed in v0.4.1