Commit graph

3085 commits

Author SHA1 Message Date
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
H. Peter Anvin
54469e27d0 outmacho: remove unused debugging functions
Remove unused debugging functions, and the _unused macro which turned
out to cause compilation problems on Linux/PowerPC.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-03 12:29:25 -08:00
H. Peter Anvin
83df633f07 Merge branch 'nasm-2.12.xx'
Resolved Conflicts:
	output/outelf32.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-02 11:00:52 -08:00
H. Peter Anvin
140c214ad0 md5: use "compiler.h", WORDS_LITTLEENDIAN and make functions static
Look for WORDS_LITTLEENDIAN instead of the gcc-specific __BYTE_ORDER.
Use our existing "compiler.h" portability layer.
Make functions which are not exported static.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-02 10:54:24 -08:00
H. Peter Anvin
53f1559c06 Remove unnecessary C99-isms
In order to make it more likely to compile cleanly with "C90 plus long
long" style compilers, remove existing constructs (mostly commas at
the end of enums) that aren't compliant.

Ironically enough this was most likely an unintentional omission in
C90...

From master branch checkin 7214d18b40

Resolved Conflicts:
	output/outelf32.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-02 10:48:53 -08:00
H. Peter Anvin
7214d18b40 Remove unnecessary C99-isms
In order to make it more likely to compile cleanly with "C90 plus long
long" style compilers, make gcc warn for incompatible constructs.
Remove existing constructs (mostly commas at the end of enums) that
aren't compliant.

Ironically enough this was most likely an unintentional omission in
C90...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-01 22:43:51 -08:00
H. Peter Anvin
25da6eaf43 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.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-01 22:20:10 -08:00
H. Peter Anvin
ef63588eb4 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.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-01 21:53:09 -08:00
H. Peter Anvin
b9c1ca7e8d Merge branch 'nasm-2.12.xx'
Resolved Conflicts:
	configure.in
	output/codeview.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-03-01 21:51:40 -08:00
H. Peter Anvin
8d9f591005 configure.in: add -fwrapv to gcc and compatible compilers
Add the -fwrapv to gcc and compatible C compilers, to enforce
deterministic 2's-complement behavior with regards to signed and
unsigned integer types.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-02-27 00:15:13 -08:00
Knut St. Osmundsen
52ae33a2cb Remove unnecessary C99 features which break Visual C++ 2010
Fixes Visual C++ 2010 breakage in recently added Codeview 8 code;
these are C99 features which were not necessary to introduce.

Signed-off-by: Knut St. Osmundsen <bird-nasm@anduin.net>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-02-26 23:44:10 -08:00
Knut St. Osmundsen
136c4bc73b doc: Remove --allow-64-bit leftover from help text.
Removes help text left behind when --allow-64-bit was turned into
default behavior + warning.

Signed-off-by: Knut St. Osmundsen <bird-nasm@anduin.net>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-02-26 23:44:07 -08:00
H. Peter Anvin
8aba13b51f Merge branch 'master' into elfmerge
Resolved Conflicts:
	output/outmacho.c

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-26 20:51:46 -08:00
H. Peter Anvin
b170a0aad5 NASM 2.12 2016-02-26 20:48:52 -08:00
H. Peter Anvin
a85060520a changes.src: document Win64 build
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-26 20:47:45 -08:00
H. Peter Anvin
96edc04a39 nasm.spec.in: document buildrequires properly
We need asciidoc, xmlto, ghostscript, texinfo in order to be able to
build the documentation.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-02-23 02:01:17 -08:00
H. Peter Anvin
d015a9f39e NASM 2.12rc7 2016-02-23 00:26:26 -08:00
H. Peter Anvin
ed8eb56546 outmacho: correctly handle references between sections
Correctly generate references between sections.  The previous
version would work correctly as long as all relative references
came from the first section, which is usually __TEXT,__text and
so it usually worked.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-23 00:13:49 -08:00
H. Peter Anvin
b7511971dc nasm.spec: change release to 0 to avoid distro conflicts
Change the RPM release number to 0 so that distribution-produced RPMs
will take precedence in all cases.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-02-22 01:18:33 -08:00
H. Peter Anvin
95b43676c3 Merge branch 'master' into elfmerge 2016-02-21 21:24:38 -08:00
H. Peter Anvin
ec82d7a92b configure: smarter way to handle fseeko() searching
Better handling of the replacement for fseeko() in its absence; also
look for the Windows _fseeki64() function.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-02-21 21:20:45 -08:00
H. Peter Anvin
d4e001db67 NASM 2.12rc6 2016-02-21 21:07:35 -08:00
H. Peter Anvin
1ac2c2f55f misc/tag-release: default to --no-push
--no-push is by far the safer default.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-02-21 21:07:11 -08:00