public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] scripts: support an empty vendor string
@ 2011-10-19  3:24 Michael Hope
  2011-10-19  6:18 ` Bryan Hundven
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Hope @ 2011-10-19  3:24 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: crossgcc

# 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>

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] scripts: support an empty vendor string
  2011-10-19  3:24 [PATCH] scripts: support an empty vendor string Michael Hope
@ 2011-10-19  6:18 ` Bryan Hundven
  2011-10-20  0:36   ` Michael Hope
  0 siblings, 1 reply; 9+ messages in thread
From: Bryan Hundven @ 2011-10-19  6:18 UTC (permalink / raw)
  To: Michael Hope; +Cc: Yann E. MORIN, crossgcc

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] scripts: support an empty vendor string
  2011-10-19  6:18 ` Bryan Hundven
@ 2011-10-20  0:36   ` Michael Hope
  2011-10-20  1:28     ` Michael Hope
  2011-10-20 21:54     ` Yann E. MORIN
  0 siblings, 2 replies; 9+ messages in thread
From: Michael Hope @ 2011-10-20  0:36 UTC (permalink / raw)
  To: Bryan Hundven; +Cc: Yann E. MORIN, crossgcc

On Wed, Oct 19, 2011 at 7:18 PM, Bryan Hundven <bryanhundven@gmail.com> wrote:
> 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. :-)

Good point.  config/toolchain.in defaults to "unknown" and most of the
samples are the same but sh4-unknown-linux-gnu,
powerpc-unknown-linux-gnu, and powerpc64-unknown-linux-gnu all use an
empty string.

-- Michael

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] scripts: support an empty vendor string
  2011-10-20  0:36   ` Michael Hope
@ 2011-10-20  1:28     ` Michael Hope
  2011-10-20  8:32       ` Bryan Hundven
  2011-10-20 22:02       ` Yann E. MORIN
  2011-10-20 21:54     ` Yann E. MORIN
  1 sibling, 2 replies; 9+ messages in thread
From: Michael Hope @ 2011-10-20  1:28 UTC (permalink / raw)
  To: Bryan Hundven; +Cc: Yann E. MORIN, crossgcc

On 20/10/11 13:35, Michael Hope wrote:
> 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.

scripts: support an empty vendor string

For Linux and other targets, config.sub defaults to 'unknown'
if no vendor was specified.  If enabled, 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>

diff --git a/config/toolchain.in b/config/toolchain.in
index d034315..94755fd 100644
--- a/config/toolchain.in
+++ b/config/toolchain.in
@@ -111,6 +111,18 @@

        Keep the default (unknown) if you don't know better.

+config ALLOW_NO_VENDOR
+    bool
+    prompt "Allow tuples with no vendor"
+    default n
+    help
+      Set this and set the vendor string to an empty string to allow
+      tuples with no vendor component such as 'arm-linux-gnueabi'
+      instead of the default 'arm-unknown-linux-gnueabi'.
+
+      This is a backwards compatibility option for earlier
+      configurations that used an empty string to mean 'unknown'.
+
  config TARGET_ALIAS_SED_EXPR
      string
      prompt "Tuple's sed transform"
diff --git a/scripts/functions b/scripts/functions
index 789b622..2ac4c50 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -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
@@ -993,10 +1007,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=""
@@ -1010,8 +1021,15 @@
        :*:*:*" "*:) CT_Abort "Don't use spaces in the target sed 
transform, it breaks things.";;
      esac

