0001-dont-build-static-dynamic-twice.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. Don't build object files twice
  2. When passed --enable-static and --enable-shared, icu will generate
  3. both a shared and a static version of its libraries.
  4. However, in order to do so, it builds each and every object file
  5. twice: once with -fPIC (for the shared library), and once without
  6. -fPIC (for the static library). While admittedly building -fPIC for a
  7. static library generates a slightly suboptimal code, this is what all
  8. the autotools-based project are doing. They build each object file
  9. once, and they use it for both the static and shared libraries.
  10. icu builds the object files for the shared library as .o files, and
  11. the object files for static library as .ao files. By simply changing
  12. the suffix of object files used for static libraries to ".o", we tell
  13. icu to use the ones built for the shared library (i.e, with -fPIC),
  14. and avoid the double build of icu.
  15. On a fast build server, this brings the target icu build from
  16. 3m41.302s down to 1m43.926s (approximate numbers: some other builds
  17. are running on the system at the same time).
  18. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  19. Index: b/source/config/mh-linux
  20. ===================================================================
  21. --- a/source/config/mh-linux
  22. +++ b/source/config/mh-linux
  23. @@ -35,7 +35,7 @@
  24. ## Shared object suffix
  25. SO = so
  26. ## Non-shared intermediate object suffix
  27. -STATIC_O = ao
  28. +STATIC_O = o
  29. ## Compilation rules
  30. %.$(STATIC_O): $(srcdir)/%.c