make buildable on rhel-6 again

f41
David Tardon 11 years ago
parent 9bde8a97af
commit ecc3768cb2

@ -0,0 +1,241 @@
From a30c0e27eafd5197193275e8334af87ecbcd8073 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Fri, 30 May 2014 08:45:18 +0200
Subject: [PATCH 1/2] Revert "resolve crashes with ICU 53.1 in locales with
collator data, fdo#77071"
This reverts commit a3c627fe38236e82bc6008075d862b3cbfbd9ce3.
---
i18npool/source/collator/collator_unicode.cxx | 98 ++-------------------------
i18npool/source/collator/gencoll_rule.cxx | 2 -
2 files changed, 6 insertions(+), 94 deletions(-)
diff --git a/i18npool/source/collator/collator_unicode.cxx b/i18npool/source/collator/collator_unicode.cxx
index 2960f03..b9f7e0c 100644
--- a/i18npool/source/collator/collator_unicode.cxx
+++ b/i18npool/source/collator/collator_unicode.cxx
@@ -142,7 +142,6 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
}
if (!collator && OUString::createFromAscii(LOCAL_RULE_LANGS).indexOf(rLocale.Language) >= 0) {
const sal_uInt8* (*func)() = NULL;
- size_t (*funclen)() = NULL;
#ifndef DISABLE_DYNLOADING
OUStringBuffer aBuf;
@@ -155,21 +154,11 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
aBuf.appendAscii("get_").append(rLocale.Language).appendAscii("_");
if ( rLocale.Language == "zh" ) {
OUString func_base = aBuf.makeStringAndClear();
- OUString funclen_base = func_base + "_length";
if (OUString("TW HK MO").indexOf(rLocale.Country) >= 0)
- {
- func = (const sal_uInt8* (*)()) osl_getFunctionSymbol(hModule,
+ func=(const sal_uInt8* (*)()) osl_getFunctionSymbol(hModule,
OUString(func_base + "TW_" + rAlgorithm).pData);
- funclen = (size_t (*)()) osl_getFunctionSymbol(hModule,
- OUString(funclen_base + "TW_" + rAlgorithm).pData);
- }
if (!func)
- {
- func = (const sal_uInt8* (*)()) osl_getFunctionSymbol(
- hModule, OUString(func_base + rAlgorithm).pData);
- funclen = (size_t (*)()) osl_getFunctionSymbol(
- hModule, OUString(funclen_base + rAlgorithm).pData);
- }
+ func=(const sal_uInt8* (*)()) osl_getFunctionSymbol(hModule, OUString(func_base + rAlgorithm).pData);
} else {
if ( rLocale.Language == "ja" ) {
// replace algorithm name to implementation name.
@@ -182,10 +171,7 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
} else {
aBuf.append(rAlgorithm);
}
- OUString func_base = aBuf.makeStringAndClear();
- OUString funclen_base = func_base + "_length";
- func = (const sal_uInt8* (*)()) osl_getFunctionSymbol(hModule, func_base.pData);
- funclen = (size_t (*)()) osl_getFunctionSymbol(hModule, funclen_base.pData);
+ func=(const sal_uInt8* (*)()) osl_getFunctionSymbol(hModule, aBuf.makeStringAndClear().pData);
}
}
#else
@@ -194,159 +180,87 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& rAlgorithm, const lang::
#if WITH_LOCALE_ALL || WITH_LOCALE_ca
} else if ( rLocale.Language == "ca" ) {
if ( rAlgorithm == "charset" )
- {
func = get_collator_data_ca_charset;
- funclen = get_collator_data_ca_charset_length;
- }
#endif
#if WITH_LOCALE_ALL || WITH_LOCALE_dz
} else if ( rLocale.Language == "dz" || rLocale.Language == "bo" ) {
// 'bo' Tibetan uses the same collation rules as 'dz' Dzongkha
if ( rAlgorithm == "charset" )
- {
func = get_collator_data_dz_charset;
- funclen = get_collator_data_dz_charset_length;
- }
#endif
#if WITH_LOCALE_ALL || WITH_LOCALE_hu
} else if ( rLocale.Language == "hu" ) {
if ( rAlgorithm == "charset" )
- {
func = get_collator_data_hu_charset;
- funclen = get_collator_data_hu_charset_length;
- }
#endif
#if WITH_LOCALE_ALL || WITH_LOCALE_ja
} else if ( rLocale.Language == "ja" ) {
if ( rAlgorithm == "charset" )
- {
func = get_collator_data_ja_charset;
- funclen = get_collator_data_ja_charset_length;
- }
else if ( rAlgorithm == "phonetic (alphanumeric first)" )
- {
func = get_collator_data_ja_phonetic_alphanumeric_first;
- funclen = get_collator_data_ja_phonetic_alphanumeric_first_length;
- }
else if ( rAlgorithm == "phonetic (alphanumeric last)" )
- {
func = get_collator_data_ja_phonetic_alphanumeric_last;
- funclen = get_collator_data_ja_phonetic_alphanumeric_last_length;
- }
#endif
#if WITH_LOCALE_ALL || WITH_LOCALE_ko
#if (U_ICU_VERSION_MAJOR_NUM < 53)
} else if ( rLocale.Language == "ko" ) {
if ( rAlgorithm == "charset" )
- {
func = get_collator_data_ko_charset;
- funclen = get_collator_data_ko_charset_length;
- }
#endif
#endif
#if WITH_LOCALE_ALL || WITH_LOCALE_ku
} else if ( rLocale.Language == "ku" ) {
if ( rAlgorithm == "alphanumeric" )
- {
func = get_collator_data_ku_alphanumeric;
- funclen = get_collator_data_ku_alphanumeric_length;
- }
#endif
#if WITH_LOCALE_ALL || WITH_LOCALE_ln
} else if ( rLocale.Language == "ln" ) {
if ( rAlgorithm == "charset" )
- {
func = get_collator_data_ln_charset;
- funclen = get_collator_data_ln_charset_length;
- }
#endif
#if WITH_LOCALE_ALL || WITH_LOCALE_my
} else if ( rLocale.Language == "my" ) {
if ( rAlgorithm == "dictionary" )
- {
func = get_collator_data_my_dictionary;
- funclen = get_collator_data_my_dictionary_length;
- }
#endif
#if WITH_LOCALE_ALL || WITH_LOCALE_ne
} else if ( rLocale.Language == "ne" ) {
if ( rAlgorithm == "charset" )
- {
func = get_collator_data_ne_charset;
- funclen = get_collator_data_ne_charset_length;
- }
#endif
#if WITH_LOCALE_ALL || WITH_LOCALE_sid
} else if ( rLocale.Language == "sid" ) {
if ( rAlgorithm == "charset" )
- {
func = get_collator_data_sid_charset;
- funclen = get_collator_data_sid_charset_length;
- }
#endif
#if WITH_LOCALE_ALL || WITH_LOCALE_zh
} else if ( rLocale.Language == "zh" && (rLocale.Country == "TW" || rLocale.Country == "HK" || rLocale.Country == "MO") ) {
if ( rAlgorithm == "charset" )
- {
func = get_collator_data_zh_TW_charset;
- funclen = get_collator_data_zh_TW_charset_length;
- }
else if ( rAlgorithm == "radical" )
- {
func = get_collator_data_zh_TW_radical;
- funclen = get_collator_data_zh_TW_radical_length;
- }
else if ( rAlgorithm == "stroke" )
- {
func = get_collator_data_zh_TW_stroke;
- funclen = get_collator_data_zh_TW_stroke_length;
- }
} else if ( rLocale.Language == "zh" ) {
if ( rAlgorithm == "charset" )
- {
func = get_collator_data_zh_charset;
- funclen = get_collator_data_zh_charset_length;
- }
else if ( rAlgorithm == "pinyin" )
- {
func = get_collator_data_zh_pinyin;
- funclen = get_collator_data_zh_pinyin_length;
- }
else if ( rAlgorithm == "radical" )
- {
func = get_collator_data_zh_radical;
- funclen = get_collator_data_zh_radical_length;
- }
else if ( rAlgorithm == "stroke" )
- {
func = get_collator_data_zh_stroke;
- funclen = get_collator_data_zh_stroke_length;
- }
else if ( rAlgorithm == "zhuyin" )
- {
func = get_collator_data_zh_zhuyin;
- funclen = get_collator_data_zh_zhuyin_length;
- }
#endif
}
#endif // DISABLE_DYNLOADING
- if (func && funclen) {
+ if (func) {
const sal_uInt8* ruleImage=func();
- size_t ruleImageSize = funclen();
- // Not only changed ICU 53.1 the API behavior that a negative
- // length (ruleImageSize) now leads to failure, but also that
- // the base RuleBasedCollator passed as uca_base here needs to
- // have a base->tailoring == CollationRoot::getRoot() otherwise
- // the init bails out as well, as it does for the previously
- // used "empty" RuleBasedCollator.
- // The default collator of the en-US locale would also fulfill
- // the requirement. The collator of the actual locale or the
- // NULL (default) locale does not.
- uca_base = static_cast<RuleBasedCollator*>(icu::Collator::createInstance(
- icu::Locale::getRoot(), status));
+ uca_base = new RuleBasedCollator(static_cast<UChar*>(NULL), status);
if (! U_SUCCESS(status)) throw RuntimeException();
- collator = new RuleBasedCollator(
- reinterpret_cast<const uint8_t*>(ruleImage), ruleImageSize, uca_base, status);
+ collator = new RuleBasedCollator(reinterpret_cast<const uint8_t*>(ruleImage), -1, uca_base, status);
if (! U_SUCCESS(status)) throw RuntimeException();
}
}
diff --git a/i18npool/source/collator/gencoll_rule.cxx b/i18npool/source/collator/gencoll_rule.cxx
index 5ba9f5d..a801545 100644
--- a/i18npool/source/collator/gencoll_rule.cxx
+++ b/i18npool/source/collator/gencoll_rule.cxx
@@ -65,10 +65,8 @@ void data_write(char* file, char* name, sal_uInt8 *data, sal_Int32 len)
fprintf(fp, "#ifndef DISABLE_DYNLOADING\n");
fprintf(fp, "SAL_DLLPUBLIC_EXPORT const sal_uInt8* get_%s() { return %s; }\n", name, name);
- fprintf(fp, "SAL_DLLPUBLIC_EXPORT size_t get_%s_length() { return sizeof(%s); }\n", name, name);
fprintf(fp, "#else\n");
fprintf(fp, "SAL_DLLPUBLIC_EXPORT const sal_uInt8* get_collator_data_%s() { return %s; }\n", name, name);
- fprintf(fp, "SAL_DLLPUBLIC_EXPORT size_t get_collator_data_%s_length() { return sizeof(%s); }\n", name, name);
fprintf(fp, "#endif\n");
fprintf(fp, "\n");
fprintf (fp, "}\n");
--
1.9.3