-    # Canonicalise it
-    CT_TARGET=$(CT_DoConfigSub "${CT_TARGET}")
+    if [ "${CT_ALLOW_NO_VENDOR}" = "y" -a -z "${CT_TARGET_VENDOR}" ]; then
+        # 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-::)
+    else
+        # Canonicalise it
+        CT_TARGET=$(CT_DoConfigSub "${CT_TARGET}")
+    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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] scripts: support an empty vendor string
  2011-10-20  1:28     ` Michael Hope
@ 2011-10-20  8:32       ` Bryan Hundven
  2011-10-20 22:02       ` Yann E. MORIN
  1 sibling, 0 replies; 9+ messages in thread
From: Bryan Hundven @ 2011-10-20  8:32 UTC (permalink / raw)
  To: Michael Hope; +Cc: Yann E. MORIN, crossgcc

On Wed, Oct 19, 2011 at 6:28 PM, Michael Hope <michael.hope@linaro.org> wrote:
> On 20/10/11 13:35, Michael Hope wrote:
>>
>> 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.
>
> scripts: support an empty vendor string
>
> For Linux and other targets, config.sub defaults to 'unknown'
> if no vendor was specified.  If enabled, 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>
Reviewed-by: Bryan Hundven <bryanhundven@gmail.com>
>
> diff --git a/config/toolchain.in b/config/toolchain.in
> index d034315..94755fd 100644
> --- a/config/toolchain.in
> +++ b/config/toolchain.in
> @@ -111,6 +111,18 @@
>
>       Keep the default (unknown) if you don't know better.
>
> +config ALLOW_NO_VENDOR
> +    bool
> +    prompt "Allow tuples with no vendor"
> +    default n
> +    help
> +      Set this and set the vendor string to an empty string to allow
> +      tuples with no vendor component such as 'arm-linux-gnueabi'
> +      instead of the default 'arm-unknown-linux-gnueabi'.
> +
> +      This is a backwards compatibility option for earlier
> +      configurations that used an empty string to mean 'unknown'.
> +
>  config TARGET_ALIAS_SED_EXPR
>     string
>     prompt "Tuple's sed transform"
> diff --git a/scripts/functions b/scripts/functions
> index 789b622..2ac4c50 100644
> --- a/scripts/functions
> +++ b/scripts/functions
> @@ -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
> @@ -993,10 +1007,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=""
> @@ -1010,8 +1021,15 @@
>       :*:*:*" "*:) CT_Abort "Don't use spaces in the target sed transform,
> it breaks things.";;
>     esac
>
> -    # Canonicalise it
> -    CT_TARGET=$(CT_DoConfigSub "${CT_TARGET}")
> +    if [ "${CT_ALLOW_NO_VENDOR}" = "y" -a -z "${CT_TARGET_VENDOR}" ]; then
> +        # 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-::)
> +    else
> +        # Canonicalise it
> +        CT_TARGET=$(CT_DoConfigSub "${CT_TARGET}")
> +    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}"
>

Thanks, Michael!

-Bryan

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] scripts: support an empty vendor string
  2011-10-20  0:36   ` Michael Hope
  2011-10-20  1:28     ` Michael Hope
@ 2011-10-20 21:54     ` Yann E. MORIN
  1 sibling, 0 replies; 9+ messages in thread
From: Yann E. MORIN @ 2011-10-20 21:54 UTC (permalink / raw)
  To: crossgcc; +Cc: Michael Hope, Bryan Hundven

Bryan, Michael, All,

On Thursday 20 October 2011 02:35:39 Michael Hope wrote:
> On Wed, Oct 19, 2011 at 7:18 PM, Bryan Hundven <bryanhundven@gmail.com> wrote:
> > 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. :-)

Right. I'll address that point in an answer to Michael's v2.

> Good point.  config/toolchain.in defaults to "unknown" and most of the
> samples are the same but sh4-unknown-linux-gnu,
> powerpc-unknown-linux-gnu, and powerpc64-unknown-linux-gnu all use an
> empty string.

I'll fix those samples so they have a non-empty vendor string.

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] scripts: support an empty vendor string
  2011-10-20  1:28     ` Michael Hope
  2011-10-20  8:32       ` Bryan Hundven
@ 2011-10-20 22:02       ` Yann E. MORIN
  2014-07-28  7:47         ` Bryan Hundven
  1 sibling, 1 reply; 9+ messages in thread
From: Yann E. MORIN @ 2011-10-20 22:02 UTC (permalink / raw)
  To: crossgcc; +Cc: Michael Hope, Bryan Hundven

Michael, Bryan, All,

On Thursday 20 October 2011 03:28:18 Michael Hope wrote:
> scripts: support an empty vendor string

That will have to wait for after the release.

> diff --git a/config/toolchain.in b/config/toolchain.in
> index d034315..94755fd 100644
> --- a/config/toolchain.in
> +++ b/config/toolchain.in
> @@ -111,6 +111,18 @@
> 
>         Keep the default (unknown) if you don't know better.
> 
> +config ALLOW_NO_VENDOR
> +    bool
> +    prompt "Allow tuples with no vendor"
> +    default n
> +    help
> +      Set this and set the vendor string to an empty string to allow
> +      tuples with no vendor component such as 'arm-linux-gnueabi'
> +      instead of the default 'arm-unknown-linux-gnueabi'.
> +
> +      This is a backwards compatibility option for earlier
> +      configurations that used an empty string to mean 'unknown'.
> +

I'd rather have the other way around:

config PROVIDE_VENDOR_STRING
    bool
    prompt "set 'vendor' part of the tuple"
    default y # Or not, I don't really care
    help
      The 'vendor' part of the tuple is the second word between dashes
      in the tuple. It's mostly informative, except in a very few cases
      where it has meaning (eg. MIPS SDE tuple must have the 'vendor'
      part set to 'sde').
      
      If you say 'y' here, you'll be able to set the 'vendor' part
      of the tuple in the next option, below.
      If you say 'n', then the 'vendor' part will be omitted in the
      tuple, giving a shortened tuple.

config TARGET_VENDOR
    depends on PROVIDE_VENDOR_STRING
    ...

