From 07240ada8bc79c425fa3cbb1604e4efbc88dd6c5 Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 22 Jan 2022 23:08:18 +0100 Subject: [PATCH 1/2] Added support to building Universal macOS binary on Apple Silicon --- docs/changes.txt | 1 + src/Makefile | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index 9d1a7b8b0..793bf8e40 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -16,6 +16,7 @@ - Added support to use --debug-mode in attack-mode 9 (Association Attack) - Added guess data to --status-json output - Added hex format for --separator option +- Added support to building Universal macOS binary on Apple Silicon ## ## Bugs diff --git a/src/Makefile b/src/Makefile index fc0afc4fb..4a5d419da 100644 --- a/src/Makefile +++ b/src/Makefile @@ -36,7 +36,7 @@ $(error "! Your Operating System ($(UNAME)) is not supported by this Makefile") endif ifeq ($(DEBUG),1) -$(warning "## Detected Operating System : $(UNAME)") +$(info "## Detected Operating System : $(UNAME)") endif ## @@ -76,6 +76,7 @@ AR := /usr/bin/ar SED := /usr/bin/sed SED_IN_PLACE := -i "" DARWIN_VERSION := $(shell uname -r | cut -d. -f1) +IS_APPLE_SILICON := $(shell lipo /bin/zsh -verify_arch arm64e && echo 1 || echo 0) endif ifneq (,$(filter $(UNAME),FreeBSD NetBSD)) @@ -333,6 +334,16 @@ LFLAGS_NATIVE := $(LFLAGS) LFLAGS_NATIVE += -framework IOKit LFLAGS_NATIVE += -lpthread 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 ifeq ($(UNAME),CYGWIN) From 743c12b8589d26ed664bd93dbaf62f3b4f7d416c Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Sat, 22 Jan 2022 23:49:02 +0100 Subject: [PATCH 2/2] Updated credits --- docs/credits.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/credits.txt b/docs/credits.txt index 1d962206e..268719f2c 100644 --- a/docs/credits.txt +++ b/docs/credits.txt @@ -23,6 +23,7 @@ Gabriele "matrix" Gristina (@gm4tr1x) * OpenCL Info feature * Apple macOS port * Apple Silicon support +* Universal binary on Apple Silicon * Hardware monitor initial code base and maintenance * Test suite initial code base and maintenance * Makefile initial code base