From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [PATCH 1/2] Add thread_info_cache_init() to all archs Date: Wed, 21 May 2008 16:38:20 -0400 Message-ID: <1211402300.8297.240.camel@pasglop> References: <20080410032354.90CB1DDF0F@ozlabs.org> <20080413171953.bde5e9ac.akpm@linux-foundation.org> <1208133506.6958.82.camel@pasglop> <20080413191338.9776ebd0.akpm@linux-foundation.org> <1208491086.6958.381.camel@pasglop> <20080417211905.8ff769fa.akpm@linux-foundation.org> <1208501061.6958.394.camel@pasglop> <1211392585.8297.218.camel@pasglop> <20080521114147.59ca3551.akpm@linux-foundation.org> <20080521190659.GB12638@uranus.ravnborg.org> Reply-To: benh@kernel.crashing.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20080521190659.GB12638@uranus.ravnborg.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+glppd-linuxppc64-dev=m.gmane.org@ozlabs.org Errors-To: linuxppc-dev-bounces+glppd-linuxppc64-dev=m.gmane.org@ozlabs.org To: Sam Ravnborg Cc: Linux-Arch , linux-m32r@ml.linux-m32r.org, Luke Browning , takata@linux-m32r.org, linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org, Paul Mackerras , Andrew Morton List-Id: linux-arch.vger.kernel.org On Wed, 2008-05-21 at 21:06 +0200, Sam Ravnborg wrote: > It was discussed to add some run-time checks for this issue. > But the examples given were a bit fluffy so I never integrated > anything > i kbuild to detect this. > > As this is only a bug for const weak functions they could be made > non-const > if they are seldomly used? With the asm("") trick ? I suppose, but I'm also happy to just reject the bad gcc... It shouldn't be too hard to do a test case made of 2 files. test_foo.c int foo(void) { printf("good\n"); } test_bar.c int foo(void) __weak { } int main(void) { foo(); return 0; } And check for "good" in the output of said program.. Can somebody test that ? Luke, you have a broken compiler, can you make up some test that could be integrated in the kernel build system easily ? (I'm travelling right now, no time to play much with it myself). Cheers, Ben. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org ([63.228.1.57]:37714 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752126AbYEUUrG (ORCPT ); Wed, 21 May 2008 16:47:06 -0400 Subject: Re: [PATCH 1/2] Add thread_info_cache_init() to all archs From: Benjamin Herrenschmidt Reply-To: benh@kernel.crashing.org In-Reply-To: <20080521190659.GB12638@uranus.ravnborg.org> References: <20080410032354.90CB1DDF0F@ozlabs.org> <20080413171953.bde5e9ac.akpm@linux-foundation.org> <1208133506.6958.82.camel@pasglop> <20080413191338.9776ebd0.akpm@linux-foundation.org> <1208491086.6958.381.camel@pasglop> <20080417211905.8ff769fa.akpm@linux-foundation.org> <1208501061.6958.394.camel@pasglop> <1211392585.8297.218.camel@pasglop> <20080521114147.59ca3551.akpm@linux-foundation.org> <20080521190659.GB12638@uranus.ravnborg.org> Content-Type: text/plain Date: Wed, 21 May 2008 16:38:20 -0400 Message-ID: <1211402300.8297.240.camel@pasglop> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Sam Ravnborg Cc: Andrew Morton , Linux-Arch , linux-m32r@ml.linux-m32r.org, takata@linux-m32r.org, linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org, Paul Mackerras , Luke Browning Message-ID: <20080521203820.rqNEGlBAhUhk20jHjL5paGCUPeYJFkw3sIUi3m2O_vw@z> On Wed, 2008-05-21 at 21:06 +0200, Sam Ravnborg wrote: > It was discussed to add some run-time checks for this issue. > But the examples given were a bit fluffy so I never integrated > anything > i kbuild to detect this. > > As this is only a bug for const weak functions they could be made > non-const > if they are seldomly used? With the asm("") trick ? I suppose, but I'm also happy to just reject the bad gcc... It shouldn't be too hard to do a test case made of 2 files. test_foo.c int foo(void) { printf("good\n"); } test_bar.c int foo(void) __weak { } int main(void) { foo(); return 0; } And check for "good" in the output of said program.. Can somebody test that ? Luke, you have a broken compiler, can you make up some test that could be integrated in the kernel build system easily ? (I'm travelling right now, no time to play much with it myself). Cheers, Ben.