public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] libc/newlib: Add optspace config for newlib
@ 2011-11-22 11:28 Zhenqiang Chen
  2011-11-22 20:23 ` Michael Hope
  2011-11-22 23:05 ` Yann E. MORIN
  0 siblings, 2 replies; 4+ messages in thread
From: Zhenqiang Chen @ 2011-11-22 11:28 UTC (permalink / raw)
  To: yann.morin.1998; +Cc: crossgcc

# HG changeset patch
# User Zhenqiang Chen <zhenqiang.chen@linaro.org>
# Date 1321942694 -28800
# Node ID b28457252771ed67373226ced85317a6c03aac74
# Parent  a6c68712024f406df7d2da4af377f51982615833
libc/newlib: Add LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE (-Os) other than -O to
control CFLAGS.

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

diff --git a/config/libc/newlib.in.2 b/config/libc/newlib.in.2
--- a/config/libc/newlib.in.2
+++ b/config/libc/newlib.in.2
@@ -35,3 +35,11 @@
           _write... If you plan to port newlib to a new
           platform/board, say Yes.

+config LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE
+    bool
+    prompt "Optimize newlib for size"
+    default y
+    help
+      Pass --enable-target-optspace to newlib configure.
+
+      This will compile newlib with -Os.
diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh
--- a/scripts/build/libc/newlib.sh
+++ b/scripts/build/libc/newlib.sh
@@ -85,6 +85,8 @@
          newlib_opts+=( "--enable-newlib-supplied-syscalls" )
      fi

+    [ "${CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE}" = "y" ] && newlib_opts+=("--enable-target-optspace")
+
      # Note: newlib handles the build/host/target a little bit differently
      # than one would expect:
      #   build  : not used

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

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

* Re: [PATCH] libc/newlib: Add optspace config for newlib
  2011-11-22 11:28 [PATCH] libc/newlib: Add optspace config for newlib Zhenqiang Chen
@ 2011-11-22 20:23 ` Michael Hope
  2011-11-22 22:14   ` Yann E. MORIN
  2011-11-22 23:05 ` Yann E. MORIN
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Hope @ 2011-11-22 20:23 UTC (permalink / raw)
  To: Zhenqiang Chen; +Cc: yann.morin.1998, crossgcc

On Wed, Nov 23, 2011 at 12:27 AM, Zhenqiang Chen
<zhenqiang.chen@linaro.org> wrote:
> # HG changeset patch
> # User Zhenqiang Chen <zhenqiang.chen@linaro.org>
> # Date 1321942694 -28800
> # Node ID b28457252771ed67373226ced85317a6c03aac74
> # Parent  a6c68712024f406df7d2da4af377f51982615833
> libc/newlib: Add LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE (-Os) other than -O to
> control CFLAGS.
>
> Reviewed-by: Michael Hope
> Signed-off-by: Zhenqiang Chen <zhenqiang.chen@linaro.org>
>
> diff --git a/config/libc/newlib.in.2 b/config/libc/newlib.in.2
> --- a/config/libc/newlib.in.2
> +++ b/config/libc/newlib.in.2
> @@ -35,3 +35,11 @@
>          _write... If you plan to port newlib to a new
>          platform/board, say Yes.
>
> +config LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE
> +    bool
> +    prompt "Optimize newlib for size"
> +    default y
> +    help
> +      Pass --enable-target-optspace to newlib configure.
> +
> +      This will compile newlib with -Os.
> diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh
> --- a/scripts/build/libc/newlib.sh
> +++ b/scripts/build/libc/newlib.sh
> @@ -85,6 +85,8 @@
>         newlib_opts+=( "--enable-newlib-supplied-syscalls" )
>     fi
>
> +    [ "${CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE}" = "y" ] &&
> newlib_opts+=("--enable-target-optspace")
> +
>     # Note: newlib handles the build/host/target a little bit differently
>     # than one would expect:
>     #   build  : not used

A question for the list: there's already a 'Optimise the GCC runtime
libraries for space' option.  Should it be promoted to something like
CT_ENABLE_TARGET_OPTSPACE and apply to all target libraries?  How you
you handle backwards compatibility of config files?

I have a similar problem with CC_STATIC_LIBSTDCXX.  GOLD is written in
C++ and really needs to have libstdc++ statically linked into it.  I'm
thinking of sending a patch that promotes CT_CC_STATIC_LIBSTDCXX to
CT_STATIC_LIBSTDCXX and uses it everywhere.

-- Michael

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

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

* Re: [PATCH] libc/newlib: Add optspace config for newlib
  2011-11-22 20:23 ` Michael Hope
@ 2011-11-22 22:14   ` Yann E. MORIN
  0 siblings, 0 replies; 4+ messages in thread
From: Yann E. MORIN @ 2011-11-22 22:14 UTC (permalink / raw)
  To: crossgcc; +Cc: Michael Hope, Zhenqiang Chen

Michael, Zhenqiang, All,

On Tuesday 22 November 2011 21:22:50 Michael Hope wrote:
> A question for the list: there's already a 'Optimise the GCC runtime
> libraries for space' option.  Should it be promoted to something like
> CT_ENABLE_TARGET_OPTSPACE and apply to all target libraries?

Sounds reasonable to me. I think the proper place would probably be in
the "Target options" sub-menu, in "Target optimisations", just before
the inclusion of "arch.in.2".

> How you
> you handle backwards compatibility of config files?

That's deliberately not handled.

So, an option rename is not caught (if that's what you were thinking).
But I don't think this should be a show-stopper.

> I have a similar problem with CC_STATIC_LIBSTDCXX.  GOLD is written in
> C++ and really needs to have libstdc++ statically linked into it.  I'm
> thinking of sending a patch that promotes CT_CC_STATIC_LIBSTDCXX to
> CT_STATIC_LIBSTDCXX and uses it everywhere.

Sounds reasonable to me, too; just below (STATIC_TOOLCHAIN) "Build Static
Toolchain". Beware, STATIC_TOOLCHAIN is also defined in config/cc/gcc.in.2.

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

* Re: [PATCH] libc/newlib: Add optspace config for newlib
  2011-11-22 11:28 [PATCH] libc/newlib: Add optspace config for newlib Zhenqiang Chen
  2011-11-22 20:23 ` Michael Hope
@ 2011-11-22 23:05 ` Yann E. MORIN
  1 sibling, 0 replies; 4+ messages in thread
From: Yann E. MORIN @ 2011-11-22 23:05 UTC (permalink / raw)
  To: crossgcc; +Cc: Zhenqiang Chen

Zhenqiang, All,

On Tuesday 22 November 2011 12:27:43 Zhenqiang Chen wrote:
> # HG changeset patch
> # User Zhenqiang Chen <zhenqiang.chen@linaro.org>
> # Date 1321942694 -28800
> # Node ID b28457252771ed67373226ced85317a6c03aac74
> # Parent  a6c68712024f406df7d2da4af377f51982615833
> libc/newlib: Add LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE (-Os) other than -O to
> control CFLAGS.

Applied as #2f4e3c312b65 (with a slightly edited commit message). Thank you!

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

end of thread, other threads:[~2011-11-22 23:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-22 11:28 [PATCH] libc/newlib: Add optspace config for newlib Zhenqiang Chen
2011-11-22 20:23 ` Michael Hope
2011-11-22 22:14   ` Yann E. MORIN
2011-11-22 23:05 ` 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).