public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: John Mylchreest <johnm@gentoo.org>
To: Olaf Hering <olh@suse.de>
Cc: linux-kernel@vger.kernel.org, stable@kernel.org, paulus@samba.org
Subject: Re: [PATCH 1/1] POWERPC: Fix ppc32 compile with gcc+SSP in 2.6.16
Date: Tue, 4 Apr 2006 08:57:29 +0000	[thread overview]
Message-ID: <20060404085729.GH3443@getafix.willow.local> (raw)
In-Reply-To: <20060402114215.GA30491@suse.de>


[-- Attachment #1.1: Type: text/plain, Size: 1189 bytes --]

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


[-- Attachment #1.2: ppc32-2.6.16-sspcc.patch --]
[-- Type: text/plain, Size: 1104 bytes --]

--- 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

[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]

  reply	other threads:[~2006-04-04  8:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-01 22:48 [PATCH 1/1] POWERPC: Fix ppc32 compile with gcc+SSP in 2.6.16 John Mylchreest
2006-04-02  8:58 ` Olaf Hering
2006-04-02 10:22   ` John Mylchreest
2006-04-02 10:28     ` Olaf Hering
2006-04-02 10:58       ` John Mylchreest
2006-04-02 11:10         ` Olaf Hering
2006-04-02 11:20           ` John Mylchreest
2006-04-02 11:42             ` Olaf Hering
2006-04-04  8:57               ` John Mylchreest [this message]
2006-04-04  9:41                 ` Olaf Hering
2006-04-04 10:01                   ` John Mylchreest
2006-04-04 10:58                     ` Olaf Hering
2006-04-10  9:01                       ` John Mylchreest
2006-04-02 13:15             ` Arjan van de Ven
2006-04-02 13:56               ` John Mylchreest
2006-04-02 14:01                 ` Olaf Hering
2006-04-02 14:35                   ` John Mylchreest
2006-04-02 14:49                 ` Arjan van de Ven
2006-04-02 15:22                   ` John Mylchreest

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060404085729.GH3443@getafix.willow.local \
    --to=johnm@gentoo.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olh@suse.de \
    --cc=paulus@samba.org \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox