Code Monkey home page Code Monkey logo

Comments (2)

iagox86 avatar iagox86 commented on August 29, 2024

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 [email protected] 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
#4

from hash_extender.

creativecoder avatar creativecoder commented on August 29, 2024

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

  • Changing /usr/include/openssl to /opt/homebrew/include/openssl
  • Adding -I/opt/homebrew/opt/openssl/include to CFLAGS

from hash_extender.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.