Commit graph

3220 commits

Author SHA1 Message Date
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
H. Peter Anvin
021b10ca14 misc/tag-release: die on unknown options
If someone specifies an unknown option, they proabably typoed
something.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-02-21 21:05:16 -08:00
H. Peter Anvin
408b200684 NASM --rel=2.12rc6 2016-02-21 21:03:47 -08:00
H. Peter Anvin
a222d21138 outmacho: make a best effort at separating SIGNED from BRANCH relocs
For 64 bits, a BRANCH reloc is sometimes needed to fix up PIC
problems.  Make a best effort at generating BRANCH relocs just as
we make a best effort at distinguishing GOTLOAD from GOT.

This needs to be replaced with information from the assembler to
the backend.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-21 20:56:19 -08:00
H. Peter Anvin
73b22f5c1c Windows portability fixes
Windows needs strsep() and defines a P_WAIT constant that we
need to undefine.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 14:40:37 -08:00
H. Peter Anvin
e65e81b172 nasmlib: allow writing of sparse files
On systems that support it, allow the writing of sparse files.
This can be useful for some file formats (like binary, or ELF if the
alignments are very large) that can contain large amounts of zeroes.

This is not inherently portable code, so condition it on certain known
systems.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 14:24:40 -08:00
H. Peter Anvin
28ec7d1ddf Merge branch 'master' into elfmerge
Resolved Conflicts:
	configure.in

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 13:57:03 -08:00
H. Peter Anvin
114ba75f7b test/Makefile: add a rule for nasm itself
If NASM needs to be rebuilt, build it in the proper directory.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 13:06:04 -08:00
H. Peter Anvin
44a609b203 configure.in: add --enable-werror option
Add an option to compile with -Werror, useful for development.

Change --with-ccache to --enable-ccache to match guidelines.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 12:09:31 -08:00
H. Peter Anvin
b423c02ad2 Platform compatibility improvements
Windows: indicate that we support multibyte character sets in file
names.

Unix: support gigantic input and output files.  Might be useful
especially in the presence of the INCBIN directive.

Signed-off-by: H. Peter Anvin <hpa@linux.kernel.org>
2016-02-18 11:57:53 -08:00
H. Peter Anvin
dea76e7779 NASM 2.12rc5 2016-02-18 11:50:42 -08:00
H. Peter Anvin
277308f1f3 doc: update documentation for a version 2.12 release
Add documentation updates for version 2.12.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 11:49:33 -08:00
H. Peter Anvin
5f0e601f98 doc/rdsrc.pl: escape braces in regular expression to support newer Perl
Newer versions of Perl require literal braces in regular expressions
to be escaped.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 11:48:12 -08:00
H. Peter Anvin
4afa730c03 outmacho: default section flags should depend on section name only
The __TEXT segment in particular contains both code and data.  The
most consistent thing is to look only at the section name, and have
the same behavior across sections.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 10:55:00 -08:00
H. Peter Anvin
2530a10b56 Make a few more data items static and const
A few more data items that should be static and const.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 02:28:15 -08:00
H. Peter Anvin
a4973cf997 A few more debugging format arrays to mark const
Making more debugging format array const.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2016-02-18 02:25:26 -08:00