all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#23764: emacs-25.0.95 fails to build on DragonFlyBSD, and an easy repair
@ 2016-06-13 20:10 Nelson H. F. Beebe
  2016-06-14 17:40 ` Glenn Morris
  0 siblings, 1 reply; 2+ messages in thread
From: Nelson H. F. Beebe @ 2016-06-13 20:10 UTC (permalink / raw)
  To: 23764; +Cc: beebe

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/ -
-------------------------------------------------------------------------------





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#23764: emacs-25.0.95 fails to build on DragonFlyBSD, and an easy repair
  2016-06-13 20:10 bug#23764: emacs-25.0.95 fails to build on DragonFlyBSD, and an easy repair Nelson H. F. Beebe
@ 2016-06-14 17:40 ` Glenn Morris
  0 siblings, 0 replies; 2+ messages in thread
From: Glenn Morris @ 2016-06-14 17:40 UTC (permalink / raw)
  To: 23764-done

Version: 25.0.96

Thanks; fixed.
I see DragonFly BSD has known about this for months, eg

https://github.com/DragonFlyBSD/DPorts/blob/master/editors/emacs-devel/dragonfly/patch-src_alloc.c





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-14 17:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-13 20:10 bug#23764: emacs-25.0.95 fails to build on DragonFlyBSD, and an easy repair Nelson H. F. Beebe
2016-06-14 17:40 ` Glenn Morris

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.