buildrootschalter/package/icu/icu-001-dont-build-static-dynamic-twice.patch
Sonic Zhang 170d526e91 icu: detect and add compiler symbol prefix to the assembly code
Some compilers, such as the Blackfin GNU compiler, prefix a character to any
C symbol in generated assembly code. If any assembly symbol is invoked
from C code, it needs to be prefixed as well.

Note: since autoreconf doesn't work with this package because automake
isn't used.

Fixes:
  http://autobuild.buildroot.net/results/c40a22814b405de2c5c75139cfc393c863ed4b81/

[Ryan: add information about why patching configure is ok]
[Ryan: add renaming of patches to be consistent with standard]

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Ryan Barnett <rjbarnet@rockwellcollins.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-04 15:27:31 +01:00

38 lines
1.4 KiB
Diff

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