initial buildroot for linux 5.15
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
Don't build object files twice
|
||||
|
||||
When passed --enable-static and --enable-shared, icu will generate
|
||||
both a shared and a static version of its libraries.
|
||||
|
||||
However, in order to do so, it builds each and every object file
|
||||
twice: once with -fPIC (for the shared library), and once without
|
||||
-fPIC (for the static library). While admittedly building -fPIC for a
|
||||
static library generates a slightly suboptimal code, this is what all
|
||||
the autotools-based project are doing. They build each object file
|
||||
once, and they use it for both the static and shared libraries.
|
||||
|
||||
icu builds the object files for the shared library as .o files, and
|
||||
the object files for static library as .ao files. By simply changing
|
||||
the suffix of object files used for static libraries to ".o", we tell
|
||||
icu to use the ones built for the shared library (i.e, with -fPIC),
|
||||
and avoid the double build of icu.
|
||||
|
||||
On a fast build server, this brings the target icu build from
|
||||
3m41.302s down to 1m43.926s (approximate numbers: some other builds
|
||||
are running on the system at the same time).
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
|
||||
Index: b/source/config/mh-linux
|
||||
===================================================================
|
||||
--- a/source/config/mh-linux
|
||||
+++ b/source/config/mh-linux
|
||||
@@ -35,7 +35,7 @@
|
||||
## Shared object suffix
|
||||
SO = so
|
||||
## Non-shared intermediate object suffix
|
||||
-STATIC_O = ao
|
||||
+STATIC_O = o
|
||||
|
||||
## Compilation rules
|
||||
%.$(STATIC_O): $(srcdir)/%.c
|
||||
@@ -0,0 +1,37 @@
|
||||
Workaround toolchain bugs
|
||||
|
||||
Many of ARM Sourcery CodeBench toolchain have a bug when compiling
|
||||
icu's translit.cpp source file. The bug is trigerred when there is a
|
||||
combination of "-W -Wall" and "-Os", and causes an internal compiler
|
||||
error. The bug has been reported to Mentor Graphics.
|
||||
|
||||
Even though it is clearly a toolchain bug, having a workaround for it
|
||||
is trivial in this case. So it will avoid our users falling into this
|
||||
internal compiler error, and allow our autobuilders to test more
|
||||
packages using this Sourcery CodeBench toolchain.qq
|
||||
|
||||
[Gustavo: update for ICU4C 54.1]
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
||||
|
||||
diff -Nura icu.orig/source/configure icu/source/configure
|
||||
--- icu.orig/source/configure 2014-12-18 15:49:43.038628644 -0300
|
||||
+++ icu/source/configure 2014-12-18 15:51:23.183083232 -0300
|
||||
@@ -4323,7 +4323,7 @@
|
||||
;;
|
||||
esac
|
||||
|
||||
- CFLAGS="$CFLAGS -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
|
||||
+ CFLAGS="$CFLAGS -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
|
||||
else
|
||||
case "${host}" in
|
||||
*-*-cygwin)
|
||||
@@ -4337,7 +4337,7 @@
|
||||
fi
|
||||
if test "$GXX" = yes
|
||||
then
|
||||
- CXXFLAGS="$CXXFLAGS -W -Wall -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long"
|
||||
+ CXXFLAGS="$CXXFLAGS -pedantic -Wpointer-arith -Wwrite-strings -Wno-long-long"
|
||||
else
|
||||
case "${host}" in
|
||||
*-*-cygwin)
|
||||
@@ -0,0 +1,35 @@
|
||||
From d5d0c4bb7cc9aa4a132ec0bea13255aee50c1cf9 Mon Sep 17 00:00:00 2001
|
||||
From: Maxime Hadjinlian <maxime.hadjinlian@devialet.com>
|
||||
Date: Fri, 6 Jun 2014 14:55:58 +0200
|
||||
Subject: [PATCH] Don't link icudata as a data only library
|
||||
|
||||
This patch cames straight from Debian. It fixes an issue when
|
||||
libicudata would not have some flags indicating it's EABIhf, causing
|
||||
applications linked against libicudata to not start on EABIhf
|
||||
systems. Getting rid of the -nodefaultlibs -nostdlib flags solves the
|
||||
problem, and is the solution that is used by Debian, see
|
||||
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=653457.
|
||||
|
||||
Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@devialet.com>
|
||||
---
|
||||
source/config/mh-linux | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/source/config/mh-linux b/source/config/mh-linux
|
||||
index 531a3b2..5a2a7c4 100644
|
||||
--- a/source/config/mh-linux
|
||||
+++ b/source/config/mh-linux
|
||||
@@ -21,7 +21,9 @@ LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN
|
||||
LD_RPATH_PRE = -Wl,-rpath,
|
||||
|
||||
## These are the library specific LDFLAGS
|
||||
-LDFLAGSICUDT=-nodefaultlibs -nostdlib
|
||||
+#LDFLAGSICUDT=-nodefaultlibs -nostdlib
|
||||
+# Debian change: linking icudata as data only causes too many problems.
|
||||
+LDFLAGSICUDT=
|
||||
|
||||
## Compiler switch to embed a library name
|
||||
# The initial tab in the next line is to prevent icu-config from reading it.
|
||||
--
|
||||
2.0.0.rc2
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From ffff12fd321c7a056e796e74cc508726b0626ae0 Mon Sep 17 00:00:00 2001
|
||||
From: Romain Naour <romain.naour@openwide.fr>
|
||||
Date: Wed, 22 Jul 2015 22:43:25 +0200
|
||||
Subject: [PATCH] fix static linking with icu-uc
|
||||
|
||||
During static linking with a C application and libicuuc.a,
|
||||
-lstdc++ is required.
|
||||
|
||||
Add -lstdc++ in Libs.private of icu-uc.pc.
|
||||
|
||||
Fixes:
|
||||
http://autobuild.buildroot.net/results/210/2107f9dfb39eeb6559fb4271c7af8b39aef521ca/
|
||||
|
||||
Signed-off-by: Romain Naour <romain.naour@openwide.fr>
|
||||
---
|
||||
source/Makefile.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/source/Makefile.in b/source/Makefile.in
|
||||
index 9db6c52..ca48e16 100644
|
||||
--- a/source/Makefile.in
|
||||
+++ b/source/Makefile.in
|
||||
@@ -264,7 +264,7 @@ config/icu-uc.pc: config/icu.pc Makefile icudefs.mk
|
||||
@echo "Description: $(PACKAGE_ICU_DESCRIPTION): Common and Data libraries" >> $@
|
||||
@echo "Name: $(PACKAGE)-uc" >> $@
|
||||
@echo "Libs:" '-L$${libdir}' "${ICULIBS_UC}" "${ICULIBS_DT}" >> $@
|
||||
- @echo "Libs.private:" '$${baselibs}' >> $@
|
||||
+ @echo "Libs.private:" '$${baselibs}' -lstdc++ >> $@
|
||||
@echo $@ updated.
|
||||
|
||||
config/icu-i18n.pc: config/icu.pc Makefile icudefs.mk
|
||||
--
|
||||
2.4.3
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
From 2dc5bea9061b4fb05cd03e21b775dd944a0eb81d Mon Sep 17 00:00:00 2001
|
||||
From: Frank Tang <ftang@chromium.org>
|
||||
Date: Tue, 13 Apr 2021 15:16:50 -0700
|
||||
Subject: [PATCH] ICU-21587 Fix memory bug w/ baseName
|
||||
|
||||
Edge cases not fixed in assign and move assign operator
|
||||
while the locale is long and call setKeywordValue with incorrect
|
||||
keyword/values.
|
||||
|
||||
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
|
||||
[Peter: Fixes CVE-2021-30535, adjust paths for tarball]
|
||||
---
|
||||
source/common/locid.cpp | 11 +++++++++--
|
||||
source/test/intltest/loctest.cpp | 26 ++++++++++++++++++++++++++
|
||||
source/test/intltest/loctest.h | 2 ++
|
||||
3 files changed, 37 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/source/common/locid.cpp b/source/common/locid.cpp
|
||||
index 02cd82a7b8..3c6e5b0669 100644
|
||||
--- a/source/common/locid.cpp
|
||||
+++ b/source/common/locid.cpp
|
||||
@@ -469,14 +469,18 @@ Locale& Locale::operator=(Locale&& other) U_NOEXCEPT {
|
||||
if ((baseName != fullName) && (baseName != fullNameBuffer)) uprv_free(baseName);
|
||||
if (fullName != fullNameBuffer) uprv_free(fullName);
|
||||
|
||||
- if (other.fullName == other.fullNameBuffer) {
|
||||
+ if (other.fullName == other.fullNameBuffer || other.baseName == other.fullNameBuffer) {
|
||||
uprv_strcpy(fullNameBuffer, other.fullNameBuffer);
|
||||
+ }
|
||||
+ if (other.fullName == other.fullNameBuffer) {
|
||||
fullName = fullNameBuffer;
|
||||
} else {
|
||||
fullName = other.fullName;
|
||||
}
|
||||
|
||||
- if (other.baseName == other.fullName) {
|
||||
+ if (other.baseName == other.fullNameBuffer) {
|
||||
+ baseName = fullNameBuffer;
|
||||
+ } else if (other.baseName == other.fullName) {
|
||||
baseName = fullName;
|
||||
} else {
|
||||
baseName = other.baseName;
|
||||
@@ -2681,6 +2685,9 @@ Locale::setKeywordValue(const char* keywordName, const char* keywordValue, UErro
|
||||
if (fullName != fullNameBuffer) {
|
||||
// if full Name is already on the heap, need to free it.
|
||||
uprv_free(fullName);
|
||||
+ if (baseName == fullName) {
|
||||
+ baseName = newFullName; // baseName should not point to freed memory.
|
||||
+ }
|
||||
}
|
||||
fullName = newFullName;
|
||||
status = U_ZERO_ERROR;
|
||||
diff --git a/source/test/intltest/loctest.cpp b/source/test/intltest/loctest.cpp
|
||||
index ce41a4c00e..5503b008b0 100644
|
||||
--- a/source/test/intltest/loctest.cpp
|
||||
+++ b/source/test/intltest/loctest.cpp
|
||||
@@ -284,6 +284,8 @@ void LocaleTest::runIndexedTest( int32_t index, UBool exec, const char* &name, c
|
||||
TESTCASE_AUTO(TestSetUnicodeKeywordValueNullInLongLocale);
|
||||
TESTCASE_AUTO(TestCanonicalize);
|
||||
TESTCASE_AUTO(TestLeak21419);
|
||||
+ TESTCASE_AUTO(TestLongLocaleSetKeywordAssign);
|
||||
+ TESTCASE_AUTO(TestLongLocaleSetKeywordMoveAssign);
|
||||
TESTCASE_AUTO_END;
|
||||
}
|
||||
|
||||
@@ -6520,6 +6522,30 @@ void LocaleTest::TestSetUnicodeKeywordValueInLongLocale() {
|
||||
}
|
||||
}
|
||||
|
||||
+void LocaleTest::TestLongLocaleSetKeywordAssign() {
|
||||
+ IcuTestErrorCode status(*this, "TestLongLocaleSetKeywordAssign");
|
||||
+ // A long base name, with an illegal keyword and copy constructor
|
||||
+ icu::Locale l("de_AAAAAAA1_AAAAAAA2_AAAAAAA3_AAAAAAA4_AAAAAAA5_AAAAAAA6_"
|
||||
+ "AAAAAAA7_AAAAAAA8_AAAAAAA9_AAAAAA10_AAAAAA11_AAAAAA12_"
|
||||
+ "AAAAAA13_AAAAAA14_AAAAAA15_AAAAAA16_AAAAAA17_AAAAAA18");
|
||||
+ Locale l2;
|
||||
+ l.setUnicodeKeywordValue("co", "12", status); // Cause an error
|
||||
+ status.reset();
|
||||
+ l2 = l; // copy operator on such bogus locale.
|
||||
+}
|
||||
+
|
||||
+void LocaleTest::TestLongLocaleSetKeywordMoveAssign() {
|
||||
+ IcuTestErrorCode status(*this, "TestLongLocaleSetKeywordMoveAssign");
|
||||
+ // A long base name, with an illegal keyword and copy constructor
|
||||
+ icu::Locale l("de_AAAAAAA1_AAAAAAA2_AAAAAAA3_AAAAAAA4_AAAAAAA5_AAAAAAA6_"
|
||||
+ "AAAAAAA7_AAAAAAA8_AAAAAAA9_AAAAAA10_AAAAAA11_AAAAAA12_"
|
||||
+ "AAAAAA13_AAAAAA14_AAAAAA15_AAAAAA16_AAAAAA17");
|
||||
+ Locale l2;
|
||||
+ l.setUnicodeKeywordValue("co", "12", status); // Cause an error
|
||||
+ status.reset();
|
||||
+ Locale l3 = std::move(l); // move assign
|
||||
+}
|
||||
+
|
||||
void LocaleTest::TestSetUnicodeKeywordValueNullInLongLocale() {
|
||||
IcuTestErrorCode status(*this, "TestSetUnicodeKeywordValueNullInLongLocale");
|
||||
const char *exts[] = {"cf", "cu", "em", "kk", "kr", "ks", "kv", "lb", "lw",
|
||||
diff --git a/source/test/intltest/loctest.h b/source/test/intltest/loctest.h
|
||||
index 05be4037bd..12a93bde53 100644
|
||||
--- a/source/test/intltest/loctest.h
|
||||
+++ b/source/test/intltest/loctest.h
|
||||
@@ -156,6 +156,8 @@ class LocaleTest: public IntlTest {
|
||||
void TestSetUnicodeKeywordValueInLongLocale();
|
||||
void TestSetUnicodeKeywordValueNullInLongLocale();
|
||||
void TestLeak21419();
|
||||
+ void TestLongLocaleSetKeywordAssign();
|
||||
+ void TestLongLocaleSetKeywordMoveAssign();
|
||||
|
||||
private:
|
||||
void _checklocs(const char* label,
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
config BR2_PACKAGE_ICU
|
||||
bool "icu"
|
||||
depends on BR2_INSTALL_LIBSTDCPP
|
||||
depends on BR2_USE_WCHAR
|
||||
depends on BR2_HOST_GCC_AT_LEAST_4_9 # C++11 PR56019
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # C++11 PR56019
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
# icu does some funky things by generating by itself an ELF
|
||||
# file, and it cannot easily be changed to generate FLAT
|
||||
# format.
|
||||
depends on !BR2_BINFMT_FLAT
|
||||
help
|
||||
International Components for Unicode.
|
||||
|
||||
http://site.icu-project.org/
|
||||
|
||||
if BR2_PACKAGE_ICU
|
||||
|
||||
config BR2_PACKAGE_ICU_CUSTOM_DATA_PATH
|
||||
string "Path to custom data library file"
|
||||
help
|
||||
This option allows to define the path to a custom data
|
||||
library generated with http://apps.icu-project.org/datacustom/
|
||||
Make sure you select the appropiate version to match the one
|
||||
provided by buildroot.
|
||||
Leave empty to not use this functionality.
|
||||
|
||||
endif
|
||||
|
||||
comment "icu needs a toolchain w/ C++, wchar, threads, gcc >= 4.9, host gcc >= 4.9"
|
||||
depends on !BR2_BINFMT_FLAT
|
||||
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \
|
||||
!BR2_TOOLCHAIN_HAS_THREADS || \
|
||||
!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || \
|
||||
!BR2_HOST_GCC_AT_LEAST_4_9
|
||||
@@ -0,0 +1,3 @@
|
||||
# Locally computed
|
||||
sha256 4cba7b7acd1d3c42c44bb0c14be6637098c7faf2b330ce876bc5f3b915d09745 icu4c-69_1-src.tgz
|
||||
sha256 7915b19db903070778581ae05d8bf4ea241b34a05deb51ca4f5cbb15ea1cbba3 LICENSE
|
||||
@@ -0,0 +1,70 @@
|
||||
################################################################################
|
||||
#
|
||||
# icu
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# Git tags (and therefore versions on release-monitoring.org) use the
|
||||
# XX-Y format, but the tarballs are named XX_Y and the containing
|
||||
# directories XX.Y.
|
||||
ICU_VERSION = 69-1
|
||||
ICU_SOURCE = icu4c-$(subst -,_,$(ICU_VERSION))-src.tgz
|
||||
ICU_SITE = \
|
||||
https://github.com/unicode-org/icu/releases/download/release-$(ICU_VERSION)
|
||||
ICU_LICENSE = ICU License
|
||||
ICU_LICENSE_FILES = LICENSE
|
||||
ICU_CPE_ID_VENDOR = icu-project
|
||||
ICU_CPE_ID_PRODUCT = international_components_for_unicode
|
||||
ICU_CPE_ID_VERSION = $(subst -,.,$(ICU_VERSION))
|
||||
|
||||
# 0005-ICU-21587-Fix-memory-bug-w-baseName.patch
|
||||
ICU_IGNORE_CVES += CVE-2021-30535
|
||||
|
||||
ICU_DEPENDENCIES = host-icu
|
||||
ICU_INSTALL_STAGING = YES
|
||||
ICU_CONFIG_SCRIPTS = icu-config
|
||||
ICU_CONF_OPTS = \
|
||||
--with-cross-build=$(HOST_ICU_DIR)/source \
|
||||
--disable-samples \
|
||||
--disable-tests
|
||||
|
||||
# When available, icu prefers to use C++11 atomics, which rely on the
|
||||
# __atomic builtins. On certain architectures, this requires linking
|
||||
# with libatomic starting from gcc 4.8.
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
|
||||
ICU_CONF_ENV += LIBS="-latomic"
|
||||
endif
|
||||
|
||||
# strtod_l() is not supported by musl; also xlocale.h is missing
|
||||
ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
|
||||
ICU_CONF_ENV += ac_cv_func_strtod_l=no
|
||||
endif
|
||||
|
||||
HOST_ICU_CONF_OPTS = \
|
||||
--disable-samples \
|
||||
--disable-tests \
|
||||
--disable-extras \
|
||||
--disable-icuio \
|
||||
--disable-layout \
|
||||
--disable-renaming
|
||||
ICU_SUBDIR = source
|
||||
HOST_ICU_SUBDIR = source
|
||||
|
||||
ICU_CUSTOM_DATA_PATH = $(call qstrip,$(BR2_PACKAGE_ICU_CUSTOM_DATA_PATH))
|
||||
|
||||
ifneq ($(ICU_CUSTOM_DATA_PATH),)
|
||||
define ICU_COPY_CUSTOM_DATA
|
||||
cp $(ICU_CUSTOM_DATA_PATH) $(@D)/source/data/in/
|
||||
endef
|
||||
ICU_POST_PATCH_HOOKS += ICU_COPY_CUSTOM_DATA
|
||||
endif
|
||||
|
||||
define ICU_REMOVE_DEV_FILES
|
||||
rm -f $(addprefix $(TARGET_DIR)/usr/bin/,derb genbrk gencfu gencnval gendict genrb icuinfo makeconv uconv)
|
||||
rm -f $(addprefix $(TARGET_DIR)/usr/sbin/,genccode gencmn gennorm2 gensprep icupkg)
|
||||
rm -rf $(TARGET_DIR)/usr/share/icu
|
||||
endef
|
||||
ICU_POST_INSTALL_TARGET_HOOKS += ICU_REMOVE_DEV_FILES
|
||||
|
||||
$(eval $(autotools-package))
|
||||
$(eval $(host-autotools-package))
|
||||
Reference in New Issue
Block a user