From nobody Sun Feb 27 17:19:56 2022 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 B419019F4464; Sun, 27 Feb 2022 17:19:56 +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 4K69Hc4hjtz3GMt; Sun, 27 Feb 2022 17:19:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645982396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1HAZOvaIZ6adXJJopm/NfeUOScu7gYqhEax9Qe7IxwQ=; b=Hcb3r/la6LyDUS87S+SbmVscUNiXyd4Qig+8PcD8dbq69RmVc0gXzAos07Z562RtNDt2jE qdKTqxUEOGpzxZlI/dgayrJ/70f7oV9zM+UnWH2dNjzKYBYyHmpXNmFGyADS0po0AyI6gc +3rcdcXAEddpSjaRpRi/GxhDkda0Q0cr/lq3vh7Gxm4apZOEAdjMRhB8zY2LssbBZYzRlc R+jrcYtKgvpEy71hAZiTDCDmwW09nTTTamSlEDCYhH8iqEW4cn6lyH2BbUEUMX06sk1DEB HiFIm4fkvnQghUVj7NebZYi3M+4v8g6MNr9GpSlMKfc2+pTe4ICiT/meWqnqdg== 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 8211631F8; Sun, 27 Feb 2022 17:19:56 +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 21RHJuK6078430; Sun, 27 Feb 2022 17:19:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21RHJuqY078429; Sun, 27 Feb 2022 17:19:56 GMT (envelope-from git) Date: Sun, 27 Feb 2022 17:19:56 GMT Message-Id: <202202271719.21RHJuqY078429@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: b042a3d8ca08 - main - databases/mysql80-server: 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: b042a3d8ca08c0da0f423e0afe49c8e512f5d8ed Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645982396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1HAZOvaIZ6adXJJopm/NfeUOScu7gYqhEax9Qe7IxwQ=; b=KOGo1Eydp9afioYz6H5Uhjdh3IOykzrH7BWy0chGCyciPiU+8LgPYiNIcaLZhOa5csE4ng YXyzZmUYG+OvE/0Ur3EICPscxwvw4ROfsPQzUSItdrTAeiSfYZbQVeD9EXVhKalQMyX5lL ITBy5AFTgQQl6vHimtO3ugyof7jFRr+znrcdW8Ei3QALiVhlpKHDwtRBKs/BIXnQsd/mQ5 NEcLMbvRIFci/1oSZMpJKrh6kaz8Ksjqwz60lIoEL3RiaW/DnBc+DhRoF/SRnOW+8g3N/v nzL6rPqIjUQu+V1sUxmzRjYKJLLsTZnp5in10cUfOZujdMECC+yWqUbwRFOhPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645982396; a=rsa-sha256; cv=none; b=A4pYR5cdZkVhdTCGzBSrsDRXYT3t6UCrK+1n1QoTa3We8HH7HVCaUyS+cesf7sNh/EQ7JP dPRj2/Q3PGYYpjq69GK60fumbQ0esC0M8ZwT/C9LfRJR/SRaX4b0BaRWT7somwQXA8ujVZ kiVgPQofx372TADWCfIJBUJAOY7i1VKs9tEHzV919gq2vT1BUzrigpLGHyrY72ZrG3KtVn lnXlnLtAL7bVC4DPPabkNBaeIlvYIrbAlxyFM73PbWSYkQ7jAro6PHBpALtRIR/b7tY2NA IUuIhsGx6f8S7ziTy/C1uoS9j/TYDTxxoi1CQwUmMs9a0s7ZW6xpmzVXlZ0o1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mikael: URL: https://cgit.FreeBSD.org/ports/commit/?id=b042a3d8ca08c0da0f423e0afe49c8e512f5d8ed commit b042a3d8ca08c0da0f423e0afe49c8e512f5d8ed Author: Daniel O'Connor AuthorDate: 2022-02-27 17:08:02 +0000 Commit: Mikael Urankar CommitDate: 2022-02-27 17:12:20 +0000 databases/mysql80-server: Fix build on aarch64 - Replace getauxval with the FreeBSD variant (elf_aux_info) - ifdef some gcc'ism and pass the correct cflags for clang Approved by: portmgr (build fix blanket) PR: 261660 --- databases/mysql80-server/Makefile | 1 + .../files/patch-storage_innobase_ut_crc32.cc | 114 +++++++++++++++++++++ 2 files changed, 115 insertions(+) diff --git a/databases/mysql80-server/Makefile b/databases/mysql80-server/Makefile index ba3a5232c6f9..d7c5c133cc6f 100644 --- a/databases/mysql80-server/Makefile +++ b/databases/mysql80-server/Makefile @@ -55,6 +55,7 @@ BUILD_DEPENDS_powerpc64le= libunwind>0:devel/libunwind CMAKE_BUILD_TYPE= Release CFLAGS+= -fPIC -DNDEBUG -malign-double +CFLAGS_aarch64?= -march=armv8-a+crc+crypto CMAKE_ARGS+= -DINSTALL_LAYOUT=FREEBSD \ -DINSTALL_LDCONFIGDIR="${LOCALBASE}/libdata/ldconfig" \ diff --git a/databases/mysql80-server/files/patch-storage_innobase_ut_crc32.cc b/databases/mysql80-server/files/patch-storage_innobase_ut_crc32.cc new file mode 100644 index 000000000000..0e42c96a1843 --- /dev/null +++ b/databases/mysql80-server/files/patch-storage_innobase_ut_crc32.cc @@ -0,0 +1,114 @@ +--- storage/innobase/ut/crc32.cc.orig 2021-12-17 17:07:27 UTC ++++ storage/innobase/ut/crc32.cc +@@ -111,7 +111,9 @@ external tools. */ + #endif /* CRC32_ARM64 */ + + #ifdef CRC32_ARM64_DEFAULT ++#ifndef __FreeBSD__ + #include ++#endif + #include + #endif /* CRC32_ARM64_DEFAULT */ + +@@ -360,8 +362,25 @@ bool can_use_poly_mul() { return true; } + #endif /* CRC32_ARM64_APPLE */ + + #ifdef CRC32_ARM64_DEFAULT ++#ifdef __FreeBSD__ ++bool can_use_crc32() { ++ unsigned long capabilities; ++ ++ if (elf_aux_info(AT_HWCAP, &capabilities, sizeof(unsigned long))) ++ return false; ++ return capabilities & HWCAP_CRC32; ++} ++bool can_use_poly_mul() { ++ unsigned long capabilities; ++ ++ if (elf_aux_info(AT_HWCAP, &capabilities, sizeof(unsigned long))) ++ return false; ++ return capabilities & HWCAP_CRC32; ++} ++#else + bool can_use_crc32() { return getauxval(AT_HWCAP) & HWCAP_CRC32; } + bool can_use_poly_mul() { return getauxval(AT_HWCAP) & HWCAP_PMULL; } ++#endif + #endif /* CRC32_ARM64_DEFAULT */ + + /** A helper template to statically unroll a loop with a fixed number of +@@ -470,25 +489,39 @@ uint64_t crc32_impl::update(uint64_t crc, uint64_t dat + + #ifdef CRC32_ARM64 + #ifdef CRC32_ARM64_DEFAULT ++#ifndef __clang__ + MY_ATTRIBUTE((target("+crc"))) ++#else ++MY_ATTRIBUTE((target("crc"))) ++#endif + #endif /* CRC32_ARM64_DEFAULT */ + uint32_t crc32_impl::update(uint32_t crc, unsigned char data) { + return __crc32cb(crc, data); + } + #ifdef CRC32_ARM64_DEFAULT ++#ifndef __clang__ + MY_ATTRIBUTE((target("+crc"))) ++#endif + #endif /* CRC32_ARM64_DEFAULT */ + uint32_t crc32_impl::update(uint32_t crc, uint16_t data) { + return __crc32ch(crc, data); + } + #ifdef CRC32_ARM64_DEFAULT ++#ifndef __clang__ + MY_ATTRIBUTE((target("+crc"))) ++#else ++MY_ATTRIBUTE((target("crc"))) ++#endif + #endif /* CRC32_ARM64_DEFAULT */ + uint32_t crc32_impl::update(uint32_t crc, uint32_t data) { + return __crc32cw(crc, data); + } + #ifdef CRC32_ARM64_DEFAULT ++#ifndef __clang__ + MY_ATTRIBUTE((target("+crc"))) ++#else ++MY_ATTRIBUTE((target("crc"))) ++#endif + #endif /* CRC32_ARM64_DEFAULT */ + uint64_t crc32_impl::update(uint64_t crc, uint64_t data) { + return (uint64_t)__crc32cd((uint32_t)crc, data); +@@ -534,7 +567,11 @@ static inline uint64_t less_significant_half_of_poly12 + } + template + #ifdef CRC32_ARM64_DEFAULT ++#ifndef __clang__ + MY_ATTRIBUTE((target("+crypto"))) ++#else ++MY_ATTRIBUTE((target("crypto"))) ++#endif + #endif /* CRC32_ARM64_DEFAULT */ + uint64_t use_pclmul::polynomial_mul_rev(uint32_t rev_u) { + constexpr uint64_t flipped_w = flip_at_32(w); +@@ -777,7 +814,11 @@ MY_ATTRIBUTE((target("sse4.2,pclmul"), flatten)) + MY_ATTRIBUTE((flatten)) + #endif /* CRC32_ARM64_APPLE */ + #ifdef CRC32_ARM64_DEFAULT ++#ifndef __clang__ + MY_ATTRIBUTE((target("+crc+crypto"), flatten)) ++#else ++MY_ATTRIBUTE((target("crc,crypto"))) ++#endif + #endif /* CRC32_ARM64_DEFAULT */ + uint32_t crc32_using_pclmul(const byte *data, size_t len) { + return crc32(0, data, len); +@@ -797,7 +838,11 @@ MY_ATTRIBUTE((target("sse4.2"), flatten)) + MY_ATTRIBUTE((flatten)) + #endif /* CRC32_ARM64_APPLE */ + #ifdef CRC32_ARM64_DEFAULT ++#ifndef __clang__ + MY_ATTRIBUTE((target("+crc"), flatten)) ++#else ++MY_ATTRIBUTE((target("crc"))) ++#endif + #endif /* CRC32_ARM64_DEFAULT */ + uint32_t crc32_using_unrolled_loop_poly_mul(const byte *data, size_t len) { + return crc32(0, data, len);