Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libmd: fix build with gcc #25950

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions devel/libmd/Portfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortSystem 1.0

name libmd
epoch 1
version 1.1.0
revision 0
categories devel
license BSD ISC Permissive
platforms darwin
maintainers {raimue @raimue} \
openmaintainer

Expand All @@ -30,3 +29,6 @@ checksums rmd160 1d8cfb5504ac71a50dc4c9372dee56fa721f5ac4 \
# hide away a bunch of generically-named header files
# see https://trac.macports.org/ticket/66832
configure.args --includedir=${prefix}/include/libmd

# https://trac.macports.org/ticket/70706
patchfiles-append patch-sha2.diff
18 changes: 18 additions & 0 deletions devel/libmd/files/patch-sha2.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--- src/sha2.c 2023-04-09 18:24:46.000000000 +0800
+++ src/sha2.c 2024-09-27 05:04:13.000000000 +0800
@@ -280,13 +280,13 @@
context->bitcount[0] = 0;
}

-#ifdef libmd_strong_alias
+#if defined(libmd_strong_alias) && defined(__clang__)
libmd_strong_alias(SHA224Transform, SHA256Transform);
libmd_strong_alias(SHA224Update, SHA256Update);
libmd_strong_alias(SHA224Pad, SHA256Pad);
#else
void
-SHA224Transform(uint64_t state[8], const uint8_t data[SHA256_BLOCK_LENGTH])
+SHA224Transform(uint32_t state[8], const uint8_t data[SHA256_BLOCK_LENGTH])
{
SHA256Transform(state, data);
}