Compiling problems on MAC M2

Good morning to all the forum.
I started compiling the sources for Proxmark3 from the Iceman fork, on an Apple Mac Air M2 device, on which Sonoma’s first public beta (14.0) is installed.
I managed to get several working versions, but every time I proceed with the compilation, it completes but presents the following compilation errors/alerts, as visible in the attached log.
Reading on various forums, it seems that the result of that calculation must be obtained using another variable.
The affected files are:
They suggest using memcpy instead of array, but I’m not very savvy about programming.
Does anyone know how to fix this. Thank you.

src/cmdhfmfhard.c:412:35: warning: cast from ‘char *’ to ‘uint32_t *’ (aka ‘unsigned int *’) increases required alignment from 1 to 4 [-Wcast-align]
uint32_t count = ((uint32_t *)uncompressed_data)[0];
Errore.pdf (41.5 KB)

src/flash.c:352:32: warning: **cast from ‘uint8_t *’ (aka ‘unsigned char *’) to 'uint32_t ’ (aka 'unsigned int ') increases required alignment from 1 to 4 [-Wcast-align]

uint32_t offset = *(uint32_t *)(ctx->elf + le32(shdrs[i].sh_offset) + le32(shdrs[i].sh_size) - 4);

Which step are you getting this error?

I noticed I had an issue in compiling as well.

My issue is that I started with a guide using homebrew but abandoned it and did it manually, now sometimes homebrews old symlinks cause me issue.

You should be able to clone the Iceman repo, CD into the repo, and make without issue as long as you have the required repos installed. XQuartz and command line tools from what I remember.

Which guide are you following and where are you running into this error

The error is displayed during the compilation phase, started with the command make clean && make -j
I’m following the official guide in the Iceman repository

I ran into issues with Iceman’s guide. I would follow the guide that amal posted here. That compiled for me and got rid of the unofficial error that I had.

Would you be so kind as to post the link.
Thank you.

Start at “getting the latest firmware”

Thanks, I ran the guide you recommended starting from “getting the latest firmware”, but I noticed that the only thing that changes is the make command. Mine was “make clean && make -j” whereas the guide’s was “make clean && make -j8 all”.
In fact the errors presented are always the same, I believe at this point that the problem may be macos Sonoma.

I’m on a m2 also just not the beta. This week I’ll upgrade and see what’s different.

Just checking you have XQuartz and the newest version of command line tools installed right?

Also I use iterm, doubt that matters but it helps go back to some of the commands. All I can think is you’re missing a dependency. You shouldn’t have to run anything in Rosetta.

Installing Sonoma tonight and I’ll report back tomorrow any issues. Just keeping you updated I didn’t forget.


Alright, updated on the beta, pulled the repo. So lets cover a couple things.

I do not know all of the specific repos that are needed. so i rely on Homebrew soely for that.

run this command (assuming you have homebrew setup, if you dont, do it). This is what is needed to make sure you have the ARM version of Proxmark3 and the required repos.

arch -arm64 brew install --HEAD --with-blueshark proxmark3

Next Install Xtools or ensure it is updated

xcode-select --install

Next install xquartz

brew install xquartz

Now is where i stray from Brew. I abandon the homebrew install of PM3. and i follow the above guide. I clone the repo in my own github folder. Then you need to navigate to that folder, and run the make command. let me know if this helps.

1 Like

Hi, I tried to give the commands you suggested, but the error generated is still the same.
I wonder why it can’t compile just those two files.