lkml.org 
[lkml]   [2006]   [Apr]   [4]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateTue, 4 Apr 2006 08:57:29 +0000
FromJohn Mylchreest <>
SubjectRe: [PATCH 1/1] POWERPC: Fix ppc32 compile with gcc+SSP in 2.6.16
On Sun, Apr 02, 2006 at 01:42:15PM +0200, Olaf Hering <olh@suse.de> wrote:
>  On Sun, Apr 02, John Mylchreest wrote:
> 
> > Going from that, I can push a patch for gcc upstream to remove the
> > __KERNEL__ dep, but gcc4.1 ships with ssp by standard, and the semantics
> > between the IBM patch for SSP applied to gcc-3 and ggc-4 have changed.
> 
> gcc4.1 has no obvious problems with --enable-ssp
> 
> > -fno-stack-protector would work for gcc4, but for gcc3 it could still be
> > patially enabled, and requires -fno-stack-protector-all. Mind If I ask
> > whats incorrect about defining __KERNEL__ for the bootcflags?
> 
> arch/powerpc/boot is no kernel code, its supposed to be selfcontained.
> Prepare a patch which uses the cc-option macro.

As requested, please see attached a small patch which rectifies this
with negating cflags. The cc-option macro won't always work, and as such
I have declared a new macro to honour $(CROSS32CC).

Thoughts welcome,
John

-- 
Role:            Gentoo Linux Kernel Lead
Gentoo Linux:    http://www.gentoo.org
Public Key:      gpg --recv-keys 9C745515
Key fingerprint: A0AF F3C8 D699 A05A EC5C  24F7 95AA 241D 9C74 5515

--- a/arch/powerpc/boot/Makefile	2006-04-03 17:33:44.000000000 +0000
+++ b/arch/powerpc/boot/aMakefile	2006-04-04 08:51:13.000000000 +0000
@@ -21,9 +21,19 @@
 #	in the toplevel makefile.
 
 
+# cc-option-crosscc
+# We can't rely on the host compiler in this situation, so we define
+# a modified cc-option macro for this task.
+# Usage: cflags-y += $(call cc-option-crosscc, -march=winchip-c6, -march=i586)
+
+cc-option-crosscc = $(shell if $(CROSS32CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
+                     > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
+
 HOSTCC		:= gcc
 BOOTCFLAGS	:= $(HOSTCFLAGS) -fno-builtin -nostdinc -isystem \
-		   $(shell $(CROSS32CC) -print-file-name=include) -fPIC
+		   $(shell $(CROSS32CC) -print-file-name=include) -fPIC \
+		   $(call cc-option-crosscc, -fno-stack-protector) \
+		   $(call cc-option-crosscc, -fno-stack-protector-all)
 BOOTAFLAGS	:= -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc 
 OBJCOPYFLAGS    := contents,alloc,load,readonly,data
 OBJCOPY_COFF_ARGS := -O aixcoff-rs6000 --set-start 0x500000[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2006-04-04 11:00    [from the cache]
©2003-2008