0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-10-10 00:25:06 -04:00
Commit Graph

5488 Commits

Author SHA1 Message Date
KO Myung-Hun
c7f426f5e5 outobj: add obj2 driver
Obj2 is an obj variation for OS/2.

Obj2 has the following differences from obj.

1. Default attributes for a segment are ALIGN=16 and USE32.
2. Add a segment to FLAT group implicitly if 32-bit segment.
3. Recognize Unix sections .text, .rodata, .data and .bss as TEXT32,
   CONST32, DATA32 and BSS32 respectively for compatibility with other
   Unix platforms.
4. Set default classes implicitly for known segments such as TEXT32,
   CONST32, DATA32, BSS32 and so on.

Signed-off-by: KO Myung-Hun <komh78@gmail.com>
2025-10-04 15:57:24 -07:00
Adam Sampson
a65be7d59b bytesex.h: fix typo in le32toh function name
This fixes the build on 32-bit/64-bit ARM.

Signed-off-by: Adam Sampson <ats@offog.org>
2025-10-04 15:54:49 -07:00
H. Peter Anvin
cd5dfb8c5f warnings: always regenerate outputs; tidy up unnecessary rules
With warnings disaggregated, there is no reason to play games with not
updating the output timestamp. Always write the files as usual.

Remove unnecessary Makefile rules.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
1# Please enter the commit message for your changes. Lines starting
2025-10-04 14:04:31 -07:00
H. Peter Anvin
69f1aa6c6a Makefile.in: re-introduce rules that can be made common
Rules that are now simple again can be made common.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-04 13:55:21 -07:00
H. Peter Anvin
a8bcdb641b Warnings: disaggregate from source and tidy up documentation
The idea of putting the warnings in the source code was a nice one,
really, but it ended up being a nightmare from the perspective of
build dependencies. Disaggregate them, and tweak the documentation for
easier reading.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-04 13:46:39 -07:00
H. Peter Anvin
bb3a51e5d6 warnings: remove stray whitespace before warning specification
The actual warning specification should begin immediately after *!.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-04 12:09:05 -07:00
Gabriel Barrantes
19e1f4bf81 Setup CI/CD pipeline
Setup job for travis tests

Signed-off-by: Gabriel Barrantes <gabriel.barrantes.dev@outlook.com>
2025-10-04 10:51:08 -07:00
H. Peter Anvin
3472f368cd This is the development branch intended to become NASM 3.01
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-03 12:59:05 -07:00
H. Peter Anvin
fe7c3c7171 This is the maintenance branch destined to become NASM 3.00.01 2025-10-03 12:58:02 -07:00
H. Peter Anvin
063e6d52e0 NASM 3.00 nasm-3.00 2025-10-03 12:37:44 -07:00
H. Peter Anvin
372e0910ba nasm.spec.in: make -doc package depend on the roboto fonts
It is not *really* required, but it is probably better to have the tag
than not.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-03 12:03:16 -07:00
H. Peter Anvin
568fbff1cd changes.src: add a few more release notes
A few more notes about changes.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-03 12:01:05 -07:00
H. Peter Anvin
e357f9489f NASM 3.00rc20 nasm-3.00rc20 2025-10-03 10:55:23 -07:00
Fabian Giesen
912849c48c Document Mach-O build_version directive
Signed-off-by: Fabian Giesen <fabian.giesen@epicgames.com>

Resolved Conflicts:
	doc/outfmt.src

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-03 10:48:19 -07:00
Fabian Giesen
83655f041e build_version pragma + macro for Mach-O
Matches the llvm-as .build_version syntax. Newer MacOS linker
complains when object files don't contain a LC_BUILD_VERSION.

Signed-off-by: Fabian Giesen <fabian.giesen@epicgames.com>
2025-10-03 10:47:27 -07:00
Fabian Giesen
0ee113ce68 Don't assume pragma directives are a single word
pragma->tail is described as "anything after the operation", but
existing parsing passed just the first whitespace-delimited
word. Change the parsing to just strip leading and trailing
white space off the rest of the line, but keep interior spaces
if there are any.

This is preparation for a build_version pragma for Mach-O matching
the llvm-as .build_version syntax.

