sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (0f4160b2bef7e7e1637902498135f93472d77a83)
- From: Ismael Luceno <scm AT sourcemage.org>
- To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
- Subject: [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (0f4160b2bef7e7e1637902498135f93472d77a83)
- Date: Sun, 4 Oct 2026 17:24:57 +0000
GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:
ChangeLog
| 2
devel/uasm/BUILD
| 3
devel/uasm/DETAILS
| 24 +
devel/uasm/HISTORY
| 6
devel/uasm/INSTALL
| 4
devel/uasm/PRE_BUILD
| 3
devel/uasm/WATCH
| 1
devel/uasm/patches/0001-Declare-strupr-for-the-Unix-build.patch
| 29 +
devel/uasm/patches/0002-Declare-the-functions-the-modules-call-across-file-boundaries.patch
| 111 +++++
devel/uasm/patches/0003-Set-the-Mach-O-header-flags-to-zero-instead-of-NULL.patch
| 28 +
devel/uasm/uasm.1
| 212 ++++++++++
11 files changed, 423 insertions(+)
New commits:
commit 0f4160b2bef7e7e1637902498135f93472d77a83
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>
uasm: new spell, Masm-compatible assembler with native ELF output
diff --git a/ChangeLog b/ChangeLog
index a456a02..0b65210 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
2026-10-04 Ismael Luceno <ismael AT sourcemage.org>
* kernels/freedos-lite: new spell, free DOS-compatible operating
system (lite image)
+ * devel/uasm: new spell, Masm-compatible assembler with native ELF
+ output
2026-10-01 Ismael Luceno <ismael AT sourcemage.org>
* python-pypi/podman-compose: new spell, run compose files with
diff --git a/devel/uasm/BUILD b/devel/uasm/BUILD
new file mode 100755
index 0000000..0f1fab6
--- /dev/null
+++ b/devel/uasm/BUILD
@@ -0,0 +1,3 @@
+force_dialect gnu17 &&
+CFLAGS+=" -Wno-error=incompatible-pointer-types" &&
+make -f Makefile-Linux-GCC-64.mak
diff --git a/devel/uasm/DETAILS b/devel/uasm/DETAILS
new file mode 100755
index 0000000..8394331
--- /dev/null
+++ b/devel/uasm/DETAILS
@@ -0,0 +1,24 @@
+ SPELL=uasm
+ VERSION=2.57r
+ SOURCE=$SPELL-$VERSION.tar.gz
+
SOURCE_HASH=sha512:588c158b34e0fc538f08a859822549fbd2e1f8548102bbbdea7099281ffaaf41b6d56f4f07f7333a7d714acbd6271b504dde2b24ad2e9790e93e78e6e516caa0
+SOURCE_DIRECTORY=$BUILD_DIRECTORY/UASM-$VERSION
+ WEB_SITE=https://github.com/Terraspace/UASM
+ SOURCE_URL[0]=$WEB_SITE/archive/refs/tags/v$VERSION.tar.gz
+ ENTERED=20261004
+ LICENSE[0]=Watcom-1.0
+ DOCS="Readme.txt History.txt License.txt"
+ DOC_DIRS="Doc"
+ KEYWORDS="devel"
+ SHORT="Masm-compatible assembler with native ELF output"
+cat << EOF
+UASM is a Masm-compatible macro assembler, forked from JWasm.
+
+It generates Intel OMF, MS COFF (32 and 64-bit), ELF (32 and 64-bit), plain
+binary, Windows PE (32 and 64-bit), Mach-O 64 and DOS MZ output, so it
+assembles both Windows and Linux objects without a cross assembler.
+
+Instructions up to AVX2 and AVX512F are supported, along with the VMX, MPX,
+AES, BND and F16C extensions, the Microsoft vectorcall and the Borland
+register calling conventions, and System V calling convention support.
+EOF
diff --git a/devel/uasm/HISTORY b/devel/uasm/HISTORY
new file mode 100644
index 0000000..5eb1745
--- /dev/null
+++ b/devel/uasm/HISTORY
@@ -0,0 +1,6 @@
+2026-10-04 Ismael Luceno <ismael AT sourcemage.org>
+ * DETAILS, BUILD, INSTALL, PRE_BUILD, WATCH, uasm.1,
+ patches/0001-Declare-strupr-for-the-Unix-build.patch,
+
patches/0002-Declare-the-functions-the-modules-call-across-file-boundaries.patch,
+
patches/0003-Set-the-Mach-O-header-flags-to-zero-instead-of-NULL.patch:
+ spell created
diff --git a/devel/uasm/INSTALL b/devel/uasm/INSTALL
new file mode 100755
index 0000000..0889130
--- /dev/null
+++ b/devel/uasm/INSTALL
@@ -0,0 +1,4 @@
+install -m555 -vDt "$INSTALL_ROOT"/usr/bin GccUnixR/uasm &&
+install -m444 -vDt "$INSTALL_ROOT"/usr/share/man/man1 \
+ "$SPELL_DIRECTORY"/uasm.1 &&
+gzip -9n "$INSTALL_ROOT"/usr/share/man/man1/uasm.1
diff --git a/devel/uasm/PRE_BUILD b/devel/uasm/PRE_BUILD
new file mode 100755
index 0000000..c230ad1
--- /dev/null
+++ b/devel/uasm/PRE_BUILD
@@ -0,0 +1,3 @@
+default_pre_build &&
+cd "$SOURCE_DIRECTORY" &&
+apply_patch_dir patches
diff --git a/devel/uasm/WATCH b/devel/uasm/WATCH
new file mode 100644
index 0000000..44eb567
--- /dev/null
+++ b/devel/uasm/WATCH
@@ -0,0 +1 @@
+0 . https://github.com/Terraspace/UASM/tags
tags/v([0-9]+[.][0-9.]+[a-z]?)[.]tar
diff --git a/devel/uasm/patches/0001-Declare-strupr-for-the-Unix-build.patch
b/devel/uasm/patches/0001-Declare-strupr-for-the-Unix-build.patch
new file mode 100644
index 0000000..a1c966c
--- /dev/null
+++ b/devel/uasm/patches/0001-Declare-strupr-for-the-Unix-build.patch
@@ -0,0 +1,29 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <ismael AT sourcemage.org>
+Date: Sun, 4 Oct 2026 12:47:40 +0200
+Subject: [PATCH 1/3] Declare strupr() for the Unix build
+
+apiemu.c supplies strupr() on Unix builds, but nothing declares it:
+globals.h maps _strupr onto it and strings.h never had the prototype.
+GCC 14 rejects the implicit declaration, and it was wrong anyway - an
+implicitly declared function returns int, so on x86-64 the returned
+pointer was truncated to 32 bits.
+
+Upstream-Status: Pending
+Origin: Source Mage
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ H/globals.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/H/globals.h
++++ b/H/globals.h
+@@ -49,6 +49,7 @@
+ #endif
+ #define _ltoa ltoa
+ #define _strupr strupr
++char *strupr( char *str );
+
+ #elif defined(__POCC__)
+
+--
diff --git
a/devel/uasm/patches/0002-Declare-the-functions-the-modules-call-across-file-boundaries.patch
b/devel/uasm/patches/0002-Declare-the-functions-the-modules-call-across-file-boundaries.patch
new file mode 100644
index 0000000..e38bb94
--- /dev/null
+++
b/devel/uasm/patches/0002-Declare-the-functions-the-modules-call-across-file-boundaries.patch
@@ -0,0 +1,111 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <ismael AT sourcemage.org>
+Date: Sun, 4 Oct 2026 12:47:40 +0200
+Subject: [PATCH 2/3] Declare the functions the modules call across file
boundaries
+
+Ten functions are called from a module that never sees a declaration of
+them: OutputInterleavedBytes, BackPatch, SymSimd, RunLineQueue,
+get_curr_srcfile, GetLineNumber, tolower, CreateMacroLibCases32,
+CreateMacroLibCases64 and AddSimdTypes. GCC 14 makes every implicit
+declaration an error. Add the include or the extern that each of the
+six calling modules is missing, next to the ones it already declares by
+hand.
+
+None of the callees return a pointer, so nothing miscompiled while they
+were implicit.
+
+Upstream-Status: Pending
+Origin: Source Mage
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ H/macrolib.h | 2 ++
+ assemble.c | 1 +
+ codegenv2.c | 2 ++
+ data.c | 1 +
+ invoke.c | 1 +
+ simd.c | 1 +
+ types.c | 2 ++
+ 7 files changed, 10 insertions(+)
+
+--- a/assemble.c
++++ b/assemble.c
+@@ -38,6 +38,7 @@
+ #include "listing.h"
+ #include "msgtext.h"
+ #include "myassert.h"
++#include "simd.h"
+ #include "linnum.h"
+ #include "cpumodel.h"
+ #include "lqueue.h"
+--- a/codegenv2.c
++++ b/codegenv2.c
+@@ -1,6 +1,7 @@
+
+ #include "codegenv2.h"
+
++#include <ctype.h>
+ #include <time.h>
+ #include "globals.h"
+ #include "parser.h"
+@@ -9,6 +10,7 @@
+ #include "fixup.h"
+ #include "fastpass.h"
+ #include "myassert.h"
++#include "input.h"
+ #include "types.h"
+ #include "macro.h"
+ #include "listing.h"
+--- a/data.c
++++ b/data.c
+@@ -85,6 +85,7 @@
+ extern ret_code segm_override( const struct expr *, struct code_info * );
+ extern struct asym *SegOverride;
+ extern const char szNull[];
++extern void OutputInterleavedBytes( const unsigned char *pbytes, int len,
struct fixup *fixup );
+ extern UINT_PTR UTF8toWideChar(const unsigned char *pSource, UINT_PTR
nSourceLen, UINT_PTR *nSourceDone, unsigned short *szTarget, UINT_PTR
nTargetMax);
+ static ret_code data_item( int *, struct asm_tok[], struct asym *, uint_32,
const struct asym *, uint_32, bool inside_struct, bool, bool, int );
+
+--- a/invoke.c
++++ b/invoke.c
+@@ -71,6 +71,7 @@
+ extern enum special_token stackreg[];
+ extern struct dsym *CurrStruct;
+ extern UINT_PTR UTF8toWideChar(const unsigned char *pSource, UINT_PTR
nSourceLen, UINT_PTR *nSourceDone, unsigned short *szTarget, UINT_PTR
nTargetMax);
++extern ret_code BackPatch( struct asym *sym );
+
+ #ifdef __I86__
+ #define NUMQUAL (long)
+--- a/H/macrolib.h
++++ b/H/macrolib.h
+@@ -3,6 +3,8 @@
+ #define _MACROLIB_H_
+
+ void InitAutoMacros64();
++void CreateMacroLibCases64();
++void CreateMacroLibCases32();
+ void InitAutoMacros32();
+
+ #endif
+\ No newline at end of file
+--- a/simd.c
++++ b/simd.c
+@@ -10,6 +10,7 @@
+ #include "simd.h"
+ #include "globals.h"
+ #include "symbols.h"
++#include "lqueue.h"
+
+ extern void AddLineQueue(const char *line);
+ extern void AddLineQueueX(const char *fmt, ...);
+--- a/types.c
++++ b/types.c
+@@ -24,6 +24,8 @@
+ #include "fastpass.h"
+ #include "myassert.h"
+
++extern void SymSimd( struct dsym *sym );
++
+ /* v2.04: changed to 0 */
+ //#define ANYNAME 1 /* fixme: this probably should be changed to 0 */
+ #define ANYNAME 0
+--
diff --git
a/devel/uasm/patches/0003-Set-the-Mach-O-header-flags-to-zero-instead-of-NULL.patch
b/devel/uasm/patches/0003-Set-the-Mach-O-header-flags-to-zero-instead-of-NULL.patch
new file mode 100644
index 0000000..e396c94
--- /dev/null
+++
b/devel/uasm/patches/0003-Set-the-Mach-O-header-flags-to-zero-instead-of-NULL.patch
@@ -0,0 +1,28 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <ismael AT sourcemage.org>
+Date: Sun, 4 Oct 2026 12:47:40 +0200
+Subject: [PATCH 3/3] Set the Mach-O header flags to zero instead of NULL
+
+mach_header_64.flags is a uint32_t, and NULL is a pointer, so gcc
+rejects the assignment under -Wint-conversion, which is an error by
+default since GCC 14.
+
+Upstream-Status: Pending
+Origin: Source Mage
+Signed-off-by: Ismael Luceno <ismael AT sourcemage.org>
+---
+ macho64.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/macho64.c
++++ b/macho64.c
+@@ -725,7 +725,7 @@
+ mm.header.cputype = CPU_TYPE_X86_64;
+ mm.header.cpusubtype = CPU_SUBTYPE_LITTLE_ENDIAN |
CPU_SUBTYPE_X86_64_ALL;
+ mm.header.filetype = MH_OBJECT;
+- mm.header.flags = NULL;
++ mm.header.flags = 0;
+
+ macho_build_structures(modinfo, mm);
+ }
+--
diff --git a/devel/uasm/uasm.1 b/devel/uasm/uasm.1
new file mode 100644
index 0000000..233de6b
--- /dev/null
+++ b/devel/uasm/uasm.1
@@ -0,0 +1,212 @@
+.TH UASM 1 "October 2026" "uasm 2.57r" "User Commands"
+.SH NAME
+uasm \- Masm-compatible macro assembler
+.SH SYNOPSIS
+.B uasm
+.RI [ options ]
+.IR asm-file ...
+.RI [ @env_var ]
+.SH DESCRIPTION
+.B uasm
+assembles Intel syntax assembly into object files or flat binaries. It is a
+fork of JWasm and reads Masm source: the
+.B .MODEL
+directive, the
+.B PROC
+and
+.B ENDP
+procedure forms and the usual segment and data directives all work, and an
+internal macro library provides the Masm mnemonics. Extensions over Masm,
+and the places where the syntax differs from it, are listed in
+.IR Doc/enh.txt .
+.PP
+Unless another output format is selected, objects are written in Intel OMF.
+Formats such as
+.BR -bin ,
+.B -mz
+and
+.B -pe
+produce a linked image rather than a relocatable object, and are meant for
+boot sectors, DOS and Windows executables.
+.PP
+Any number of source files may be given, each with its own options.
+.B @
+arguments read further options from an environment variable, or from a file
+named by it.
+.SH OPTIONS
+.SS Output format
+.TP
+.B -bin
+Plain binary output.
+.TP
+.B -coff
+MS COFF object, 32-bit.
+.TP
+.B -elf
+ELF object, 32-bit.
+.TP
+.B -elf64
+ELF object, 64-bit.
+.TP
+.B -macho64
+Mach-O object, 64-bit.
+.TP
+.B -mz
+DOS MZ executable.
+.TP
+.B -omf
+Intel OMF object. This is the default.
+.TP
+.B -pe
+Windows PE executable, 32 or 64-bit.
+.TP
+.B -win64
+MS COFF object, 64-bit.
+.TP
+.B -pie
+Generate a position independent image. ELF64 and Mach-O64 only.
+.SS File names
+.TP
+.BI -Fo " file"
+Write the object to
+.IR file .
+A name without an extension gets
+.B .o
+appended.
+.TP
+.BI -Fl " file"
+Write a listing to
+.IR file .
+.TP
+.BI -Fw " file"
+Write errors to
+.IR file .
+.TP
+.BI -Fi " file"
+Include
+.I file
+before assembling.
+.TP
+.BI "-I " directory
+Add
+.I directory
+to the include path.
+.TP
+.BI "-D " name [= text ]
+Define a text macro.
+.SS Code generation
+.TP
+.BI -0 " .. " -10 [ p ]
+Set the target CPU, from 8086 (0, the default) to x86-64 (10). A trailing
+.B p
+allows privileged instructions.
+.TP
+.BI -arch SSE | AVX
+Select the instruction set extensions the macro library generates for.
+.TP
+.BI -G p | c | f | z
+Set the calling convention to Pascal, C, Fastcall or stdcall.
+.TP
+.BI -m t | s | c | m | l | h | f
+Set the memory model.
+.TP
+.BI -Zp [ n ]
+Set the structure alignment to
+.IR n .
+.TP
+.BI -Sp [ n ]
+Set the segment alignment to
+.IR n .
+.TP
+.B -Zg
+Generate code that matches Masm byte for byte.
+.TP
+.B -nomlib
+Do not use the internal macro library.
+.TP
+.B -zcm ", " -zcw
+Decorate C names with a leading underscore, or leave them alone.
+.SS Diagnostics
+.TP
+.BI -W level
+Set the warning level, 0 to 4. The default is 2.
+.TP
+.B -WX
+Treat warnings as errors.
+.TP
+.BI -e number
+Stop after
+.I number
+errors. The default is 50.
+.TP
+.B -Zs
+Check the syntax only.
+.TP
+.B -eq
+Do not report errors.
+.TP
+.B -q ", " -nologo
+Do not print the version banner.
+.SS Listing contents
+.TP
+.B -EP
+Write the preprocessed source to standard output.
+.TP
+.B -Sa
+Produce a maximal source listing.
+.TP
+.B -Sf
+List the first pass.
+.TP
+.B -Sg
+Include the generated code in the listing.
+.TP
+.B -Sn
+Omit the symbol table from the listing.
+.TP
+.B -Sx
+List false conditionals.
+.SH ENVIRONMENT
+.TP
+.B INCLUDE
+A colon separated list of include directories, added to by
+.BR -I .
+.SH EXIT STATUS
+.B uasm
+exits with status 0 when every file assembled without an error, and non-zero
+otherwise.
+.SH EXAMPLES
+Write a freestanding 64-bit Linux program that prints a line, and link it:
+.PP
+.RS
+.nf
+$ cat hello.asm
+ .code
+PUBLIC _start
+_start:
+ lea rdx, msg
+ mov ecx, edx
+ mov edx, len
+ mov eax, 1 ; sys_write
+ mov edi, 1 ; stdout
+ syscall
+ mov eax, 60 ; sys_exit
+ xor edi, edi
+ syscall
+
+msg db 'hello, world', 10
+len equ $-msg
+ END
+
+$ uasm -10p -elf64 -Fo hello.o hello.asm
+$ gcc -nostdlib -static -o hello hello.o
+$ ./hello
+hello, world
+.fi
+.RE
+.SH SEE ALSO
+.PP
+.I /usr/share/doc/uasm
+holds the upstream readme, the change log, the licence and the developer
+notes under
+.IR Doc/ .
- [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (0f4160b2bef7e7e1637902498135f93472d77a83), Ismael Luceno, 10/04/2026
Archive powered by MHonArc 2.6.24.