Re: [gentoo-dev] [PATCH v1] eclass/toolchain-bintuils: enable targets powerpc-linux-gnu for ppc64

2016-04-20 Thread Mike Frysinger
On 21 Apr 2016 13:16, Leno Hou wrote:
> On Wed, Apr 20, 2016 at 11:07 PM, Mike Frysinger wrote:
> > On 20 Apr 2016 13:52, Leno Hou wrote:
> > > Authored-by: Linda Jiang 
> > > ---
> > >  eclass/toolchain-binutils.eclass | 1 +
> > >  1 file changed, 1 insertion(+)
> >
> > when you submit a patch that is not extremely obvious, you must provide
> > details/justification in the commit message.  otherwise we're forced to
> > try and guess what/why it is you want to do things, and ultimately we
> > tend to start of just saying "no".
> >
> 
> Sorry, We describes details/justification in  Gentoo Bugzilla#580614
> . Explain here again.

that bug hadn't been reassigned yet to toolchain@ so i didn't see it.
i'll follow up there.
-mike


signature.asc
Description: Digital signature


Re: [gentoo-dev] [PATCH v1] eclass/toolchain-bintuils: enable targets powerpc-linux-gnu for ppc64

2016-04-20 Thread Leno Hou
On Wed, Apr 20, 2016 at 11:07 PM, Mike Frysinger  wrote:

> On 20 Apr 2016 13:52, Leno Hou wrote:
> > Authored-by: Linda Jiang 
> > ---
> >  eclass/toolchain-binutils.eclass | 1 +
> >  1 file changed, 1 insertion(+)
>
> when you submit a patch that is not extremely obvious, you must provide
> details/justification in the commit message.  otherwise we're forced to
> try and guess what/why it is you want to do things, and ultimately we
> tend to start of just saying "no".
>

Sorry, We describes details/justification in  Gentoo Bugzilla#580614
. Explain here again.

1) When use CHOST="powerpc64le-unknown-linux-gnu" (active host?) to build
binutils. there is no birch support.
See current supported emulations#powerpc64le-unknown-linux-gnu-ld -V

leno@localhost ~ $ powerpc64le-unknown-linux-gnu-ld -V

GNU ld (Gentoo 2.25.1 p1.1) 2.25.1

  Supported emulations:

   elf64lppc

   elf32lppc

   elf32lppclinux

   elf32lppcsim

   But we want elf64ppc for building grub2. If we there is no elf64ppc
emulation, we can't compiling grub2 and grub2-install
for ppc64le platform.

2) Following are the emulations what we want

leno@localhost ~ $ powerpc64le-unknown-linux-gnu-ld -V

GNU ld (Gentoo 2.25.1 p1.1) 2.25.1

  Supported emulations:

   elf64lppc

   elf32lppc

   elf32lppclinux

   elf32lppcsim

   elf32ppclinux

   elf32ppc

   elf32ppcsim

   elf64ppc

3) Linda Jiang found that *--enable-targets=all *make on sense to build the
above emulations what we want.
But *--enable-targets="powerpc-linux-gnu" *built the targets we want.
If there is no other arch-specific
handled like this, Is there another can handle this case? where is the
file you attached ?

and indeed, when i query a default ppc64 linker, it says it already
> supports both 32bit & 64bit targets:
> $ powerpc64-unknown-linux-gnu-ld --help | grep supported
> powerpc64-unknown-linux-gnu-ld: supported targets: elf64-powerpc
> elf64-powerpcle elf32-powerpc elf32-powerpcle aixcoff-rs6000
> aixcoff64-rs6000 aix5coff64-rs6000 elf64-little elf64-big elf32-little
> elf32-big plugin srec symbolsrec verilog tekhex binary ihex
> powerpc64-unknown-linux-gnu-ld: supported emulations: elf64ppc elf32ppc
> elf32ppclinux elf32ppcsim
>
> it would have to of course in order for biarch support (which works)
> which is how we build 64-bit kernels in a 32-bit userland.
> -mike
>


Re: [gentoo-dev] [PATCH v1] eclass/toolchain-bintuils: enable targets powerpc-linux-gnu for ppc64

2016-04-20 Thread Mike Frysinger
On 20 Apr 2016 13:52, Leno Hou wrote:
> Authored-by: Linda Jiang 
> ---
>  eclass/toolchain-binutils.eclass | 1 +
>  1 file changed, 1 insertion(+)

