From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Nelson H. F. Beebe" Newsgroups: gmane.emacs.bugs 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 Message-ID: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1465848688 25404 80.91.229.3 (13 Jun 2016 20:11:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 13 Jun 2016 20:11:28 +0000 (UTC) Cc: beebe@math.utah.edu To: 23764@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 13 22:11:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bCYCb-0004lk-0G for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Jun 2016 22:11:17 +0200 Original-Received: from localhost ([::1]:58987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCYCa-0007s2-AB for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Jun 2016 16:11:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCYCQ-0007rv-Ru for bug-gnu-emacs@gnu.org; Mon, 13 Jun 2016 16:11:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCYCM-000408-5w for bug-gnu-emacs@gnu.org; Mon, 13 Jun 2016 16:11:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55206) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCYCM-000404-1U for bug-gnu-emacs@gnu.org; Mon, 13 Jun 2016 16:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bCYCL-0006MC-Ri for bug-gnu-emacs@gnu.org; Mon, 13 Jun 2016 16:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Nelson H. F. Beebe" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Jun 2016 20:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23764 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.146584864624413 (code B ref -1); Mon, 13 Jun 2016 20:11:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Jun 2016 20:10:46 +0000 Original-Received: from localhost ([127.0.0.1]:39310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCYC2-0006Ld-LF for submit@debbugs.gnu.org; Mon, 13 Jun 2016 16:10:46 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCYBy-0006LN-Tq for submit@debbugs.gnu.org; Mon, 13 Jun 2016 16:10:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCYBs-0003vH-0A for submit@debbugs.gnu.org; Mon, 13 Jun 2016 16:10:33 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:38648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCYBr-0003vA-SZ for submit@debbugs.gnu.org; Mon, 13 Jun 2016 16:10:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCYBp-0007jD-BE for bug-gnu-emacs@gnu.org; Mon, 13 Jun 2016 16:10:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCYBj-0003uT-Q0 for bug-gnu-emacs@gnu.org; Mon, 13 Jun 2016 16:10:28 -0400 Original-Received: from mail.math.utah.edu ([155.101.98.135]:57418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCYBj-0003sw-Bh for bug-gnu-emacs@gnu.org; Mon, 13 Jun 2016 16:10:23 -0400 Original-Received: from gamma.math.utah.edu (gamma.math.utah.edu [155.101.96.20]) by mail.math.utah.edu (8.14.8/8.14.8) with ESMTP id u5DKA7gB011347; Mon, 13 Jun 2016 14:10:12 -0600 (MDT) Original-Received: from gamma.math.utah.edu (localhost [127.0.0.1]) by gamma.math.utah.edu (8.15.1/8.15.1) with ESMTP id u5DKA7Rs017879; Mon, 13 Jun 2016 14:10:07 -0600 Original-Received: (from beebe@localhost) by gamma.math.utah.edu (8.15.1/8.15.1/Submit) id u5DKA7IJ017877; Mon, 13 Jun 2016 14:10:07 -0600 X-US-Mail: "Department of Mathematics, 110 LCB, University of Utah, 155 S 1400 E RM 233, Salt Lake City, UT 84112-0090, USA" X-Telephone: +1 801 581 5254 X-FAX: +1 801 581 4148 X-URL: http://www.math.utah.edu/~beebe X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (mail.math.utah.edu [155.101.98.135]); Mon, 13 Jun 2016 14:10:12 -0600 (MDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:119515 Archived-At: 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/ - -------------------------------------------------------------------------------