This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: powerpc-eabi


Mircea, All,

On Thursday 15 September 2011 13:37:40 Mircea Gherzan wrote:
> I'm trying to build a cross-compiler for PowerPC EABI with the exact
> tuple "powerpc-eabi". I'm using crosstool-ng 1.12.2.
> 
> 1. Is there a way of setting CT_TARGET_SYS from within menuconfig
>    or from somewhere else? All I could do was hack the powerpc.sh
>    script to set this to "eabi" but this is quite dirty.

No, there's no such possibility. If you need EABI for PPC, it should be
done with a new config option + corresponding code in powerpc.sh.

That is, exactly what you did, but conditionaly on a config option.
Of course, EABI and SPE are probably incompatible, so both should be
guarded from each other, for example with a choice:

    config ARCH_ppc_ABI
        string
        default ""     if ARCH_ppc_ABI_DEFAULT
        default "eabi" if ARCH_ppc_ABI_EABI
        default "spe"  if ARCH_ppc_ABI_SPE

    choice
        bool
        prompt "ABI"
        default ARCH_ppc_ABI_DEFAULT

    config ARCH_ppc_ABI_DEFAULT
        bool
        prompt "default"

    config ARCH_ppc_ABI_EABI
        bool
        prompt "EABI"

    config ARCH_ppc_ABI_SPE
        bool
        prompt "SPE"

    endchoice


And in the script, something like:

    CT_TARGET_SYS="gnu"
    case "${CT_ARCH_ppc_ABI}" in
        "") ;;
        eabi)
            CT_TARGET_SYS="eabi"
            ;;
        spe)
            case "${CT_LIBC}" in
                glibc|eglibc)
                    CT_TARGET_SYS="gnuspe"
                    ;;
            esac
            ;;
    esac

Adapt to your own needs and to reality (eg. it might be "gnueabi" instead
of simply "eabi").

> 2. Is there a way o completely removing the vendor string from the
>    tuple? I've tried with the menuconfig sed option but the build still
>    ends up with "powerpc-unknown-eabi".

The tuple will always contain the vendor string. If you provide an empty
vendor string, it gets replaced with "unknown". It is however possible to
create aliases, and for each tool (eg. gcc, ar, as, ld...), a symlink is
made that points to the corresponding full-tuple tool.

If you want shorter aliases, you have two possibilities:

 - use the sed expression to mangle the tuple. In your case, that would
   be something like:
     CT_TARGET_ALIAS_SED_EXPR="s/-unknown-/-/;"
 - use a constant alias, in your case, something like:
     CT_TARGET_ALIAS="powerpc-eabi"
 - use both of the above

In any case, the tuple will always contain the vendor string, and aliases
will simply create symlinks.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]