Commit graph

3257 commits

Author SHA1 Message Date
H. Peter Anvin
b156bc8c61 autoconf: rename configure.in to configure.ac
In accordance with current practice, rename configure.in to configure.ac.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-03-16 02:13:43 -07:00
H. Peter Anvin
89c1770e14 autoconf improvements: @SET_MAKE@, library extension
Minor autoconf corner cases.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-03-09 14:11:40 -08:00
H. Peter Anvin
65808c983a version: call this branch 2.13rc0
Call this branch 2.13rc0 for now, so the daily build release numbers
make more sense.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 12:31:04 -08:00
H. Peter Anvin
3ef4f00d5a lib: split library into stdlib and nasmlib; header handling fixes
Split lib/ into nasmlib/ (for nasm-specific functions) and stdlib/
(for replacements for C library functions which may be missing.)

Rename the ersatz inttypes.h to nasmint.h so we can use a simple test
in compiler.h instead of dealing with include path magic.

Remove tests in configure.in for ancient missing functions (which will
break the build anyway.)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 12:20:02 -08:00
H. Peter Anvin
7ab5595347 Move fseeko/ftello/off_t handling from compiler.h into lib/file.c
This should only matter in this very specific file, so let's not make
*everything* depend on it...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 02:23:23 -08:00
H. Peter Anvin
2bc0ab38a2 Move version strings to a separate header
Move version strings to a separate header, instead of needing to
include nasm.h in places where it probably really doesn't belong.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 02:17:36 -08:00
H. Peter Anvin
cc147f79e4 Makefiles: use actual archive managers
There is no reason to not use an archive manager to build our
executables.  If there really are systems which don't have any kind of
archive manager, we can simply link all the objects.

This also drops any use of configure to detect library objects.
Instead just use HAVE_* and let the archive manager delete them.

A lot of additional functions could be declared library functions and
reorganized.

