aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cgcc
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-10-27 11:35:09 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-10-30 09:52:14 +0100
commit2c06f143fa63394dbdfa07f3f9d00b24b7c902c5 (patch)
tree6c19c53230ab117d2bf82f64b64ea7e50962d1dc /cgcc
parent0a35fa5b1ce9be51c0a2f557fdfe75fabdf58a23 (diff)
downloadsparse-dev-2c06f143fa63394dbdfa07f3f9d00b24b7c902c5.tar.gz
arch: add an option to specify the desired arch: --arch=<arch>
Sparse is universal in the sense that the same executable can be used for all architectures. For this, most arch-specific setting can be set with an option and the default values are taken from the host machine. This is working nicely for native targets. However, for cross- compilation, while seeming to work relatively well (thanks to the kernel build system using -m32/-m64 for all archs, for example) things can never work 100% correctly. For example, in the case an X86-64 host machine is used for an ARM target, the kernel build system will call sparse with -m32, Sparse will 'autodetect' the target arch as i386 (x86-64 + -m32) and will then predefine the macro __i386__. Most of the time this is not a problem (at least for the kernel) unless, of course, if the code contains something like: #ifdef __i386__ ... #elif __arm__ ... So, add an option --arch=<arch> to specify the target architecture. The native arch is still used if no such flag is given. Reported-by: Ben Dooks <ben.dooks@codethink.co.uk> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'cgcc')
0 files changed, 0 insertions, 0 deletions