RDOFF has been deprecated as it has unfixable problems, and has been
announced that it will be killed off in NASM 2.16.
This deletes it once and for all.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Fix circular dependency on asm/warnings.c by factoring out
warnings.$(O) from the dependencies, and use a separate <file>.time
which "generate" the main source file as a "side effect", giving us a
null target.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
NASM 2.15.04
Conflicts:
asm/listing.h
asm/pptok.pl
asm/preproc.c
version
This doesn't pass travis test 3392711, which is using an extremely odd
construct of %?? in the middle of an argument sequence for an smacro
while not being in a macro itself, and expecting it to expand to the
macro name. This seems to *really* confuse the master branch.
Resolve this later...
The warning files are generated by a script, but the scripts is fast
enough run every time a C file is updated. To prevent having to
rebuild every file, however, make the generation script only actually
modify the file if it has changed.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Fold the prepreprocessor and the nop preprocessor into the main
preprocessor. This means handling # cpp-like lines and TASM
compatibility tokens in the preprocessor proper, but that is really
not very hard to do.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
config/unconfig.h really is no different than the other perlreq files,
so move it into the Makefile. This has the extra advantage that
config/unconfig.h no longer needs to be kept in the source repository.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Add warnings.src to PERLREQ. If this isn't done, warnings.src ends up
in the xdoc tarball rather than the release tarball, which means that
unless the user can "make warnings" manually (which requires Perl)
then they can't build the documentation.
As this only affects the documentation build, it probably does not
warrant a point release.
Add a few more extensions to the list of recognized binary extensions
for the purpose of generating a .zip file with DOS line ending
conventions.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Haiku apparently wants to include <float.h> rather than
"float.h". Rename float.[ch] to floats.[ch] to avoid unnecessary
namespace confusion.
Reported-by: <alaviss0+nasm@gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
If we have external dependencies, we need Makefile.dep to exist;
this forces make to invoke the Makefile.dep target if this file is
missing.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
There is no point to run config.status --recheck just because
we have changed Makefile.in. Just run config.status.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Set an expression descent limit to 8192, which is more reasonable to
expect to work on most platforms. Furthermore, if getrlimit() exists,
then try to use it to see if we need to further limit the size.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Significantly improve the portability/reliability of a general
make command. Build a .pdf.xz version of the documentation,
using an uncompressed pdf as basis.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Move the definitions to a separate file, in order to separate code
from data better.
We can auto-generate more information about the instruction flags, so
let's do so.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
It is extremely desirable to allow the user fine-grained control of
warnings, but this has been complicated by the fact that a warning
class has had to be defined in no less than three places (error.h,
error.c, nasmdoc.src) before it can be used in source code. Instead,
use a script to define these via magic comments at the point of use.
This hopefully will encourage creating new classes as needed.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
It is possible on memory exhaustion that nasm_fatal() might cause
another allocation error, thus calling nasm_alloc_failed() again. If
we find us in nasm_alloc_failed() for a second time, try to get a
message out and then call abort().
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Add a version of (v)asprintf(), which allocates a string on the
heap. Unlike the standard version of (v)asprintf(), we return the
pointer; if one wants the length of the string then one can simply use
the %n pattern.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
The currently-unused strtbl was basically a slightly different version
of strlist, with the find and linearize capabilities. Merge these two
together by augmenting strlist to have the same capabilities.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Create our own ctype table where we can do the tests we want to do
cheaply, instead of calling ctype functions and then adding additional
tests all over the code.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Apparently it isn't just NMAKE which is sensitive to the ordering of
.SUFFIXES, it apparently applies just as well to Unix make.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
1. The mkdep.pl program didn't handle excluded dependencies correctly,
causing it to error out due to config/config.h not existing.
2. NMAKE is sensitive to the order suffixes appear in .SUFFIXES,
causing it to try to use the builtin rule .c.exe instead of
.c.obj -> .obj.exe.
3. NMAKE doesn't handle the && operator between commands.
4. The !ifdef jungle around dependency generation was wrong.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Get rid of remaining dependencies on FILENAME_MAX, which ought to have
been removed a long time ago.
Remove ofmt->filename(); all implementations pretty much do the same
thing and there is absolutely no reason to duplicate that
functionality all over the place.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Make further autoconf rule improvements and update the required
version of autoconf to 2.69. That version is now 5+ years old and
although there might be older versions which have the prerequisite
macros they are known to have lots of bugs, and we can't really test
them.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Make it possible to keep dependency information separate from the
Makefiles, so we don't have to deal with it noisifying the git logs.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
For many (most?) targets these will be very small functions, so inline
them. However, just in case make these external library functions.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This is a fix for a4f6ca5a33
- We should not use sole CPPFLAGS when compiling,
but rather merge it into ALL_CFLAGS
- nasm.spec.in should use DESTDIR since
INSTALLROOT now renamed to it
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
* CPPFLAGS is a user variable and should be respected
when compiling .c files. Think of -D_FORTIFY_SOURCE=2.
* Pass ALL_CFLAGS when linking too. This is recommended
for certain edge cases (-flto)
* Use DESTDIR instead of INSTALLROOT for staging dir
Every other build system (Automake, CMake, Meson) uses
DESTDIR. This integrates better into distro and other
build systems that have standard hooks for DESTDIR.
* $(MAKE) -C <dir> is better than cd'ing into a <dir>
* Use Autoconf's ${docdir} and ${htmldir} for installing
the documentation. This makes handling documentation
easier and respects user choice.
Signed-off-by: David Seifert <soap@gentoo.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Move byte order handling functions to their own header file, and try
to be more specific about how exactly to handle things.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Several output formats use "string tables", which is a collection of
null-terminated (C) strings which are referenced by a byte offset into
the string table. A single string can be referenced an arbitrary
number of times.
As this is quite simple to implement with a hash table, we do exactly
that.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
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>
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>
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>