Im currently following a book called 'Bare Metal C' by Stephen Oualline and i got stuck trying to run a couple of commands on chapter 1. The first command is supposed to ask for an assembly language listing that prints the machine code in human-readable format, with the corresponding assembly language statements that generated that code. The other command tells the gcc command to pass flags to the linker so we an see a map of where the linker put things in memory. (just learning about all of this, please bear with me)
The commands i keyed in the terminal are as follows
Assembly language statements listing:
gcc -Wall -Wextra -g -Wextra -Wa,-a=hello.lst -c hello.c
Error:
clang: error: unsupported argument '-a=hello.lst' to option '-Wa,'
Linker map:
gcc -Wall -Wextra -static -Wl,-Map=hello.map -o hello hello.o
Error:
ld: library not found for -lcrt0.o clang: error: linker command failed with exit code 1 (use -v to see invocation)
Edit:(Couldn't fit it all in one comment, I'm responding to Clifford) Forgot to mention that I'm very fresh to programming let alone embedded systems so as I may not understand everything you're saying, ill attempt to decipher it and I hope you'll tell me if I'm hot or cold. Now, I'm aware that Clang is the default compiler for macOS, and so according to you, macOS decided to use Clang over GCC which I specified ( ill look into that later). As for everything else you've said I've no clue. After a quick Google search, I found out that ARM and x86 are different types of chip architectures. And the NUCLEO board I have contains an ARM chip so I'm unclear on what you mean there when you say it's not "bare metal" or "embedded". Second, the book told me that GCC was supposedly already installed as part of a developer package for macOS, there was no mention of having to install a GCC cross-compiler. As for ST's STM32CubeIDE, ill have to research and get familiar with it. I know this site isn't dedicated to teaching novices so I won't expect a detailed, dumbed-down response, maybe just a referral to somewhere where I could better learn this stuff. Regardless, thank you for your patience and time Clifford