Commit Graph

3635 Commits

Author SHA1 Message Date
H. Peter Anvin
4aa13c9e81 Makefile.in: better filter for Perl dependencies
Be a bit smarter about what to require and what to ignore.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-26 00:21:40 -07:00
H. Peter Anvin
752781f2af doc/pspdf.pl: fix spacing
Fix whitespace alignment, no functional change.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-26 00:16:57 -07:00
H. Peter Anvin
e6eb87edc4 win32, doc: fix PDF generation scripts for Windows
Win32::Registry is obsolete, we need to use Win32::TieRegistry on
current platforms.

GhostScript uses # rather than = on Windows, it seems.

Try to find GhostScript in the registry and add it to the PATH.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-26 00:05:12 -07:00
H. Peter Anvin
409da5b561 Windows portability: fix construct in findfont.ph, README update
Fix a construct in doc/findfont.ph which crashes Perl on Windows
unconditionally.

Improve the README for building the full package with MSVC.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-25 20:32:39 -07:00
H. Peter Anvin
35915aec7f NASM 2.13rc22 2017-04-25 13:19:49 -07:00
H. Peter Anvin
c26a7d4cbe nasmlib/path.c: a few more detection macros
Add a few more operating system detection macros, including BeOS.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-25 13:18:36 -07:00
Chang S. Bae
1d73d14eb0 outmatch: fix file info and cleanup in dwarf generation
In debug info and line, only main source is showed up. Header files
will be laid out via TAG_subprogram

Included missing memory cleanups

Removed unnecessary null assertions

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-25 12:54:25 -07:00
Chang S. Bae
64dd380f1e nasmlib: include macro for Mach system and fix on filename extraction
Add __MACH__ as a Unix-like system (e.g. MacOS X defines __MACH__ but
no variant of __unix__.)

Fix a reversed test in first_filename_char().

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-25 12:53:52 -07:00
H. Peter Anvin
c6bbfaa70d doc: formatting consistency for %!
Consistent formatting for the %! environment variable reference.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-25 12:39:11 -07:00
H. Peter Anvin
3ddaa86ba2 doc: make the %! (environment variable) construct a little clearer
Make the %! construct a little more clear.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-24 14:21:43 -07:00
H. Peter Anvin
f268b97a8e doc: add (deprecated) to context fall-through lookup heading
Context fall-through lookup is deprecated, make it as clear as
possible.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-24 14:18:59 -07:00
H. Peter Anvin
4b177bfb03 outmacho: clean up list walks, use nasm_basename/nasm_dirname
Use the new nasm_basename() and nasm_dirname() functions to split a
pathname.

Use nasm_wcstring() to write a C string to an SAA.

Use list_for_each() to walk linked lists.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 23:46:41 -07:00
H. Peter Anvin
6e11b2cc54 saa, raa: saa_init() and raa_init() will never return NULL
Like other NASM allocation functions, these will abort rather than
ever return NULL.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 23:37:11 -07:00
H. Peter Anvin
40f0a7495a SAA: add saa_wcstring()
Add saa_wcstring() to write a C string (a string including final NUL)
to an SAA, and return the number of bytes written.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 23:20:54 -07:00
H. Peter Anvin
d00d8c6ac3 nasmlib: fix MacOS classic catsep definition
Correct the definition for MacOS classic "catsep" in nasm_catfile().
Also put in a stern comment that this function doesn't handle
filenames with path components.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 23:11:12 -07:00
H. Peter Anvin
11a07a7319 nasmlib: add function to splice pathnames
Add a function to splice a pathname consisting of a directory and a
filename.  It is worth noting that this function is limited to that
particular use case: in particular, it does NOT currently support
concatenating a filename which itself contains directory components to
a non-null directory.

Combining directory names is extremely system-dependent and probably
needs more than just parameterized code in many cases, for example,
on VMS combining "foo:[bar]" with "[baz]quux" should produce
"foo:[bar.baz]quux" whereas combining "foo:[bar]" and baz:quux" is an
outright error.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 23:01:00 -07:00
H. Peter Anvin
0979957e19 nasmlib: add path-splitting functions
Some debugging formats may need to be able to split paths into
directory name and filename, at least.  This is kind of iffy, at least
across platforms, but that isn't really expected to be an issue in
practice... we hope.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 22:39:53 -07:00
H. Peter Anvin
26fad144de configure.ac: fix --enable-sections
The --enable-sections option isn't too useful without
-Wl,--gc-sections.  It's unclear if gcc will provide that option by
default.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 21:42:31 -07:00
H. Peter Anvin
d2b7aa8edf aclocal.m4: fix underquoted strings
Some strings were underquoted, causing failures.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 21:42:08 -07:00
H. Peter Anvin
7aae842810 nasm.spec: LTO breaks debug info, fall back to --enable-sections
--enable-lto seems to completely break RPM debug information, so fall
back on --enable-sections, which at least allows the linker to do
better dead code removal.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 21:19:09 -07:00
H. Peter Anvin
b8b77e4452 nasm.spec: more cleanups, doc is noarch
The doc file is noarch, and do some other cleanups.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 21:15:05 -07:00
H. Peter Anvin
3e019c9197 nasm.spec: s/Build-Requires/BuildRequires/
Fix incorrectly spelled tag.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 18:58:53 -07:00
H. Peter Anvin
16ffec1864 nasm.spec: use a sed file to insert perl dependencies
There are just too many ways that an inline sed script can screw up.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 18:54:23 -07:00
H. Peter Anvin
cf96845bf6 nasm.spec: sync with Fedora spec file, auto-generate Perl depends
Sync up with how the Fedora spec file has evolved.
Auto-generate the Perl build dependencies.
Add --enable-lto: it makes especally the rdoff files much smaller.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 18:33:53 -07:00
H. Peter Anvin
3e555483b3 labels, outelf: remove casts for allocations
Remove casts from allocations.  This is simply Not How To Do Things:
every cast carries a potential risk of being a toxic type misuse
(e.g. pointer as integer) and so any unnecessary cast is actively
harmful.

