From cfce691a50a6fff590585f0b03e64267ed832b1b Mon Sep 17 00:00:00 2001 From: Andrew Janke Date: Thu, 31 Aug 2017 04:22:13 -0400 Subject: [PATCH] initialize ltc_mp to force allocation under all compilers, including clang on macOS --- README.md | 2 +- makefile | 6 ------ src/misc/crypt/crypt_ltc_mp_descriptor.c | 3 ++- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 27a134d..b9bed94 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ There are several `makefile`s provided. Please choose the one that fits best for | makefile | use-case | | -------- | -------- | -| `makefile` | builds a static library (GNU Make required, broken on Mac OSX - use `makefile.unix` instead) | +| `makefile` | builds a static library (GNU Make required) | | `makefile.shared` | builds a shared (and static) library (GNU Make required) | | `makefile.unix` | for unusual UNIX platforms, or if you do not have GNU Make | | `makefile.mingw` | for usage with the mingw compiler on MS Windows | diff --git a/makefile b/makefile index 3200d86..a7ff18f 100644 --- a/makefile +++ b/makefile @@ -15,12 +15,6 @@ endif PLATFORM := $(shell uname | sed -e 's/_.*//') -ifneq ($(MAKECMDGOALS),clean) -ifeq ($(PLATFORM), Darwin) -$(error Known to not work on Mac, please use makefile.unix for static libraries or makefile.shared for shared libraries) -endif -endif - # ranlib tools ifndef RANLIB RANLIB:=$(CROSS_COMPILE)ranlib diff --git a/src/misc/crypt/crypt_ltc_mp_descriptor.c b/src/misc/crypt/crypt_ltc_mp_descriptor.c index f06147d..0f1407c 100644 --- a/src/misc/crypt/crypt_ltc_mp_descriptor.c +++ b/src/misc/crypt/crypt_ltc_mp_descriptor.c @@ -8,7 +8,8 @@ */ #include "tomcrypt.h" -ltc_math_descriptor ltc_mp; +/* Initialize ltc_mp to nulls, to force allocation on all platforms, including macOS. */ +ltc_math_descriptor ltc_mp = { 0 }; /* ref: $Format:%D$ */ /* git commit: $Format:%H$ */