public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] scripts: Select the correct "strip" to strip gdbserver for Canadian build
@ 2012-09-19  5:49 Zhenqiang Chen
  2012-09-19  6:05 ` Mike Frysinger
  0 siblings, 1 reply; 6+ messages in thread
From: Zhenqiang Chen @ 2012-09-19  5:49 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: crossgcc

exporting patch:
# HG changeset patch
# User Zhenqiang Chen <zhenqiang.chen@linaro.org>
# Date 1348031492 -28800
# Node ID bb161ecc8ecb451225697ad0f6729376eb3e43f3
# Parent  2858a24a584642e263a920b4214c815c172ed547
scripts: Select the correct "strip" to strip gdbserver for Canadian build.

For Canadian build, we can not run the bin/${CT_TARGET}-strip on the build
system. But ${CT_TARGET}-strip should be on PATH.

Signed-off-by: Zhenqiang Chen <zhenqiang.chen@linaro.org>

diff -r 2858a24a5846 -r bb161ecc8ecb scripts/build/internals.sh
--- a/scripts/build/internals.sh	Sun Aug 12 07:45:42 2012 -0400
+++ b/scripts/build/internals.sh	Wed Sep 19 13:11:32 2012 +0800
@@ -25,8 +25,15 @@

         # Strip gdbserver
         if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
-           CT_DoExecLog ALL bin/${CT_TARGET}-strip ${strip_args}    \
-                            ${CT_TARGET}/debug-root/usr/bin/gdbserver
+            # For Canadian build, we can not run the bin/${CT_TARGET}-strip on
+            # the build system. But ${CT_TARGET}-strip should be on PATH.
+            if [ "${CT_CANADIAN}" = "y" ]; then
+                CT_DoExecLog ALL ${CT_TARGET}-strip ${strip_args}    \
+                                 ${CT_TARGET}/debug-root/usr/bin/gdbserver
+            else
+                CT_DoExecLog ALL bin/${CT_TARGET}-strip ${strip_args}    \
+                                 ${CT_TARGET}/debug-root/usr/bin/gdbserver
+            fi
         fi
         # We can not use the version in CT_CC_VERSION because
         # of the Linaro stuff. So, harvest the version string

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

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

* Re: [PATCH] scripts: Select the correct "strip" to strip gdbserver for Canadian build
  2012-09-19  5:49 [PATCH] scripts: Select the correct "strip" to strip gdbserver for Canadian build Zhenqiang Chen
@ 2012-09-19  6:05 ` Mike Frysinger
  2012-09-19  8:56   ` Zhenqiang Chen
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2012-09-19  6:05 UTC (permalink / raw)
  To: crossgcc; +Cc: Zhenqiang Chen, Yann E. MORIN

[-- Attachment #1: Type: Text/Plain, Size: 1249 bytes --]

On Wednesday 19 September 2012 01:48:57 Zhenqiang Chen wrote:
> --- a/scripts/build/internals.sh	Sun Aug 12 07:45:42 2012 -0400
> +++ b/scripts/build/internals.sh	Wed Sep 19 13:11:32 2012 +0800
> 
>          # Strip gdbserver
>          if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
> -           CT_DoExecLog ALL bin/${CT_TARGET}-strip ${strip_args}    \
> -                            ${CT_TARGET}/debug-root/usr/bin/gdbserver
> +            # For Canadian build, we can not run the bin/${CT_TARGET}-strip 
> +            # the build system. But ${CT_TARGET}-strip should be on PATH.
> +            if [ "${CT_CANADIAN}" = "y" ]; then
> +                CT_DoExecLog ALL ${CT_TARGET}-strip ${strip_args}    \
> +                                 ${CT_TARGET}/debug-root/usr/bin/gdbserver
> +            else
> +                CT_DoExecLog ALL bin/${CT_TARGET}-strip ${strip_args}    \
> +                                 ${CT_TARGET}/debug-root/usr/bin/gdbserver
> +            fi

could you set a local variable so that you don't have to copy & paste the 
entire command twice ?
	local cross_strip="bin/${CT_TARGET}-strip"
	[[ ${CT_TARGET} == "y" ]] && cross_strip=${CT_TARGET}-strip
	CT_DoExecLog ALL ${cross_strip} ...
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] scripts: Select the correct "strip" to strip gdbserver for Canadian build
  2012-09-19  6:05 ` Mike Frysinger
