[PATCH] scripts: support an empty vendor string

Bryan Hundven bryanhundven@gmail.com
Wed Oct 19 06:18:00 GMT 2011


On Tue, Oct 18, 2011 at 8:24 PM, Michael Hope <michael.hope@linaro.org> wrote:
> # HG changeset patch
> # User Michael Hope <michael.hope@linaro.org>
> # Date 1318994616 -46800
> # Node ID 5b1330e7264a72b0b50243394469606ef0f76351
> # Parent  a31d097e28cd73d07a5484129929a500b4d58efa
> scripts: support an empty vendor string
>
> For Linux and other targets, config.sub defaults to 'unknown'
> if no vendor was specified.  This patch supplies a fake vendor and
> then strips it out afterwards.
>
> This is needed to have an Ubuntu style vendorless tuple such as
> arm-linux-gnueabi.  Other features like the alias and sed transform
> don't cover it.
>
> Signed-off-by: Michael Hope <michael.hope@linaro.org>
>

imo, this functionality should be optional to:
   Allow empty vendor string (enabled)
or
   revert to the previous default of 'unknown'. (disabled)

I think some components that crosstool-ng builds depend on having
a vendor string.

http://sourceware.org/cgi-bin/search.cgi?q=vendor&cmd=Search%21&form=extended&m=all&ps=10&fmt=long&wm=wrd&sp=1&sy=1&wf=2221&type=&GroupBySite=no&ul=%2Fml%2Fcrossgcc%2F%25

or

http://goo.gl/BFVyU

My only real reference there was the uClibc vendor string problem,
so if ! LIBC_UCLIBC_CONFIG_FILE(or any better test), then this
option can be enabled, otherwise revert to current default.

The other side of the idea is support older configurations, as users
move to newer versions of ctng, their configs will still build and work.
If they did before. You obviously know you want this option and will
enable it in your config. :-)

-Bryan

> diff -r a31d097e28cd -r 5b1330e7264a scripts/functions
> --- a/scripts/functions Wed Oct 19 15:27:32 2011 +1300
> +++ b/scripts/functions Wed Oct 19 16:23:36 2011 +1300
> @@ -944,6 +944,20 @@
>     fi
>  }
>
> +# Computes the target tuple from the configuration and the supplied
> +# vendor string
> +CT_BuildOneTargetTuple() {
> +    local vendor="${1}"
> +    local target
> +
> +    target="${CT_TARGET_ARCH}"
> +    target="${target}${vendor:+-${vendor}}"
> +    target="${target}${CT_TARGET_KERNEL:+-${CT_TARGET_KERNEL}}"
> +    target="${target}${CT_TARGET_SYS:+-${CT_TARGET_SYS}}"
> +
> +    echo "${target}"
> +}
> +
>  # Compute the target tuple from what is provided by the user
>  # Usage: CT_DoBuildTargetTuple
>  # In fact this function takes the environment variables to build the target
> @@ -994,10 +1008,7 @@
>     CT_DoKernelTupleValues
>
>     # Finish the target tuple construction
> -    CT_TARGET="${CT_TARGET_ARCH}"
> -    CT_TARGET="${CT_TARGET}${CT_TARGET_VENDOR:+-${CT_TARGET_VENDOR}}"
> -    CT_TARGET="${CT_TARGET}${CT_TARGET_KERNEL:+-${CT_TARGET_KERNEL}}"
> -    CT_TARGET="${CT_TARGET}${CT_TARGET_SYS:+-${CT_TARGET_SYS}}"
> +    CT_TARGET=$(CT_BuildOneTargetTuple "${CT_TARGET_VENDOR}")
>
>     # Sanity checks
>     __sed_alias=""
> @@ -1012,7 +1023,14 @@
>     esac
>
>     # Canonicalise it
> -    CT_TARGET=$(CT_DoConfigSub "${CT_TARGET}")
> +    if [ -n "${CT_TARGET_VENDOR}" ]; then
> +        CT_TARGET=$(CT_DoConfigSub "${CT_TARGET}")
> +    else
> +        # Canonicalise with a fake vendor string then strip it out
> +        local target=$(CT_BuildOneTargetTuple "CT_INVALID")
> +        CT_TARGET=$(CT_DoConfigSub "${target}" |sed -r -s s:CT_INVALID-::)
> +    fi
> +
>     # Prepare the target CFLAGS
>     CT_ARCH_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_ARCH_ENDIAN_CFLAG}"
>     CT_ARCH_TARGET_CFLAGS="${CT_ARCH_TARGET_CFLAGS} ${CT_ARCH_ARCH_CFLAG}"
>
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq
>
>

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



More information about the crossgcc mailing list