initial buildroot for linux 5.15

This commit is contained in:
Huan.Feng
2021-12-06 14:12:13 +08:00
parent d7767d594e
commit 7b6fc358fa
12736 changed files with 508822 additions and 0 deletions
@@ -0,0 +1,39 @@
From 26e3f1440bbc75c704fc93ff43a2abbfbe4c0203 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Thu, 11 Oct 2018 22:56:50 +0200
Subject: [PATCH] fix static linking with curl
When curl is statically built with openssl support, xerces needs to
link with openssl libraries so use pkg_check_modules to get any
needed dependencies
Fixes:
- http://autobuild.buildroot.org/results/29ca90fff2c8e38f2edf7240eca3aa3fe7397c45
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
cmake/XercesNetAccessorSelection.cmake | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/cmake/XercesNetAccessorSelection.cmake b/cmake/XercesNetAccessorSelection.cmake
index 7a63f1f6b..e90fcf034 100644
--- a/cmake/XercesNetAccessorSelection.cmake
+++ b/cmake/XercesNetAccessorSelection.cmake
@@ -31,7 +31,13 @@ if(network)
# Requires select() which is UNIX only
if(UNIX)
- find_package(CURL)
+ find_package(PkgConfig)
+ if (PkgConfig_FOUND)
+ pkg_check_modules(CURL libcurl)
+ if (NOT CURL_FOUND)
+ find_package(CURL)
+ endif()
+ endif()
if(CURL_FOUND)
list(APPEND netaccessors curl)
endif()
--
2.17.1
@@ -0,0 +1,87 @@
From 1bdf6d8ba878c1fe1d779824be70001fc0bebd2c Mon Sep 17 00:00:00 2001
From: Even Rouault <even.rouault@spatialys.com>
Date: Fri, 27 Aug 2021 01:33:27 +0200
Subject: [PATCH] InMemMsgLoader::loadMsg(): fix memory leak when transcoding
fails.
Seen with the IconvGNU transcoder when parsing "<aaa.xsdopengis.net/gml\x96".
The reason is that XMLString::transcode(repText2, manager) throws a TranscodingException
which causes the tmp1 string to leak.
```
0 0x8791409 in operator new(unsigned int) /src/llvm-project/compiler-rt/lib/asan/asan_new_delete.cpp:99:3
1 0xbd147f7 in xercesc_4_0::MemoryManagerImpl::allocate(unsigned int) gdal/xerces-c/src/xercesc/internal/MemoryManagerImpl.cpp:40:18
2 0xbe8c73e in xercesc_4_0::IconvGNULCPTranscoder::transcode(char const*, xercesc_4_0::MemoryManager*) gdal/xerces-c/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp:870:32
3 0xbc22ca2 in xercesc_4_0::XMLString::transcode(char const*, xercesc_4_0::MemoryManager*) gdal/xerces-c/src/xercesc/util/XMLString.cpp:621:25
4 0xbe8f4ad in xercesc_4_0::InMemMsgLoader::loadMsg(unsigned int, char16_t*, unsigned int, char const*, char const*, char const*, char const*, xercesc_4_0::MemoryManager*) gdal/xerces-c/src/xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp:157:16
5 0xbc20175 in xercesc_4_0::XMLException::loadExceptText(xercesc_4_0::XMLExcepts::Codes, char const*, char const*, char const*, char const*) gdal/xerces-c/src/xercesc/util/XMLException.cpp:241:23
6 0xbc48bee in xercesc_4_0::UTFDataFormatException::UTFDataFormatException(char const*, unsigned long long, xercesc_4_0::XMLExcepts::Codes, char const*, char const*, char const*, char const*, xercesc_4_0::MemoryManager*) gdal/xerces-c/src/xercesc/util/UTFDataFormatException.hpp:31:1
7 0xbc4824e in xercesc_4_0::XMLUTF8Transcoder::transcodeFrom(unsigned char const*, unsigned int, char16_t*, unsigned int, unsigned int&, unsigned char*) gdal/xerces-c/src/xercesc/util/XMLUTF8Transcoder.cpp:182:13
8 0xbd27d7e in xercesc_4_0::XMLReader::xcodeMoreChars(char16_t*, unsigned char*, unsigned int) gdal/xerces-c/src/xercesc/internal/XMLReader.cpp:1926:34
9 0xbd271dd in xercesc_4_0::XMLReader::refreshCharBuffer() gdal/xerces-c/src/xercesc/internal/XMLReader.cpp:571:19
10 0xbd15c63 in xercesc_4_0::XMLReader::peekNextChar(char16_t&) gdal/xerces-c/src/xercesc/internal/XMLReader.hpp:767:14
11 0xbd15aaf in xercesc_4_0::ReaderMgr::peekNextChar() gdal/xerces-c/src/xercesc/internal/ReaderMgr.cpp:158:21
12 0xbd328da in xercesc_4_0::XMLScanner::scanProlog() gdal/xerces-c/src/xercesc/internal/XMLScanner.cpp:1241:45
13 0xbd31ef4 in xercesc_4_0::XMLScanner::scanFirst(xercesc_4_0::InputSource const&, xercesc_4_0::XMLPScanToken&) gdal/xerces-c/src/xercesc/internal/XMLScanner.cpp:549:9
14 0xbdadcff in xercesc_4_0::SAX2XMLReaderImpl::parseFirst(xercesc_4_0::InputSource const&, xercesc_4_0::XMLPScanToken&) gdal/xerces-c/src/xercesc/parsers/SAX2XMLReaderImpl.cpp:500:22
```
Upstream: https://github.com/apache/xerces-c/commit/1bdf6d8ba878c1fe1d779824be70001fc0bebd2c
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
---
.../MsgLoaders/InMemory/InMemMsgLoader.cpp | 31 ++++++++++++++-----
1 file changed, 23 insertions(+), 8 deletions(-)
diff --git a/src/xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp b/src/xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp
index cda103226..6971fde96 100644
--- a/src/xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp
+++ b/src/xercesc/util/MsgLoaders/InMemory/InMemMsgLoader.cpp
@@ -25,6 +25,7 @@
// ---------------------------------------------------------------------------
#include <xercesc/util/BitOps.hpp>
#include <xercesc/util/PlatformUtils.hpp>
+#include <xercesc/util/TranscodingException.hpp>
#include <xercesc/util/XMLMsgLoader.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/util/XMLUni.hpp>
@@ -153,14 +154,28 @@ bool InMemMsgLoader::loadMsg(const XMLMsgLoader::XMLMsgId msgToLoad
XMLCh* tmp4 = 0;
bool bRet = false;
- if (repText1)
- tmp1 = XMLString::transcode(repText1, manager);
- if (repText2)
- tmp2 = XMLString::transcode(repText2, manager);
- if (repText3)
- tmp3 = XMLString::transcode(repText3, manager);
- if (repText4)
- tmp4 = XMLString::transcode(repText4, manager);
+ try
+ {
+ if (repText1)
+ tmp1 = XMLString::transcode(repText1, manager);
+ if (repText2)
+ tmp2 = XMLString::transcode(repText2, manager);
+ if (repText3)
+ tmp3 = XMLString::transcode(repText3, manager);
+ if (repText4)
+ tmp4 = XMLString::transcode(repText4, manager);
+ }
+ catch( const TranscodingException& )
+ {
+ if (tmp1)
+ manager->deallocate(tmp1);
+ if (tmp2)
+ manager->deallocate(tmp2);
+ if (tmp3)
+ manager->deallocate(tmp3);
+ // Note: tmp4 cannot leak
+ throw;
+ }
bRet = loadMsg(msgToLoad, toFill, maxChars, tmp1, tmp2, tmp3, tmp4, manager);
--
2.17.1
+23
View File
@@ -0,0 +1,23 @@
config BR2_PACKAGE_XERCES
bool "xerces-c++"
depends on BR2_INSTALL_LIBSTDCPP
depends on !BR2_STATIC_LIBS
depends on BR2_USE_WCHAR
help
Xerces-C++ is a validating XML parser written in portable C++.
http://xerces.apache.org/xerces-c/
if BR2_PACKAGE_XERCES
config BR2_PACKAGE_XERCES_ENABLE_NETWORK
bool "Enable network support"
default y
help
Enable network support in xerces
endif
comment "xerces-c++ needs a toolchain w/ C++, dynamic library, wchar"
depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS || \
!BR2_USE_WCHAR
+5
View File
@@ -0,0 +1,5 @@
# From http://www.apache.org/dist/xerces/c/3/sources/xerces-c-3.2.3.tar.xz.sha256
sha256 12fc99a9fc1d1a79bd0e927b8b5637a576d6656f45b0d5e70ee3694d379cc149 xerces-c-3.2.3.tar.xz
# Hash for license file
sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE
+48
View File
@@ -0,0 +1,48 @@
################################################################################
#
# xerces
#
################################################################################
XERCES_VERSION = 3.2.3
XERCES_SOURCE = xerces-c-$(XERCES_VERSION).tar.xz
XERCES_SITE = http://archive.apache.org/dist/xerces/c/3/sources
XERCES_LICENSE = Apache-2.0
XERCES_LICENSE_FILES = LICENSE
XERCES_CPE_ID_VENDOR = apache
XERCES_CPE_ID_PRODUCT = xerces-c\+\+
XERCES_INSTALL_STAGING = YES
define XERCES_DISABLE_SAMPLES
$(SED) 's/add_subdirectory(samples)//' $(@D)/CMakeLists.txt
endef
XERCES_POST_PATCH_HOOKS += XERCES_DISABLE_SAMPLES
ifeq ($(BR2_PACKAGE_ICU),y)
XERCES_DEPENDENCIES += icu
endif
ifeq ($(BR2_PACKAGE_LIBICONV),y)
XERCES_CONF_ENV += LIBS=-liconv
XERCES_DEPENDENCIES += libiconv
endif
ifeq ($(BR2_PACKAGE_XERCES_ENABLE_NETWORK),y)
ifeq ($(BR2_PACKAGE_LIBCURL),y)
XERCES_CONF_OPTS += -Dnetwork-accessor=curl
XERCES_DEPENDENCIES += libcurl
else
XERCES_CONF_OPTS += -Dnetwork-accessor=socket
endif
else
XERCES_CONF_OPTS += -Dnetwork=OFF
endif
ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
XERCES_CONF_OPTS += -Dthreads=ON
else
XERCES_CONF_OPTS += -Dthreads=OFF
endif
$(eval $(cmake-package))