diff options
Diffstat (limited to 'dev-libs/rocksdb')
-rw-r--r-- | dev-libs/rocksdb/Manifest | 4 | ||||
-rw-r--r-- | dev-libs/rocksdb/files/rocksdb-6.17.3-add_timer_for_riscv.patch | 40 | ||||
-rw-r--r-- | dev-libs/rocksdb/files/rocksdb-6.17.3-libatomic.patch | 71 | ||||
-rw-r--r-- | dev-libs/rocksdb/rocksdb-6.17.3.ebuild | 7 |
4 files changed, 118 insertions, 4 deletions
diff --git a/dev-libs/rocksdb/Manifest b/dev-libs/rocksdb/Manifest index 552554ff4eb1..56d4a6a45924 100644 --- a/dev-libs/rocksdb/Manifest +++ b/dev-libs/rocksdb/Manifest @@ -1,8 +1,10 @@ AUX rocksdb-6.14.6-libatomic.patch 2994 BLAKE2B cac08dfa6fd490645e341148701ba0372aa97f76c84010e3ed94e3aa3a501762c7b2ea09cccc9e895912204e79d7430694b5ab7302fccb7b25f1c7f2ebba4afc SHA512 9f3814133699d7069ebff35b0513ad113a744d7adf21d7ec1d7975fc4fbd114430618760fd38dea69c6948dbf1dc4f5a994f7b347b40423c0244d2867276e448 +AUX rocksdb-6.17.3-add_timer_for_riscv.patch 1647 BLAKE2B d1e78c98149f534ce8d02754f5e15b5aeccadb99cf82586bd24c44c68aef5134bdd5d00f5f81699bae59f27ae9f565f40069afedba081f7a76ec54d90a37462b SHA512 ebcf6c5df091860bf53edf54af47678e90da251f28d0ed46be7ac1cf32f50528f8185e94d82ec770c97aa23d24dfcbba634ffcf2671a5dad5fcfd6104115bb69 +AUX rocksdb-6.17.3-libatomic.patch 2131 BLAKE2B 2f12fee9b062cf4bf633d784bd4234a1076d0b763f85b9ab0332c828661674944251098e7784b07118e95aa2f4729360cfe3b7b0c95afe58772ea0d3579afd96 SHA512 4717fb67b322f34a2fa351eac1d8fdcbf239acedefd8bcb69c07f11f472f0adc8579e7ddf01be6ba9239009f81d8df4b1cbfb1b88e996ad63fc1d3ff8b801526 DIST rocksdb-6.14.6.tar.gz 6397194 BLAKE2B 43ad8e7e9fdf0c6c75ff03370f2107899bbcef9fd34630c85408abcf208a8213f5e24ea50407bd6a719220b6c29b9ba29c121e94a5a2701f637b17ccf50b90a4 SHA512 609f407b0b2810954541ad8ebad5c754ebfde5021f24ee4b3f1544a5335252c06cbe2b282562e3d084bb9cbe8de239668fdedb2d2d726056c31cf9463db08fe7 DIST rocksdb-6.15.5.tar.gz 6501252 BLAKE2B f85c6b54043019692a7174e41b69625650d072ee4de1f2850628854af4b5672ff7072ab5c41de84bca9ad0713a1eea7ad7c5cca5ba9b3b96c4bd492a01b5e859 SHA512 c0918fd48bc1e57be9e30452c5cd0c2ba627a15012ab6922404d6cddffdf80799e4442b14d03cbe13a9a9acbdf1736c505cc6f5406efefbf68aba71ec05cf5f0 DIST rocksdb-6.17.3.tar.gz 6651009 BLAKE2B c032bdf61d93a35e84c65146ad6d1f8639e9f36a323c142fe4131b501051bfb9c4c4edb13b69c86e35740117029996bb4c94887ea690d1957926bdfd347c744a SHA512 085adab94b7eb22859b4119b0356f148231800413571e932a7248967b1866d40a0be4b8265f2a9c6c21c600d3b2254c36e64ce7851171ff7c439a17306a84981 EBUILD rocksdb-6.14.6-r1.ebuild 1160 BLAKE2B 5009cd00349faa37165a5367a5ff79200b8c20422e6de77658f72da663478b283d8b084f7d7f76c23f83a7b22ff2b7b42d536858adb45742395a90cdc924ad19 SHA512 a8b462f530fa1b158722977ded10f60426b09d8fd538f2d1511dcb781abddd198de7e0f83f88a097f2f6b13da65f999685e54e745c8f06a95f6d19115a61e70d EBUILD rocksdb-6.15.5.ebuild 1152 BLAKE2B 1f8cfcf17f8b74bf9e6eb8fdeed62cf75b59a807f4f153ab715bc46084f313271fa7199e1fa2eb8f09b5e77b712a5f7a6baaca120efbc64bac723d42fe14692f SHA512 f7a0c6457c609e0c2341e389fce1124e2ba64107f620c04506ddf39901135561cd3af9ce48211fc5f5816985d273d578bb93ce1aad0ee7c02b4590bb1cd7fa7d -EBUILD rocksdb-6.17.3.ebuild 1159 BLAKE2B d8409769d990b81de0cc17fbf7c0f0dde178c6894af6b2a076bacdce813a3996236818ac3832883e7ba75022bad89ad105edc635bf225da5faa96ea84af8102a SHA512 39bd04fab4b745e1f656e9fa0b027e40690510e0378b3b26d4b96956db0257ef2d7042f24059a92ba31eb312774b290ad7483be79ff5fce32d59f86bd2e8dcda +EBUILD rocksdb-6.17.3.ebuild 1213 BLAKE2B bb2dd1c56e07e52ae6056943088e3a75b6fb6bdea645976fe1badfda1ea8c9c42d2053ee23fe423599c80fd7f8a01167b4c1278cebb3df850c5a818e6e4a2762 SHA512 3ec1f528013ed9e5dd88f9f186f8bd9ceeb449878f0cfcf1faecfc18fcb8a45db5c1fa550aa626c3da1998550b26623bc93fed843c090597669c5a58975bab08 MISC metadata.xml 250 BLAKE2B 0b272f56e53b7d76c6d5c253fbe5d7c4c9a1d7b58c21e2f59b8323a5f5cd2791c64651fdfa243a8f560ac9c0a0ff38fcffdc24290fa6d18100da0cadffc19845 SHA512 076f0dbffbab6987cfab48a5ff3631789190c570c35515cc77de5757760f19a8ad615f642e7d61b12344ffc77c599e6ff8b79b67329e69929fdd19a7c80723ff diff --git a/dev-libs/rocksdb/files/rocksdb-6.17.3-add_timer_for_riscv.patch b/dev-libs/rocksdb/files/rocksdb-6.17.3-add_timer_for_riscv.patch new file mode 100644 index 000000000000..b98cc9dc5fd6 --- /dev/null +++ b/dev-libs/rocksdb/files/rocksdb-6.17.3-add_timer_for_riscv.patch @@ -0,0 +1,40 @@ +Add timer for riscv. +Upstream PR status: https://github.com/facebook/rocksdb/pull/9215 +This PR hasn't been merged into the main branch. +https://bugs.gentoo.org/834855 + +--- a/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h ++++ b/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h +@@ -101,7 +101,7 @@ int toku_clock_gettime(clockid_t clk_id, struct timespec *ts) __attribute__((__v + typedef uint64_t tokutime_t; // Time type used in by tokutek timers. + + #if 0 +-// The value of tokutime_t is not specified here. ++// The value of tokutime_t is not specified here. + // It might be microseconds since 1/1/1970 (if gettimeofday() is + // used), or clock cycles since boot (if rdtsc is used). Or something + // else. +@@ -133,6 +133,23 @@ static inline tokutime_t toku_time_now(void) { + return result; + #elif defined(__powerpc__) + return __ppc_get_timebase(); ++#elif defined(__riscv) && __riscv_xlen == 32 ++ uint32_t cycles_lo, cycles_hi0, cycles_hi1; ++ // Implemented in assembly because Clang insisted on branching. ++ asm volatile( ++ "rdcycleh %0\n" ++ "rdcycle %1\n" ++ "rdcycleh %2\n" ++ "sub %0, %0, %2\n" ++ "seqz %0, %0\n" ++ "sub %0, zero, %0\n" ++ "and %1, %1, %0\n" ++ : "=r"(cycles_hi0), "=r"(cycles_lo), "=r"(cycles_hi1)); ++ return (static_cast<uint64_t>(cycles_hi1) << 32) | cycles_lo; ++#elif defined(__riscv) && __riscv_xlen == 64 ++ uint64_t cycles; ++ asm volatile("rdcycle %0" : "=r"(cycles)); ++ return cycles; + #else + #error No timer implementation for this platform + #endif diff --git a/dev-libs/rocksdb/files/rocksdb-6.17.3-libatomic.patch b/dev-libs/rocksdb/files/rocksdb-6.17.3-libatomic.patch new file mode 100644 index 000000000000..56cc674d09a4 --- /dev/null +++ b/dev-libs/rocksdb/files/rocksdb-6.17.3-libatomic.patch @@ -0,0 +1,71 @@ +Fixes check for atomics. + +The upstream currently does not have checks for atomics in v6.17.3. +However, since v6.22.1, rocksdb includes checks similar/identical to +files/rocksdb-6.14.6-libatomic.patch, which is superseded by this new patch. +See: https://github.com/facebook/rocksdb/commit/47b424f4bd51078591e674ff936de5a270530ce2 +Once the upstream adopts new methods for checking, this patch may be removed after testing. + +https://bugs.gentoo.org/834855 + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -289,6 +289,7 @@ else() + endif() + + include(CheckCXXSourceCompiles) ++set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) + if(NOT MSVC) + set(CMAKE_REQUIRED_FLAGS "-msse4.2 -mpclmul") + endif() +@@ -305,7 +306,6 @@ int main() { + auto d = _mm_cvtsi128_si64(c); + } + " HAVE_SSE42) +-unset(CMAKE_REQUIRED_FLAGS) + if(HAVE_SSE42) + add_definitions(-DHAVE_SSE42) + add_definitions(-DHAVE_PCLMUL) +@@ -313,6 +313,37 @@ elseif(FORCE_SSE42) + message(FATAL_ERROR "FORCE_SSE42=ON but unable to compile with SSE4.2 enabled") + endif() + ++# Check if -latomic is required or not ++if (NOT MSVC) ++ set(CMAKE_REQUIRED_FLAGS "--std=c++11") ++ set(ATOMIC_TEST_SOURCE " ++ #include <atomic> ++ std::atomic<int> x; ++ std::atomic<short> y; ++ std::atomic<char> z; ++ std::atomic<long long> w; ++ int main() { ++ ++z; ++ ++y; ++ ++w; ++ return ++x; ++ }") ++ CHECK_CXX_SOURCE_COMPILES("${ATOMIC_TEST_SOURCE}" BUILTIN_ATOMIC) ++ if (NOT BUILTIN_ATOMIC) ++ set(CMAKE_REQUIRED_LIBRARIES atomic) ++ CHECK_CXX_SOURCE_COMPILES("${ATOMIC_TEST_SOURCE}" ATOMICS_REQUIRE_LIBATOMIC) ++ unset(CMAKE_REQUIRED_LIBRARIES) ++ if (ATOMICS_REQUIRE_LIBATOMIC) ++ list(APPEND THIRDPARTY_LIBS atomic) ++ else() ++ message(FATAL_ERROR "Host compiler must support std::atomic!") ++ endif() ++ endif() ++endif() ++ ++# Reset the required flags ++set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) ++ + CHECK_CXX_SOURCE_COMPILES(" + #if defined(_MSC_VER) && !defined(__thread) + #define __thread __declspec(thread) +@@ -1354,3 +1385,4 @@ option(WITH_EXAMPLES "build with examples" OFF) + if(WITH_EXAMPLES) + add_subdirectory(examples) + endif() ++ diff --git a/dev-libs/rocksdb/rocksdb-6.17.3.ebuild b/dev-libs/rocksdb/rocksdb-6.17.3.ebuild index 76c4d651f8af..948eba50fa13 100644 --- a/dev-libs/rocksdb/rocksdb-6.17.3.ebuild +++ b/dev-libs/rocksdb/rocksdb-6.17.3.ebuild @@ -1,4 +1,4 @@ -# Copyright 2020-2021 Gentoo Authors +# Copyright 2020-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -11,7 +11,7 @@ SRC_URI="https://github.com/facebook/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" LICENSE="GPL-2" SLOT="0" -KEYWORDS="~amd64 ~arm64 ~ppc64 -riscv ~x86" +KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86" IUSE="cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_x86_sse4_2 jemalloc static-libs" DEPEND=" @@ -26,7 +26,8 @@ DEPEND=" RDEPEND="${DEPEND}" PATCHES=( - "${FILESDIR}"/${PN}-6.14.6-libatomic.patch + "${FILESDIR}"/${PN}-6.17.3-add_timer_for_riscv.patch + "${FILESDIR}"/${PN}-6.17.3-libatomic.patch ) src_configure() { |