initial buildroot for linux 5.15
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
From 8a8016f6d2af335ab205aa40d5274fc9b0c7a566 Mon Sep 17 00:00:00 2001
|
||||
From: Steve James <ste@junkomatic.net>
|
||||
Date: Sun, 5 Apr 2015 16:29:51 +0200
|
||||
Subject: [PATCH 1/2] Fix compilation with g++ 4.8.2
|
||||
|
||||
Where db_iter.cc fails to get a typedef for ssize_t when compiled by
|
||||
GCC.
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/google/leveldb/issues/233]
|
||||
|
||||
Signed-off-by: Steve James <ste@junkomatic.net>
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
---
|
||||
db/db_iter.cc | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/db/db_iter.cc b/db/db_iter.cc
|
||||
index 3b2035e..c2e5f35 100644
|
||||
--- a/db/db_iter.cc
|
||||
+++ b/db/db_iter.cc
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "util/logging.h"
|
||||
#include "util/mutexlock.h"
|
||||
#include "util/random.h"
|
||||
+#include <sys/types.h> // for ssize_t
|
||||
|
||||
namespace leveldb {
|
||||
|
||||
--
|
||||
2.1.0
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
From 2fa960098e5b6f9daa9f7d6cab27188566859be8 Mon Sep 17 00:00:00 2001
|
||||
From: Bernd Kuhls <bernd.kuhls@t-online.de>
|
||||
Date: Sat, 12 Oct 2019 14:43:46 +0200
|
||||
Subject: [PATCH] CMake: install libmemenv.a
|
||||
|
||||
Needed for qt5webkit
|
||||
https://git.busybox.net/buildroot/commit/?id=8a10d9ce311c6cb0490d76921cae55618c258354
|
||||
https://git.busybox.net/buildroot/commit/?id=16f847340d07dce620e4c3fc0a099aa79898d86a
|
||||
|
||||
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
||||
---
|
||||
CMakeLists.txt | 26 +++++++++++++++++++++++++-
|
||||
1 file changed, 25 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index a65afbf..83b2425 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -187,6 +187,30 @@ target_sources(leveldb
|
||||
"${LEVELDB_PUBLIC_INCLUDE_DIR}/write_batch.h"
|
||||
)
|
||||
|
||||
+set(libmemenv_a_sources
|
||||
+ "${PROJECT_SOURCE_DIR}/helpers/memenv/memenv.cc"
|
||||
+ "${PROJECT_SOURCE_DIR}/helpers/memenv/memenv.h"
|
||||
+ )
|
||||
+add_library(memenv STATIC ${libmemenv_a_sources})
|
||||
+target_compile_definitions(memenv
|
||||
+ PRIVATE
|
||||
+ # Used by include/export.h when building shared libraries.
|
||||
+ LEVELDB_COMPILE_LIBRARY
|
||||
+ # Used by port/port.h.
|
||||
+ ${LEVELDB_PLATFORM_NAME}=1
|
||||
+)
|
||||
+if (NOT HAVE_CXX17_HAS_INCLUDE)
|
||||
+ target_compile_definitions(memenv
|
||||
+ PRIVATE
|
||||
+ LEVELDB_HAS_PORT_CONFIG_H=1
|
||||
+ )
|
||||
+endif(NOT HAVE_CXX17_HAS_INCLUDE)
|
||||
+target_include_directories(memenv
|
||||
+ PUBLIC
|
||||
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||
+)
|
||||
+
|
||||
if (WIN32)
|
||||
target_sources(leveldb
|
||||
PRIVATE
|
||||
@@ -418,7 +436,7 @@ endif(LEVELDB_BUILD_BENCHMARKS)
|
||||
|
||||
if(LEVELDB_INSTALL)
|
||||
include(GNUInstallDirs)
|
||||
- install(TARGETS leveldb
|
||||
+ install(TARGETS leveldb memenv
|
||||
EXPORT leveldbTargets
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
@@ -444,6 +462,12 @@ if(LEVELDB_INSTALL)
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/leveldb
|
||||
)
|
||||
|
||||
+ install(
|
||||
+ FILES
|
||||
+ "${PROJECT_SOURCE_DIR}/helpers/memenv/memenv.h"
|
||||
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/helpers/memenv
|
||||
+ )
|
||||
+
|
||||
include(CMakePackageConfigHelpers)
|
||||
write_basic_package_version_file(
|
||||
"${PROJECT_BINARY_DIR}/leveldbConfigVersion.cmake"
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
From 9e82eb57870ec7c01734b44ed4bb994362004df3 Mon Sep 17 00:00:00 2001
|
||||
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Date: Fri, 27 Dec 2019 10:20:53 +0100
|
||||
Subject: [PATCH] CMakeLists.txt: check for atomic library
|
||||
|
||||
On some architectures, atomic binutils are provided by the libatomic
|
||||
library from gcc. Linking with libatomic is therefore necessary,
|
||||
otherwise the build fails with:
|
||||
|
||||
[100%] Linking CXX executable leveldbutil
|
||||
/home/fabrice/buildroot/output/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/7.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: libleveldb.a(env_posix.cc.o): in function `leveldb::(anonymous namespace)::Limiter::Acquire()':
|
||||
env_posix.cc:(.text+0x124): undefined reference to `__atomic_fetch_sub_4'
|
||||
|
||||
This is often for example the case on sparcv8 32 bit.
|
||||
|
||||
Fixes:
|
||||
- http://autobuild.buildroot.org/results/01d5a50581ac9e9b46f40e6f9665f74897db5e6f
|
||||
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
[Upstream status: https://github.com/google/leveldb/pull/765]
|
||||
---
|
||||
CMakeLists.txt | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index be41ba4..9d6773f 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -41,6 +41,7 @@ include(CheckIncludeFile)
|
||||
check_include_file("unistd.h" HAVE_UNISTD_H)
|
||||
|
||||
include(CheckLibraryExists)
|
||||
+check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_ATOMIC)
|
||||
check_library_exists(crc32c crc32c_value "" HAVE_CRC32C)
|
||||
check_library_exists(snappy snappy_compress "" HAVE_SNAPPY)
|
||||
check_library_exists(tcmalloc malloc "" HAVE_TCMALLOC)
|
||||
@@ -270,6 +271,9 @@ if(HAVE_CLANG_THREAD_SAFETY)
|
||||
-Werror -Wthread-safety)
|
||||
endif(HAVE_CLANG_THREAD_SAFETY)
|
||||
|
||||
+if(HAVE_ATOMIC)
|
||||
+ target_link_libraries(leveldb atomic)
|
||||
+endif(HAVE_ATOMIC)
|
||||
if(HAVE_CRC32C)
|
||||
target_link_libraries(leveldb crc32c)
|
||||
endif(HAVE_CRC32C)
|
||||
--
|
||||
2.24.0
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
From 450c1d88b3e1af34614294830b4dc0612d198d26 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Pawe=C5=82=20Bylica?= <chfast@gmail.com>
|
||||
Date: Wed, 8 May 2019 10:42:03 +0200
|
||||
Subject: [PATCH] cmake: Use find_package() to find Snappy
|
||||
|
||||
Upstream: https://github.com/google/leveldb/pull/686/commits/3e73a396a082efc76e065ae974fe18c3bb27219d
|
||||
[Thomas: this commit allows to fix the detection of the snappy library
|
||||
in static link configurations]
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
---
|
||||
CMakeLists.txt | 12 ++++++++----
|
||||
cmake/FindSnappy.cmake | 31 +++++++++++++++++++++++++++++++
|
||||
2 files changed, 39 insertions(+), 4 deletions(-)
|
||||
create mode 100644 cmake/FindSnappy.cmake
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 78fead6..2efccda 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -6,6 +6,9 @@ cmake_minimum_required(VERSION 3.9)
|
||||
# Keep the version below in sync with the one in db.h
|
||||
project(leveldb VERSION 1.22.0 LANGUAGES C CXX)
|
||||
|
||||
+# Include local CMake modules.
|
||||
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
+
|
||||
# This project can use C11, but will gracefully decay down to C89.
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_C_STANDARD_REQUIRED OFF)
|
||||
@@ -31,13 +34,14 @@ option(LEVELDB_INSTALL "Install LevelDB's header and library" ON)
|
||||
include(TestBigEndian)
|
||||
test_big_endian(LEVELDB_IS_BIG_ENDIAN)
|
||||
|
||||
+find_package(Snappy)
|
||||
+
|
||||
include(CheckIncludeFile)
|
||||
check_include_file("unistd.h" HAVE_UNISTD_H)
|
||||
|
||||
include(CheckLibraryExists)
|
||||
check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_ATOMIC)
|
||||
check_library_exists(crc32c crc32c_value "" HAVE_CRC32C)
|
||||
-check_library_exists(snappy snappy_compress "" HAVE_SNAPPY)
|
||||
check_library_exists(tcmalloc malloc "" HAVE_TCMALLOC)
|
||||
|
||||
include(CheckCXXSymbolExists)
|
||||
@@ -276,9 +280,9 @@ endif(HAVE_ATOMIC)
|
||||
if(HAVE_CRC32C)
|
||||
target_link_libraries(leveldb crc32c)
|
||||
endif(HAVE_CRC32C)
|
||||
-if(HAVE_SNAPPY)
|
||||
- target_link_libraries(leveldb snappy)
|
||||
-endif(HAVE_SNAPPY)
|
||||
+if(TARGET Snappy::snappy)
|
||||
+ target_link_libraries(leveldb Snappy::snappy)
|
||||
+endif()
|
||||
if(HAVE_TCMALLOC)
|
||||
target_link_libraries(leveldb tcmalloc)
|
||||
endif(HAVE_TCMALLOC)
|
||||
diff --git a/cmake/FindSnappy.cmake b/cmake/FindSnappy.cmake
|
||||
new file mode 100644
|
||||
index 0000000..88c1de9
|
||||
--- /dev/null
|
||||
+++ b/cmake/FindSnappy.cmake
|
||||
@@ -0,0 +1,31 @@
|
||||
+# Copyright 2019 The LevelDB Authors. All rights reserved.
|
||||
+# Use of this source code is governed by a BSD-style license that can be
|
||||
+# found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||
+
|
||||
+find_library(SNAPPY_LIBRARY
|
||||
+ NAMES snappy
|
||||
+ HINTS ${SNAPPY_ROOT_DIR}/lib
|
||||
+)
|
||||
+
|
||||
+find_path(SNAPPY_INCLUDE_DIR
|
||||
+ NAMES snappy.h
|
||||
+ HINTS ${SNAPPY_ROOT_DIR}/include
|
||||
+)
|
||||
+
|
||||
+include(FindPackageHandleStandardArgs)
|
||||
+find_package_handle_standard_args(Snappy DEFAULT_MSG SNAPPY_LIBRARY SNAPPY_INCLUDE_DIR)
|
||||
+
|
||||
+mark_as_advanced(SNAPPY_LIBRARY SNAPPY_INCLUDE_DIR)
|
||||
+
|
||||
+if(SNAPPY_FOUND)
|
||||
+ set(HAVE_SNAPPY TRUE) # For compatibity with generating port_config.h.
|
||||
+
|
||||
+ # Add imported targets.
|
||||
+ # Follow the package naming convetion 'Snappy::' from
|
||||
+ # https://github.com/google/snappy/blob/master/CMakeLists.txt#L211.
|
||||
+ add_library(Snappy::snappy UNKNOWN IMPORTED)
|
||||
+ set_target_properties(Snappy::snappy PROPERTIES
|
||||
+ IMPORTED_LOCATION ${SNAPPY_LIBRARY}
|
||||
+ INTERFACE_INCLUDE_DIRECTORIES ${SNAPPY_INCLUDE_DIR}
|
||||
+ )
|
||||
+endif()
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
config BR2_PACKAGE_LEVELDB
|
||||
bool "leveldb"
|
||||
depends on BR2_INSTALL_LIBSTDCPP
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
help
|
||||
LevelDB is a fast key-value storage library written at Google
|
||||
that provides an ordered mapping from string keys to string
|
||||
values.
|
||||
|
||||
https://github.com/google/leveldb
|
||||
|
||||
comment "leveldb needs a toolchain w/ C++, threads, gcc >= 4.8"
|
||||
depends on !BR2_INSTALL_LIBSTDCPP || \
|
||||
!BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
|
||||
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 55423cac9e3306f4a9502c738a001e4a339d1a38ffbee7572d4a07d5d63949b2 leveldb-1.22.tar.gz
|
||||
sha256 ccc19f1da0798ed666609b65a5b44dd8b3abe6fc08b9c0592eb76e82e174db19 LICENSE
|
||||
@@ -0,0 +1,20 @@
|
||||
################################################################################
|
||||
#
|
||||
# leveldb
|
||||
#
|
||||
################################################################################
|
||||
|
||||
LEVELDB_VERSION = 1.22
|
||||
LEVELDB_SITE = $(call github,google,leveldb,$(LEVELDB_VERSION))
|
||||
LEVELDB_LICENSE = BSD-3-Clause
|
||||
LEVELDB_LICENSE_FILES = LICENSE
|
||||
LEVELDB_INSTALL_STAGING = YES
|
||||
LEVELDB_CONF_OPTS = \
|
||||
-DLEVELDB_BUILD_BENCHMARKS=OFF \
|
||||
-DLEVELDB_BUILD_TESTS=OFF
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SNAPPY),y)
|
||||
LEVELDB_DEPENDENCIES += snappy
|
||||
endif
|
||||
|
||||
$(eval $(cmake-package))
|
||||
Reference in New Issue
Block a user