Opened 6 months ago
Closed 7 weeks ago
#1469 closed Bug / Defect (fixed-external)
DCO tree on Ubuntu 20.04 does not build with OpenSSL 3.0.5
Reported by: | Gert Döring | Owned by: | Antonio Quartulli |
---|---|---|---|
Priority: | major | Milestone: | release 2.6 |
Component: | Generic / unclassified | Version: | OpenVPN git master branch (Community Ed) |
Severity: | Not set (select this one, unless your'e a OpenVPN developer) | Keywords: | dco, building, ubuntu2004, libnl, pkg-config |
Cc: |
Description
Having OpenSSL 1.1.1 in the standard system library path and OpenSSL 3.0.x in a custom path fails, because pkg-config for libnl injects -L/usr/lib/x86_64-linux-gnu
in the link path, so -lssl -lcrypto
finds the wrong library:
... cryptoapi.o -Wl,-rpath=/home/openssl-3.0.5/lib64 ../../src/compat/.libs/libcompat.a -L/usr/lib/x86_64-linux-gnu -lnsl -lresolv -llzo2 -L/usr/lib -llz4 -L/home/openssl-3.0.5/lib64 -lssl -lcrypto -ldl -lnl-genl-3 -lnl-3
Arguably the bug is in Ubuntu's .pc file
$ pkg-config --libs --print-errors "libnl-genl-3.0 >= 3.4.0" -L/usr/lib/x86_64-linux-gnu -lnl-genl-3 -lnl-3
but I think our configure could be a bit smarter about command line placement - so if we place "things that are not pkg-config" in front (OPENSSL_LIBS, LZO_LIBS, ...) - assuming that those will be "in that place, there is only this single library" - we'd be more robust against .pc stupidity.
We might want to file an ubuntu bug as well, but I think this is likely to hit us again - so if we can handle it, even better.
Change History (2)
comment:1 Changed 6 months ago by
comment:2 Changed 7 weeks ago by
Resolution: | → fixed-external |
---|---|
Status: | assigned → closed |
So, it turns out that this is an Ubuntu "too many choices" weirdness.
There is "pkgconf", which does
$ pkg-config -libs libnl-genl-3.0 -L/usr/lib/x86_64-linux-gnu -lnl-genl-3 -lnl-3
and there is "pkg-config", which you get by explicitly asking for it...
$ SU apt-get install pkg-config ... The following packages will be REMOVED: pkgconf The following NEW packages will be installed: pkg-config ...
... and then:
$ pkg-config --libs libnl-genl-3.0 -lnl-genl-3 -lnl-3
which will make the build succeed.
Recording this here, in full detail, in case someone else bumps into this - but we're not going to do anything about it on the OpenVPN build side for now.
Can you try this patch and see how that works out for you?