summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-libs/asmjit/Manifest1
-rw-r--r--dev-libs/asmjit/asmjit-2021.11.13.ebuild34
-rw-r--r--dev-libs/asmjit/files/asmjit-2021.11.13-gentoo.patch45
-rw-r--r--dev-libs/asmjit/metadata.xml11
4 files changed, 91 insertions, 0 deletions
diff --git a/dev-libs/asmjit/Manifest b/dev-libs/asmjit/Manifest
new file mode 100644
index 000000000000..1a9ef2aede79
--- /dev/null
+++ b/dev-libs/asmjit/Manifest
@@ -0,0 +1 @@
+DIST asmjit-2021.11.13.tar.gz 717251 BLAKE2B 2bcad7234b0cab2d60c9fcd09149c93397595ca4859cb415378dabf52f8660de3aa5de40ee192fca814ee62bfc690ae8260c2f54faf10eb52c3ed3d63d1f4258 SHA512 2774168ff0847b3c29aee87325f12e431693c70661f8c10e0dc0d6530a3683d51ca472ef993e88c9d4e179494b045b2e75c22d6eda19b0c75e19843b69162da1
diff --git a/dev-libs/asmjit/asmjit-2021.11.13.ebuild b/dev-libs/asmjit/asmjit-2021.11.13.ebuild
new file mode 100644
index 000000000000..27da2e68b8b3
--- /dev/null
+++ b/dev-libs/asmjit/asmjit-2021.11.13.ebuild
@@ -0,0 +1,34 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit cmake
+
+CommitId=4ec760a3d1f69e32ba460ecd2513f29b8428700b
+DESCRIPTION="Machine code generation for C++"
+HOMEPAGE="https://asmjit.com/"
+SRC_URI="https://github.com/asmjit/${PN}/archive/${CommitId}.tar.gz
+ -> ${P}.tar.gz"
+
+LICENSE="ZLIB"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="test"
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+BDEPEND="test? ( dev-cpp/gtest )"
+RESTRICT="!test? ( test )"
+
+S="${WORKDIR}"/${PN}-${CommitId}
+
+PATCHES=(
+ "${FILESDIR}"/${P}-gentoo.patch
+)
+
+src_configure() {
+ mycmakeargs=(
+ -DASMJIT_TEST=$(usex test TRUE FALSE)
+ )
+ cmake_src_configure
+}
diff --git a/dev-libs/asmjit/files/asmjit-2021.11.13-gentoo.patch b/dev-libs/asmjit/files/asmjit-2021.11.13-gentoo.patch
new file mode 100644
index 000000000000..035ffbbbdcea
--- /dev/null
+++ b/dev-libs/asmjit/files/asmjit-2021.11.13-gentoo.patch
@@ -0,0 +1,45 @@
+diff --git a/src/asmjit/core/support.h b/src/asmjit/core/support.h
+index f98ffaa..2329cb2 100644
+--- a/src/asmjit/core/support.h
++++ b/src/asmjit/core/support.h
+@@ -33,33 +33,40 @@
+ ASMJIT_BEGIN_NAMESPACE
+
+ //! \addtogroup asmjit_utilities
+ //! \{
+
+ //! Contains support classes and functions that may be used by AsmJit source
+ //! and header files. Anything defined here is considered internal and should
+ //! not be used outside of AsmJit and related projects like AsmTK.
+ namespace Support {
+
+ // ============================================================================
+ // [asmjit::Support - Architecture Features & Constraints]
+ // ============================================================================
+
+ //! \cond INTERNAL
++#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 11
++// There is a bug in GCC11+ that makes it unusable to use annotated unaligned loads/stores.
++static constexpr bool kUnalignedAccess16 = false;
++static constexpr bool kUnalignedAccess32 = false;
++static constexpr bool kUnalignedAccess64 = false;
++#else
+ static constexpr bool kUnalignedAccess16 = ASMJIT_ARCH_X86 != 0;
+ static constexpr bool kUnalignedAccess32 = ASMJIT_ARCH_X86 != 0;
+ static constexpr bool kUnalignedAccess64 = ASMJIT_ARCH_X86 != 0;
++#endif
+ //! \endcond
+
+ // ============================================================================
+ // [asmjit::Support - Internal]
+ // ============================================================================
+
+ //! \cond INTERNAL
+ namespace Internal {
+ template<typename T, size_t Alignment>
+ struct AlignedInt {};
+
+ template<> struct AlignedInt<uint16_t, 1> { typedef uint16_t ASMJIT_ALIGN_TYPE(T, 1); };
+ template<> struct AlignedInt<uint16_t, 2> { typedef uint16_t T; };
+ template<> struct AlignedInt<uint32_t, 1> { typedef uint32_t ASMJIT_ALIGN_TYPE(T, 1); };
+ template<> struct AlignedInt<uint32_t, 2> { typedef uint32_t ASMJIT_ALIGN_TYPE(T, 2); };
diff --git a/dev-libs/asmjit/metadata.xml b/dev-libs/asmjit/metadata.xml
new file mode 100644
index 000000000000..0e892b7edd0d
--- /dev/null
+++ b/dev-libs/asmjit/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>tupone@gentoo.org</email>
+ <name>Tupone Alfredo</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">asmjit/asmjit</remote-id>
+ </upstream>
+</pkgmetadata>