public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Owens <kaos@ocs.com.au>
To: Willy Tarreau <w@1wt.eu>
Cc: Andrew Morton <akpm@osdl.org>, Jakub Jelinek <jakub@redhat.com>,
	Nicholas Miell <nmiell@comcast.net>,
	linux-kernel@vger.kernel.org, davem@davemloft.net, ak@suse.de
Subject: Re: [patch 2.6.19-rc6] Stop gcc 4.1.0 optimizing wait_hpet_tick away
Date: Fri, 01 Dec 2006 17:32:42 +1100	[thread overview]
Message-ID: <23790.1164954762@kao2.melbourne.sgi.com> (raw)
In-Reply-To: Your message of "Fri, 01 Dec 2006 06:26:53 BST." <20061201052653.GB11835@1wt.eu>

Willy Tarreau (on Fri, 1 Dec 2006 06:26:53 +0100) wrote:
>On Fri, Dec 01, 2006 at 04:14:04PM +1100, Keith Owens wrote:
>> SuSE's SLES10 ships with gcc 4.1.0.  There is nothing to stop a
>> distributor from backporting the bug fix from gcc 4.1.1 to 4.1.0, but
>> this patch would not allow the fixed compiler to build the kernel.
>
>Then maybe replace #error with #warning ? It's too dangerous to let people
>build their kernel with a known broken compiler without being informed.

Agreed.

>I think this shows the limit of backports to known broken versions.
>Providing a full update to 4.1.1 would certainly be cleaner for all
>customers than backporting 4.1.1 to 4.1.0 and calling it 4.1.0.

Agreed, but Enterprise customers expect bug fixes, not wholesale
replacements of critical programs.

>Another solution would be to be able to check gcc for known bugs in the
>makefile, just like we check it for specific options. But I don't know
>how we can check gcc for bad code, especially in cross-compile environments

It is doable, but it is as ugly as hell.  Note the lack of a
signed-off-by :)

---
 arch/i386/kernel/Makefile |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Index: linux/arch/i386/kernel/Makefile
===================================================================
--- linux.orig/arch/i386/kernel/Makefile
+++ linux/arch/i386/kernel/Makefile
@@ -83,3 +83,19 @@ $(obj)/vsyscall-syms.o: $(src)/vsyscall.
 k8-y                      += ../../x86_64/kernel/k8.o
 stacktrace-y		  += ../../x86_64/kernel/stacktrace.o
 
+# Some versions of gcc generate invalid code for hpet_timer, depending
+# on other config options.  Make sure that the generated code is valid.
+# Invalid versions of gcc generate a tight loop in wait_hpet_tick, with
+# no 'cmp' instructions.  Extract the generated object code for
+# wait_hpet_tick, down to the next function then check that the code
+# contains at least one comparison.
+
+ifeq ($(CONFIG_HPET_TIMER),y)
+$(obj)/built-in.o: $(obj)/.tmp_check_gcc_bug
+
+$(obj)/.tmp_check_gcc_bug: $(obj)/time_hpet.o
+	$(Q)[ -n "`$(OBJDUMP) -Sr $< | grep -A40 '<wait_hpet_tick>:' | sed -e '1d; />:$$/,$$d;' | grep -w cmp`" ] || \
+		(echo gcc volatile bug detected, fix your gcc; exit 1)
+	$(Q)touch $@
+
+endif


  reply	other threads:[~2006-12-01  6:33 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-29  2:22 [patch 2.6.19-rc6] Stop gcc 4.1.0 optimizing wait_hpet_tick away Keith Owens
2006-11-29  3:08 ` Nicholas Miell
2006-11-29  3:56   ` Keith Owens
2006-11-29  4:04     ` David Miller
2006-11-29  4:30       ` Keith Owens
2006-11-29  4:57         ` Nicholas Miell
2006-11-30  1:04       ` David Schwartz
2006-12-01  5:50         ` Kyle Moffett
2006-12-01 11:24           ` David Schwartz
2006-12-01 12:08             ` Kyle Moffett
2006-12-01 13:52               ` David Schwartz
2006-12-02  9:02                 ` Jan Engelhardt
2006-12-01 12:31             ` Andreas Schwab
2006-12-01 14:03               ` David Schwartz
2006-12-02 10:39                 ` Kyle Moffett
2006-12-03  4:29                   ` David Schwartz
2006-12-07 14:02                     ` Kyle Moffett
2006-12-08  4:22                       ` David Schwartz
2006-11-29  9:08     ` Jakub Jelinek
2006-11-29 20:14       ` Willy Tarreau
2006-12-01  5:05         ` Andrew Morton
2006-12-01  5:14           ` Keith Owens
2006-12-01  5:26             ` Willy Tarreau
2006-12-01  6:32               ` Keith Owens [this message]
2006-12-01  7:28                 ` Willy Tarreau
2006-12-01  7:57                   ` Jakub Jelinek

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=23790.1164954762@kao2.melbourne.sgi.com \
    --to=kaos@ocs.com.au \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=davem@davemloft.net \
    --cc=jakub@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nmiell@comcast.net \
    --cc=w@1wt.eu \
    /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