Opened 6 years ago

Closed 5 years ago

#9230 closed defect (duplicate)

tor current compile breakage "libor-crypto.a" undefined EVP_aes_128_ctr

Reported by: yancm Owned by:
Priority: Medium Milestone: Tor: 0.2.4.x-final
Component: Core Tor/Tor Version: Tor: unspecified
Severity: Keywords: tor-client
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Compile stops with:
src/common/libor-crypto.a(aes.o): In function `aes_new_cipher':
src/common/aes.c:100: undefined reference to `EVP_aes_128_ctr'

using openssl=openssl-1.0.1enb1

I find a comment reference to a "commented out" function (EVP_aes_128_ctr) in openssl 1.0.0 in aes.c. I do not find a definition of this function in any file in src/common ...

Child Tickets

Attachments (1)

Makefile (137.3 KB) - added by yancm 6 years ago.
Modified Makefile to use /usr/pkg version of openssl

Download all attachments as: .zip

Change History (9)

comment:1 in reply to:  description Changed 6 years ago by yancm

I should have mentioned... trying to compile on NetBSD 5_Stable i386...

Replying to yancm:

Compile stops with:
src/common/libor-crypto.a(aes.o): In function `aes_new_cipher':
src/common/aes.c:100: undefined reference to `EVP_aes_128_ctr'

using openssl=openssl-1.0.1enb1

I find a comment reference to a "commented out" function (EVP_aes_128_ctr) in openssl 1.0.0 in aes.c. I do not find a definition of this function in any file in src/common ...

comment:2 Changed 6 years ago by nickm

Keywords: tor-client added
Milestone: Tor: 0.2.4.x-final

Hm. Well, you wouldn't expect to find it in openssl 1.0.0; it's new in openssl 1.0.1. That's why we do:

#if OPENSSL_VERSION_NUMBER >= OPENSSL_V_NOPATCH(1,0,1) &&               \
  ...
#define USE_EVP_AES_CTR
#endif

Is it possible that the version of openssl you're linking against doesn't match the one that Tor found the the headers for?

comment:3 Changed 6 years ago by nickm

(Also, when you say "tor current", do you mean 0.2.4.15-rc, or git master, or something else?)

Changed 6 years ago by yancm

Attachment: Makefile added

Modified Makefile to use /usr/pkg version of openssl

comment:4 Changed 6 years ago by yancm

git master ... sorry, used to NetBSD cvs nomenclature...but yes, I basically just do a "git pull" and update my source tree...then try to build...

I'm pretty sure I'm running into the same bug I encountered with bug report #9058

NetBSD stores locally updated packages in /usr/pkg rather than /usr/local .. to fix 9058 I went into the Makefile, after running configure, and changed all references to openssl to point at /usr/pkg/... trying to use the same syntax that is used with libevent...

it would be nice if:
./configure --with-libevent-dir=/usr/pkg --with-openssl-dir=/usr/pkg

did the right thing, but it appears not to...

nickm mentioned trying to get bug #6311 resolved, but reading the status, that seems to be stalled...

I'll attach my modified Makefile...maybe you can take a look and tell me what I missed pointing at the right openssl?

comment:5 Changed 6 years ago by nickm

Hm. I'm not so good at examining the generated makefiles, and I wouldn't recommend editing them directly. Can you run with "make V=1" and look for the actual line that tries to link the tor binary, but fails? That's likelier to tell us what we need to know.

Also, is it possible that the openssl in /usr/pkg is missing shared libraries, or that the libraries there don't match the headers? It would be good to rule that possibility out too.

comment:6 Changed 6 years ago by yancm

The only way I was able to get it to compile previously was to edit the generated Makefile directly (but I will give the make V=1 output below)... however... maybe we need to understand why the --with-openssl-dir=/usr/pkg flag to configure is not picking up the pkgsrc openssl as the primary problem here? configure clearly points to the system openssl (older) rather than the one in /usr/pkg...which is reflected in Makefile...

# make V=1
make all-am
gcc -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -fwrapv --param ssp-buffer-size=1 -fPIE -Wall -fno-strict-aliasing -pie -z relro -z now -o src/tools/tor-gencert src/tools/tor-gencert.o src/common/libor.a src/common/libor-crypto.a src/common/libcurve25519_donna.a -lm -lz -lssl -lcrypto -lpthread
src/common/libor-crypto.a(aes.o): In function `aes_new_cipher':
src/common/aes.c:100: undefined reference to `EVP_aes_128_ctr'
* Error code 1

Stop.
make: stopped in /usr/local/src/tor
* Error code 1

Stop.
make: stopped in /usr/local/src/tor
#

I do believe the pkgsrc openssl has a shared library:
In /ust/pkg/lib...
# ls -lasd *ssl*

0 lrwxr-xr-x 1 root wheel 29 Jun 10 20:43 libevent_openssl-2.0.so.5@ -> libevent_openssl-2.0.so.5.1.9

22 -rwxr-xr-x 1 root wheel 21841 Jun 10 20:43 libevent_openssl-2.0.so.5.1.9*
16 -rw-r--r-- 1 root wheel 14904 Jun 10 20:43 libevent_openssl.a

2 -rwxr-xr-x 1 root wheel 1074 Jun 10 20:43 libevent_openssl.la*
0 lrwxr-xr-x 1 root wheel 29 Jun 10 20:43 libevent_openssl.so@ -> libevent_openssl-2.0.so.5.1.9

512 -rw-r--r-- 1 root wheel 500698 Jun 3 17:53 libssl.a

0 lrwxr-xr-x 1 root wheel 15 Jun 3 17:53 libssl.so@ -> libssl.so.1.0.0

400 -r-xr-xr-x 1 root wheel 378867 Jun 3 17:53 libssl.so.1.0.0*
#
But not sure why the .so is identified as 1.0.0...
# /usr/pkg/bin/openssl
OpenSSL> version
OpenSSL 1.0.1e 11 Feb 2013
OpenSSL> exit
#

comment:7 Changed 6 years ago by yancm

Well...I "hid" the system (open)ssl headers and libraries and autogen/configure picked up the pkgsrc version of openssl and tor built and runs...

So now, I think I have confirmed that autogen/make is flaky at choosing the right openssl on NetBSD...

I'll speculate this is too obscure to get fix resources? <sigh>

comment:8 Changed 5 years ago by nickm

Resolution: duplicate
Status: newclosed

Not too obscure, but the right solution is going to be part of rewriting the autoconf stuff, which might happen as part of #1354 or #6311, but which is not going to happen as part of 0.2.4.x. I'm going to close this as a duplicate of #1354 , which I hope we can get done in 0.2.5. (It's been long enough!)

Note: See TracTickets for help on using tickets.