From 0ca2356375935267a3533e680dff7f932e37f872 Mon Sep 17 00:00:00 2001 From: Juha Kallioinen Date: Mon, 18 Mar 2013 18:21:57 +0000 Subject: [PATCH] Use /usr/bin/localedef during qemu builds Enabler for accelerating glibc build with sb2. Signed-off-by: Juha Kallioinen Change-Id: Id037b0b356b2eb10f9a05f44d2f936d663599296 --- eglibc-2.15-use-usrbin-localedef.patch | 31 ++++++++++++++++++++++++++ glibc.changes | 3 +++ glibc.spec | 21 ++++++++++++----- 3 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 eglibc-2.15-use-usrbin-localedef.patch diff --git a/eglibc-2.15-use-usrbin-localedef.patch b/eglibc-2.15-use-usrbin-localedef.patch new file mode 100644 index 0000000..e7e94da --- /dev/null +++ b/eglibc-2.15-use-usrbin-localedef.patch @@ -0,0 +1,31 @@ +diff -Naur eglibc-2.15.old/localedata/Makefile eglibc-2.15/localedata/Makefile +--- eglibc-2.15.old/localedata/Makefile 2011-11-17 21:56:08.000000000 +0000 ++++ eglibc-2.15/localedata/Makefile 2013-03-18 15:25:40.078955980 +0000 +@@ -159,7 +159,11 @@ + # Dependency for the locale files. We actually make it depend only on + # one of the files. + $(addprefix $(objpfx),$(CTYPE_FILES)): %: \ +- gen-locale.sh $(common-objpfx)locale/localedef Makefile \ ++ if [ -f /usr/bin/localedef ]; then \ ++ gen-locale.sh /usr/bin/localedef Makefile \ ++ else \ ++ gen-locale.sh $(common-objpfx)locale/localedef Makefile \ ++ fi\ + $(addprefix charmaps/,$(CHARMAPS)) $(addprefix locales/,$(LOCALE_SRCS)) + @$(SHELL) -e gen-locale.sh $(common-objpfx) \ + '$(if $(cross-localedef), \ +@@ -235,8 +239,12 @@ + INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES)) + + # Sometimes the whole collection of locale files should be installed. +-LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \ +-$(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef ++ifeq (,$(wildcard /usr/bin/localedef)) ++LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C $(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef ++else ++LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C /usr/bin/localedef ++endif ++ + install-locales: $(INSTALL-SUPPORTED-LOCALES) + + install-locales-dir: diff --git a/glibc.changes b/glibc.changes index 3f5e8db..986890f 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,6 @@ +* Mon Mar 18 2013 Juha Kallioinen - 2.15 +- If available, use /usr/bin/localedef in qemu builds + * Thu Mar 14 2013 Juha Kallioinen - 2.15 - Force -mfpu=vfpv3-d16 for armv7tnhl diff --git a/glibc.spec b/glibc.spec index 75b98c3..fec49f5 100644 --- a/glibc.spec +++ b/glibc.spec @@ -35,6 +35,7 @@ Patch9: eglibc-2.15-mips-async-unwind.patch Patch10: eglibc-2.15-mips-no-n32-n64.patch Patch11: glibc-2.14-locarchive-fedora.patch Patch12: eglibc-2.15-disable-multilib.patch +Patch13: eglibc-2.15-use-usrbin-localedef.patch Provides: ldconfig # The dynamic linker supports DT_GNU_HASH @@ -195,6 +196,9 @@ If unsure if you need this, don't install this package. %patch10 -p1 %patch11 -p1 %patch12 -p1 +%if 0%{?qemu_user_space_build} +%patch13 -p1 +%endif # Not well formatted locales --cvm sed -i "s|^localedata/locale-eo_EO.diff$||g" debian/patches/series @@ -366,12 +370,17 @@ rm locale-archive || : # Intentionally we do not pass --alias-file=, aliases will be added # by build-locale-archive. # note that due to qemu-arm emulation behaviour, we need to break this up into multiple invocations. -# see BMC 10526. -find . -name '*_*' -maxdepth 1 | xargs -r -n10 -P1 --verbose \ -$olddir/build-%{nptl_target_cpu}-linuxnptl/elf/ld.so \ - --library-path $olddir/build-%{nptl_target_cpu}-linuxnptl/ \ - $olddir/build-%{nptl_target_cpu}-linuxnptl/locale/localedef \ - --prefix ${RPM_BUILD_ROOT} --add-to-archive +# see BMC 10526. + +localedef_bin="$olddir/build-%{nptl_target_cpu}-linuxnptl/elf/ld.so --library-path $olddir/build-%{nptl_target_cpu}-linuxnptl/ $olddir/build-%{nptl_target_cpu}-linuxnptl/locale/localedef" + +%if 0%{?qemu_user_space_build} +if [ -f /usr/bin/localedef ]; then + localedef_bin=/usr/bin/localedef +fi +%endif + +find . -name '*_*' -maxdepth 1 | xargs -r -n10 -P1 --verbose $localedef_bin --prefix ${RPM_BUILD_ROOT} --add-to-archive rm -rf *_* mv locale-archive{,.tmpl}