--- lib/freebl/Makefile.orig	2025-02-28 03:25:02.000000000 -0500
+++ lib/freebl/Makefile	2025-03-26 14:50:09.227846000 -0400
@@ -264,7 +264,7 @@
 endif
 endif # Darwin
 
-ifeq ($(OS_TARGET),Linux)
+ifeq (,$(filter-out Linux MidnightBSD, $(OS_TARGET)))
 ifeq ($(CPU_ARCH),x86_64)
     # Lower case s on mpi_amd64_common due to make implicit rules.
     ASFILES  = arcfour-amd64-gas.s mpi_amd64_common.s
@@ -358,7 +358,7 @@
 # to bind the blapi function references in FREEBLVector vector
 # (ldvector.c) to the blapi functions defined in the freebl
 # shared libraries.
-ifeq (,$(filter-out FreeBSD Linux NetBSD OpenBSD, $(OS_TARGET)))
+ifeq (,$(filter-out MidnightBSD FreeBSD Linux NetBSD OpenBSD, $(OS_TARGET)))
     MKSHLIB += -Wl,-Bsymbolic
 endif
 
