The package rpms/xbyak_aarch64.git has added or updated architecture specific content in
its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/xbyak_aarch64.git/commit/?id=6532....
Change:
+ExclusiveArch: AArch64
Thanks.
Full change:
============
commit 6532c55d0e721ee1cf0f122d97153280e0d4f213
Author: Benson Muite <benson_muite(a)emailplus.org>
Date: Mon Jan 2 11:54:55 2023 +0300
Initial import (fedora#2143005).
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1c3b11d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/xbyak_aarch64-1.0.0.tar.gz
diff --git a/Makefile.patch b/Makefile.patch
new file mode 100644
index 0000000..9d6b83e
--- /dev/null
+++ b/Makefile.patch
@@ -0,0 +1,30 @@
+--- xbyak_aarch64-1.0.0/MakefileOriginal 2022-11-22 14:33:01.085367255 +0300
++++ xbyak_aarch64-1.0.0/Makefile 2022-11-23 23:09:28.913721325 +0300
+@@ -14,10 +14,10 @@
+ # limitations under the License.
+ #*******************************************************************************
+ ARCH?=$(shell uname -m)
+-TARGET=lib/libxbyak_aarch64.a
++TARGET=lib/libxbyak_aarch64.so.0.soname
+ all: $(TARGET)
+
+-CFLAGS=-std=c++11 -DNDEBUG -g -I ./xbyak_aarch64 -Wall -Wextra -fPIC
++CXXFLAGS+=-std=c++11 -DNDEBUG -g -I ./xbyak_aarch64 -Wall -Wextra -fPIC
+ ifneq ($(DEBUG),1)
+ CFLAGS+=-O2
+ endif
+@@ -25,12 +25,12 @@
+ LIB_OBJ=obj/xbyak_aarch64_impl.o obj/util_impl.o
+
+ obj/%.o: src/%.cpp
+- $(CXX) $(CFLAGS) -c $< -o $@ -MMD -MP -MF $(@:.o=.d)
++ $(CXX) $(CXXFLAGS) -c $< -o $@ -MMD -MP -MF $(@:.o=.d)
+
+ -include obj/xbyak_aarch64_impl.d
+
+ $(TARGET): $(LIB_OBJ)
+- ar r $@ $^
++ $(CXX) $(CXXFLAGS) -shared -Wl,-soname,libxbyak_aarch64.so.0 -o $@ $^
+
+ test: $(TARGET)
+ $(MAKE) -C test
diff --git a/MakefileStatic.patch b/MakefileStatic.patch
new file mode 100644
index 0000000..6fb7089
--- /dev/null
+++ b/MakefileStatic.patch
@@ -0,0 +1,21 @@
+--- xbyak_aarch64-1.0.0/MakefileOriginal 2022-11-24 10:39:21.817629786 +0000
++++ xbyak_aarch64-1.0.0/MakefileStatic 2022-11-24 17:29:13.742340862 +0000
+@@ -17,15 +17,15 @@
+ TARGET=lib/libxbyak_aarch64.a
+ all: $(TARGET)
+
+-CFLAGS=-std=c++11 -DNDEBUG -g -I ./xbyak_aarch64 -Wall -Wextra -fPIC
++CXXFLAGS+=-std=c++11 -DNDEBUG -g -I ./xbyak_aarch64 -Wall -Wextra -fPIC
+ ifneq ($(DEBUG),1)
+-CFLAGS+=-O2
++CXXFLAGS+=-O2
+ endif
+
+ LIB_OBJ=obj/xbyak_aarch64_impl.o obj/util_impl.o
+
+ obj/%.o: src/%.cpp
+- $(CXX) $(CFLAGS) -c $< -o $@ -MMD -MP -MF $(@:.o=.d)
++ $(CXX) $(CXXFLAGS) -c $< -o $@ -MMD -MP -MF $(@:.o=.d)
+
+ -include obj/xbyak_aarch64_impl.d
+
diff --git a/sources b/sources
new file mode 100644
index 0000000..5f3d805
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (xbyak_aarch64-1.0.0.tar.gz) =
910dbe9a9ebdeba735d97d504a68c1a87bd37cb1597d72c93b00c96c52166dfb0070087c15c49a3ec95ca8df06be31e2de17ea3b83c7785ce80a43566febd17d
diff --git a/xbyak_aarch64.spec b/xbyak_aarch64.spec
new file mode 100644
index 0000000..c22a565
--- /dev/null
+++ b/xbyak_aarch64.spec
@@ -0,0 +1,184 @@
+Summary: JIT assembler for AArch64 CPUs by C++
+Name: xbyak_aarch64
+License: Apache-2.0
+
+Version: 1.0.0
+Release: 5%{?dist}
+
+URL:
https://github.com/fujitsu/xbyak_aarch64
+Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
+# Also create dynamically linked library in addition to static library
+# Add soname
+# Related issue
https://github.com/fujitsu/xbyak_aarch64/issues/74
+Patch01: Makefile.patch
+Patch02: MakefileStatic.patch
+
+Group: Development/Libraries
+ExclusiveArch: AArch64
+
+BuildRequires: make
+BuildRequires: gcc-c++
+
+%bcond_with check
+%if %{with check}
+# check
+BuildRequires: qemu
+BuildRequires: qemu-user
+BuildRequires: qemu-system-aarch64
+BuildRequires: qemu-user-static-aarch64
+%endif
+
+%description
+Xbyak_aarch64 is a C++ library which enables run-time assemble coding with the
+AArch64 instruction set of Arm(R)v8-A architecture. Xbyak_aarch64 is based on
+Xbyak developed for x86_64 CPUs by MITSUNARI Shigeo.
+
+%package devel
+Summary: JIT assembler for AArch64 CPUs by C++
+Requires: %{name}%{?_isa} = %{version}-%{release}
+
+%description devel
+Xbyak_aarch64 is a C++ library which enables run-time assemble coding with the
+AArch64 instruction set of Arm(R)v8-A architecture. Xbyak_aarch64 is based on
+Xbyak developed for x86_64 CPUs by MITSUNARI Shigeo.
+
+%package static
+Summary: JIT assembler for AArch64 CPUs by C++
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Provides: %{name}-static = %{version}-%{release}
+
+%description static
+Xbyak_aarch64 is a C++ library which enables run-time assemble coding with the
+AArch64 instruction set of Arm(R)v8-A architecture. Xbyak_aarch64 is based on
+Xbyak developed for x86_64 CPUs by MITSUNARI Shigeo.
+
+%prep
+%setup -q
+# Create modified Makefiles for static and dynamically linked libraries
+cp Makefile MakefileOriginal
+cp Makefile MakefileStatic
+
+%patch01 -p1
+# Add soname which is not encoded in the patch
+sed -i 's/so.0.soname/so.0.%{version}/g' Makefile
+
+%patch02 -p1
+
+%build
+%{set_build_flags}
+# Make dynamiclly linked library
+%make_build
+# Make statically linked library
+%make_build -f MakefileStatic
+
+%install
+mkdir -p %{buildroot}%{_datadir}/xbyak_aarch64
+cp -pr sample %{buildroot}%{_datadir}/xbyak_aarch64/
+
+mkdir -p %{buildroot}%{_libdir}
+install -m 755 lib/libxbyak_aarch64.so.0.%{version} %{buildroot}%{_libdir}/
+install -m 644 lib/libxbyak_aarch64.a %{buildroot}%{_libdir}/
+mkdir -p %{buildroot}%{_includedir}/xbyak_aarch64
+install -m 644 xbyak_aarch64/*.h %{buildroot}%{_includedir}/xbyak_aarch64
+
+ln -sf ./lib/libxbyak_aarch64.so.0.%{version}
%{buildroot}%{_libdir}/libxbyak_aarch64.so.0
+ln -sf ./lib/libxbyak_aarch64.so.0.%{version} ./lib/libxbyak_aarch64.so.0
+ln -sf ./lib/libxbyak_aarch64.so.0 %{buildroot}%{_libdir}/libxbyak_aarch64.so
+
+%check
+# make test needs modifications for architectures other
+# than armv8. Use a smoke test based on program in the
+# Readme
+cat << EOF > simpletest.cpp
+#include "xbyak_aarch64.h"
+using namespace Xbyak_aarch64;
+class Generator : public CodeGenerator {
+public:
+ Generator() {
+ Label L1, L2;
+ L(L1);
+ add(w0, w1, w0);
+ cmp(w0, 13);
+ b(EQ, L2);
+ sub(w1, w1, 1);
+ b(L1);
+ L(L2);
+ ret();
+ }
+};
+int main() {
+ Generator gen;
+ gen.ready();
+ auto f = gen.getCode<int (*)(int, int)>();
+ std::cout << f(3, 4) << std::endl;
+ return 0;
+}
+EOF
+
+# Test dynamically linked library
+$CXX $CXXFLAGS -o simpletest simpletest.cpp \
+ -I%{buildroot}%{_includedir}/xbyak_aarch64 \
+ %{buildroot}%{_libdir}/libxbyak_aarch64.so.0.%{version}
+LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir} ./simpletest
+# Test statially linked library
+cd sample
+make
+./add.exe
+./add2.exe 3 6
+./label.exe
+./direct_write.exe
+./dump.exe
+./bf.exe hello.bf
+./cpuinfo.exe
+cd ..
+
+#Perform thorough check using emulation
+%bcond_with check
+%if %{with check}
+make clean
+export QEMU_CPU="max,sve512=on"
+export EMULATOR="qemu-aarch64"
+export CXX=aarch64-linux-gnu-g++
+CXX=aarch64-redhat-linux-g++ make -f MakefileOriginal
+cd test
+source ../.github/automation/env/setenv
+./test_all.sh -g
+cd ..
+%endif
+
+%ldconfig_scriptlets
+
+%files
+%license LICENSE
+%doc README.md
+%{_libdir}/libxbyak_aarch64.so.0.%{version}
+%{_libdir}/libxbyak_aarch64.so.0
+
+%files devel
+%{_libdir}/libxbyak_aarch64.so
+%dir %{_includedir}/xbyak_aarch64
+%dir %{_datadir}/xbyak_aarch64
+%{_includedir}/xbyak_aarch64/*.h
+%doc %{_datadir}/xbyak_aarch64/sample/
+
+%files static
+%{_libdir}/libxbyak_aarch64.a
+
+%changelog
+* Thu Nov 24 2022 Benson Muite <benson_muite(a)emailplus.org> - 1.0.0-5
+- Fix soname and softlinking
+- Ensure devel package pulls in main library
+- Package static and dynamic libraries
+
+* Mon Nov 21 2022 Benson Muite <benson_muite(a)emailplus.org> - 1.0.0-4
+- Optional thorough verifcation using emulation
+
+* Mon Nov 21 2022 Benson Muite <benson_muite(a)emailplus.org> - 1.0.0-3
+- Use a patch to modify the Makefile
+- Add more instructions on verification using emulation
+
+* Mon Nov 21 2022 Benson Muite <benson_muite(a)emailplus.org> - 1.0.0-2
+- Package as dynamically linked library
+
+* Tue Nov 15 2022 Benson Muite <benson_muite(a)emailplus.org> - 1.0.0-1
+- Initial release, based on xbyak spec