Misc improvements and fixes to 'icu' package
cover Misc improvements and fixes to 'icu' package
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
Signature · 1 line
1.7.9.5
PATCH 1/3 icu: 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.
--- package/icu/icu-workaround-toolchain-bugs.patch | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 package/icu/icu-workaround-toolchain-bugs.patch
package/icu/icu-workaround-toolchain-bugs.patch new file +36 -0
@@ -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 <[email protected]> + +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";;
Signature · 1 line
1.7.9.5
PATCH 2/3 icu: don't build object files twice
In reply to Thomas PetazzoniWhen 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).
--- .../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
package/icu/icu-dont-build-static-dynamic-twice.patch new file +37 -0
@@ -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 <[email protected]> + +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
Signature · 1 line
1.7.9.5
PATCH 3/3 icu: speed up host build
In reply to Thomas PetazzoniThe 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.
--- package/icu/icu.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
package/icu/icu.mk +6 -1
@@ -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
Signature · 1 line
1.7.9.5
cover Misc improvements and fixes to 'icu' package
In reply to Thomas PetazzoniQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Thomas" == Thomas Petazzoni <[email protected]> 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.
Signature · 1 line
Bye, Peter Korsgaard