when you submit a patch that is not extremely obvious, you must provide
details/justification in the commit message.  otherwise we're forced to
try and guess what/why it is you want to do things, and ultimately we
tend to start of just saying "no".

> --- a/eclass/toolchain-binutils.eclass
> +++ b/eclass/toolchain-binutils.eclass
> @@ -271,6 +271,7 @@ toolchain-binutils_src_configure() {
>   # We used to do it for everyone, but it's slow on 32bit arches. #438522
>   case $(tc-arch) in
>   ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
> + ppc64) myconf+=( --enable-targets="powerpc-linux-gnu" ) ;;
>   esac

why ?  we don't normally do this (as you can see in the file, there is no
other arch-specific handling like this).  instead, binutils itself handles
things by selecting a default set of supported targets based on the active
host.  and when i glance in there, this seems to already be done for you.

bfd/config.bfd:
  powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux* | \
  powerpc64-*-*bsd*)
targ_defvec=powerpc_elf64_vec
targ_selvecs="powerpc_elf64_le_vec powerpc_elf32_vec powerpc_elf32_le_vec 
rs6000_xcoff_vec rs6000_xcoff64_vec rs6000_xcoff64_aix_vec"
want64=true
;;
  powerpc64le-*-elf* | powerpcle-*-elf64* | powerpc64le-*-linux* | \
  powerpc64le-*-*bsd*)
targ_defvec=powerpc_elf64_le_vec
targ_selvecs="powerpc_elf64_vec powerpc_elf32_le_vec powerpc_elf32_vec 
rs6000_xcoff_vec rs6000_xcoff64_vec rs6000_xcoff64_aix_vec"
want64=true
;;

ld/configure.tgt:
powerpc*-*-elf* | powerpc*-*-eabi* | powerpc*-*-sysv* \
  | powerpc*-*-linux* | powerpc*-*-netbsd* | powerpc*-*-openbsd* \
  | powerpc*-*-solaris* | powerpc*-*-kaos* | powerpc*-*-vxworks*)
 case "${targ}" in
*64*)   targ_emul=elf64ppc
targ_extra_emuls="elf32ppc elf32ppclinux elf32ppcsim"
targ_extra_libpath="elf32ppc elf32ppclinux"
td=tdir_elf32ppc
case "${targ}" in
powerpc*le-*) td=tdir_elf32lppc;;
esac
eval ${td}=`echo "${targ_alias}" | sed -e 's/64//'`
eval ${td}linux=\$${td}
eval ${td}sim=\$${td}
;;

and indeed, when i query a default ppc64 linker, it says it already
supports both 32bit & 64bit targets:
$ powerpc64-unknown-linux-gnu-ld --help | grep supported
powerpc64-unknown-linux-gnu-ld: supported targets: elf64-powerpc 
elf64-powerpcle elf32-powerpc elf32-powerpcle aixcoff-rs6000 aixcoff64-rs6000 
aix5coff64-rs6000 elf64-little elf64-big elf32-little elf32-big plugin srec 
symbolsrec verilog tekhex binary ihex
powerpc64-unknown-linux-gnu-ld: supported emulations: elf64ppc elf32ppc 
elf32ppclinux elf32ppcsim

it would have to of course in order for biarch support (which works)
which is how we build 64-bit kernels in a 32-bit userland.
-mike


signature.asc
Description: Digital signature


[gentoo-dev] [PATCH v1] eclass/toolchain-bintuils: enable targets powerpc-linux-gnu for ppc64

2016-04-19 Thread Leno Hou
Authored-by: Linda Jiang 
---
 eclass/toolchain-binutils.eclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/eclass/toolchain-binutils.eclass b/eclass/toolchain-binutils.eclass
index a23300f..6d2dde8 100644
--- a/eclass/toolchain-binutils.eclass
+++ b/eclass/toolchain-binutils.eclass
@@ -271,6 +271,7 @@ toolchain-binutils_src_configure() {
# We used to do it for everyone, but it's slow on 32bit arches. #438522
case $(tc-arch) in
ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
+   ppc64) myconf+=( --enable-targets="powerpc-linux-gnu" ) ;;
esac
 
use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
-- 
1.9.1