On 20 Apr 2016 13:52, Leno Hou wrote:
> Authored-by: Linda Jiang <linda.q...@gmail.com>
> ---
>  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

Attachment: signature.asc
Description: Digital signature

Reply via email to