***FIX*** Mkfiles/*.mak have not yet been updated.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 02:08:44 -08:00
H. Peter Anvin
bdae10bee2 Move file I/O related functions out of nasmlib.c
nasmlib.[ch] desperately need to be broken up into smaller chunks.

Break file I/O related functions out into file.c, so at least we can
avoid the problem with P_WAIT being defined in <io.h> on Windows but
is also used as a prefix constant in "nasm.h".

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 01:22:13 -08:00
H. Peter Anvin
1917f45ec2 Merge remote-tracking branch 'origin/nasm-2.12.xx'
Resolved Conflicts:
	output/codeview.c
	output/outelf32.c
	output/outelf64.c
	output/outelfx32.c
	output/outform.c
	output/outform.h
	output/outieee.c
	output/outobj.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 01:08:53 -08:00
H. Peter Anvin
4bef68a84e msvc.mak: /Ox and /Oy are redundant with /O2
Per the MSVC++ docs, /Ox and /Oy are redundant with /O2, and the docs
recommend that they do not be used together.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-08 00:50:13 -08:00
H. Peter Anvin
134874848c nasmdoc.src: remove unimplemented %comment directive
%comment..%endcomment were never implemented, remove from the
documentation.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-07 23:58:11 -08:00
H. Peter Anvin
8da30d0266 Makefiles: run "make alldeps"
Automatic update of dependencies.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-07 23:23:19 -08:00
H. Peter Anvin
283b3fb15a Defer debug format search until after command line parsing
Avoid funnies with ordering of debug format selection by deferring
debug format search until after command line processing.  Also permit
the -gformat syntax used by many C compilers.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-07 23:20:00 -08:00
H. Peter Anvin
477ae4419c ofmt: get rid of the debuginfo parameter to ofmt->cleanup()
Get rid of the completely pointless "debuginfo" parameter to
ofmt->cleanup().  Most backends completely ignore it, and the two that
care (obj, ieee) can simply test dfmt instead.

Also, dfmt is never NULL, so any test for a NULL dfmt is bogus.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-07 22:55:43 -08:00
H. Peter Anvin
3ab8c5f9c6 NASM 2.12.01rc2 2016-03-07 22:18:29 -08:00
H. Peter Anvin
2a74d84d1c doc: document fix to the codeview output format
Document the label fix; although a global error, it was user-visible
in the Codeview backend so document it as such.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Jim Kukunas <james.t.kukunas@linux.intel.com>
2016-03-07 22:17:10 -08:00
H. Peter Anvin
c941a35e58 outelf*: remove null debug functions
Instead of duplicating empty functions, use the corresponding
null_debug_* functions.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-07 22:12:19 -08:00
H. Peter Anvin
bc42cbe363 codeview: remove hack for handling local labels
Now when labels are properly concatenated in common code, there is no
reason for the debugging backend to need to be aware of local
symbols.  We don't have to consider ..[^@] special symbols either, as
they are now filtered in labels.c.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Debugged-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
2016-03-07 22:06:16 -08:00
H. Peter Anvin
3def9fcb59 outieee: no need to filter .. symbols in the debug format anymore
labels.c now filter ..[^@] special symbols from the debug backend,
so we don't have to open-code that everywhere.

In the actual output format, don't treat ..@ symbols as special.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Jim Kukunas <james.t.kukunas@linux.intel.com>
2016-03-07 22:04:54 -08:00
H. Peter Anvin
5686a65fe9 outobj: no need to filter .. symbols in the debug format anymore
labels.c now filter ..[^@] special symbols from the debug backend, so
we don't have to open-code that everywhere.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Jim Kukunas <james.t.kukunas@linux.intel.com>
2016-03-07 22:03:50 -08:00
H. Peter Anvin
fc0ff223b2 labels: emit the same label name to the output and debug backends!!
When a local label was seen, the debug backend would not receive the
full label name!  In order to both simplify the code and avoid this
kind of discrepancy again, make both the output and debug format calls
from a common static function.

However, none of the current debug format backends want to see NASM
special symbols (that start with .. but not ..@) so filter those from
the debug backend.

Finally, fix an incorrect comment in nasm.h: the debug format is
called *after* the output format.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Jim Kukunas <james.t.kukunas@linux.intel.com>
2016-03-07 22:00:01 -08:00
Jim Kukunas
63c42f08f7 codeview: Don't treat labels starting with .. as local labels
For local labels, starting with '.', the label name is concatenated with
the previous non-local label to produce a label that can be accessed from
elsewhere. This is the name we want to generate debug info for.

Labels starting with ".." are special and shouldn't be concatenated.

Fix Bugzilla #3392342

Signed-off-by: Jim Kukunas <james.t.kukunas@linux.intel.com>
2016-03-07 19:36:41 -05:00
H. Peter Anvin
6224033738 Merge remote-tracking branch 'origin/nasm-2.12.xx'
Resolved Conflicts:
	.gitignore
	Makefile.in
	assemble.c
	configure.in
	eval.c
	float.c
	listing.c
	nasm.c
	nasmlib.c
	output/outform.h
	preproc.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-07 12:15:40 -08:00
H. Peter Anvin
172b840aa3 Change nasmlist/ListGen to lfmt/struct lfmt
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>
2016-03-07 12:08:48 -08:00
H. Peter Anvin
335c4857ce Remove ofmt->current_dfmt indirection
Move ofmt->current_dfmt into a separate global variable.  This
should allow us to make ofmt readonly and removes some additional
gratuitious differences between backends.

From master branch checkin a7bc15dd0a

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-03-07 12:07:50 -08:00
H. Peter Anvin
0b7969e9a9 Merge branch 'nasm-2.12.xx'
Resolved Conflicts:
	compiler.h

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-07 11:50:38 -08:00
H. Peter Anvin
ccab91f826 Merge branch 'nasm-2.12.xx' of ssh://repo.or.cz/srv/git/nasm into nasm-2.12.xx 2016-03-07 11:37:16 -08:00
H. Peter Anvin
3c6300738c NASM 2.12.01rc1 2016-03-07 11:36:46 -08:00
Cyrill Gorcunov
6832acb6e3 doc: changes -- Don't forget to mention MONITORX and MWAITX
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-03-07 22:36:18 +03:00
Cyrill Gorcunov
f34cf39459 doc: changes -- Add CLZERO into the list
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-03-07 22:32:31 +03:00
H. Peter Anvin
cfd56ebb81 configure.in: disable -Wwrite-strings for now
At the moment, NASM is not clean with -Wwrite-strings due to passing
string constants to functions that under some conditions modify their
arguments.  This is problematic if nothing else for guaranteeing
correctness, but will take some work to remedy.  In the meantime,
disable -Wwrite-strings.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-06 21:44:14 -08:00
Cyrill Gorcunov
b854be2772 insns.dat: Add CLZERO AMD instruction
https://sourceware.org/ml/binutils/2015-03/msg00078.html
http://bugzilla.nasm.us/show_bug.cgi?id=3392337

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-03-05 12:39:06 +03:00
Cyrill Gorcunov
f8b33e9191 nsis: Update icons
To match the main logo.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-03-05 11:59:03 +03:00
Cyrill Gorcunov
a19c22ec90 insns.dat: Add MONITORX/MWAITX AMD instructions
http://bugzilla.nasm.us/show_bug.cgi?id=3392336

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-03-05 01:36:49 +03:00
H. Peter Anvin
52e8646d17 configure: enable additional code cleanliness warnings
We are supposed to handle compiling on a "C90 plus long long"
compiler, so make gcc (our most common development platform compiler)
complain when we don't.

However, suppress the complaints about the Microsoft definitions of
the <inttypes.h> strings.

From master branch checkin 25da6eaf43,
except that -Wwrite-strings is omitted; making the code base
-Wwrite-strings clean is going to take additional work.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-04 11:14:35 -08:00
H. Peter Anvin
409e2df1f2 configure.in: if byte order is unknown or ill defined, don't define any
We can always operate correctly if neither WORDS_BIGENDIAN nor
WORDS_LITTLEENDIAN are defined, so if the word order is either
indeterminable or universal (the compiler generates both bigendian and
litteendian output from the same sources) then define neither.

From master branch checkin ef63588eb4

Resolved Conflicts:
	configure.in

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-04 11:11:37 -08:00
H. Peter Anvin
d414e5f4cd test/cv8struc.asm: fix missing comma in test case
Fix a missing comma in the test case which make the test case bogus.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-04 10:59:13 -08:00
H. Peter Anvin
f3e5494a6a Merge branch 'nsis' into nasm-2.12.xx
Improve the automation in generating NSIS installers for Windows.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-04 10:58:14 -08:00
H. Peter Anvin
c073fc095f changes.src: document fix for the no list file error
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-04 10:58:03 -08:00
Cyrill Gorcunov
92c02bb50d listing: Don't try to open non-specified listing
By default we setup @listname to '\0' and if has
not been specified in command line it is passed
in this form into list_init() which cause

 | [cyrill@uranus nasm.git] ./nasm -felf64 t.asm
 | nasm: error: unable to open listing file `'

So make a proper test here.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2016-03-04 20:44:42 +03:00
H. Peter Anvin
d4c67b1597 nsis: make nsis output automatically select architecture
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>
2016-03-03 21:37:37 -08:00
H. Peter Anvin
a9a1b5c318 test: add test for cv8 structure bug (BR 3392342 and 3392343)
Add test case for bugs 3392342 and 3392343.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-03 17:05:20 -08:00
H. Peter Anvin
bd464749d1 Output preprocessor warnings to the listing file
Most preprocessor warnings are ERR_PASS1, but we want to see them in
the listing file too.  If we make it to the code-generation pass,
ignore ERR_PASS* for the purpose of emitting warnings to the list
file.

While we are at it, allow ERR_DEBUG to specify ERR_PASS* too.

From master branch checkin 4a8d10c1a0

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-03-03 15:22:03 -08:00
H. Peter Anvin
d6d1b65826 Additional ERR_PANIC/ERR_FATAL -> nasm_panic/nasm_fatal changes
Additional places where we can change ERR_PANIC and ERR_FATAL to
nasm_panic and nasm_fatal.  Note that nasm_panic and nasm_fatal should
*aways* be expected to be fatal; they should never be used in a
suppressed context.  It is critical that we verify that this doesn't
break anything.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-03 15:22:03 -08:00
H. Peter Anvin
215186fe82 Get rid of a bunch of unnecessary indirections
We pass around a whole bunch of function pointers in arguments,
which then just get stashed in static variables.  Clean this mess
up and in particular handle the error management in the preprocessor
using nasm_set_verror() which already exists.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>

From master branch checkin 130736c0cf

Resolved Conflicts:
	nasm.c
	preproc-nop.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-03 15:22:03 -08:00
H. Peter Anvin
41087068aa Replace nasm_error(ERR_FATAL/ERR_PANIC) with nasm_fatal/nasm_panic
Replace all instances of ERR_FATAL or ERR_PANIC with nasm_fatal or
nasm_panic so the compiler knows that these functions cannot return,
*and* we trigger abort() if we were to ever violate that constraint.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-03 15:22:02 -08:00
H. Peter Anvin
7f087afc66 nasmlib: add nasm_fatal() like nasm_panic()
Just like nasm_panic(), nasm_fatal() tells the compiler that
we can never return from this call.

From master branch checkin bbbf508394

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-03-03 15:22:02 -08:00
H. Peter Anvin
c5b2de0964 codeview: be a bit more explicit about the nature of a panic
When we have to die due to an assertion violation, then show the
missing symbol.  Also, use nasm_panic() rather than nasm_assert() for
this purpose.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-03 14:15:41 -08:00
H. Peter Anvin
c5b95dd5d4 changes.src: begin documentation for 2.12.01
We probably ought to release 2.12.01 in the short term.  So far the
changes that have accumulated have all been build fixes.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-03 12:43:02 -08:00
H. Peter Anvin
fdf0d07310 Make --disable-werror work
autoconf's handling of --without and --disable are a bit
counterintuitive: instead of calling the "not given" branch of the
conditional, they instead call the "given" part of the conditional
with an argument of "no".  Make --disable-werror work as expected.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-03 12:39:02 -08:00