Skip to contentSkip to conversation

sparc: define __linux__ to fix defconfig build

PATCH Applied Sam Ravnborg 2 participants 4 messages Mar 30, 2013 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 2/5 sparc: define __linux__ to fix defconfig build

The gcc version I use do not include a definition of __linux__. Like many other archs add this to CFLAGS.

This fixes at least the following build error:
include/uapi/linux/coda.h:221: error: expected specifier-qualifier-list before 'u_quad_t'

---
 arch/sparc/Makefile |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/sparc/Makefile +2 -0
index 541b8b0..f489626 100644
@@ -14,6 +14,8 @@ else
         KBUILD_DEFCONFIG := sparc64_defconfig
 endif
 
+KBUILD_CFLAGS  += -D__linux__
+
 ifeq ($(CONFIG_SPARC32),y)
 #####
 # sparc32
Signature · 1 line
1.6.0.6
maintainer
#1 lore raw

From: Sam Ravnborg <[email protected]>
Date: Sat, 30 Mar 2013 22:44:23 +0100

Quoted 1 line

The gcc version I use do not include a definition of __linux__.

Then it's not a gcc targetting Linux.

#2 lore raw
In reply to Sam Ravnborg
Quoted 6 lines · David Miller

From: Sam Ravnborg <[email protected]>
Date: Sat, 30 Mar 2013 22:44:23 +0100

Quoted 1 line

The gcc version I use do not include a definition of __linux__.

Then it's not a gcc targetting Linux.

It was built some time ago using crosstool-ng. I added ssupport for sparc some time ago - but seems I got it wrong. I should fix that...

Do you have a configure command I can use to build my own gcc's for sparc32 + sparc64 for now?

Sam

maintainer
#3 lore raw
In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: Sat, 30 Mar 2013 22:57:50 +0100

Quoted 6 lines · David Miller
Quoted 5 lines

From: Sam Ravnborg <[email protected]>
Date: Sat, 30 Mar 2013 22:44:23 +0100

Quoted 1 line

The gcc version I use do not include a definition of __linux__.

Quoted 7 lines
Quoted 1 line

Then it's not a gcc targetting Linux.

It was built some time ago using crosstool-ng. I added ssupport for sparc some time ago - but seems I got it wrong. I should fix that...

Do you have a configure command I can use to build my own gcc's for sparc32 + sparc64 for now?

The only critical option is "--enable-targets=all" which, when building a 32-bit compiler binary, will enable support for 64-bit code generation.