$NetBSD: patch-an,v 1.2 2006/10/22 15:32:47 dmcmahill Exp $

https://bugzilla.mozilla.org/show_bug.cgi?id=323977
https://bugzilla.mozilla.org/attachment.cgi?id=209007&action=view

Added DragonFly.

Also, when building on solaris with gcc, be sure to correctly set the
flags used by the solaris assembler which is explicitly called out in
the makefile in a couple of places.  This prevents errors when trying to
assemble files which contain cpu specific instructions.

--- mozilla/security/nss/lib/freebl/Makefile.orig	2005-11-22 02:13:32.000000000 -0500
+++ mozilla/security/nss/lib/freebl/Makefile
@@ -188,6 +188,17 @@ endif
 endif
 endif
 
+# The blapi functions are defined not only in the freebl shared
+# libraries but also in the shared libraries linked with loader.c
+# (libsoftokn3.so and libssl3.so).  We need to use GNU ld's
+# -Bsymbolic option or the equivalent option for other linkers
+# to bind the blapi function references in FREEBLVector vector
+# (ldvector.c) to the blapi functions defined in the freebl
+# shared libraries.
+ifeq (,$(filter-out BSD_OS FreeBSD Linux NetBSD DragonFly, $(OS_TARGET)))
+    MKSHLIB += -Wl,-Bsymbolic
+endif
+
 ifeq ($(OS_TARGET),SunOS)
 
 # The -R '$ORIGIN' linker option instructs this library to search for its
@@ -227,16 +238,20 @@ ifeq ($(CPU_ARCH),sparc)
 	endif
 	ifdef USE_ABI32_INT64
 	    ARCHFLAG=-mcpu=v9 -Wa,-xarch=v8plus
+	    SOLARIS_AS_FLAGS = -xarch=v8plus -K PIC
 	endif
 	ifdef USE_ABI32_FPU
 	    ARCHFLAG=-mcpu=v9 -Wa,-xarch=v8plus
+	    SOLARIS_AS_FLAGS = -xarch=v8plusa -K PIC
 	endif # USE_ABI32_FPU
 	ifdef USE_ABI64_INT
 	    # this builds for Sparc v9a pure 64-bit architecture
+	    SOLARIS_AS_FLAGS = -xarch=v9 -K PIC
 	endif
 	ifdef USE_ABI64_FPU
 	    # this builds for Sparc v9a pure 64-bit architecture
 	    # It uses floating point, and 32-bit word size
+	    SOLARIS_AS_FLAGS = -xarch=v9a -K PIC
 	endif
     else # NS_USE_GCC
 	ifdef USE_ABI32_INT32
