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

Multiple cgo warnings and undefined references #83

Open
stanier opened this issue Feb 6, 2017 · 0 comments
Open

Multiple cgo warnings and undefined references #83

stanier opened this issue Feb 6, 2017 · 0 comments

Comments

@stanier
Copy link

stanier commented Feb 6, 2017

When following the instructions supplied in the repository, I am getting numerous errors relating to cgo compilation. I've tried removing individual CFLAGs, yielding the same result each time. This leads me to believe that CFLAGs either do not gag their corresponding warnings or that they are being ignored in compilation altogether.

Past the warnings, I'm getting multiple build errors related to undefined references.

 github.com/zubairhamed/canopus
In file included from $WORK/github.com/zubairhamed/canopus/_obj/_cgo_export.c:3:0:
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go: In function ‘psk_callback’:
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:145:29: warning: passing argument 2 of ‘go_psk_callback’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  return go_psk_callback(ssl,hint,identity,max_identity_len,(char*)psk,max_psk_len);
                             ^~~~
In file included from $WORK/github.com/zubairhamed/canopus/_obj/_cgo_export.c:3:0:
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:104:21: note: expected ‘char *’ but argument is of type ‘const char *’
 extern unsigned int go_psk_callback(SSL *ssl, char *hint, char *identity, unsigned int max_identity_len, char *psk, unsigned int max_psk_len);
                     ^~~~~~~~~~~~~~~
# github.com/zubairhamed/canopus
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go: In function ‘psk_callback’:
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:145:29: warning: passing argument 2 of ‘go_psk_callback’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  return go_psk_callback(ssl,hint,identity,max_identity_len,(char*)psk,max_psk_len);
                             ^~~~
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:104:21: note: expected ‘char *’ but argument is of type ‘const char *’
 extern unsigned int go_psk_callback(SSL *ssl, char *hint, char *identity, unsigned int max_identity_len, char *psk, unsigned int max_psk_len);
                     ^~~~~~~~~~~~~~~
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go: In function ‘_cgo_81a35f110302_Cfunc_DTLSv1_2_client_method’:
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:340:2: warning: ‘DTLSv1_2_client_method’ is deprecated [-Wdeprecated-declarations]
 
  ^
In file included from /home/keyton/go/src/github.com/zubairhamed/canopus/openssl/include/openssl/ct.h:13:0,
                 from /home/keyton/go/src/github.com/zubairhamed/canopus/openssl/include/openssl/ssl.h:61,
                 from /home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:10:
/home/keyton/go/src/github.com/zubairhamed/canopus/openssl/include/openssl/ssl.h:1643:45: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_2_client_method(void)) /* DTLSv1.2 */
                                             ^
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go: In function ‘_cgo_81a35f110302_Cfunc_DTLSv1_2_server_method’:
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:356:2: warning: ‘DTLSv1_2_server_method’ is deprecated [-Wdeprecated-declarations]
   return ""
  ^
In file included from /home/keyton/go/src/github.com/zubairhamed/canopus/openssl/include/openssl/ct.h:13:0,
                 from /home/keyton/go/src/github.com/zubairhamed/canopus/openssl/include/openssl/ssl.h:61,
                 from /home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:10:
/home/keyton/go/src/github.com/zubairhamed/canopus/openssl/include/openssl/ssl.h:1642:45: note: declared here
 DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_2_server_method(void)) /* DTLSv1.2 */
                                             ^
# github.com/zubairhamed/canopus
/tmp/go-build200340458/github.com/zubairhamed/canopus/_obj/_cgo_main.o:(.data.rel+0x0): undefined reference to `DTLSv1_listen'
/tmp/go-build200340458/github.com/zubairhamed/canopus/_obj/dtls.cgo2.o: In function `go_bio_create':
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:114: undefined reference to `BIO_set_init'
/tmp/go-build200340458/github.com/zubairhamed/canopus/_obj/dtls.cgo2.o: In function `_cgo_81a35f110302_Cfunc_BIO_get_data':
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:201: undefined reference to `BIO_get_data'
/tmp/go-build200340458/github.com/zubairhamed/canopus/_obj/dtls.cgo2.o: In function `_cgo_81a35f110302_Cfunc_BIO_get_shutdown':
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:219: undefined reference to `BIO_get_shutdown'
/tmp/go-build200340458/github.com/zubairhamed/canopus/_obj/dtls.cgo2.o: In function `_cgo_81a35f110302_Cfunc_DTLSv1_2_client_method':
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:340: undefined reference to `DTLSv1_2_client_method'
/tmp/go-build200340458/github.com/zubairhamed/canopus/_obj/dtls.cgo2.o: In function `_cgo_81a35f110302_Cfunc_DTLSv1_2_server_method':
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:356: undefined reference to `DTLSv1_2_server_method'
/tmp/go-build200340458/github.com/zubairhamed/canopus/_obj/dtls.cgo2.o: In function `init_lib':
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:56: undefined reference to `OPENSSL_init_ssl'
/tmp/go-build200340458/github.com/zubairhamed/canopus/_obj/dtls.cgo2.o: In function `init_session_bio_method':
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:62: undefined reference to `BIO_meth_new'
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:63: undefined reference to `BIO_meth_set_write'
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:64: undefined reference to `BIO_meth_set_read'
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:65: undefined reference to `BIO_meth_set_ctrl'
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:66: undefined reference to `BIO_meth_set_create'
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:67: undefined reference to `BIO_meth_set_destroy'
/tmp/go-build200340458/github.com/zubairhamed/canopus/_obj/dtls.cgo2.o: In function `_cgo_81a35f110302_Cfunc_BIO_set_data':
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:283: undefined reference to `BIO_set_data'
/tmp/go-build200340458/github.com/zubairhamed/canopus/_obj/dtls.cgo2.o: In function `_cgo_81a35f110302_Cfunc_BIO_set_init':
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:311: undefined reference to `BIO_set_init'
/tmp/go-build200340458/github.com/zubairhamed/canopus/_obj/dtls.cgo2.o: In function `init_lib':
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:58: undefined reference to `OPENSSL_init_ssl'
/tmp/go-build200340458/github.com/zubairhamed/canopus/_obj/dtls.cgo2.o: In function `setGoClientId':
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:156: undefined reference to `BIO_set_data'
/tmp/go-build200340458/github.com/zubairhamed/canopus/_obj/dtls.cgo2.o: In function `setGoSessionId':
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:97: undefined reference to `BIO_set_data'
/tmp/go-build200340458/github.com/zubairhamed/canopus/_obj/dtls.cgo2.o: In function `set_cookie_option':
/home/keyton/go/src/github.com/zubairhamed/canopus/dtls.go:87: undefined reference to `SSL_set_options'

I'm not sure if this is an issue caused by my negligence or if there is something wrong with the build? My versions are as follow:

  • Distro: Ubuntu 14.04 linux/amd64
  • Go: 1.7.5
  • Openssl: 1.1.1-dev
  • Gcc: 6.2.0
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

1 participant