comp.lang.ada
 help / color / mirror / Atom feed
* link error AWS with SSL on debian 9 64 bit
@ 2017-08-28 10:29 Björn Lundin
  2017-08-28 15:52 ` Pascal Obry
  2017-09-09  1:53 ` David Thompson
  0 siblings, 2 replies; 5+ messages in thread
From: Björn Lundin @ 2017-08-28 10:29 UTC (permalink / raw)



Hi!
The following problem was posted on AWS-mailing liust 2017-08-20 and
did not receive any reply. I repost it here in hope of a bigger audience.


Having a production machine on 64 bit debian 8 I got

bnl@prod:~$ apt-cache pkgnames | grep -i libssl | sort
libssl1.0.0
libssl1.0.0-dbg
libssl-dev
libssl-doc
libssl-ocaml
libssl-ocaml-dev


and a dev machine on 64 bit debian 9 with

bnl@tp:~/svn/bnlbot/botstart/bot-1-0/source/ada$ apt-cache pkgnames |
grep libssl | sort
libssl1.0.0
libssl1.0.2
libssl1.0-dev
libssl1.1
libssl-dev
libssl-doc
libssl-ocaml
libssl-ocaml-dev
bnl@tp:~/svn/bnlbot/botstart/bot-1-0/source/ada$


To build AWS with ssl support I set

SOCKET    = openssl


in makefile.conf

Building AWS itself works on both debians but using it does not work on
debian 9

   [link]         poll.adb
/usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):
In function `aws__net__ssl__locking__initializeXnn':
aws-net-ssl__openssl.adb:(.text+0x6b0a): undefined reference to
`CRYPTO_set_id_callback'
aws-net-ssl__openssl.adb:(.text+0x6b14): undefined reference to
`CRYPTO_set_locking_callback'
aws-net-ssl__openssl.adb:(.text+0x6b1e): undefined reference to
`CRYPTO_set_dynlock_create_callback'
aws-net-ssl__openssl.adb:(.text+0x6b28): undefined reference to
`CRYPTO_set_dynlock_lock_callback'
/usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):
In function `aws__net__ssl__ciphers':
aws-net-ssl__openssl.adb:(.text+0x7e76): undefined reference to
`SSLv23_method'
/usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):
In function `aws__net__ssl__signature__3':
aws-net-ssl__openssl.adb:(.text+0x9248): undefined reference to
`EVP_MD_CTX_create'
aws-net-ssl__openssl.adb:(.text+0x931e): undefined reference to
`EVP_MD_CTX_destroy'
/usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):
In function `aws__net__ssl__set_accept_state':
aws-net-ssl__openssl.adb:(.text+0xb1aa): undefined reference to
`SSL_set_tmp_rsa_callback'
/usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):
In function `aws__net__ssl__version':
aws-net-ssl__openssl.adb:(.text+0xd9e9): undefined reference to
`SSLeay_version'
aws-net-ssl__openssl.adb:(.text+0xda86): undefined reference to
`SSLeay_version'
aws-net-ssl__openssl.adb:(.text+0xdaa0): undefined reference to
`SSLeay_version'
aws-net-ssl__openssl.adb:(.text+0xdaba): undefined reference to
`SSLeay_version'
aws-net-ssl__openssl.adb:(.text+0xdad4): undefined reference to
`SSLeay_version'
/usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):
In function `aws__net__ssl___elabb':
aws-net-ssl__openssl.adb:(.text+0xe177): undefined reference to
`CRYPTO_num_locks'
aws-net-ssl__openssl.adb:(.text+0xe2ff): undefined reference to
`SSL_load_error_strings'
aws-net-ssl__openssl.adb:(.text+0xe304): undefined reference to
`SSL_library_init'
aws-net-ssl__openssl.adb:(.text+0xe31e): undefined reference to
`SSL_CTX_get_ex_new_index'
/usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):
In function `aws__net__ssl___elabs':
aws-net-ssl__openssl.adb:(.text+0xe492): undefined reference to `SSLeay'
/usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):
In function `aws__net__ssl__locking__initializeXnn':
aws-net-ssl__openssl.adb:(.text+0x6b36): undefined reference to
`CRYPTO_set_dynlock_destroy_callback'
/usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):(.rodata+0x16c0):
undefined reference to `SSLv23_method'
/usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):(.rodata+0x16c8):
undefined reference to `SSLv23_server_method'
/usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):(.rodata+0x16d0):
undefined reference to `SSLv23_client_method'
/usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):(.rodata+0x1720):
undefined reference to `SSLv23_method'
/usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):(.rodata+0x1728):
undefined reference to `SSLv23_server_method'
/usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):(.rodata+0x1730):
undefined reference to `SSLv23_client_method'
collect2: error: ld returned 1 exit status
gprbuild: link of poll.adb failed
makefile:67: receptet för målet ”adabot” misslyckades
make[1]: *** [adabot] Fel 4
make[1]: Lämnar katalogen
”/home/bnl/svn/bnlbot/botstart/bot-1-0/source/ada”


bnl@tp:~/svn/bnlbot/botstart/bot-1-0/source/ada$ uname -a
Linux tp 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64
GNU/Linux
bnl@tp:~/svn/bnlbot/botstart/bot-1-0/source/ada$


bnl@tp:~/svn/bnlbot/botstart/bot-1-0/source/ada$ gnatls -v

GNATLS GPL 2017 (20170515-63)
Copyright (C) 1997-2017, Free Software Foundation, Inc.

Source Search Path:
   <Current_Directory>

/usr/local/ada/gpl2017/gnatx64/lib/gcc/x86_64-pc-linux-gnu/6.3.1/rts-native/adainclude



Object Search Path:
   <Current_Directory>

/usr/local/ada/gpl2017/gnatx64/lib/gcc/x86_64-pc-linux-gnu/6.3.1/rts-native/adalib



Project Search Path:
   <Current_Directory>
   /usr/local/ada/aws/gpl2017_ssl/share/gpr
   /usr/local/ada/gpl2017/gnatx64/lib/gnat
   /usr/local/ada/gpl2017/share/gpr
   /usr/local/ada/gpl2017/lib/gnat
   /usr/local/ada/gpl2017/gnatx64/x86_64-pc-linux-gnu/lib/gnat
   /usr/local/ada/gpl2017/gnatx64/x86_64-pc-linux-gnu/share/gpr
   /usr/local/ada/gpl2017/gnatx64/share/gpr
   /usr/local/ada/gpl2017/gnatx64/lib/gnat



Looking around internet it seems like openssl changed a bit between 1.0
and 1.1

How is this best handled ?

-- 
--
Björn

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: link error AWS with SSL on debian 9 64 bit
  2017-08-28 10:29 link error AWS with SSL on debian 9 64 bit Björn Lundin
@ 2017-08-28 15:52 ` Pascal Obry
  2017-09-09  1:53 ` David Thompson
  1 sibling, 0 replies; 5+ messages in thread
From: Pascal Obry @ 2017-08-28 15:52 UTC (permalink / raw)


Le lundi 28 août 2017 à 12:29 +0200, Björn Lundin a écrit :
> The following problem was posted on AWS-mailing liust 2017-08-20 and
> did not receive any reply. I repost it here in hope of a bigger
> audience.

The AWS mailing list has been discontinued. Please report issues via
GitHub now that AWS is there.

And note that in august people may be in vacation :)

-- 
  Pascal Obry /  Magny Les Hameaux (78)

  The best way to travel is by means of imagination

  http://www.obry.net

  gpg --keyserver keys.gnupg.net --recv-key F949BD3B


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: link error AWS with SSL on debian 9 64 bit
  2017-08-28 10:29 link error AWS with SSL on debian 9 64 bit Björn Lundin
  2017-08-28 15:52 ` Pascal Obry