@ 2012-09-19  8:56   ` Zhenqiang Chen
  2012-09-19 21:04     ` Yann E. MORIN
  0 siblings, 1 reply; 6+ messages in thread
From: Zhenqiang Chen @ 2012-09-19  8:56 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: crossgcc, Yann E. MORIN

> could you set a local variable so that you don't have to copy & paste the
> entire command twice ?
>         local cross_strip="bin/${CT_TARGET}-strip"
>         [[ ${CT_TARGET} == "y" ]] && cross_strip=${CT_TARGET}-strip
>         CT_DoExecLog ALL ${cross_strip} ...

Thanks for the comments. Update it as:

exporting patch:
# HG changeset patch
# User Zhenqiang Chen <zhenqiang.chen@linaro.org>
# Date 1348044842 -28800
# Node ID 49dc965c5eada0b4bbef5f7810a259eae5773bb1
# Parent  2858a24a584642e263a920b4214c815c172ed547
scripts: Select the correct "strip" to strip gdbserver for Canadian build.

For Canadian build, we can not run the bin/${CT_TARGET}-strip on the build
system. But ${CT_TARGET}-strip should be on PATH.

Signed-off-by: Zhenqiang Chen <zhenqiang.chen@linaro.org>

diff -r 2858a24a5846 -r 49dc965c5ead scripts/build/internals.sh
--- a/scripts/build/internals.sh	Sun Aug 12 07:45:42 2012 -0400
+++ b/scripts/build/internals.sh	Wed Sep 19 16:54:02 2012 +0800
@@ -25,8 +25,12 @@

         # Strip gdbserver
         if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
-           CT_DoExecLog ALL bin/${CT_TARGET}-strip ${strip_args}    \
-                            ${CT_TARGET}/debug-root/usr/bin/gdbserver
+            local cross_strip="bin/${CT_TARGET}-strip"
+            # For Canadian build, we can not run the bin/${CT_TARGET}-strip on
+            # the build system. But ${CT_TARGET}-strip should be on PATH.
+            [ "${CT_CANADIAN}" = "y" ] && cross_strip="${CT_TARGET}-strip"
+            CT_DoExecLog ALL ${cross_strip} ${strip_args}    \
+                             ${CT_TARGET}/debug-root/usr/bin/gdbserver
         fi
         # We can not use the version in CT_CC_VERSION because
         # of the Linaro stuff. So, harvest the version string

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

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

