3 /* Define architecture */
5 # define TRIPLET_ARCH "i386"
6 #elif defined(__x86_64__)
7 # define TRIPLET_ARCH "x86_64"
9 # define TRIPLET_ARCH "arm"
10 #elif defined(__aarch64__)
11 # define TRIPLET_ARCH "aarch64"
13 # define TRIPLET_ARCH "unknown"
17 #if defined (__linux__)
18 # define TRIPLET_OS "linux"
19 #elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
20 # define TRIPLET_OS "kfreebsd"
21 #elif !defined (__GNU__)
22 # define TRIPLET_OS "unknown"
25 /* Define calling convention and ABI */
26 #if defined (__ARM_EABI__)
27 # if defined (__ARM_PCS_VFP)
28 # define TRIPLET_ABI "gnueabihf"
30 # define TRIPLET_ABI "gnueabi"
33 # define TRIPLET_ABI "gnu"
37 # define TRIPLET TRIPLET_ARCH "-" TRIPLET_ABI
39 # define TRIPLET TRIPLET_ARCH "-" TRIPLET_OS "-" TRIPLET_ABI
46 int main(int argc
, char *argv
[])
48 switch(argc
== 2 ? argv
[1][0] : 0) {
51 volatile unsigned foo
= 0x01234567;
52 puts(*(unsigned char*)&foo
== 0x67 ? "no" : "yes");
57 printf("%d\n", __GNUC_MINOR__
);
60 printf("%d\n", __GNUC__
);
72 /* to test -Wno-unused-result */
73 fread(NULL
, 1, 1, NULL
);