@ 2017-09-09  1:53 ` David Thompson
  2017-09-09 12:13   ` Brian Drummond
  2017-09-14  8:04   ` [SOLVED] " Björn Lundin
  1 sibling, 2 replies; 5+ messages in thread
From: David Thompson @ 2017-09-09  1:53 UTC (permalink / raw)


On Mon, 28 Aug 2017 12:29:40 +0200, Björn Lundin
<b.f.lundin@gmail.com> wrote:

> and a dev machine on 64 bit debian 9 with
> 
> bnl@tp:~/svn/bnlbot/botstart/bot-1-0/source/ada$ apt-cache pkgnames |
> grep libssl | sort
> libssl1.0.0
> libssl1.0.2
> libssl1.0-dev
> libssl1.1
> libssl-dev
> libssl-doc
> libssl-ocaml
> libssl-ocaml-dev
> bnl@tp:~/svn/bnlbot/botstart/bot-1-0/source/ada$
> 
> 
> To build AWS with ssl support I set
> 
> SOCKET    = openssl
> 
> 
> in makefile.conf
> 
> Building AWS itself works on both debians but using it does not work on
> debian 9
> 
>    [link]         poll.adb
> /usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):
> In function `aws__net__ssl__locking__initializeXnn':
> aws-net-ssl__openssl.adb:(.text+0x6b0a): undefined reference to
> `CRYPTO_set_id_callback'
> aws-net-ssl__openssl.adb:(.text+0x6b14): undefined reference to
> `CRYPTO_set_locking_callback'
> aws-net-ssl__openssl.adb:(.text+0x6b1e): undefined reference to
> `CRYPTO_set_dynlock_create_callback'
> aws-net-ssl__openssl.adb:(.text+0x6b28): undefined reference to
> `CRYPTO_set_dynlock_lock_callback'

You appear to be getting OpenSSL 1.1.0. 1.1.0 changed threading and
locking bigtime; this will probably need code changes.

> /usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):
> In function `aws__net__ssl__ciphers':
> aws-net-ssl__openssl.adb:(.text+0x7e76): undefined reference to
> `SSLv23_method'

1.1.0 changed this (long-out-of-date) name to TLS_method, although the
old name _should_ be available as a compatibility macro.

> /usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):
> In function `aws__net__ssl__signature__3':
> aws-net-ssl__openssl.adb:(.text+0x9248): undefined reference to
> `EVP_MD_CTX_create'
> aws-net-ssl__openssl.adb:(.text+0x931e): undefined reference to
> `EVP_MD_CTX_destroy'

Renamed _new and _free to be consistent with (many) other modules.

> /usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):
> In function `aws__net__ssl__set_accept_state':
> aws-net-ssl__openssl.adb:(.text+0xb1aa): undefined reference to
> `SSL_set_tmp_rsa_callback'

set_tmp_rsa was only used for 'export' ciphersuites which have been
broken and obsolete for over 20 years and were finally removed,
although compatibility macros that should have hidden this.

> /usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):
> In function `aws__net__ssl__version':
> aws-net-ssl__openssl.adb:(.text+0xd9e9): undefined reference to
> `SSLeay_version'
> aws-net-ssl__openssl.adb:(.text+0xda86): undefined reference to
> `SSLeay_version'
> aws-net-ssl__openssl.adb:(.text+0xdaa0): undefined reference to
> `SSLeay_version'
> aws-net-ssl__openssl.adb:(.text+0xdaba): undefined reference to
> `SSLeay_version'
> aws-net-ssl__openssl.adb:(.text+0xdad4): undefined reference to
> `SSLeay_version'

Renamed OpenSSL_version, again compatibility macro should handle.

> /usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):
> In function `aws__net__ssl___elabb':
> aws-net-ssl__openssl.adb:(.text+0xe177): undefined reference to
> `CRYPTO_num_locks'

Obsoleted by the threading changes (above) but again compatibility
macros should handle.

> aws-net-ssl__openssl.adb:(.text+0xe2ff): undefined reference to
> `SSL_load_error_strings'
> aws-net-ssl__openssl.adb:(.text+0xe304): undefined reference to
> `SSL_library_init'
> aws-net-ssl__openssl.adb:(.text+0xe31e): undefined reference to
> `SSL_CTX_get_ex_new_index'

Changed but compatibility macros should handle.

> /usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):
> In function `aws__net__ssl___elabs':
> aws-net-ssl__openssl.adb:(.text+0xe492): undefined reference to `SSLeay'
> /usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):
> In function `aws__net__ssl__locking__initializeXnn':
> aws-net-ssl__openssl.adb:(.text+0x6b36): undefined reference to
> `CRYPTO_set_dynlock_destroy_callback'
> /usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):(.rodata+0x16c0):
> undefined reference to `SSLv23_method'
> /usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):(.rodata+0x16c8):
> undefined reference to `SSLv23_server_method'
> /usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):(.rodata+0x16d0):
> undefined reference to `SSLv23_client_method'
> /usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):(.rodata+0x1720):
> undefined reference to `SSLv23_method'
> /usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):(.rodata+0x1728):
> undefined reference to `SSLv23_server_method'
> /usr/local/ada/aws/gpl2017_ssl/lib/aws/libaws.a(aws-net-ssl__openssl.o):(.rodata+0x1730):
> undefined reference to `SSLv23_client_method'

Dupes of above.

> collect2: error: ld returned 1 exit status
> gprbuild: link of poll.adb failed
> makefile:67: receptet för målet ”adabot” misslyckades
> make[1]: *** [adabot] Fel 4
> make[1]: Lämnar katalogen
> ”/home/bnl/svn/bnlbot/botstart/bot-1-0/source/ada”
> 

If (AWS) code has not yet been updated to deal with OpenSSL 1.1.0 API
changes, you are probably best off using 1.0.x. I don't use Debian,
but the fact libssl-dev and libssl1.0-dev are separate packages
suggests there is some way to make 1.0.x available to AWS.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: link error AWS with SSL on debian 9 64 bit
  2017-09-09  1:53 ` David Thompson
@ 2017-09-09 12:13   ` Brian Drummond
  2017-09-14  8:04   ` [SOLVED] " Björn Lundin
  1 sibling, 0 replies; 5+ messages in thread
From: Brian Drummond @ 2017-09-09 12:13 UTC (permalink / raw)


On Fri, 08 Sep 2017 21:53:56 -0400, David Thompson wrote:

> On Mon, 28 Aug 2017 12:29:40 +0200, Björn Lundin <b.f.lundin@gmail.com>
> wrote:
>> 
>> Building AWS itself works on both debians but using it does not work on
>> debian 9
>> 
> 
> 1.1.0 changed this (long-out-of-date) name to TLS_method, although the
> old name _should_ be available as a compatibility macro.

Just to comment on this part : was "gcc -fdump-ada-spec" involved 
anywhere in this process?

It doesn't translate macros, or didn't, or not very well, when I last 
used it (not on SSL but other projects). I created a separate package and 
hand-translated into it any macros I needed (as function calls or 
constants). Separate package is then "with/use"d alongside the auto-
generated thin bindings.

-- Brian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [SOLVED] Re: link error AWS with SSL on debian 9 64 bit
  2017-09-09  1:53 ` David Thompson
  2017-09-09 12:13   ` Brian Drummond
@ 2017-09-14  8:04   ` Björn Lundin
  1 sibling, 0 replies; 5+ messages in thread
From: Björn Lundin @ 2017-09-14  8:04 UTC (permalink / raw)


On 2017-09-09 03:53, David Thompson wrote:
> On Mon, 28 Aug 2017 12:29:40 +0200, Björn Lundin
> <b.f.lundin@gmail.com> wrote:
> 
> 
> You appear to be getting OpenSSL 1.1.0. 1.1.0 changed threading and
> locking bigtime; this will probably need code changes.

Thanks for the insightful  comments.

I did as Pascal said - opened an issue at GitHub.
There he suggested to install libssl1.0-dev.
This made AWS to build.
Also my code build ok - except for warnings issued by libpq (postgresql
client lib).
But this is a dev machine so I find that ok.
The prod has no issues with that
I have re-installed the dev machine (for other reasons)
with ubuntu (to get my dock to work)
so - for me - the issue is resolved

-- 
--
Björn

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-09-14  8:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-28 10:29 link error AWS with SSL on debian 9 64 bit Björn Lundin
2017-08-28 15:52 ` Pascal Obry
2017-09-09  1:53 ` David Thompson
2017-09-09 12:13   ` Brian Drummond
2017-09-14  8:04   ` [SOLVED] " Björn Lundin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox