summaryrefslogtreecommitdiffstats
path: root/package/icu/icu-dont-build-static-dynamic-twice.patch
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2013-03-09 04:02:59 +0000
committerPeter Korsgaard <jacmet@sunsite.dk>2013-03-10 23:15:52 +0100
commita33baa1ef9dadbec8e45d411c30d636fa6b8872a (patch)
tree604d9e3429af600e5db23eafda0568e2d5328f18 /package/icu/icu-dont-build-static-dynamic-twice.patch
parent867b986721d275e74edd6d61dad4a63e540dece1 (diff)
downloadbuildroot-novena-a33baa1ef9dadbec8e45d411c30d636fa6b8872a.tar.gz
buildroot-novena-a33baa1ef9dadbec8e45d411c30d636fa6b8872a.zip
icu: 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> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/icu/icu-dont-build-static-dynamic-twice.patch')
-rw-r--r--package/icu/icu-dont-build-static-dynamic-twice.patch37
1 files changed, 37 insertions, 0 deletions
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 000000000..ccbe534aa
--- /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