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

no extern(C) for defined ssl functions. #1892

Closed
wants to merge 1 commit into from

Conversation

John-Colvin
Copy link
Contributor

See 44ee1ad#commitcomment-23653389

Otherwise they clash with the declarations in the openssl package.

John-Colvin referenced this pull request Aug 15, 2017
…nSSL11 version constant.

Fixes #1758.

Closes #1759. Closes #1748. Closes #1651.
@s-ludwig
Copy link
Member

Looks like we can remove all of those (OPENSSL)_sk_* symbols them altogether. Can you try if everything still links if you do that (I still didn't get around to install a distro that uses OpenSSL 1.1.0)?

@s-ludwig s-ludwig closed this in 42da581 Aug 18, 2017
@s-ludwig
Copy link
Member

Since there is still more than a week of RC phase and we can still fix this if necessary, I just made the change now.

@ximion
Copy link
Contributor

ximion commented Aug 18, 2017

Hi! When trying the Meson build with the new OpenSSL, the issue mentioned in this bug is fixed, but I now get linking errors:

[3/46] Linking target mail/vibe-test_mail.
FAILED: mail/vibe-test_mail 
ldc2  -of mail/vibe-test_mail 'mail/vibe-test_mail@exe/vibe_mail_smtp.d.o' -L-rpath=/srv/buildd/vibe.d/b/utils/:/srv/buildd/vibe.d/b/core/:/srv/buildd/vibe.d/b/data/:/srv/buildd/vibe.d/b/inet/:/srv/buildd/vibe.d/b/stream/:/srv/buildd/vibe.d/b/textfilter/:/srv/buildd/vibe.d/b/tls/ -Lutils/libvibe-utils.so.0.8.1 -Lcore/libvibe-core.so.0.8.1 -Ldata/libvibe-data.so.0.8.1 -Linet/libvibe-inet.so.0.8.1 -Lstream/libvibe-stream.so.0.8.1 -Ltls/libvibe-tls.so.0.8.1 -main -L-lz -L-lcrypto -L-lssl -L-levent  
tls/libvibe-tls.so.0.8.1: Warning: undefined reference to »sk_value«
tls/libvibe-tls.so.0.8.1: Warning: undefined reference to »sk_num«
collect2: error: ld returned 1 exit status
Error: /usr/bin/gcc failed with status: 1
[4/46] Linking target tls/vibe-test_tls.
FAILED: tls/vibe-test_tls 
ldc2  -of tls/vibe-test_tls 'tls/vibe-test_tls@exe/vibe_stream_botan.d.o' 'tls/vibe-test_tls@exe/vibe_stream_openssl.d.o' 'tls/vibe-test_tls@exe/vibe_stream_tls.d.o' -L-rpath=/srv/buildd/vibe.d/b/utils/:/srv/buildd/vibe.d/b/core/:/srv/buildd/vibe.d/b/data/:/srv/buildd/vibe.d/b/stream/ -Lutils/libvibe-utils.so.0.8.1 -Lcore/libvibe-core.so.0.8.1 -Ldata/libvibe-data.so.0.8.1 -Lstream/libvibe-stream.so.0.8.1 -main -L-lz -L-lcrypto -L-lssl -L-levent  
tls/vibe-test_tls@exe/vibe_stream_openssl.d.o: In Funktion »_D6deimos7openssl9safestack57__T10SKM_sk_numTS6deimos7openssl6x509v315GENERAL_NAME_stZ16__T10SKM_sk_numZ10SKM_sk_numFNbPS6deimos7openssl9safestack54__T8STACK_OFTS6deimos7openssl6x509v315GENERAL_NAME_stZ8STACK_OFZi«:
/srv/buildd/vibe.d/b/../lib/subprojects/openssl/deimos/openssl/safestack.d:140: Warning: undefined reference to »sk_num«
tls/vibe-test_tls@exe/vibe_stream_openssl.d.o: In Funktion »_D6deimos7openssl9safestack59__T12SKM_sk_valueTS6deimos7openssl6x509v315GENERAL_NAME_stZ18__T12SKM_sk_valueZ12SKM_sk_valueFNbPS6deimos7openssl9safestack54__T8STACK_OFTS6deimos7openssl6x509v315GENERAL_NAME_stZ8STACK_OFiZPS6deimos7openssl6x509v315GENERAL_NAME_st«:
/srv/buildd/vibe.d/b/../lib/subprojects/openssl/deimos/openssl/safestack.d:142: Warning: undefined reference to »sk_value«
collect2: error: ld returned 1 exit status
Error: /usr/bin/gcc failed with status: 1
[10/46] Linking target http/vibe-test_http.
FAILED: http/vibe-test_http 
ldc2  -of http/vibe-test_http 'http/vibe-test_http@exe/vibe_http_auth_basic_auth.d.o' 'http/vibe-test_http@exe/vibe_http_auth_digest_auth.d.o' 'http/vibe-test_http@exe/vibe_http_client.d.o' 'http/vibe-test_http@exe/vibe_http_common.d.o' 'http/vibe-test_http@exe/vibe_http_dist.d.o' 'http/vibe-test_http@exe/vibe_http_fileserver.d.o' 'http/vibe-test_http@exe/vibe_http_form.d.o' 'http/vibe-test_http@exe/vibe_http_log.d.o' 'http/vibe-test_http@exe/vibe_http_proxy.d.o' 'http/vibe-test_http@exe/vibe_http_router.d.o' 'http/vibe-test_http@exe/vibe_http_server.d.o' 'http/vibe-test_http@exe/vibe_http_session.d.o' 'http/vibe-test_http@exe/vibe_http_status.d.o' 'http/vibe-test_http@exe/vibe_http_websockets.d.o' -L-rpath=/srv/buildd/vibe.d/b/core/:/srv/buildd/vibe.d/b/utils/:/srv/buildd/vibe.d/b/data/:/srv/buildd/vibe.d/b/stream/:/srv/buildd/vibe.d/b/textfilter/:/srv/buildd/vibe.d/b/inet/:/srv/buildd/vibe.d/b/tls/:/srv/buildd/vibe.d/b/crypto/ -Lcore/libvibe-core.so.0.8.1 -Lutils/libvibe-utils.so.0.8.1 -Ldata/libvibe-data.so.0.8.1 -Lstream/libvibe-stream.so.0.8.1 -Ltextfilter/libvibe-textfilter.so.0.8.1 -Linet/libvibe-inet.so.0.8.1 -Ltls/libvibe-tls.so.0.8.1 -Lcrypto/libvibe-crypto.so.0.8.1 -main -L-lz -L-lcrypto -L-lssl -L-levent  
tls/libvibe-tls.so.0.8.1: Warning: undefined reference to »sk_num«
tls/libvibe-tls.so.0.8.1: Warning: undefined reference to »sk_value«
collect2: error: ld returned 1 exit status
Error: /usr/bin/gcc failed with status: 1
[12/46] Compiling D object 'mongodb/vibe-test_mongodb@exe/vibe_db_mongo_collection.d.o'.
ninja: build stopped: subcommand failed.

I wonder if that can be worked around in Vibe... The proper fix would be in the OpenSSL D bindings.

@s-ludwig
Copy link
Member

Hm, so this was in fact not just a left-over, but steps in for the the removed symbol in 1.1 and also has to be extern (C).

@John-Colvin, I assumed that the error you got was a linker error, too, but just realized that there was actually no actual error posted, so what was the actual issue? The only possibility that I can currently see is that there is a version of OpenSSL 1.1.x that still has sk_value defined. In that case, we'd either need to make this a weakly linked symbol, or switch to (yet to be) updated OpenSSL bindings.

@ximion
Copy link
Contributor

ximion commented Aug 18, 2017

@s-ludwig If I revert your patch, I get:

../lib/subprojects/openssl/deimos/openssl/stack.d(79): Error: Function type does not match previously declared function with the same mangled name: sk_num

So, there is definitely something to be fixed here ;-)

@s-ludwig
Copy link
Member

Does the following work correctly?

// #  define sk_num OPENSSL_sk_num
extern(C) int OPENSSL_sk_num(const void *);
extern(C) int sk_num(const(_STACK)* a) {
	return OPENSSL_sk_num(a);
}

// #  define sk_value OPENSSL_sk_value
extern(C) void *OPENSSL_sk_value(const void *, int);
extern(C) void *sk_value(const(_STACK)* s, int l) {
	return OPENSSL_sk_value(s, l);
}

_STACK appears to be public, so it looks like it should.

@ximion ximion mentioned this pull request Aug 18, 2017
@ximion
Copy link
Contributor

ximion commented Aug 18, 2017

@s-ludwig Yes, this works - I just did the same and created a pull-request for it before noticing your reply :P

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

Successfully merging this pull request may close these issues.

3 participants