Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Aug 2025 00:58:41 +0000
From:      bugzilla-noreply@freebsd.org
To:        pkg@FreeBSD.org
Subject:   [Bug 289111] Should the bootstrap pkg get the "Fix symbols collision between libmd and libcrypto" fix too?
Message-ID:  <bug-289111-32340-X0pXlnSc7t@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-289111-32340@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289111

--- Comment #2 from Mark Millard <marklmi26-fbsd@yahoo.com> ---
(In reply to Xin LI from comment #1)

Note that the summary is in the form of a question
(as was the one for the orginal submittal) and that
bapt asked for this submittal.

However, bapt's original explanation of the change
in the port-pkg is:

QUOTE
Makefile: link libmd after openssl crypto libs
Some of the symbols exported by libmd have the same names as those in
libcrypto.  When they are statically link and libmd appears first in the
link order, some OpenSSL routines end up using libmd's implementations.
This causes problems since they aren't binary-compatible (OpenSSL's have
a return value and libssl furthermore checks the return value, so when
libmd implements them we end up comparing a garbage register with 0.)

Reorder libraries to work around this problem.  In FreeBSD main libmd
has been fixed such that this isn't a problem, but those patches aren't
in stable/14.  Note that libmd is only used by lzma.

See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=286532
END QUOTE

Looking in FreeBSD's usr.sbin/pkg/Makefile I see:

LIBADD= archive der fetch pkgecc ucl crypto ssl util md

And in releng/14.2 : LIBADD=    archive fetch ucl crypto ssl util md

Looking at the corrected port-pkg's src/makefile.autostup
shows:

@if PKG_OPENSSL_LIBS
LOCAL_CFLAGS+=  @PKG_OPENSSL_CFLAGS@
OTHER_LIBS+=    @PKG_OPENSSL_LDFLAGS@ @PKG_OPENSSL_LIBS@
@else
OTHER_LIBS+=    -lssl -lcrypto
@endif

# libmd must be linked after libssl/libcrypto.
@if HAVE_LIBMD
OTHER_LIBS+=    -lmd
@endif

So it may be that the order is already okay for libmd .
(I'm not as sure about the apparent reversal of libssl vs.
libcrypto .)


Ultimately, bapt's judgment guides things here. But he may
find it is a simple "not a bug".

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-289111-32340-X0pXlnSc7t>