From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [PATCH 1/2] Add thread_info_cache_init() to all archs Date: Wed, 21 May 2008 11:41:47 -0700 Message-ID: <20080521114147.59ca3551.akpm@linux-foundation.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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1211392585.8297.218.camel@pasglop> 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: benh@kernel.crashing.org 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 List-Id: linux-arch.vger.kernel.org On Wed, 21 May 2008 13:56:25 -0400 Benjamin Herrenschmidt wrote: > > On Fri, 2008-04-18 at 16:44 +1000, Benjamin Herrenschmidt wrote: > > > > so what > > > > about the patch below ? > > > > > > I like it, but the compiler won't ;) > > > > > > > If you're ok, I'll re-send with appropriate sob > > > > & adapted powerpc part. > > > > > > Sure. > > > > > > > +void __init __attribute__((weak) thread_info_cache_init(void) > > > > > Back to this old subject... > > I'm having reports that this is not working... > > gcc is seeing the empty weak function and is optimizing it out > before it gets a chance to link to the arch provided one. > > This would affect that and the other one next to it.. > > That seems pretty bad... it causes nasty crashes as we end up having no > idea what the compiler decided to generate... I suppose we could keep > the weak stubs out of the file where they are called but that sucks. > > ie. This is some form of gcc 4.1.1 > > Is that a known problem ? A gcc issue ? Not sure what is expected from > those weak functions. yup, gcc bug. Discussed recently on lkml, "Subject: Re: huge gcc 4.1.{0,1} __weak problem". I don't think anything ended up happening about it though. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:40971 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933984AbYEUSwr (ORCPT ); Wed, 21 May 2008 14:52:47 -0400 Date: Wed, 21 May 2008 11:41:47 -0700 From: Andrew Morton Subject: Re: [PATCH 1/2] Add thread_info_cache_init() to all archs Message-ID: <20080521114147.59ca3551.akpm@linux-foundation.org> In-Reply-To: <1211392585.8297.218.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> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: benh@kernel.crashing.org Cc: 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: <20080521184147.pV1r7Xek63nZhCPSKh3qbmGaQ5BlycrS21jFkNaC5R8@z> On Wed, 21 May 2008 13:56:25 -0400 Benjamin Herrenschmidt wrote: > > On Fri, 2008-04-18 at 16:44 +1000, Benjamin Herrenschmidt wrote: > > > > so what > > > > about the patch below ? > > > > > > I like it, but the compiler won't ;) > > > > > > > If you're ok, I'll re-send with appropriate sob > > > > & adapted powerpc part. > > > > > > Sure. > > > > > > > +void __init __attribute__((weak) thread_info_cache_init(void) > > > > > Back to this old subject... > > I'm having reports that this is not working... > > gcc is seeing the empty weak function and is optimizing it out > before it gets a chance to link to the arch provided one. > > This would affect that and the other one next to it.. > > That seems pretty bad... it causes nasty crashes as we end up having no > idea what the compiler decided to generate... I suppose we could keep > the weak stubs out of the file where they are called but that sucks. > > ie. This is some form of gcc 4.1.1 > > Is that a known problem ? A gcc issue ? Not sure what is expected from > those weak functions. yup, gcc bug. Discussed recently on lkml, "Subject: Re: huge gcc 4.1.{0,1} __weak problem". I don't think anything ended up happening about it though.