Permalink
Browse files

fix dlopen static link warning from openssl

  • Loading branch information...
ryancdotorg committed Oct 24, 2015
1 parent bd08fad commit cfd1d092a01be1e60310d0823197902e9f6a6c69
Showing with 15 additions and 2 deletions.
  1. +2 −2 Makefile
  2. +13 −0 dldummy.c
View
@@ -1,10 +1,10 @@
HEADERS = bloom.h crack.h hash160.h warpwallet.h
OBJ_MAIN = brainflayer.o hex2blf.o blfchk.o ecmtabgen.o
-OBJ_UTIL = hex.o bloom.o mmapf.o hsearchf.o ec_pubkey_fast.o
+OBJ_UTIL = hex.o bloom.o mmapf.o hsearchf.o ec_pubkey_fast.o dldummy.o
OBJ_FMT = warpwallet.o brainwalletio.o brainv2.o
OBJECTS = $(OBJ_MAIN) $(OBJ_UTIL) $(OBJ_FMT)
BINARIES = brainflayer hex2blf blfchk ecmtabgen
-LIBS = -lssl -lrt -lcrypto -lz -ldl -lgmp
+LIBS = -lssl -lrt -lcrypto -lz -lgmp
CFLAGS = -O3 -flto -pedantic -std=gnu99 -Wall -Wextra -funsigned-char -Wno-pointer-sign -Wno-sign-compare
COMPILE = gcc $(CFLAGS)
View
@@ -0,0 +1,13 @@
+/* gets rid of warnings about opnessl using dlopen when statically linked */
+
+#include <stdlib.h>
+
+static char *dlerrstr = "dynamic loader not available (using dldummy)";
+
+//void * dlopen(const char *filename, int flat) { return NULL; }
+void * dlopen(void) { return NULL; }
+char * dlerror(void) { return dlerrstr; }
+void * dlsym(void) { return NULL; }
+int dlclose(void) { return -1; }
+/* this is supposed to set some null pointers on error, but fuck it */
+int dladdr(void) { return -1; }

0 comments on commit cfd1d09

Please sign in to comment.