All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/3] Misc improvements and fixes to 'icu' package
@ 2013-03-09 14:02 Thomas Petazzoni
  2013-03-09 14:02 ` [Buildroot] [PATCH 1/3] icu: workaround toolchain bugs Thomas Petazzoni
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2013-03-09 14:02 UTC (permalink / raw)
  To: buildroot

Hello,

This set of 3 patches make a few improvements and fixes to the icu
package.

First patch workarounds an internal compiler error that occurs with
certain toolchains when building icu.

The second and third patch make nice build time improvements when
building the icu package.

Thanks,

Thomas

Thomas Petazzoni (3):
  icu: workaround toolchain bugs
  icu: don't build object files twice
  icu: speed up host build

 .../icu/icu-dont-build-static-dynamic-twice.patch  |   37 ++++++++++++++++++++
 package/icu/icu-workaround-toolchain-bugs.patch    |   36 +++++++++++++++++++
 package/icu/icu.mk                                 |    7 +++-
 3 files changed, 79 insertions(+), 1 deletion(-)
 create mode 100644 package/icu/icu-dont-build-static-dynamic-twice.patch
 create mode 100644 package/icu/icu-workaround-toolchain-bugs.patch

-- 
1.7.9.5

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

* [Buildroot] [PATCH 1/3] icu: workaround toolchain bugs
  2013-03-09 14:02 [Buildroot] [PATCH 0/3] Misc improvements and fixes to 'icu' package Thomas Petazzoni
@ 2013-03-09 14:02 ` Thomas Petazzoni
  2013-03-09 14:02 ` [Buildroot] [PATCH 2/3] icu: don't build object files twice Thomas Petazzoni
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2013-03-09 14:02 UTC (permalink / raw)
  To: buildroot

Many of ARM Sourcery CodeBench toolchain have a bug when compiling
icu's translit.cpp source file. The bug is trigerred when there is a
combination of "-W -Wall" and "-Os", and causes an internal compiler
error. The bug has been reported to Mentor Graphics.

Even though it is clearly a toolchain bug, having a workaround for it
is trivial in this case. So it will avoid our users falling into this
internal compiler error, and allow our autobuilders to test more
packages using this Sourcery CodeBench toolchain.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/icu/icu-workaround-toolchain-bugs.patch |   36 +++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 package/icu/icu-workaround-toolchain-bugs.patch

diff --git a/package/icu/icu-workaround-toolchain-bugs.patch b/package/icu/icu-workaround-toolchain-bugs.patch
new file mode 100644
index 0000000..df9d528
--- /dev/null
+++ b/package/icu/icu-workaround-toolchain-bugs.patch
@@ -0,0 +1,36 @@
+Workaround toolchain bugs
+
+Many of ARM Sourcery CodeBench toolchain have a bug when compiling
+icu's translit.cpp source file. The bug is trigerred when there is a
+combination of "-W -Wall" and "-Os", and causes an internal compiler
+error. The bug has been reported to Mentor Graphics.
+
+Even though it is clearly a toolchain bug, having a workaround for it
+is trivial in this case. So it will avoid our users falling into this
+internal compiler error, and allow our autobuilders to test more
+packages using this Sourcery CodeBench toolchain.qq
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/source/configure
+===================================================================
+--- a/source/configure
++++ b/source/configure
+@@ -4320,7 +4320,7 @@
+                 echo "# Note: We are not using '-ansi' with HP/UX GCC because int64_t broke, see <http://bugs.icu-project.org/trac/ticket/8493>"
+                 CFLAGS="$CFLAGS -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long";;
+             *)
+-                CFLAGS="$CFLAGS -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long";;
++                CFLAGS="$CFLAGS -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long";;
+             esac
+         else
+             case "${host}" in
+@@ -4333,7 +4333,7 @@
+         fi
+         if test "$GXX" = yes
+         then
+-            CXXFLAGS="$CXXFLAGS -W -Wall -ansi -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long"
++            CXXFLAGS="$CXXFLAGS -ansi -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long"
+             case "${host}" in
+             *-*-solaris*)
+                 CXXFLAGS="$CXXFLAGS -D__STDC__=0";;
-- 
1.7.9.5

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

* [Buildroot] [PATCH 2/3] icu: don't build object files twice
  2013-03-09 14:02 [Buildroot] [PATCH 0/3] Misc improvements and fixes to 'icu' package Thomas Petazzoni
  2013-03-09 14:02 ` [Buildroot] [PATCH 1/3] icu: workaround toolchain bugs Thomas Petazzoni
@ 2013-03-09 14:02 ` Thomas Petazzoni
  2013-03-09 14:03 ` [Buildroot] [PATCH 3/3] icu: speed up host build Thomas Petazzoni
  2013-03-10 22:34 ` [Buildroot] [PATCH 0/3] Misc improvements and fixes to 'icu' package Peter Korsgaard
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2013-03-09 14:02 UTC (permalink / raw)
  To: buildroot

When passed --enable-static and --enable-shared, icu will generate
both a shared and a static version of its libraries.

However, in order to do so, it builds each and every object file
twice: once with -fPIC (for the shared library), and once without
-fPIC (for the static library). While admittedly building -fPIC for a
static library generates a slightly suboptimal code, this is what all
the autotools-based project are doing. They build each object file
once, and they use it for both the static and shared libraries.

icu builds the object files for the shared library as .o files, and
the object files for static library as .ao files. By simply changing
the suffix of object files used for static libraries to ".o", we tell
icu to use the ones built for the shared library (i.e, with -fPIC),
and avoid the double build of icu.

On a fast build server, this brings the target icu build from
3m41.302s down to 1m43.926s (approximate numbers: some other builds
are running on the system at the same time).

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 .../icu/icu-dont-build-static-dynamic-twice.patch  |   37 ++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 package/icu/icu-dont-build-static-dynamic-twice.patch

diff --git a/package/icu/icu-dont-build-static-dynamic-twice.patch b/package/icu/icu-dont-build-static-dynamic-twice.patch
new file mode 100644
index 0000000..ccbe534
--- /dev/null
+++ b/package/icu/icu-dont-build-static-dynamic-twice.patch
@@ -0,0 +1,37 @@
+Don't build object files twice
+
+When passed --enable-static and --enable-shared, icu will generate
+both a shared and a static version of its libraries.
+
+However, in order to do so, it builds each and every object file
+twice: once with -fPIC (for the shared library), and once without
+-fPIC (for the static library). While admittedly building -fPIC for a
+static library generates a slightly suboptimal code, this is what all
+the autotools-based project are doing. They build each object file
+once, and they use it for both the static and shared libraries.
+
+icu builds the object files for the shared library as .o files, and
+the object files for static library as .ao files. By simply changing
+the suffix of object files used for static libraries to ".o", we tell
+icu to use the ones built for the shared library (i.e, with -fPIC),
+and avoid the double build of icu.
+
+On a fast build server, this brings the target icu build from
+3m41.302s down to 1m43.926s (approximate numbers: some other builds
+are running on the system at the same time).
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/source/config/mh-linux
+===================================================================
+--- a/source/config/mh-linux
++++ b/source/config/mh-linux
+@@ -35,7 +35,7 @@
+ ## Shared object suffix
+ SO = so
+ ## Non-shared intermediate object suffix
+-STATIC_O = ao
++STATIC_O = o
+ 
+ ## Compilation rules
+ %.$(STATIC_O): $(srcdir)/%.c
-- 
1.7.9.5

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

* [Buildroot] [PATCH 3/3] icu: speed up host build
  2013-03-09 14:02 [Buildroot] [PATCH 0/3] Misc improvements and fixes to 'icu' package Thomas Petazzoni
  2013-03-09 14:02 ` [Buildroot] [PATCH 1/3] icu: workaround toolchain bugs Thomas Petazzoni
  2013-03-09 14:02 ` [Buildroot] [PATCH 2/3] icu: don't build object files twice Thomas Petazzoni
@ 2013-03-09 14:03 ` Thomas Petazzoni
  2013-03-10 22:34 ` [Buildroot] [PATCH 0/3] Misc improvements and fixes to 'icu' package Peter Korsgaard
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2013-03-09 14:03 UTC (permalink / raw)
  To: buildroot

The host build of icu doesn't need to build everything, so we can add
a few more --disable-<foo> options to save a little bit of build time.

On a fast build server, this bring the host icu build from 2m28.517s
to 2m5.192s.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/icu/icu.mk |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/package/icu/icu.mk b/package/icu/icu.mk
index 5a88496..7658589 100644
--- a/package/icu/icu.mk
+++ b/package/icu/icu.mk
@@ -15,7 +15,12 @@ ICU_INSTALL_STAGING = YES
 ICU_CONFIG_SCRIPTS = icu-config
 ICU_CONF_OPT = --with-cross-build=$(HOST_ICU_DIR)/source --disable-samples \
 		--disable-tests
-HOST_ICU_CONF_OPT = --disable-samples --disable-tests
+HOST_ICU_CONF_OPT = \
+	--disable-samples \
+	--disable-tests \
+	--disable-extras \
+	--disable-icuio \
+	--disable-layout
 ICU_MAKE = $(MAKE1)
 ICU_SUBDIR = source
 HOST_ICU_SUBDIR = source
-- 
1.7.9.5

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

* [Buildroot] [PATCH 0/3] Misc improvements and fixes to 'icu' package
  2013-03-09 14:02 [Buildroot] [PATCH 0/3] Misc improvements and fixes to 'icu' package Thomas Petazzoni
                   ` (2 preceding siblings ...)
  2013-03-09 14:03 ` [Buildroot] [PATCH 3/3] icu: speed up host build Thomas Petazzoni
@ 2013-03-10 22:34 ` Peter Korsgaard
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2013-03-10 22:34 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 Thomas> Hello,
 Thomas> This set of 3 patches make a few improvements and fixes to the icu
 Thomas> package.

 Thomas> First patch workarounds an internal compiler error that occurs with
 Thomas> certain toolchains when building icu.

 Thomas> The second and third patch make nice build time improvements when
 Thomas> building the icu package.

Committed series, thanks.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2013-03-10 22:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-09 14:02 [Buildroot] [PATCH 0/3] Misc improvements and fixes to 'icu' package Thomas Petazzoni
2013-03-09 14:02 ` [Buildroot] [PATCH 1/3] icu: workaround toolchain bugs Thomas Petazzoni
2013-03-09 14:02 ` [Buildroot] [PATCH 2/3] icu: don't build object files twice Thomas Petazzoni
2013-03-09 14:03 ` [Buildroot] [PATCH 3/3] icu: speed up host build Thomas Petazzoni
2013-03-10 22:34 ` [Buildroot] [PATCH 0/3] Misc improvements and fixes to 'icu' package Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.