From nobody Sun Oct 10 17:00:08 2021 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7F77117DC508; Sun, 10 Oct 2021 17:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HS7TN38zmz3JK3; Sun, 10 Oct 2021 17:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42C541153D; Sun, 10 Oct 2021 17:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19AH08MX007654; Sun, 10 Oct 2021 17:00:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19AH08Va007651; Sun, 10 Oct 2021 17:00:08 GMT (envelope-from git) Date: Sun, 10 Oct 2021 17:00:08 GMT Message-Id: <202110101700.19AH08Va007651@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mikael Urankar Subject: git: 379597b79b3a - main - databases/rocksdb: Fix build on aarch64. List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mikael X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 379597b79b3a22dbd1995440c69e003a7ae17a35 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mikael: URL: https://cgit.FreeBSD.org/ports/commit/?id=379597b79b3a22dbd1995440c69e003a7ae17a35 commit 379597b79b3a22dbd1995440c69e003a7ae17a35 Author: Mikael Urankar AuthorDate: 2021-10-10 16:52:59 +0000 Commit: Mikael Urankar CommitDate: 2021-10-10 17:00:06 +0000 databases/rocksdb: Fix build on aarch64. Approved by: portmgr (build fix blanket) --- databases/rocksdb/files/patch-CMakeLists.txt | 14 ++++++++++ .../files/patch-build_tools-build_detect_platform | 11 ++++++++ databases/rocksdb/files/patch-util_crc32c.cc | 29 ++++++++++++++++++++- .../rocksdb/files/patch-util_crc32c__arm64.cc | 30 ++++++++++++++++++++++ 4 files changed, 83 insertions(+), 1 deletion(-) diff --git a/databases/rocksdb/files/patch-CMakeLists.txt b/databases/rocksdb/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..eeefd6074532 --- /dev/null +++ b/databases/rocksdb/files/patch-CMakeLists.txt @@ -0,0 +1,14 @@ +--- CMakeLists.txt.orig 2021-10-10 13:48:40 UTC ++++ CMakeLists.txt +@@ -521,6 +521,11 @@ if(HAVE_AUXV_GETAUXVAL) + add_definitions(-DROCKSDB_AUXV_GETAUXVAL_PRESENT) + endif() + ++check_cxx_symbol_exists(elf_aux_info sys/auxv.h HAVE_ELF_AUX_INFO) ++if(HAVE_ELF_AUX_INFO) ++ add_definitions(-DROCKSDB_AUXV_GETAUXVAL_PRESENT) ++endif() ++ + include_directories(${PROJECT_SOURCE_DIR}) + include_directories(${PROJECT_SOURCE_DIR}/include) + if(WITH_FOLLY_DISTRIBUTED_MUTEX) diff --git a/databases/rocksdb/files/patch-build_tools-build_detect_platform b/databases/rocksdb/files/patch-build_tools-build_detect_platform index b685a2dfc33a..1984674f19ec 100644 --- a/databases/rocksdb/files/patch-build_tools-build_detect_platform +++ b/databases/rocksdb/files/patch-build_tools-build_detect_platform @@ -100,3 +100,14 @@ Remove -fno-builtin-memcmp and -ltcmalloc fi fi +@@ -558,8 +558,8 @@ EOF + fi + + # TODO(tec): Fix -Wshorten-64-to-32 errors on FreeBSD and enable the warning. +-# -Wshorten-64-to-32 breaks compilation on FreeBSD i386 +-if ! [ "$TARGET_OS" = FreeBSD -a "$TARGET_ARCHITECTURE" = i386 ]; then ++# -Wshorten-64-to-32 breaks compilation on FreeBSD i386 and aarch64 ++if ! { [ "$TARGET_OS" = FreeBSD ] && [ "$TARGET_ARCHITECTURE" = i386 -o "$TARGET_ARCHITECTURE" = "arm64" ]; }; then + # Test whether -Wshorten-64-to-32 is available + $CXX $CFLAGS -x c++ - -o /dev/null -Wshorten-64-to-32 2>/dev/null <; +-#elif defined(__linux__) && defined(HAVE_ARM64_CRC) ++#elif (defined(__FreeBSD__) || defined(__linux__)) && defined(HAVE_ARM64_CRC) + if(crc32c_runtime_check()) { + return ExtendARMImpl; + } else { diff --git a/databases/rocksdb/files/patch-util_crc32c__arm64.cc b/databases/rocksdb/files/patch-util_crc32c__arm64.cc new file mode 100644 index 000000000000..bc2a2a775b6b --- /dev/null +++ b/databases/rocksdb/files/patch-util_crc32c__arm64.cc @@ -0,0 +1,30 @@ +--- util/crc32c_arm64.cc.orig 2021-10-10 13:50:13 UTC ++++ util/crc32c_arm64.cc +@@ -5,9 +5,11 @@ + + #include "util/crc32c_arm64.h" + +-#if defined(__linux__) && defined(HAVE_ARM64_CRC) ++#if (defined(__FreeBSD__) || defined(__linux__)) && defined(HAVE_ARM64_CRC) + ++#if !defined(__FreeBSD__) + #include ++#endif + #ifdef ROCKSDB_AUXV_GETAUXVAL_PRESENT + #include + #endif +@@ -37,7 +39,14 @@ + + uint32_t crc32c_runtime_check(void) { + #ifdef ROCKSDB_AUXV_GETAUXVAL_PRESENT ++#if defined(__FreeBSD__) ++ uint64_t auxv; ++ int result = elf_aux_info(AT_HWCAP, &auxv, sizeof auxv); ++ if (result != 0) ++ return 0; ++#else + uint64_t auxv = getauxval(AT_HWCAP); ++#endif + return (auxv & HWCAP_CRC32) != 0; + #else + return 0;