From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wy0-f179.google.com (mail-wy0-f179.google.com [74.125.82.179]) by ozlabs.org (Postfix) with ESMTP id 981CEB7DBE for ; Wed, 12 May 2010 16:31:34 +1000 (EST) Received: by wyf19 with SMTP id 19so777800wyf.38 for ; Tue, 11 May 2010 23:31:30 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4BEA2375.7040802@nerdbynature.de> References: <20100511174749.19309.44615.stgit@muvarov> <4BEA2375.7040802@nerdbynature.de> Date: Wed, 12 May 2010 10:31:26 +0400 Message-ID: Subject: Re: [PATCH 1/2] Fix kexec on powerpc32 From: Maxim Uvarov To: Christian Kujau Content-Type: multipart/alternative; boundary=001485f44ff89c260904865fca77 Cc: kexec@lists.infradead.org, linuxppc-dev@lists.ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --001485f44ff89c260904865fca77 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 2010/5/12 Christian Kujau > Maxim Uvarov wrote on 2010-05-11 10:47 : > > This patch is required in case if you are using new toolchains. > > I'm on Debian/stable (binutils 2.18, gcc 4.3.2), so I applied your patche= s > to the latest -git checkout: > > First, compilation fails with: > > cc1: warnings being treated as errors > kexec/arch/ppc/kexec-ppc.c: In function =91get_base_ranges=92: > kexec/arch/ppc/kexec-ppc.c:258: error: value computed is not used > make: *** [kexec/arch/ppc/kexec-ppc.o] Error 1 > > Somehow a "-" hyphen made it into one of the functions: > > > --- a/kexec/arch/ppc/kexec-ppc.c > > +++ b/kexec/arch/ppc/kexec-ppc.c > [...] > > if (local_memory_ranges >=3D max_memory_ranges) { > > - fclose(file); > > - break; > > + if (realloc_memory_ranges() < 0){ > > + - fclose(file); > > Oh, I sent this patch twice with stg -a by mistake. And second version ha= s "-". I will fix and resend patches. > > Removing this, gets me further, until: > > > purgatory/arch/ppc/crt.o: In function `__lshrdi3': > (.text+0xf0): multiple definition of `__lshrdi3' > purgatory/arch/ppc/misc.o:(.text+0x50): first defined here > collect2: ld returned 1 exit status > make: *** [purgatory/purgatory.ro] Error 1 > > And has been defined in purgatory/arch/ppc/crt.S and > ./purgatory/arch/ppc/misc.S. Removing it from e.g. crt.S > makes it compile, I have not tested it yet, though :-) > Yes, that is expected result for old tool chains. New tool chains (from cod= e sourcery ) need this crt.S. I think we can have --with-oldtoolchain option to configure to point to old tool chains. (or even rename it to --with-crts, I don't know what is better.) > > Thanks, > Christian. > > PS: Where is -Werror defined? I could not find it anywhere in the kexec > source (execpt in arch/mips)... > -- > This -Werror came from mips. kexec/arch/mips/Makefile. It is already remove= d in the git. We already saw this problem. > make bzImage, not war > --=20 Best regards, Maxim Uvarov --001485f44ff89c260904865fca77 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable

2010/5/12 Christian Kujau <lists@nerdbynature.de&= gt;
Maxim Uvarov wrote on 2010-05-11 10:47 :
> This patch is required in case if you are using new = toolchains.

I'm on Debian/stable (binutils 2.18, gcc 4.3.2), so I applied you= r patches
to the latest -git checkout:

First, compilation fails with:

cc1: warnings being treated as errors
kexec/arch/ppc/kexec-ppc.c: In function =91get_base_ranges=92:
kexec/arch/ppc/kexec-ppc.c:258: error: value computed is not used
make: *** [kexec/arch/ppc/kexec-ppc.o] Error 1

Somehow a "-" hyphen made it into one of the functions:

> --- a/kexec/arch/ppc/kexec-ppc.c
> +++ b/kexec/arch/ppc/kexec-ppc.c
[...]
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (loca= l_memory_ranges >=3D max_memory_ranges) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fclose(file)= ;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (realloc_= memory_ranges() < 0){
> + =A0 =A0 - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 fclose(file);

Oh, I sent this patch twice with stg -a by mist= ake. And second version has "-". I will fix and resend patches.

Removing this, gets me further, until:


purgatory/arch/ppc/crt.o: In function `__lshrdi3':
(.text+0xf0): multiple definition of `__lshrdi3'
purgatory/arch/ppc/misc.o:(.text+0x50): first defined here
collect2: ld returned 1 exit status
make: *** [purgatory/purg= atory.ro] Error 1

And has been defined in purgatory/arch/ppc/crt.S and
./purgatory/arch/ppc/misc.S. Removing it from e.g. crt.S
makes it compile, I have not tested it yet, though :-)

Yes, that is expected result for old tool chains. New tool chains (fro= m code sourcery )=A0 need this crt.S.
I think we can have --with-oldtool= chain option to configure to point to old tool chains. (or even rename it t= o --with-crts,
I don't know what is better.)

Thanks,
Christian.

PS: Where is -Werror defined? I could not find it anywhere in the kexec
=A0 =A0source (execpt in arch/mips)...
--

This -Werror cam= e from mips. kexec/arch/mips/Makefile. It is already removed in the git. We= already saw this problem.


=A0
make bzImage, not war



--
Best regards,Maxim Uvarov
--001485f44ff89c260904865fca77--