Merge pull request #2577 from Cryolitia-Forks/master

feat: detect march and mcpu
This commit is contained in:
Iceman 2024-10-17 11:56:40 +02:00 committed by GitHub
commit 66ae89f3f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 8 deletions

View file

@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file.
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
## [unreleased][unreleased] ## [unreleased][unreleased]
- Added an Makefile variable `DONT_BUILD_NATIVE` in mfd_aes_brute Makefile to easify downstream package
- Auto detect whether compile option `march=native` is supported for mfd_aes_brute Makefile
- Changed `hf mf sim` - support data-first and nested reader attacks (@doegox) - Changed `hf mf sim` - support data-first and nested reader attacks (@doegox)
- Fixed em4x50_read() - `lf search` and `lf em 4x50 rdbl -b <blk>` does not coredump reading EM4450 tag (@ANTodorov) - Fixed em4x50_read() - `lf search` and `lf em 4x50 rdbl -b <blk>` does not coredump reading EM4450 tag (@ANTodorov)
- Fixed flashing - client doesnt fail every other flash attempt (@iceman1001) - Fixed flashing - client doesnt fail every other flash attempt (@iceman1001)

View file

@ -5,15 +5,15 @@ MYCFLAGS = -Ofast
MYDEFS = MYDEFS =
MYLDLIBS = -lcrypto MYLDLIBS = -lcrypto
# A better way would be to just try compiling with march and seeing if we succeed SUPPORT_MARCH := $(shell $(CC) -xc /dev/null -c -o /dev/null -march=native > /dev/null 2>/dev/null && echo y)
cpu_arch = $(shell uname -m) SUPPORT_MCPU := $(shell $(CC) -xc /dev/null -c -o /dev/null -mcpu=native > /dev/null 2>/dev/null && echo y)
ifneq ($(findstring arm64, $(cpu_arch)), )
MYCFLAGS += -mcpu=native ifeq ($(DONT_BUILD_NATIVE),y)
# iOS 'fun' # do nothing
else ifneq ($(findstring iP, $(cpu_arch)), ) else ifeq ($(SUPPORT_MARCH),y)
MYCFLAGS += -mcpu=native
else
MYCFLAGS += -march=native MYCFLAGS += -march=native
else ifeq ($(SUPPORT_MCPU),y)
MYCFLAGS += -mcpu=native
endif endif
ifneq ($(SKIPPTHREAD),1) ifneq ($(SKIPPTHREAD),1)
@ -43,6 +43,8 @@ ifeq ($(USE_MACPORTS),1)
MYLDFLAGS += -L$(MACPORTS_PREFIX)/lib/openssl-3 -L$(MACPORTS_PREFIX)/lib/openssl-1.1 MYLDFLAGS += -L$(MACPORTS_PREFIX)/lib/openssl-3 -L$(MACPORTS_PREFIX)/lib/openssl-1.1
endif endif
showinfo: $(info c flags: $(MYCFLAGS))
brute_key : $(OBJDIR)/brute_key.o $(MYOBJS) brute_key : $(OBJDIR)/brute_key.o $(MYOBJS)
mfd_aes_brute : $(OBJDIR)/mfd_aes_brute.o $(MYOBJS) mfd_aes_brute : $(OBJDIR)/mfd_aes_brute.o $(MYOBJS)