* Re: [PATCH] scripts: Select the correct "strip" to strip gdbserver for Canadian build
  2012-09-19  8:56   ` Zhenqiang Chen
@ 2012-09-19 21:04     ` Yann E. MORIN
  2012-09-20  3:23       ` Zhenqiang Chen
  0 siblings, 1 reply; 6+ messages in thread
From: Yann E. MORIN @ 2012-09-19 21:04 UTC (permalink / raw)
  To: crossgcc; +Cc: Zhenqiang Chen, Mike Frysinger

Zhenqiang, Mike, All,

On Wednesday 19 September 2012 10:56:18 Zhenqiang Chen wrote:
> # HG changeset patch
> # User Zhenqiang Chen <zhenqiang.chen@linaro.org>
> # Date 1348044842 -28800
> # Node ID 49dc965c5eada0b4bbef5f7810a259eae5773bb1
> # Parent  2858a24a584642e263a920b4214c815c172ed547
> scripts: Select the correct "strip" to strip gdbserver for Canadian build.
> 
> For Canadian build, we can not run the bin/${CT_TARGET}-strip on the build
> system. But ${CT_TARGET}-strip should be on PATH.
> 
> Signed-off-by: Zhenqiang Chen <zhenqiang.chen@linaro.org>
> 
> diff -r 2858a24a5846 -r 49dc965c5ead scripts/build/internals.sh
> --- a/scripts/build/internals.sh	Sun Aug 12 07:45:42 2012 -0400
> +++ b/scripts/build/internals.sh	Wed Sep 19 16:54:02 2012 +0800
> @@ -25,8 +25,12 @@
> 
>          # Strip gdbserver
>          if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
> -           CT_DoExecLog ALL bin/${CT_TARGET}-strip ${strip_args}    \
> -                            ${CT_TARGET}/debug-root/usr/bin/gdbserver
> +            local cross_strip="bin/${CT_TARGET}-strip"
> +            # For Canadian build, we can not run the bin/${CT_TARGET}-strip on
> +            # the build system. But ${CT_TARGET}-strip should be on PATH.
> +            [ "${CT_CANADIAN}" = "y" ] && cross_strip="${CT_TARGET}-strip"
> +            CT_DoExecLog ALL ${cross_strip} ${strip_args}    \
> +                             ${CT_TARGET}/debug-root/usr/bin/gdbserver

Just call ${CT_TARGET}-strip :
  - if in cross-mode, then we can run it from the final installation
    location ${CT_PREFIX_DIR}/bin, which is in the $PATH
  - if in canadian-mode, then we can run it from the 'host' binutils
    that was build earlier, and isntalled in ${CT_BUILDTOOLS_DIR}/bin,
    which is also in the $PATH

Note: in cross-mode, both ${CT_PREFIX_DIR}/bin and ${CT_BUILDTOOLS_DIR}/bin
are in the $PATH, in this order, to give precedence to the final location
over the build-time-only tools. In canadian-mode, only the latter is in the
$PATH, so we do not even have the possibility to run host code.

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] 6+ messages in thread

* Re: [PATCH] scripts: Select the correct "strip" to strip gdbserver for Canadian build
  2012-09-19 21:04     ` Yann E. MORIN
@ 2012-09-20  3:23       ` Zhenqiang Chen
  2012-09-25 21:00         ` scripts: Use ${CT_TARGET}-strip to strip gdbserver Yann E. MORIN
  0 siblings, 1 reply; 6+ messages in thread
From: Zhenqiang Chen @ 2012-09-20  3:23 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: crossgcc, Mike Frysinger

