Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put libmd last in relayd's link order
libmd and libcrypto define some identical symbols, but they are not source-compatible since libmd's functions do not have a return value, while libcrypto's implementations always return 0. OpenSSL checks these return values, so when using libmd's implementations, it can fail in mysterious ways. Normally it's not a problem since libmd provides weak symbols so if libmd.so and libcrypto.so are both linked, libcrypto's implementations will be used. FreeBSD's net/relayd port changes relayd's link line to statically link LibreSSL. It looks like this after patching: LDADD= -lmd -L${PREFIX}/lib ${LIBEVENT} /usr/local/lib/libssl.a /usr/local/lib/libcrypto.a When mixing libmd.so with the libcrypto.a archive like this, libmd's symbols are used by LibreSSL, resulting in strange crashes. Link ordering rules are not really well defined when mixing dynamically and statically linked libraries like this, as far as I know. Moving libmd to the end of the link order fixes the problem, so this diff fixes the problem by doing just that.
- Loading branch information