summaryrefslogtreecommitdiff
path: root/devel/nasm
diff options
context:
space:
mode:
Diffstat (limited to 'devel/nasm')
-rw-r--r--devel/nasm/.footprint9
-rw-r--r--devel/nasm/.signature7
-rw-r--r--devel/nasm/MAKEPKG31
-rw-r--r--devel/nasm/nasm-3.01-musl.patch92
4 files changed, 139 insertions, 0 deletions
diff --git a/devel/nasm/.footprint b/devel/nasm/.footprint
new file mode 100644
index 0000000..b15ff34
--- /dev/null
+++ b/devel/nasm/.footprint
@@ -0,0 +1,9 @@
+drwxr-xr-x root/root usr/
+drwxr-xr-x root/root usr/bin/
+-rwxr-xr-x root/root usr/bin/nasm
+-rwxr-xr-x root/root usr/bin/ndisasm
+drwxr-xr-x root/root usr/share/
+drwxr-xr-x root/root usr/share/man/
+drwxr-xr-x root/root usr/share/man/man1/
+-rw-r--r-- root/root usr/share/man/man1/nasm.1.gz
+-rw-r--r-- root/root usr/share/man/man1/ndisasm.1.gz
diff --git a/devel/nasm/.signature b/devel/nasm/.signature
new file mode 100644
index 0000000..37da238
--- /dev/null
+++ b/devel/nasm/.signature
@@ -0,0 +1,7 @@
+RWTZ9IduCSQ/mCSRJc+kPsaCurf/frS69eB9bURBPIfwZD3FmU6fnxxyuqcOCEZYfuidQlGoaRzDvdicB+SJlTuPz0Mbxc3pFgo=
+
+SHA256 (MAKEPKG) = f91c3197c685e10c8704fae039f68ca37b6b7d99db0c6d6e57d9c62157da812d
+SHA256 (.footprint) = 2f2595d48b1d9747afa0d6b676a290528c98d1151c567954c594803a07fa9255
+SHA256 (nasm-3.02.tar.xz) = 87336eba53b4acfe917424ab5d500d2b0054d9f5148d35c2273ccf2cfb712f0d
+SHA256 (nasm-3.01-musl.patch) = 230ee9c355991d6e7f6ed2f815d102d61e24e69fef50b3bf11c257f285e7b1e6
+SHA256 (nasm#3.02-1.pkg.tar.gz) = 4df9b9093893d959a4d54cf178da1df0fc9f91a1b1a7c0ee335e53eeea8ccbba
diff --git a/devel/nasm/MAKEPKG b/devel/nasm/MAKEPKG
new file mode 100644
index 0000000..a01d034
--- /dev/null
+++ b/devel/nasm/MAKEPKG
@@ -0,0 +1,31 @@
+#!/bin/mkpkg
+# description: Netwide Assembler (x86/x86_64)
+# url: https://www.nasm.us/
+
+name=nasm
+version=3.02
+release=1
+depends=(zlib)
+source=(https://www.nasm.us/pub/nasm/releasebuilds/$version/$name-$version.tar.xz
+ nasm-3.01-musl.patch)
+sha256sums=(
+ "87336eba53b4acfe917424ab5d500d2b0054d9f5148d35c2273ccf2cfb712f0d"
+ "230ee9c355991d6e7f6ed2f815d102d61e24e69fef50b3bf11c257f285e7b1e6"
+)
+
+build() {
+ cd $name-$version
+
+ #patch -p1 -i $SRC/nasm-3.01-musl.patch
+
+ ./configure --prefix=/usr
+ make
+ make DESTDIR=$PKG install
+}
+
+signify() {
+ untrusted comment: public key
+ RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3
+}
+
+# vim: filetype=sh
diff --git a/devel/nasm/nasm-3.01-musl.patch b/devel/nasm/nasm-3.01-musl.patch
new file mode 100644
index 0000000..20efe15
--- /dev/null
+++ b/devel/nasm/nasm-3.01-musl.patch
@@ -0,0 +1,92 @@
+https://github.com/netwide-assembler/nasm/commit/44e89ba9b650b5e1533bca43682e167f51a3511f
+From: "H. Peter Anvin (Intel)" <hpa@zytor.com>
+Date: Sun, 12 Oct 2025 12:48:32 -0700
+Subject: [PATCH] compiler.h: drop the stupid C++-style cast-to-bool hack
+
+The C++-style cast-to-bool hack was broken in concept that it doesn't help the
+fundamental problem -- implicit conversions are broken for the
+backwards compatibility enum definition -- as well as in
+implementation, as it misspelled __STDC_VERSION__ as __STDC_VERSION.
+
+The #ifdef bool test *should* have prevented this problem, but
+apparently several compilers do define "bool" in <stdbool.h> even when
+it is a keyword, in violation of the C23 spec.
+
+Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
+--- a/include/compiler.h
++++ b/include/compiler.h
+@@ -181,19 +181,10 @@ size_t strlcpy(char *, const char *, size_t);
+ char * pure_func strrchrnul(const char *, int);
+ #endif
+
+-#if !defined(__cplusplus) || (__STDC_VERSION >= 202311L)
+ /* C++ and C23 have bool, false, and true as proper keywords */
++#if !defined(__cplusplus) || (__STDC_VERSION__ >= 202311L)
+ # ifdef HAVE_STDBOOL_H
+-/* If <stdbool.h> exists, include it explicitly to prevent it from
+- begin included later, causing the "bool" macro to be defined. */
+ # include <stdbool.h>
+-# ifdef bool
+-/* Force bool to be a typedef instead of a macro. What a "clever" hack
+- this is... */
+- typedef bool /* The macro definition of bool */
+-# undef bool
+- bool; /* No longer the macro definition */
+-# endif
+ # elif defined(HAVE___BOOL)
+ typedef _Bool bool;
+ # define false 0
+@@ -201,14 +192,10 @@ char * pure_func strrchrnul(const char *, int);
+ # else
+ /* This is a bit dangerous, because casting to this ersatz bool
+ will not produce the same result as the standard (bool) cast.
+- Instead, use the bool() constructor-style macro defined below. */
++ Instead, use the explicit construct !!x instead of relying on
++ implicit conversions or casts. */
+ typedef enum bool { false, true } bool;
+ # endif
+-/* This amounts to a C++-style conversion cast to bool. This works
+- because C ignores an argument-taking macro when used without an
+- argument and because bool was redefined as a typedef if it previously
+- was defined as a macro (see above.) */
+-# define bool(x) ((bool)!!(x))
+ #endif
+
+ /* Create a NULL pointer of the same type as the address of
+@@ -321,11 +308,11 @@ static inline void *mempset(void *dst, int c, size_t n)
+ * less likely to be taken.
+ */
+ #ifdef HAVE___BUILTIN_EXPECT
+-# define likely(x) __builtin_expect(bool(x), true)
+-# define unlikely(x) __builtin_expect(bool(x), false)
++# define likely(x) __builtin_expect(!!(x), true)
++# define unlikely(x) __builtin_expect(!!(x), false)
+ #else
+-# define likely(x) bool(x)
+-# define unlikely(x) bool(x)
++# define likely(x) (!!(x))
++# define unlikely(x) (!!(x))
+ #endif
+
+ #ifdef HAVE___BUILTIN_PREFETCH
+
+https://github.com/netwide-assembler/nasm/commit/746e7c9efa37cec9a44d84a1e96b8c38f385cc1f
+From: "H. Peter Anvin (Intel)" <hpa@zytor.com>
+Date: Sun, 12 Oct 2025 13:05:55 -0700
+Subject: [PATCH] compiler.h: the test for "neither C++ nor C23" still wrong
+
+The test needs to test for neither nor; as it was it tested "(not C++)
+or C23" which was not at all what was intended...
+
+Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
+--- a/include/compiler.h
++++ b/include/compiler.h
+@@ -182,7 +182,7 @@ char * pure_func strrchrnul(const char *, int);
+ #endif
+
+ /* C++ and C23 have bool, false, and true as proper keywords */
+-#if !defined(__cplusplus) || (__STDC_VERSION__ >= 202311L)
++#if !defined(__cplusplus) && (__STDC_VERSION__ < 202311L)
+ # ifdef HAVE_STDBOOL_H
+ # include <stdbool.h>
+ # elif defined(HAVE___BOOL)