all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Nelson H. F. Beebe" <beebe@math.utah.edu>
To: 23764@debbugs.gnu.org
Cc: beebe@math.utah.edu
Subject: bug#23764: emacs-25.0.95 fails to build on DragonFlyBSD, and an easy repair
Date: Mon, 13 Jun 2016 14:10:07 -0600	[thread overview]
Message-ID: <CMM.0.96.0.1465848607.beebe@gamma.math.utah.edu> (raw)

emacs-25.0.95 fails to build on DragonFlyBSD 3.8, 3.9, 4.0, 4.2, 4.4,
and 4.6, independent of the compiler (various gcc or clang versions)
used.

On each system, src/alloc.c fails to compile:

	CC       alloc.o
	alloc.c:474:32: error: macro "ALIGN" passed 2 arguments, but takes just 1
	 ALIGN (void *ptr, int alignment)
					^
	alloc.c:475:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '' token
	 {
	 ^
	alloc.c: In function 'pure_alloc':
	alloc.c:5171:66: error: macro "ALIGN" passed 2 arguments, but takes just 1
	       result = ALIGN (purebeg + pure_bytes_used_lisp, GCALIGNMENT);
									  ^
	alloc.c:5171:16: error: 'ALIGN' undeclared (first use in this function)
	       result = ALIGN (purebeg + pure_bytes_used_lisp, GCALIGNMENT);
			^
	alloc.c:5171:16: note: each undeclared identifier is reported only once for each function it appears in
	Makefile:378: recipe for target 'alloc.o' failed
	gmake[1]: [alloc.o] Error 1 (ignored)

The conflict with the all-to-generic macro name ALIGN() appears to
come from these DragonFlyBSD definitions:

	% find /usr/include -type f | xargs grep '[^_A-Z]_ALIGN[^_A-Z]'
	/usr/include/cpu/param.h:#define _ALIGN(p)      (((unsigned long)(p) + _ALIGNBYTES) & ~_ALIGNBYTES)
	/usr/include/cpu/param.h:#define ALIGN(p)       _ALIGN(p)

whereas alloc.c has

	static void *
	ALIGN (void *ptr, int alignment)
	{
	  return (void *) ROUNDUP ((uintptr_t) ptr, alignment);
	}

As an experiment, I made these patches to alloc.c on DragonFlyBSD 4.6:

	% diff alloc.c.org alloc.c
	474c474
	< ALIGN (void *ptr, int alignment)
	---
	> EMACS_ALIGN (void *ptr, int alignment)
	1245c1245
	<       abase = ALIGN (base, BLOCK_ALIGN);
	---
	>       abase = EMACS_ALIGN (base, BLOCK_ALIGN);
	5171c5171
	<       result = ALIGN (purebeg + pure_bytes_used_lisp, GCALIGNMENT);
	---
	>       result = EMACS_ALIGN (purebeg + pure_bytes_used_lisp, GCALIGNMENT);

That solved the build problem on DragonFlyBSD 4.6, and I've installed
the new emacs on that system.  The same fix repaired all of the five
other versions of that O/S in my lab.

Another, and simpler solution, would be to insert

	#undef ALIGN

before the first use of ALIGN() in alloc.c.

-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe@math.utah.edu  -
- 155 S 1400 E RM 233                       beebe@acm.org  beebe@computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------





             reply	other threads:[~2016-06-13 20:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13 20:10 Nelson H. F. Beebe [this message]
2016-06-14 17:40 ` bug#23764: emacs-25.0.95 fails to build on DragonFlyBSD, and an easy repair Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CMM.0.96.0.1465848607.beebe@gamma.math.utah.edu \
    --to=beebe@math.utah.edu \
    --cc=23764@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.