On 2018-06-26 at 11:16, Charlie Gibbs wrote:
> I've written a software suite using openssl-1.1.0f and libssh2-1.8.0.
> On my main development box, everything compiles fine, but on my laptop
> it can't find the OpenSSL library. Here's my console output:
>
> cc -c revdate.c
> cc -O -DLINUX -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0
> -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0
> -lglib-2.0 -o linux/GenStart GenStart.c revdate.o linuxo/genesis.a
> -lcurses -lssh2 -lssl -lcrypto
> linuxo/genesis.a(gensock.o): In function `socksslstart':
> gensock.c:(.text+0x1c9): undefined reference to `OPENSSL_init_ssl'
> gensock.c:(.text+0x1d8): undefined reference to `OPENSSL_init_ssl'
> gensock.c:(.text+0x1e6): undefined reference to `TLS_server_method'
> gensock.c:(.text+0x3f1): undefined reference to `TLS_client_method'
> /usr/bin/ld: linuxo/genesis.a(gensock.o): unrecognized relocation (0x2a)
> in section `.text'
> /usr/bin/ld: final link failed: Bad value
> collect2: error: ld returned 1 exit status
> make: *** [linux/GenStart] Error 1
> makefile.lnx:376: recipe for target 'linux/GenStart' failed
>
> I'm running Stretch on the desktop box; "cat /etc/debian_version"
> returns "9.2". The failing laptop is still running a patched version of
> Jessie; "cat /etc/debian_version" returns "jessie/sid". Both are 64-bit
> systems.
What version of ld are you running on each? ('apt-cache policy binutils'
or 'ld --version' should tell you.)
According to my reading of the (current?) first answer on
https://stackoverflow.com/questions/46058050/unable-to-compile-unrecognized-relocation
this failure occurs when:
* A version of ld which supports a new relocation type has been released.
* A library has been compiled using that new version.
* You attempt to link against that library using an older version of ld,
which does not yet support that new relocation type.
> Do I need to upgrade my laptop?
As a whole, probably not.
You probably do need to upgrade the binutils package, however - and the
dependencies involved in doing that may result in upgrading enough other
low-level things that you might want to upgrade the rest of the system
along with it.
--
The Wanderer
The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man. -- George Bernard Shaw
Attachment:
signature.asc
Description: OpenPGP digital signature