File diff suppressed because it is too large Load Diff

@ -278,45 +278,49 @@ Patch5: libreoffice-rhel6poppler.patch
Patch6: libreoffice-rhel6langs.patch Patch6: libreoffice-rhel6langs.patch
# not upstreamed # not upstreamed
Patch7: libreoffice-rhel6glib.patch Patch7: libreoffice-rhel6glib.patch
# reverted upstream commit
Patch8: 0001-Revert-resolve-crashes-with-ICU-53.1-in-locales-with.patch
# reverted upstream commit
Patch9: 0002-upgrade-to-ICU-53.1-fdo-77071-related.patch
%endif %endif
%endif %endif
# not upstreamed # not upstreamed
Patch8: 0001-Resolves-rhbz-1035092-no-shortcut-key-for-Italian-To.patch Patch10: 0001-Resolves-rhbz-1035092-no-shortcut-key-for-Italian-To.patch
# not upstreamed # not upstreamed
Patch9: 0001-disable-firebird-unit-test.patch Patch11: 0001-disable-firebird-unit-test.patch
# not upstreamed # not upstreamed
Patch10: 0001-never-run-autogen.sh.patch Patch12: 0001-never-run-autogen.sh.patch
# not upstreamed # not upstreamed
Patch11: 0001-add-X-TryExec-entries-to-desktop-files.patch Patch13: 0001-add-X-TryExec-entries-to-desktop-files.patch
# not upstreamed # not upstreamed
Patch12: 0001-disable-PSD-import-test-which-deadlocks-on-ARM.patch Patch14: 0001-disable-PSD-import-test-which-deadlocks-on-ARM.patch
Patch13: 0001-build-libodfgen-as-shared-lib.patch Patch15: 0001-build-libodfgen-as-shared-lib.patch
Patch14: 0002-bundle-librevenge.patch Patch16: 0002-bundle-librevenge.patch
Patch15: 0003-the-other-way-around.patch Patch17: 0003-the-other-way-around.patch
Patch16: 0004-fix-deps-for-projects-using-librevenge.patch Patch18: 0004-fix-deps-for-projects-using-librevenge.patch
Patch17: 0005-always-provide-REDLAND_CFLAGS-LIBS-to-ext.-projects.patch Patch19: 0005-always-provide-REDLAND_CFLAGS-LIBS-to-ext.-projects.patch
Patch18: 0006-rebase-all-import-libs.patch Patch20: 0006-rebase-all-import-libs.patch
Patch19: 0007-libwpd-stream-does-not-exist-anymore.patch Patch21: 0007-libwpd-stream-does-not-exist-anymore.patch
Patch20: 0008-export-SYSTEM_REVENGE.patch Patch22: 0008-export-SYSTEM_REVENGE.patch
Patch21: 0009-drop-trailing-comma.patch Patch23: 0009-drop-trailing-comma.patch
Patch22: 0001-improve-WPXSvInputStream-test.patch Patch24: 0001-improve-WPXSvInputStream-test.patch
Patch23: 0002-enable-new-handlers.patch Patch25: 0002-enable-new-handlers.patch
Patch24: 0003-Add-new-libmwaw-drawing-format.patch Patch26: 0003-Add-new-libmwaw-drawing-format.patch
Patch25: 0004-add-new-libmwaw-drawing-formats-forgotten-files.patch Patch27: 0004-add-new-libmwaw-drawing-formats-forgotten-files.patch
Patch26: 0005-organize-the-test-data-files-by-test.patch Patch28: 0005-organize-the-test-data-files-by-test.patch
Patch27: 0006-fix-return-value-for-libe-book-import-filter.patch Patch29: 0006-fix-return-value-for-libe-book-import-filter.patch
Patch28: 0007-parse-zipped-FictionBook-2-files-again.patch Patch30: 0007-parse-zipped-FictionBook-2-files-again.patch
Patch29: 0008-re-enable-libe-book-integration-test.patch Patch31: 0008-re-enable-libe-book-integration-test.patch
Patch30: 0009-use-the-right-XML-import-service.patch Patch32: 0009-use-the-right-XML-import-service.patch
Patch31: 0010-Try-to-add-support-for-WKS-WDB-files.patch Patch33: 0010-Try-to-add-support-for-WKS-WDB-files.patch
Patch32: 0011-Make-the-wdb-wks-and-GreatWorks-draw-work.patch Patch34: 0011-Make-the-wdb-wks-and-GreatWorks-draw-work.patch
Patch33: 0012-add-writerperfect-calc-integration-test.patch Patch35: 0012-add-writerperfect-calc-integration-test.patch
Patch34: 0013-Add-new-libmwaw-s-database-spreadsheet-formats.patch Patch36: 0013-Add-new-libmwaw-s-database-spreadsheet-formats.patch
Patch35: 0014-fix-detection-of-Keynote-3-documents.patch Patch37: 0014-fix-detection-of-Keynote-3-documents.patch
Patch36: 0015-enable-integration-test-for-libmwaw-calc-import.patch Patch38: 0015-enable-integration-test-for-libmwaw-calc-import.patch
Patch37: 0016-enable-integration-test-for-libmwaw-draw-import.patch Patch39: 0016-enable-integration-test-for-libmwaw-draw-import.patch
Patch38: 0017-these-formats-are-supported-by-libmwaw-0.3.x.patch Patch40: 0017-these-formats-are-supported-by-libmwaw-0.3.x.patch
Patch39: 0018-fix-copypasta.patch Patch41: 0018-fix-copypasta.patch
%define instdir %{_libdir} %define instdir %{_libdir}
%define baseinstdir %{instdir}/libreoffice %define baseinstdir %{instdir}/libreoffice

Loading…
Cancel
Save