iagox86 / hash_extender

Other
1.07k stars 182 forks source link

can't make hash_extender on mac os 10.11 #4

Open DogeWatch opened 8 years ago

DogeWatch commented 8 years ago

➜ hash_extender git:(master) ✗ make [CC] buffer.o [CC] formats.o [CC] hash_extender.o [CC] hash_extender_engine.o [CC] test.o [CC] util.o [LD] hash_extender Undefined symbols for architecture x86_64: "_WHIRLPOOL_Final", referenced from: _whirlpool_hash in hash_extender_engine.o "_WHIRLPOOL_Init", referenced from: _whirlpool_hash in hash_extender_engine.o "_WHIRLPOOL_Update", referenced from: _whirlpool_hash in hash_extender_engine.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *\ [hash_extender] Error 1

how can I fix it

iagox86 commented 8 years ago

Hey, just wanted to reply and let you know that this is on my radar.

I don't have any Apple devices that I can really use, besides borrowing from a friend, so if any devs with Apple experience are following, help would be great. :)

If not, I'll attempt a fix in the next week or two!

Ron

On Mon, May 9, 2016 at 10:44 PM, DogeWatch notifications@github.com wrote:

➜ hash_extender git:(master) ✗ make [CC] buffer.o [CC] formats.o [CC] hash_extender.o [CC] hash_extender_engine.o [CC] test.o [CC] util.o [LD] hash_extender Undefined symbols for architecture x86_64: "_WHIRLPOOL_Final", referenced from: _whirlpool_hash in hash_extender_engine.o "_WHIRLPOOL_Init", referenced from: _whirlpool_hash in hash_extender_engine.o "_WHIRLPOOL_Update", referenced from: _whirlpool_hash in hash_extender_engine.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *\ [hash_extender] Error 1

how can I fix it

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/iagox86/hash_extender/issues/4

creativecoder commented 9 months ago

In case it's helpful, here's a Makefile I was able to use to compile hash_extender on an M1 Mac.

Be sure to install openssl with Homebrew first (brew install openssl), if you don't already have it in /opt/homebrew/opt/openssl/

# Checks if /usr/include/openssl/whrlpool.h exists, and set a define if it
# doesn't.
INCLUDE_OPENSSL     := /opt/homebrew/include/openssl
INCLUDE_WHIRLPOOL   := whrlpool.h
ifneq ($(shell ls $(INCLUDE_OPENSSL)/$(INCLUDE_WHIRLPOOL) 2>/dev/null), $(INCLUDE_OPENSSL)/$(INCLUDE_WHIRLPOOL))
WHIRLPOOL   := -DDISABLE_WHIRLPOOL
endif

# Capture the operating system name for use by the preprocessor.
OS      := $(shell uname | tr '/[[:lower:]]' '_[[:upper:]]')

# These are the specifications of the toolchain
CC      := gcc
CFLAGS      := -std=c89 -g -oS -Wall -Werror -Wno-deprecated -I/opt/homebrew/opt/openssl/include
CPPFLAGS    := -D_DEFAULT_SOURCE -D$(OS) $(WHIRLPOOL)
ifeq ($(OS),DARWIN)
    LDFLAGS     := -lssl -lcrypto -L/opt/homebrew/opt/openssl/lib/
else
    LDFLAGS     := -lssl -lcrypto
endif

BIN_MAIN    := hash_extender
BIN_TEST    := hash_extender_test
BINS        := $(BIN_MAIN) $(BIN_TEST)

SRCS        := $(wildcard *.c)
OBJS        := $(patsubst %.c,%.o,$(SRCS))
OBJS_MAIN   := $(filter-out $(BIN_TEST).o,$(OBJS))
OBJS_TEST   := $(filter-out $(BIN_MAIN).o,$(OBJS))

all: $(BINS)

$(BIN_MAIN): $(OBJS_MAIN)
    @echo [LD] $@
    @$(CC) $(CFLAGS) -o $(BIN_MAIN) $(OBJS_MAIN) $(LDFLAGS)

$(BIN_TEST): $(OBJS_TEST)
    @echo [LD] $@
    @$(CC) $(CFLAGS) -o $(BIN_TEST) $(OBJS_TEST) $(LDFLAGS)

%.o: %.c
    @echo [CC] $@
    @$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<

clean:
    @echo [RM] \*.o
    @rm -f $(OBJS)
    @echo [RM] $(BIN_MAIN)
    @rm -f $(BIN_MAIN)
    @echo [RM] $(BIN_TEST)
    @rm -f $(BIN_TEST)

The differences are