1
mirror of https://github.com/hashcat/hashcat synced 2024-11-28 05:21:38 +01:00

Added support to building Universal macOS binary on Apple Silicon

This commit is contained in:
Gabriele Gristina 2022-01-22 23:08:18 +01:00
parent d85f86373c
commit 07240ada8b
2 changed files with 13 additions and 1 deletions

View File

@ -16,6 +16,7 @@
- Added support to use --debug-mode in attack-mode 9 (Association Attack) - Added support to use --debug-mode in attack-mode 9 (Association Attack)
- Added guess data to --status-json output - Added guess data to --status-json output
- Added hex format for --separator option - Added hex format for --separator option
- Added support to building Universal macOS binary on Apple Silicon
## ##
## Bugs ## Bugs

View File

@ -36,7 +36,7 @@ $(error "! Your Operating System ($(UNAME)) is not supported by this Makefile")
endif endif
ifeq ($(DEBUG),1) ifeq ($(DEBUG),1)
$(warning "## Detected Operating System : $(UNAME)") $(info "## Detected Operating System : $(UNAME)")
endif endif
## ##
@ -76,6 +76,7 @@ AR := /usr/bin/ar
SED := /usr/bin/sed SED := /usr/bin/sed
SED_IN_PLACE := -i "" SED_IN_PLACE := -i ""
DARWIN_VERSION := $(shell uname -r | cut -d. -f1) DARWIN_VERSION := $(shell uname -r | cut -d. -f1)
IS_APPLE_SILICON := $(shell lipo /bin/zsh -verify_arch arm64e && echo 1 || echo 0)
endif endif
ifneq (,$(filter $(UNAME),FreeBSD NetBSD)) ifneq (,$(filter $(UNAME),FreeBSD NetBSD))
@ -333,6 +334,16 @@ LFLAGS_NATIVE := $(LFLAGS)
LFLAGS_NATIVE += -framework IOKit LFLAGS_NATIVE += -framework IOKit
LFLAGS_NATIVE += -lpthread LFLAGS_NATIVE += -lpthread
LFLAGS_NATIVE += -liconv LFLAGS_NATIVE += -liconv
ifeq ($(IS_APPLE_SILICON),1)
CFLAGS_NATIVE += -arch arm64
CFLAGS_NATIVE += -arch x86_64
ifeq ($(SHARED),1)
LFLAGS_NATIVE += -arch arm64
LFLAGS_NATIVE += -arch x86_64
endif
endif
endif # Darwin endif # Darwin
ifeq ($(UNAME),CYGWIN) ifeq ($(UNAME),CYGWIN)