The code to handle building in a separate directory had seriously
bitrotted. This contains a number of fixes to make it possible,
including bits like the documentation which never worked in the past.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
The old code for keeping track of source file name and line was
confused as hell about ownership of the strings, and it is pretty
clear we leaked that information all over the place.
Instead, use a hash table to keep a copy of each string as necessary,
and simply make references to a string pool that we keep until the end
of the assembly session.
This pool probably should be unified with the list of dependency
files, and so on, but that is for the development branch.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
For consistency with ofmt/dfmt, change the listing structure
to "struct lfmt" and "lfmt" and move it to listing.h.
From master branch commit 8ac25aa020
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Make the NSIS output automatically select the output architecture to
generate the proper filename and, much more importantly, set up the
proper default install directory.
This requires Perl as well as makensis to be present in order to make
an installer, but that doesn't really seem like a too onerous of a
requirement (NSIS being the big external dependency here.)
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Merge the two Mach-O backends for cleanliness and maintainability.
This should also make the recent fixes to MachO-64 available in
MachO-32.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
The previous commit contained unnecessary dependencies for realpath.c
so run make alldeps to remove those.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Try harder to nasm_realpath() to be as portable as possible. Move it
to a separate file since it has gotten complex enough that it is
cleaner that way.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Codeview is a debug format for win32/win64 PE/COFF files. It adds two sections,
.debug$S (symbols) and .debug$T (types), to the generated object file. These
sections are then used by the linker to generate a PDB file which can be used
by various debuggers (WinDbg, Visual Studio, etc).
Signed-off-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This implementation was written by Colin Plumb and
is in the public domain.
I've updated it to use stdint.h and the standard C types rather than
sys/types.h for portability.
Signed-off-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Multi-dependencies don't work as expected, especially not across Make
versions, this is why we don't use them and read the instructions list
multiple times.
iflag.h has a lot of static content, so factor out the static content.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
We've 'test' target in toplevel Makefile, lets be
complete and allow to generate "golden" tests from
toplevel as well.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Consolidated two separate but similar functions in nasm and ndisasm
into a commonly linked source code.
To encode and decode the compressed displacement (disp8*N) for EVEX,
N value should be derived using various conditions.
Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
This reverts commit b6c7291b3d.
We already have this cleanup stage in "cleaner" target, I managed
to miss it.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
"make dist" (tarball generation) really should include "make alldeps"
so the Makefile dependencies are correct.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This reverts commit 99427bdb6c.
We don't include generated files in the repository, instead we should
pregenerate them for the tarball generation, just as we do for the
Perl-generated files.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
It's been reported that force people to install
asciidoc for man pages generation is not acceptible.
Just ship them pregenerated.
http://bugzilla.nasm.us/show_bug.cgi?id=3392262
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
It's a bit more than that, also TRACE=1 make
flag added to run this facility on and off
at compiling time.
Debug feature only, doesn't affect regular users.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Michael proposed to run
| sed -i -e '/^.PHONY: all/s/$/ test/' Makefile.in
since we have test/ directory. Good idea.
Reported-by: Michael Sterrett
Patch-by: Michael Sterrett
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Apparently some people still care about compiling native on MS-DOS,
and we don't have a significant number of files which need adjustment.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Add ilog2_{32,64}() and alignlog2_{32,64}() ... the latter is intended
for alignment statements and return -1 for non-power-of-2 other than 0
(which returns 0).
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Also made Makefile.in to handle dependency.
There are some makefiles in Mkfiles\ should
be fixed as well.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Merge elfcommon.h, elf32.h, elf64.h into
single elf.h -- we do support both elf32
and elf64 anyway. Let put them into common
place.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Add strlcpy() function and implementation, and use configure to detect
if strlcpy() is natively available on the system.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Hash all directives, even the ones that are backend-specific,
and instead pass the backend an already-parsed directive number.
Furthermore, unify null functions across various backends.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>