On 20 September 2012 05:04, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> Zhenqiang, Mike, All,
>
> On Wednesday 19 September 2012 10:56:18 Zhenqiang Chen wrote:
>> # HG changeset patch
>> # User Zhenqiang Chen <zhenqiang.chen@linaro.org>
>> # Date 1348044842 -28800
>> # Node ID 49dc965c5eada0b4bbef5f7810a259eae5773bb1
>> # Parent  2858a24a584642e263a920b4214c815c172ed547
>> scripts: Select the correct "strip" to strip gdbserver for Canadian build.
>>
>> For Canadian build, we can not run the bin/${CT_TARGET}-strip on the build
>> system. But ${CT_TARGET}-strip should be on PATH.
>>
>> Signed-off-by: Zhenqiang Chen <zhenqiang.chen@linaro.org>
>>
>> diff -r 2858a24a5846 -r 49dc965c5ead scripts/build/internals.sh
>> --- a/scripts/build/internals.sh      Sun Aug 12 07:45:42 2012 -0400
>> +++ b/scripts/build/internals.sh      Wed Sep 19 16:54:02 2012 +0800
>> @@ -25,8 +25,12 @@
>>
>>          # Strip gdbserver
>>          if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
>> -           CT_DoExecLog ALL bin/${CT_TARGET}-strip ${strip_args}    \
>> -                            ${CT_TARGET}/debug-root/usr/bin/gdbserver
>> +            local cross_strip="bin/${CT_TARGET}-strip"
>> +            # For Canadian build, we can not run the bin/${CT_TARGET}-strip on
>> +            # the build system. But ${CT_TARGET}-strip should be on PATH.
>> +            [ "${CT_CANADIAN}" = "y" ] && cross_strip="${CT_TARGET}-strip"
>> +            CT_DoExecLog ALL ${cross_strip} ${strip_args}    \
>> +                             ${CT_TARGET}/debug-root/usr/bin/gdbserver
>
> Just call ${CT_TARGET}-strip :
>   - if in cross-mode, then we can run it from the final installation
>     location ${CT_PREFIX_DIR}/bin, which is in the $PATH
>   - if in canadian-mode, then we can run it from the 'host' binutils
>     that was build earlier, and isntalled in ${CT_BUILDTOOLS_DIR}/bin,
>     which is also in the $PATH
>
> Note: in cross-mode, both ${CT_PREFIX_DIR}/bin and ${CT_BUILDTOOLS_DIR}/bin
> are in the $PATH, in this order, to give precedence to the final location
> over the build-time-only tools. In canadian-mode, only the latter is in the
> $PATH, so we do not even have the possibility to run host code.
>
> Regards,
> Yann E. MORIN.

Thanks! Update it as:

exporting patch:
# HG changeset patch
# User Zhenqiang Chen <zhenqiang.chen@linaro.org>
# Date 1348111216 -28800
# Node ID 8724aedc7a30ac1e5c0a412747e5a88707da95a4
# Parent  2858a24a584642e263a920b4214c815c172ed547
scripts: Use ${CT_TARGET}-strip to strip gdbserver

Signed-off-by: Zhenqiang Chen <zhenqiang.chen@linaro.org>

diff -r 2858a24a5846 -r 8724aedc7a30 scripts/build/internals.sh
--- a/scripts/build/internals.sh	Sun Aug 12 07:45:42 2012 -0400
+++ b/scripts/build/internals.sh	Thu Sep 20 11:20:16 2012 +0800
@@ -25,8 +25,8 @@

         # Strip gdbserver
         if [ "${CT_GDB_GDBSERVER}" = "y" ]; then
-           CT_DoExecLog ALL bin/${CT_TARGET}-strip ${strip_args}    \
-                            ${CT_TARGET}/debug-root/usr/bin/gdbserver
+            CT_DoExecLog ALL ${CT_TARGET}-strip ${strip_args}    \
+                             ${CT_TARGET}/debug-root/usr/bin/gdbserver
         fi
         # We can not use the version in CT_CC_VERSION because
         # of the Linaro stuff. So, harvest the version string

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

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

* scripts: Use ${CT_TARGET}-strip to strip gdbserver
  2012-09-20  3:23       ` Zhenqiang Chen
@ 2012-09-25 21:00         ` Yann E. MORIN
  0 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2012-09-25 21:00 UTC (permalink / raw)
  To: Zhenqiang Chen; +Cc: crossgcc

Zhenqiang, All,

Your patch:
    scripts: Use ${CT_TARGET}-strip to strip gdbserver

has been applied as #f36c207348ef. Thank you!

Regards,
Yann E. MORIN.



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

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

end of thread, other threads:[~2012-09-25 21:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-19  5:49 [PATCH] scripts: Select the correct "strip" to strip gdbserver for Canadian build Zhenqiang Chen
2012-09-19  6:05 ` Mike Frysinger
2012-09-19  8:56   ` Zhenqiang Chen
2012-09-19 21:04     ` Yann E. MORIN
2012-09-20  3:23       ` Zhenqiang Chen
2012-09-25 21:00         ` scripts: Use ${CT_TARGET}-strip to strip gdbserver 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).