[PATCH 2/2] cgcc: let sparse define _BIG_ENDIAN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In addition of __BIG_ENDIAN__, gcc defines _BIG_ENDIAN on
powerpc (32 & 64-bit). cgcc does that too but this may also
beeneeded when using sparse itself.

So, move this define the the sparse code.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 cgcc  | 3 +--
 lib.c | 2 ++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/cgcc b/cgcc
index c97085e74..93bdc644c 100755
--- a/cgcc
+++ b/cgcc
@@ -276,8 +276,7 @@ sub add_specs {
 	return (' --arch=x86_64' .
 		&float_types (1, 1, 33, [24,8], [53,11], [113,15]));
     } elsif ($spec eq 'ppc') {
-	return (' -D_BIG_ENDIAN' .
-		' --arch=ppc' .
+	return (' --arch=ppc' .
 		&float_types (1, 1, 21, [24,8], [53,11], [113,15]));
     } elsif ($spec eq 'ppc64') {
 	return (
diff --git a/lib.c b/lib.c
index fbf14282b..fd45da5d1 100644
--- a/lib.c
+++ b/lib.c
@@ -1514,6 +1514,8 @@ static void predefined_macros(void)
 		predefine("__powerpc", 1, "1");
 		predefine("__ppc__", 1, "1");
 		predefine("__PPC__", 1, "1");
+		if (arch_big_endian)
+			predefine("_BIG_DEBIAN", 1, "1");
 		break;
 	case MACH_RISCV64:
 	case MACH_RISCV32:
-- 
2.24.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux