The objective here is describe a didactic way to build GNU GCC on MacOSX. In order to compile GCC you need three libraries: GMP, MPFR and MPC. To organize I usually create folders for each purpose. In this case, three, respectively: source, build and install. [It's not a rule]. My original enviroment is MacOSX 10.6.4 and gcc [...]
I was trying some GCC options and decided see how they affect assembly code generated. I’ve created a simple Python script that parses .s output and put in a human readable way. Suppose the classical Hello World program. The output will be something like:
$ python stats_opcodes.py file
For Cortex-m3 (check previous post):
At my laptop (x86):
Download the script here.
I’ve made some code snippets about assembly inline with GCC. A quick search points to a lot of good documentation.
IBM DeveloperWorks about Inline asssembly for x86 in Linux
Linux Documentation Project HOWTO describing GCC Inline Assembly
The syntax may be confusing, if you don’t understand read the documentation available. Each example are an C function with [...]