freebsd-ports/devel/nasm/files/patch-output_outelf32.c
Adam Weinberger cff9f73b44 Add a patch, taken from the nasm repo, written by emaste, that fixes
alignment on 64-bit archs.

From emaste:

Essentially what happens is that nasm creates object files that have
section contents aligned to 16 bytes, but it only specifies that the
section requires 4 byte alignment. It seems that the GNU tools (strip
at least) silently correct this to 8, which is what it should be.

This fix only affects FreeBSD -CURRENT in combination with another
(not yet committed) fix to libtool. On stable/10 and earlier GNU ld
masks the nasm bug, and without the libtool fix we don't yet try to
strip debug info from object files in -CURRENT.

PORTREVISION bump for this.

Also, while here, rename two other patches to have proper separators
(_ instead of +).

And, donate this port back to ports@. It is used by many other ports
so it deserves to be maintained by the collective.
2015-04-19 19:06:55 +00:00

11 lines
448 B
C

--- output/outelf32.c.orig
+++ output/outelf32.c
@@ -1702,7 +1702,7 @@
* the source-file, the n_desc field should be set to the number
* of remaining stabs
*/
- WRITE_STAB(sptr, fileidx[0], 0, 0, 0, strlen(allfiles[0] + 12));
+ WRITE_STAB(sptr, fileidx[0], 0, 0, 0, stabstrlen);
/* this is the stab for the main source file */
WRITE_STAB(sptr, fileidx[mainfileindex], N_SO, 0, 0, 0);