Re: [MacPorts] #58060: Build error on Ubuntu: unknown type name ‘SHA2_CTX’ / conflicting types for ‘SHA256_CTX’

MacPorts noreply at macports.org
Tue Apr 27 01:32:59 UTC 2021


#58060: Build error on Ubuntu: unknown type name ‘SHA2_CTX’ / conflicting types for
‘SHA256_CTX’
---------------------+--------------------
  Reporter:  mojca   |      Owner:  (none)
      Type:  defect  |     Status:  new
  Priority:  Low     |  Milestone:
 Component:  base    |    Version:
Resolution:          |   Keywords:
      Port:          |
---------------------+--------------------

Comment (by Ionic):

 If you don't have `libmd` installed, `libcrypto` (i.e., OpenSSL and
 derivatives) will be used.

 Now, if you do have `libmd` installed, this library ships a `sha256.h`
 header file which includes `sha2.h`.

 The issue is that base also ships an (incompatible) `sha2.h` header file
 (which should only be getting used if neither `libmd` nor `libcrypto` are
 available) in `src/pextlib1.0`, which wrongly gets included by `libmd`'s
 `sha256.h` header file, making the build fail.

 I'd propose to move pextlib's stand-alone SHA2 implementation
 (`sha2.{c,h}`) to `src/compat/sha2`.

 That should fix this. Up until it breaks because a library changes API,
 but that'll always be a risk.

 Speaking of which... there is more breakage.

 `aclocal.m4` checks for `SHA1_File` via `AC_CHECK_FUNCS`, which explicitly
 requires a symbol the linker can find. Neither FreeBSD's nor `libmd` nor
 the standalone `libmd` that is getting used on Linux systems define such a
 symbol - instead, most often it's a macro. So we'll have to switch to
 `AC_CHECK_DECLS` instead.

 With that, using `libmd` should finally work again.

 Everyone on board with that?

-- 
Ticket URL: <https://trac.macports.org/ticket/58060#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list