Note that a lot of allocations here are completely unnecessary: the
core code now guarantees that all filenames are permanently allocated
for the duration of the assembly, and so should be turned into const
char * without any further allocation.  Any remaining malloc+strcpy
should be turned into nasm_strdup(), and nasm_new[n]() used whereever
possible.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-23 17:02:46 -07:00
Chang S. Bae
4dfbd9aec5 macho: add file path to the dwarf debugging output
Apple's linker requires file path along with file name to produce
debug notes.

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-23 16:46:45 -07:00
H. Peter Anvin
9f94136c33 NASM 2.13rc21 2017-04-20 18:04:42 -07:00
H. Peter Anvin
57e08284a6 doc, html: switch to a columnar layout for a very wide window
If we open in a very wide window, split the text into columns so it
can actually be conveniently read.

Also, change the body margin to 8px, as that seems to be the more
common browser default.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-20 18:03:10 -07:00
Henrik Gramner
16d4db3aab Fix ModR/M.mod for EVEX instructions
It was incorrectly set to 01b in some cases when where it should be 10b.

Fixes BR 3392402.

Signed-off-by: Henrik Gramner <henrik@gramner.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-20 17:48:44 -07:00
H. Peter Anvin
32b9824f5c doc: formatting fixes to the warnings documentation
Formatting and language consistency cleanups to the sections about
disabling and enabling warning classes.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-20 02:03:59 -07:00
H. Peter Anvin
c2f371c0b9 Merge branch 'master' of ssh://repo.or.cz/nasm 2017-04-20 01:39:42 -07:00
H. Peter Anvin
4d993a1c03 doc: update links to ABI documents
We have a separate namespace for ABI documents.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-20 01:36:57 -07:00
H. Peter Anvin
b68edcac72 tools/release: make doesn't like MAKE in the environment, so call it makej
make really doesn't like something called MAKE in the environment, so
call it makej like buildall.sh on the server.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-18 10:52:05 -07:00
H. Peter Anvin
5f46eea191 tools/release: don't double-quote $MAKE
We actually want it broken down into words... (e.g. make -jX).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-18 10:39:07 -07:00
H. Peter Anvin
ab8c1d2ee5 tools/release: allow invoking make as a parallel build
If the variable MAKE is set in the environment, use it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2017-04-18 10:35:15 -07:00
H. Peter Anvin
7e9d4fdf8d nasmdoc.pdf: always begin a chapter on an odd page
If we want to print the document, we really want each chapter to start
on an odd (right-facing) page; otherwise it gets rather strange.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-17 16:01:31 -07:00
H. Peter Anvin
84deac219d rdoff.c: one more unsafe use of fread()
Use the same error pattern as the rest of the calls in this function.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-17 14:25:13 -07:00
H. Peter Anvin
6edeb335f0 rdflib.c: fix(?) one more unsafe use of fread()
It isn't 100% clear what is the right thing to do in this particular
case, so this is my best attempt...

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-17 14:22:32 -07:00
H. Peter Anvin
f20f1878f5 NASM 2.13rc20 2017-04-17 14:15:51 -07:00
H. Peter Anvin
3d6d7331ab rdoff: add back rdfutils.h missing from previous checkin
Checkin 8dc965347d was missing this
file, causing obvious failures.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-17 14:14:26 -07:00
H. Peter Anvin
cea308b3dc changes.src: document DWARF support for Mach-O
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-17 14:05:51 -07:00
H. Peter Anvin
3e66fcd8f8 NASM 2.13rc19 2017-04-17 14:02:38 -07:00
Chang S. Bae
5431732560 Fix errors uncovered by clang warnings
1. One incorrect variable use(!)
2. One possibly uninitialized variable.

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-17 14:01:33 -07:00
Chang S. Bae
d685bdd65c outmacho: dwarf debug (4/4)
line information added in dwarf output

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-17 14:00:20 -07:00
Chang S. Bae
2c2272a86d outmacho: dwarf debug (3/4)
debug information sections now generated.

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-17 14:00:20 -07:00
Chang S. Bae
6d14596476 outmacho: dwarf debug (2/4)
file and section list added for managing debug line info
also, now macho parts get to call debug interfaces

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-17 14:00:18 -07:00
Chang S. Bae
6a912a3c90 outmacho: dwarf debug (1/4)
skeletion interfaces

MachO Dwarf is basically porting of ELF's DWARF implementations
and it includes debug line information and some debug meta data

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-17 14:00:16 -07:00
Chang S. Bae
3b26c45e7f outmacho: align filesize together with vmsize
According to the Mach-O spec this should not be necessary for .o
files, but it seems that we get problems with extracted dsyms if this
is not done, so do this for now -- we might be able to troubleshoot
this later.

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-17 14:00:07 -07:00
H. Peter Anvin
ef1ea87c3c Merge branch 'master' of ssh://repo.or.cz/nasm 2017-04-17 13:57:59 -07:00
H. Peter Anvin
8dc965347d rdoff: use nasm-provided safe memory allocation and I/O
We already have abort-on-error memory allocation and I/O operations in
nasmlib, so use them for rdoff as well.

Delete long-since-obsolete rdoff Mkfiles directory.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2017-04-17 13:56:50 -07:00