Signed-off-by: Fabian Giesen <fabian.giesen@epicgames.com>
2025-10-03 10:47:25 -07:00
H. Peter Anvin
b4697f09e7 Conditionalize __builtin_prefetch() on it existing!!
You have to check that something that isn't standard C actually exists
before trying to use it...

Cc: Colin Ian King <colin.i.king@intel.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-03 10:47:23 -07:00
Colin Ian King
d6dc97dfc0 Add prefetching on strings before hashing
Turns out that the hotspots of nasm are mainly on string hashing
when accessing memory. A simple performance improvement is to
prefetch the first cacheline of a string to be hashed. Ran 50 tests
on an i9-12900 building intel-ipsec-mb that heavily uses nasm and
improved wall clock build times from 56.1 seconds to 53.2 seconds or
around 5% speed improvement.

Signed-off-by: Colin Ian King <colin.i.king@intel.com>
2025-10-03 10:31:27 -07:00
Zachary Turner
6f48f8f7b7 Support nested response files.
This allows response files specified with -@ to reference other
response files.  This keeps parity with many other common toolchains
such as MSVC, GCC, and Clang which all support nested response
files.

Signed-off-by: Zachary Turner <zturner@roblox.com>
2025-10-03 10:31:12 -07:00
Fabian Giesen
9e03a95922 elf: change form for DW_AT_frame_base to DW_form_exprloc
data4 was not spec-compliant here, causing some tools reading
DWARF debug info to complain. Thanks to Nikita Smith for
debugging this!

Signed-off-by: Fabian Giesen <fabian.giesen@epicgames.com>
2025-10-03 10:30:55 -07:00
KO Myung-Hun
1d72743d6b Disable other warnings in endstruc
endstruc calls __?SECT?__ and this causes unnecessary warnings on obj
output if a section is defined with any attributes, because obj output
does not like a segment definition with any attributes when it appears
again.

Signed-off-by: KO Myung-Hun <komh78@gmail.com>
2025-10-03 10:30:33 -07:00
KO Myung-Hun
bc2108b940 autogen.sh: Use $PATH_SEPARATOR as a path separator of ACLOCAL_PATH
A path separator of ACLOCAL_PATH on OS/2 is ';' not ':'. So use
$PATH_SEPARATOR instead of hard-coded ':'.

Signed-off-by: KO Myung-Hun <komh78@gmail.com>
2025-10-03 10:29:57 -07:00
H. Peter Anvin
95f866d47c changes.src: document FLAT obj changes.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-03 10:29:08 -07:00
KO Myung-Hun
05343069fa outobj: disallow the combination of USE16(16-bit segment) and FLAT
FLAT should be used only with USE32(32-bit segment).

Signed-off-by: KO Myung-Hun <komh78@gmail.com>
2025-10-03 10:27:39 -07:00
KO Myung-Hun
3f37cacdd2 outobj: allow for segments in the group FLAT to belong to the other group
It's possible that segments belong to both the group FLAT and the other
group because the group FLAT is a pseudo group.

Signed-off-by: KO Myung-Hun <komh78@gmail.com>
2025-10-03 10:27:39 -07:00
H. Peter Anvin
d45ad2e7ed openwcom.mak: use %null instead of @rem for $(SIDE)
%null appears to be the recommended way to do $(SIDE) on WMAKE.

Suggested-by: KO Mying-Hun <komh78@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-03 10:23:11 -07:00
H. Peter Anvin
a563e84a69 Merge remote-tracking branch 'jperrett256/jdp-doc-edits'
Resolved Conflicts:
	doc/macropkg.src

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2025-10-03 10:19:32 -07:00
thesmartwon
28b96452a1 fix typo in --help 2025-10-03 10:14:26 -07:00
H. Peter Anvin
505fa79142 Merge pull request #115 from yjh-styx/master
Absent command 'BTS' (typo?)
2025-10-03 10:11:57 -07:00
Yongjie2017
a05239c08e Merge branch 'netwide-assembler:master' into master 2025-10-03 08:59:55 +08:00
Yongjie2017
f0037ab726 additional note for running nmake building 2025-10-03 08:59:41 +08:00
H. Peter Anvin
f2da39910a doc/rdsrc.pl: fix output file comment
Not at all important, but might as well be consistent...

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-02 17:37:39 -07:00
H. Peter Anvin
40a161bccd NASM 3.00rc19 nasm-3.00rc19 2025-10-02 17:37:09 -07:00
H. Peter Anvin
467828c431 Even more path hacks for the rpm build
- append /html if htmldir = docdir

- Run autogen.sh with --cleanenv

- Actually use PDFZ and not just Z in doc/Makefile.in.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-02 17:31:58 -07:00
H. Peter Anvin
b0b56c836f tools/release: unset ACLOCAL_PATH
ACLOCAL_PATH should not be used for a release build.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-02 17:12:45 -07:00
H. Peter Anvin
a179a1a826 install: add option for installing .pdf.xz; fix RPMs
- Add an option to use "make install" to install .pdf.xz

- Fix RPM spec file to put the documentation in doc/nasm instead of
  doc/nasm-doc.

- RPM doesn't like unversioned Obsoletes; set a valid cutoff.

- Make nasm-doc depend on nasm.

- Add zlib-devel as a build dependency.

- Add EXTRA_CFLAGS and EXTRA_LDFLAGS for some automated platforms.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-02 17:11:52 -07:00
H. Peter Anvin
7415a1e5f8 Build: update various build installation directories
Modernize and improve the handling of build directories.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-02 16:08:04 -07:00
yjh-styx
4e7a90c4e2 Merge branch 'netwide-assembler:master' into master 2025-10-03 01:45:35 +03:00
H. Peter Anvin
534edcba04 editors: add JSON output
Add JSON formatted editor help output as a way to help more general
editor support code.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-02 14:18:57 -07:00
H. Peter Anvin
c6c67f3011 editors: add explicit special case handing
The automatic extraction procedure can only do so much. At some point
it is simpler to add explicit special case handling.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-02 13:57:15 -07:00
H. Peter Anvin
02042dae1c nasmtok.el: use ${file} to end, to match the start
Use ${file} in both places, in case someone uses a different output
filename for some reason.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-02 13:50:38 -07:00
H. Peter Anvin
01e40a9aeb Move editor help files to editors/, add NASM version number
Move the editor help files (currently nasmtok.el) to the editors/
subdirectory in anticipation of having more such files.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-02 13:49:43 -07:00
H. Peter Anvin
959644a017 msvc.mak: make sure perl is only run if it exists
Only try to run a Perl interpreter if the system actually has one
available. Because timestamps on Windows are apparently not preserved
on archive extraction, otherwise it might happen that nmake will try
to rebuild files even through they already exist.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-01 19:36:22 -07:00
H. Peter Anvin
03391e61ec nasmtok.el: include builtin macros and macro functions
Use a really hacky way to run the NASM binary and extract automatic
builtin macros. As this is not something normally supported during the
NASM build process, the output is canned and will need to be run
manually.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-01 16:06:40 -07:00
H. Peter Anvin
094cc54cd3 emacstbl.pl: extract build-in macro names
Extract builtin macro names into emacstbl.pl, and avoid duplicated
tokens.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-01 15:11:40 -07:00
H. Peter Anvin
869935edfd Merge remote-tracking branch 'emacstbl/emacstbl-footer'
Resolved Conflicts:
	misc/emacstbl.pl

This also reverts the token names to the version without the -token-
infix.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-01 14:35:14 -07:00
H. Peter Anvin
d021e86def NASM 3.00rc18 nasm-3.00rc18 2025-10-01 14:25:54 -07:00
H. Peter Anvin
72118a9ff6 emacstbl.pl: a few minor tweaks to the emacs token table generator
Hopefully this will be useful to someone.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-01 14:25:04 -07:00
H. Peter Anvin
0b3c971f5b portability: "const macros_t" is redundant
Some C compilers don't like that...

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-01 13:55:38 -07:00
H. Peter Anvin
dfacf9a3d7 Makefiles: remove warnings generation from auxiliary Makefiles
The .time trick doesn't seem to work in general, and auxiliary
Makefiles aren't guaranteed to build modified sources anyway.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2025-10-01 13:55:33 -07:00