Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8015

C/C++ • Re: How Do I Detect Compiling on a Pi5? Have Tried '__arm__'

$
0
0
..(belatedly). I have the attached scripts: "m.zip" unpacks to "m.tar" which contains..

Code:

$ tar tvf m.tar-rwxr--r-- foo/foo          59 2020-01-19 20:17 usr/local/sd/bin/gcc-headers-rwxr--r-- foo/foo          49 2017-06-22 02:26 usr/local/sd/bin/gcc-macros-rwxr--r-- foo/foo          32 2017-06-22 02:26 usr/local/sd/bin/gcc-options-rwxr--r-- foo/foo          48 2019-09-20 13:48 usr/local/sd/bin/gcc-targets-rwxr--r-- foo/foo          59 2020-01-19 20:18 usr/local/sd/bin/g++-headers-rwxr--r-- foo/foo          56 2025-07-04 14:34 usr/local/sd/bin/g++-macros-rwxr--r-- foo/foo          32 2017-06-22 02:26 usr/local/sd/bin/g++-options
eg:

Code:

foo@pi24:~ $ g++-macros | grep -i arm#define __ARM_64BIT_STATE 1#define __ARM_ALIGN_MAX_PWR 28#define __ARM_ALIGN_MAX_STACK_PWR 16#define __ARM_ARCH 8#define __ARM_ARCH_8A 1#define __ARM_ARCH_ISA_A64 1#define __ARM_ARCH_PROFILE 65#define __ARM_FEATURE_CLZ 1#define __ARM_FEATURE_FMA 1#define __ARM_FEATURE_IDIV 1#define __ARM_FEATURE_NUMERIC_MAXMIN 1#define __ARM_FEATURE_UNALIGNED 1#define __ARM_FP 14#define __ARM_FP16_ARGS 1#define __ARM_FP16_FORMAT_IEEE 1#define __ARM_NEON 1#define __ARM_PCS_AAPCS64 1#define __ARM_SIZEOF_MINIMAL_ENUM 4#define __ARM_SIZEOF_WCHAR_T 4
..which I would have expected to have yielded "__arm__"/"__aarch64__" which begs the question - does something need to be added? On x86 I get..

Code:

foo@sdu:~$ g++-macros | grep -i x86#define __x86_64 1#define __x86_64__ 1
To save the casual reader unpacking, it's merely..

Code:

$ cat /usr/local/sd/bin/gcc-macros #!/bin/bashgcc "$@" -dM -E - </dev/null | sort
..replacing 'gcc' with 'g++' accordingly.
m.zip

Statistics: Posted by swampdog — Sat Dec 13, 2025 2:32 pm



Viewing all articles
Browse latest Browse all 8015

Trending Articles