diff --git a/poky/meta/classes/libc-package.bbclass b/poky/meta/classes/libc-package.bbclass
index 345ec29..8859dad 100644
--- a/poky/meta/classes/libc-package.bbclass
+++ b/poky/meta/classes/libc-package.bbclass
@@ -37,16 +37,11 @@
                 d.setVar("DEPENDS", depends)
                 d.setVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", "compile")
                 break
-
-    # try to fix disable charsets/locales/locale-code compile fail
-    if bb.utils.contains('DISTRO_FEATURES', 'libc-charsets', True, False, d) and \
-            bb.utils.contains('DISTRO_FEATURES', 'libc-locales', True, False, d) and \
-            bb.utils.contains('DISTRO_FEATURES', 'libc-locale-code', True, False, d):
-        d.setVar('PACKAGE_NO_GCONV', '0')
-    else:
-        d.setVar('PACKAGE_NO_GCONV', '1')
 }
 
+# try to fix disable charsets/locales/locale-code compile fail
+PACKAGE_NO_GCONV ?= "0"
+
 OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
 
 locale_base_postinst_ontarget() {
@@ -69,9 +64,14 @@
 	for i in $treedir/${datadir}/i18n/charmaps/*gz; do 
 		gunzip $i
 	done
-	tar -cf - -C ${LOCALETREESRC}${base_libdir} -p . | tar -xf - -C $treedir/${base_libdir}
-	if [ -f ${STAGING_DIR_NATIVE}${prefix_native}/lib/libgcc_s.* ]; then
-		tar -cf - -C ${STAGING_DIR_NATIVE}/${prefix_native}/${base_libdir} -p libgcc_s.* | tar -xf - -C $treedir/${base_libdir}
+	# The extract pattern "./l*.so*" is carefully selected so that it will
+	# match ld*.so and lib*.so*, but not any files in the gconv directory
+	# (if it exists). This makes sure we only unpack the files we need.
+	# This is important in case usrmerge is set in DISTRO_FEATURES, which
+	# means ${base_libdir} == ${libdir}.
+	tar -cf - -C ${LOCALETREESRC}${base_libdir} -p . | tar -xf - -C $treedir/${base_libdir} --wildcards './l*.so*'
+	if [ -f ${STAGING_LIBDIR_NATIVE}/libgcc_s.* ]; then
+		tar -cf - -C ${STAGING_LIBDIR_NATIVE} -p libgcc_s.* | tar -xf - -C $treedir/${base_libdir}
 	fi
 	install -m 0755 ${LOCALETREESRC}${bindir}/localedef $treedir/${base_bindir}
 }
@@ -115,8 +115,8 @@
     def calc_gconv_deps(fn, pkg, file_regex, output_pattern, group):
         deps = []
         f = open(fn, "rb")
-        c_re = re.compile('^copy "(.*)"')
-        i_re = re.compile('^include "(\w+)".*')
+        c_re = re.compile(r'^copy "(.*)"')
+        i_re = re.compile(r'^include "(\w+)".*')
         for l in f.readlines():
             l = l.decode("latin-1")
             m = c_re.match(l) or i_re.match(l)
@@ -130,15 +130,15 @@
         if bpn != 'glibc':
             d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'))
 
-    do_split_packages(d, gconv_libdir, file_regex='^(.*)\.so$', output_pattern=bpn+'-gconv-%s', \
+    do_split_packages(d, gconv_libdir, file_regex=r'^(.*)\.so$', output_pattern=bpn+'-gconv-%s', \
         description='gconv module for character set %s', hook=calc_gconv_deps, \
         extra_depends=bpn+'-gconv')
 
     def calc_charmap_deps(fn, pkg, file_regex, output_pattern, group):
         deps = []
         f = open(fn, "rb")
-        c_re = re.compile('^copy "(.*)"')
-        i_re = re.compile('^include "(\w+)".*')
+        c_re = re.compile(r'^copy "(.*)"')
+        i_re = re.compile(r'^include "(\w+)".*')
         for l in f.readlines():
             l = l.decode("latin-1")
             m = c_re.match(l) or i_re.match(l)
@@ -152,14 +152,14 @@
         if bpn != 'glibc':
             d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'))
 
-    do_split_packages(d, charmap_dir, file_regex='^(.*)\.gz$', output_pattern=bpn+'-charmap-%s', \
+    do_split_packages(d, charmap_dir, file_regex=r'^(.*)\.gz$', output_pattern=bpn+'-charmap-%s', \
         description='character map for %s encoding', hook=calc_charmap_deps, extra_depends='')
 
     def calc_locale_deps(fn, pkg, file_regex, output_pattern, group):
         deps = []
         f = open(fn, "rb")
-        c_re = re.compile('^copy "(.*)"')
-        i_re = re.compile('^include "(\w+)".*')
+        c_re = re.compile(r'^copy "(.*)"')
+        i_re = re.compile(r'^include "(\w+)".*')
         for l in f.readlines():
             l = l.decode("latin-1")
             m = c_re.match(l) or i_re.match(l)
@@ -173,13 +173,13 @@
         if bpn != 'glibc':
             d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'))
 
-    do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern=bpn+'-localedata-%s', \
+    do_split_packages(d, locales_dir, file_regex=r'(.*)', output_pattern=bpn+'-localedata-%s', \
         description='locale definition for %s', hook=calc_locale_deps, extra_depends='')
     d.setVar('PACKAGES', d.getVar('PACKAGES', False) + ' ' + d.getVar('MLPREFIX', False) + bpn + '-gconv')
 
     use_bin = d.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE")
 
-    dot_re = re.compile("(.*)\.(.*)")
+    dot_re = re.compile(r"(.*)\.(.*)")
 
     # Read in supported locales and associated encodings
     supported = {}
@@ -236,6 +236,8 @@
         if use_cross_localedef == "1":
             target_arch = d.getVar('TARGET_ARCH')
             locale_arch_options = { \
+                "arc":     " --uint32-align=4 --little-endian ", \
+                "arceb":   " --uint32-align=4 --big-endian ",    \
                 "arm":     " --uint32-align=4 --little-endian ", \
                 "armeb":   " --uint32-align=4 --big-endian ",    \
                 "aarch64": " --uint32-align=4 --little-endian ",    \
@@ -278,7 +280,7 @@
             qemu_options = d.getVar('QEMU_OPTIONS')
 
             cmd = "PSEUDO_RELOADED=YES PATH=\"%s\" I18NPATH=\"%s\" %s -L %s \
-                -E LD_LIBRARY_PATH=%s %s %s/bin/localedef %s" % \
+                -E LD_LIBRARY_PATH=%s %s %s${base_bindir}/localedef %s" % \
                 (path, i18npath, qemu, treedir, ldlibdir, qemu_options, treedir, localedef_opts)
 
         commands["%s/%s" % (outputpath, name)] = cmd
@@ -290,7 +292,7 @@
         d.setVar('ALLOW_EMPTY_%s' % pkgname, '1')
         d.setVar('PACKAGES', '%s %s' % (pkgname, d.getVar('PACKAGES')))
         rprovides = ' %svirtual-locale-%s' % (mlprefix, legitimize_package_name(name))
-        m = re.match("(.*)_(.*)", name)
+        m = re.match(r"(.*)_(.*)", name)
         if m:
             rprovides += ' %svirtual-locale-%s' % (mlprefix, m.group(1))
         d.setVar('RPROVIDES_%s' % pkgname, rprovides)
@@ -343,11 +345,14 @@
         makefile = oe.path.join(d.getVar("WORKDIR"), "locale-tree", "Makefile")
         m = open(makefile, "w")
         m.write("all: %s\n\n" % " ".join(commands.keys()))
-        for cmd in commands:
+        total = len(commands)
+        for i, cmd in enumerate(commands):
             m.write(cmd + ":\n")
+            m.write("\t@echo 'Progress %d/%d'\n" % (i, total))
             m.write("\t" + commands[cmd] + "\n\n")
         m.close()
         d.setVar("EXTRA_OEMAKE", "-C %s ${PARALLEL_MAKE}" % (os.path.dirname(makefile)))
+        d.setVarFlag("oe_runmake", "progress", "outof:Progress\s(\d+)/(\d+)")
         bb.note("Executing binary locale generation makefile")
         bb.build.exec_func("oe_runmake", d)
         bb.note("collecting binary locales from locale tree")
@@ -356,12 +361,12 @@
     if use_bin in ('compile', 'precompiled'):
         lcsplit = d.getVar('GLIBC_SPLIT_LC_PACKAGES')
         if lcsplit and int(lcsplit):
-            do_split_packages(d, binary_locales_dir, file_regex='^(.*/LC_\w+)', \
+            do_split_packages(d, binary_locales_dir, file_regex=r'^(.*/LC_\w+)', \
                 output_pattern=bpn+'-binary-localedata-%s', \
                 description='binary locale definition for %s', recursive=True,
                 hook=metapkg_hook, extra_depends='', allow_dirs=True, match_path=True)
         else:
-            do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
+            do_split_packages(d, binary_locales_dir, file_regex=r'(.*)', \
                 output_pattern=bpn+'-binary-localedata-%s', \
                 description='binary locale definition for %s', extra_depends='', allow_dirs=True)
     else:
