diff options
author | Yi Zhao <yi.zhao@windriver.com> | 2017-12-05 09:17:04 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-12-18 18:03:57 +0000 |
commit | 2293d7b67724d6dbb8cb7293ad7cadad3bce5067 (patch) | |
tree | 8c86c5e889f6addab26a72c196ce8ef724b408d2 /meta/recipes-support | |
parent | 9b27bb00d5ec0e25dfdfe581190a8ae5d9ed512f (diff) | |
download | poky-2293d7b67724d6dbb8cb7293ad7cadad3bce5067.tar.gz |
icu: fix libicudata corruption on big endian system
ICU library libicudata is created with a wrong endianness if the host
and target have different endianness. (e.g. build ICU for qemuppc on
x86-64 host)
See upstream bug report: http://bugs.icu-project.org/trac/ticket/11758
The discussion in oe-core mailing list:
https://www.mail-archive.com/openembedded-core@lists.openembedded.org/msg65155.html
The root cause is the native pkgdata can not generate correct icu data
for different endianness. By default, this data is built into the shared
library libicudata that would cause it corrupt. But ICU also provides
additional options for loading the data. With option
--with-data-packaging=archive, ICU outputs a single icudt.dat file which
can be loaded by the library.
See document: http://userguide.icu-project.org/icudata
So for big endian system, we can use the separated data file which
re-generates by icupkg and set the correct ICU_DATA environment variable
to make sure the library can load the data without problems.
(From OE-Core rev: 77d1b9cda69d09cd7d3c8174ef14b4ee10e5efb6)
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support')
-rw-r--r-- | meta/recipes-support/icu/icu.inc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/meta/recipes-support/icu/icu.inc b/meta/recipes-support/icu/icu.inc index a1ef9ec8bf..3fb16b0f68 100644 --- a/meta/recipes-support/icu/icu.inc +++ b/meta/recipes-support/icu/icu.inc | |||
@@ -17,6 +17,8 @@ STAGING_ICU_DIR_NATIVE = "${STAGING_DATADIR_NATIVE}/${BPN}/${PV}" | |||
17 | 17 | ||
18 | BINCONFIG = "${bindir}/icu-config" | 18 | BINCONFIG = "${bindir}/icu-config" |
19 | 19 | ||
20 | ICU_MAJOR_VER = "${@d.getVar('PV').split('.')[0]}" | ||
21 | |||
20 | inherit autotools pkgconfig binconfig | 22 | inherit autotools pkgconfig binconfig |
21 | 23 | ||
22 | # ICU needs the native build directory as an argument to its --with-cross-build option when | 24 | # ICU needs the native build directory as an argument to its --with-cross-build option when |
@@ -26,6 +28,8 @@ EXTRA_OECONF = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}" | |||
26 | EXTRA_OECONF_class-native = "" | 28 | EXTRA_OECONF_class-native = "" |
27 | EXTRA_OECONF_class-nativesdk = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}" | 29 | EXTRA_OECONF_class-nativesdk = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}" |
28 | 30 | ||
31 | EXTRA_OECONF_append_class-target = "${@base_conditional('SITEINFO_ENDIANNESS', 'be', ' --with-data-packaging=archive', '', d)}" | ||
32 | TARGET_CXXFLAGS_append = "${@base_conditional('SITEINFO_ENDIANNESS', 'be', ' -DICU_DATA_DIR=\\""${datadir}/${BPN}/${PV}\\""', '', d)}" | ||
29 | 33 | ||
30 | # strtod_l() is not supported by musl; also xlocale.h is missing | 34 | # strtod_l() is not supported by musl; also xlocale.h is missing |
31 | # It is not possible to disable its use via configure switches or env vars | 35 | # It is not possible to disable its use via configure switches or env vars |
@@ -44,6 +48,15 @@ do_install_append_class-native() { | |||
44 | cp -r ${B}/tools ${D}/${STAGING_ICU_DIR_NATIVE} | 48 | cp -r ${B}/tools ${D}/${STAGING_ICU_DIR_NATIVE} |
45 | } | 49 | } |
46 | 50 | ||
51 | do_install_append_class-target() { | ||
52 | # The native pkgdata can not generate the correct data file. | ||
53 | # Use icupkg to re-generate it. | ||
54 | if [ "${SITEINFO_ENDIANNESS}" = "be" ] ; then | ||
55 | rm -f ${D}/${datadir}/${BPN}/${PV}/icudt${ICU_MAJOR_VER}b.dat | ||
56 | icupkg -tb ${S}/data/in/icudt${ICU_MAJOR_VER}l.dat ${D}/${datadir}/${BPN}/${PV}/icudt${ICU_MAJOR_VER}b.dat | ||
57 | fi | ||
58 | } | ||
59 | |||
47 | PACKAGES =+ "libicudata libicuuc libicui18n libicutu libicuio" | 60 | PACKAGES =+ "libicudata libicuuc libicui18n libicutu libicuio" |
48 | 61 | ||
49 | FILES_${PN}-dev += "${libdir}/${BPN}/" | 62 | FILES_${PN}-dev += "${libdir}/${BPN}/" |