>   config TARGET_ALIAS_SED_EXPR
>       string
>       prompt "Tuple's sed transform"
> diff --git a/scripts/functions b/scripts/functions
> index 789b622..2ac4c50 100644
> --- a/scripts/functions
> +++ b/scripts/functions
> @@ -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
> @@ -993,10 +1007,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=""
> @@ -1010,8 +1021,15 @@
>         :*:*:*" "*:) CT_Abort "Don't use spaces in the target sed 
> transform, it breaks things.";;
>       esac
> 
> -    # Canonicalise it
> -    CT_TARGET=$(CT_DoConfigSub "${CT_TARGET}")
> +    if [ "${CT_ALLOW_NO_VENDOR}" = "y" -a -z "${CT_TARGET_VENDOR}" ]; then
> +        # 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-::)
> +    else
> +        # Canonicalise it
> +        CT_TARGET=$(CT_DoConfigSub "${CT_TARGET}")
> +    fi
> +

Hmmm. The code does not look nice. I can't say why, it just looks ugly to
me. I believe there is a better way to do it. At least, the existing code
deserves a bit of cleanup first... Let's revisit this after the release.

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] scripts: support an empty vendor string
  2011-10-20 22:02       ` Yann E. MORIN
@ 2014-07-28  7:47         ` Bryan Hundven
  2014-07-29 20:16           ` Bryan Hundven
  0 siblings, 1 reply; 9+ messages in thread
From: Bryan Hundven @ 2014-07-28  7:47 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: crossgcc maillist, Michael Hope

Yann, Michael, list

On Thu, Oct 20, 2011 at 3:02 PM, Yann E. MORIN
<yann.morin.1998@anciens.enib.fr> wrote:
> Michael, Bryan, All,
>
> On Thursday 20 October 2011 03:28:18 Michael Hope wrote:
>> scripts: support an empty vendor string
>
> That will have to wait for after the release.
>
>> diff --git a/config/toolchain.in b/config/toolchain.in
>> index d034315..94755fd 100644
>> --- a/config/toolchain.in
>> +++ b/config/toolchain.in
>> @@ -111,6 +111,18 @@
>>
>>         Keep the default (unknown) if you don't know better.
>>
>> +config ALLOW_NO_VENDOR
>> +    bool
>> +    prompt "Allow tuples with no vendor"
>> +    default n
>> +    help
>> +      Set this and set the vendor string to an empty string to allow
>> +      tuples with no vendor component such as 'arm-linux-gnueabi'
>> +      instead of the default 'arm-unknown-linux-gnueabi'.
>> +
>> +      This is a backwards compatibility option for earlier
>> +      configurations that used an empty string to mean 'unknown'.
>> +
>
> I'd rather have the other way around:
>
> config PROVIDE_VENDOR_STRING
>     bool
>     prompt "set 'vendor' part of the tuple"
>     default y # Or not, I don't really care
>     help
>       The 'vendor' part of the tuple is the second word between dashes
>       in the tuple. It's mostly informative, except in a very few cases
>       where it has meaning (eg. MIPS SDE tuple must have the 'vendor'
>       part set to 'sde').
>
>       If you say 'y' here, you'll be able to set the 'vendor' part
>       of the tuple in the next option, below.
>       If you say 'n', then the 'vendor' part will be omitted in the
>       tuple, giving a shortened tuple.
>
> config TARGET_VENDOR
>     depends on PROVIDE_VENDOR_STRING
>     ...
>
>>   config TARGET_ALIAS_SED_EXPR
>>       string
>>       prompt "Tuple's sed transform"
>> diff --git a/scripts/functions b/scripts/functions
>> index 789b622..2ac4c50 100644
>> --- a/scripts/functions
>> +++ b/scripts/functions
>> @@ -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
>> @@ -993,10 +1007,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=""
>> @@ -1010,8 +1021,15 @@
>>         :*:*:*" "*:) CT_Abort "Don't use spaces in the target sed
>> transform, it breaks things.";;
>>       esac
>>
>> -    # Canonicalise it
>> -    CT_TARGET=$(CT_DoConfigSub "${CT_TARGET}")
>> +    if [ "${CT_ALLOW_NO_VENDOR}" = "y" -a -z "${CT_TARGET_VENDOR}" ]; then
>> +        # 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-::)
>> +    else
>> +        # Canonicalise it
>> +        CT_TARGET=$(CT_DoConfigSub "${CT_TARGET}")
>> +    fi
>> +
>
> Hmmm. The code does not look nice. I can't say why, it just looks ugly to
> me. I believe there is a better way to do it. At least, the existing code
> deserves a bit of cleanup first... Let's revisit this after the release.
>
> 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.  |
> '------------------------------^-------^------------------^--------------------'

Kicking an old horse...

This one seems to have gotten dropped. Any chance we can revisit this patch?

-Bryan

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] scripts: support an empty vendor string
  2014-07-28  7:47         ` Bryan Hundven
@ 2014-07-29 20:16           ` Bryan Hundven
  0 siblings, 0 replies; 9+ messages in thread
From: Bryan Hundven @ 2014-07-29 20:16 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: crossgcc maillist, Trevor Woerner

Yann, Trevor,

On Mon, Jul 28, 2014 at 12:47 AM, Bryan Hundven <bryanhundven@gmail.com> wrote:
> Yann, Michael, list

Ugh, I sent this to Yann's old email address, and Michael doesn't work
for linaro anymore.
I now have updated Yann's email address, and added Trevor to the email.

> On Thu, Oct 20, 2011 at 3:02 PM, Yann E. MORIN
> <yann.morin.1998@anciens.enib.fr> wrote:
>> Michael, Bryan, All,
>>
>> On Thursday 20 October 2011 03:28:18 Michael Hope wrote:
>>> scripts: support an empty vendor string
>>
>> That will have to wait for after the release.
>>
>>> diff --git a/config/toolchain.in b/config/toolchain.in
>>> index d034315..94755fd 100644
>>> --- a/config/toolchain.in
>>> +++ b/config/toolchain.in
>>> @@ -111,6 +111,18 @@
>>>
>>>         Keep the default (unknown) if you don't know better.
>>>
>>> +config ALLOW_NO_VENDOR
>>> +    bool
>>> +    prompt "Allow tuples with no vendor"
>>> +    default n
>>> +    help
>>> +      Set this and set the vendor string to an empty string to allow
>>> +      tuples with no vendor component such as 'arm-linux-gnueabi'
>>> +      instead of the default 'arm-unknown-linux-gnueabi'.
>>> +
>>> +      This is a backwards compatibility option for earlier
>>> +      configurations that used an empty string to mean 'unknown'.
>>> +
>>
>> I'd rather have the other way around:
>>
>> config PROVIDE_VENDOR_STRING
>>     bool
>>     prompt "set 'vendor' part of the tuple"
>>     default y # Or not, I don't really care
>>     help
>>       The 'vendor' part of the tuple is the second word between dashes
>>       in the tuple. It's mostly informative, except in a very few cases
>>       where it has meaning (eg. MIPS SDE tuple must have the 'vendor'
>>       part set to 'sde').
>>
>>       If you say 'y' here, you'll be able to set the 'vendor' part
>>       of the tuple in the next option, below.
>>       If you say 'n', then the 'vendor' part will be omitted in the
>>       tuple, giving a shortened tuple.
>>
>> config TARGET_VENDOR
>>     depends on PROVIDE_VENDOR_STRING
>>     ...
>>
>>>   config TARGET_ALIAS_SED_EXPR
>>>       string
>>>       prompt "Tuple's sed transform"
>>> diff --git a/scripts/functions b/scripts/functions
>>> index 789b622..2ac4c50 100644
>>> --- a/scripts/functions
>>> +++ b/scripts/functions
>>> @@ -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
>>> @@ -993,10 +1007,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=""
>>> @@ -1010,8 +1021,15 @@
>>>         :*:*:*" "*:) CT_Abort "Don't use spaces in the target sed
>>> transform, it breaks things.";;
>>>       esac
>>>
>>> -    # Canonicalise it
>>> -    CT_TARGET=$(CT_DoConfigSub "${CT_TARGET}")
>>> +    if [ "${CT_ALLOW_NO_VENDOR}" = "y" -a -z "${CT_TARGET_VENDOR}" ]; then
>>> +        # 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-::)
>>> +    else
>>> +        # Canonicalise it
>>> +        CT_TARGET=$(CT_DoConfigSub "${CT_TARGET}")
>>> +    fi
>>> +
>>
>> Hmmm. The code does not look nice. I can't say why, it just looks ugly to
>> me. I believe there is a better way to do it. At least, the existing code
>> deserves a bit of cleanup first... Let's revisit this after the release.
>>
>> 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.  |
>> '------------------------------^-------^------------------^--------------------'
>
> Kicking an old horse...
>
> This one seems to have gotten dropped. Any chance we can revisit this patch?
>
> -Bryan

^^^ my question persists, now it's just being asked on the right email
addresses ;)

-Bryan

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-07-29 20:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-19  3:24 [PATCH] scripts: support an empty vendor string Michael Hope
2011-10-19  6:18 ` Bryan Hundven
2011-10-20  0:36   ` Michael Hope
2011-10-20  1:28     ` Michael Hope
2011-10-20  8:32       ` Bryan Hundven
2011-10-20 22:02       ` Yann E. MORIN
2014-07-28  7:47         ` Bryan Hundven
2014-07-29 20:16           ` Bryan Hundven
2011-10-20 21:54     ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).