unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Failed to build Emacs v26.3.50 on macOS v10.15.4 with Xcode 11.4.1
@ 2020-04-28  2:58 ENDOH Hiroaki
  2020-04-28  7:30 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: ENDOH Hiroaki @ 2020-04-28  2:58 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 359 bytes --]

Hi, Emacs team.

I got the build error of Emacs v26.3.50 on macOS v10.15.4 with Xcode 11.4.1.
Using the attached diff.patch, you would get success build Emacs v26.3.50.

The reproduction procedure, error log and workarounds are summarized below.
https://github.com/hiroakit/emacs-on-apple/issues/1

Would you be able to check it?

Best regards,
Hiroaki ENDOH

[-- Attachment #2: diff.patch --]
[-- Type: application/octet-stream, Size: 3042 bytes --]

--- a/src/unexmacosx.c	2020-04-27 23:26:24.000000000 +0900
+++ b/src/unexmacosx.c	2020-04-27 23:58:54.000000000 +0900
@@ -97,9 +97,9 @@ along with GNU Emacs.  If not, see <http
 
 #include "unexec.h"
 #include "lisp.h"
+#include "sysstdio.h"
 
 #include <errno.h>
-#include <stdio.h>
 #include <fcntl.h>
 #include <stdarg.h>
 #include <stdint.h>
@@ -303,9 +303,9 @@ unexec_error (const char *format, ...)
   va_list ap;
 
   va_start (ap, format);
-  fprintf (stderr, "unexec: ");
+  fputs ("unexec: ", stderr);
   vfprintf (stderr, format, ap);
-  fprintf (stderr, "\n");
+  putc ('\n', stderr);
   va_end (ap);
   exit (1);
 }
@@ -447,7 +447,7 @@ unexec_regions_recorder (task_t task, vo
 
   while (num && num_unexec_regions < MAX_UNEXEC_REGIONS)
     {
-      /* Subtract the size of trailing null bytes from filesize.  It
+      /* Subtract the size of trailing NUL bytes from filesize.  It
 	 can be smaller than vmsize in segment commands.  In such a
 	 case, trailing bytes are initialized with zeros.  */
       for (p = ranges->address + ranges->size; p > ranges->address; p--)
@@ -503,22 +503,34 @@ unexec_regions_sort_compare (const void 
 static void
 unexec_regions_merge (void)
 {
-  int i, n;
-  unexec_region_info r;
-  vm_size_t padsize;
-
   qsort (unexec_regions, num_unexec_regions, sizeof (unexec_regions[0]),
 	 &unexec_regions_sort_compare);
-  n = 0;
-  r = unexec_regions[0];
-  padsize = r.range.address & (pagesize - 1);
-  if (padsize)
-    {
-      r.range.address -= padsize;
-      r.range.size += padsize;
-      r.filesize += padsize;
+
+  /* Align each region start address to a page boundary.  */
+  for (unexec_region_info *cur = unexec_regions;
+       cur < unexec_regions + num_unexec_regions; cur++)
+    {
+      vm_size_t padsize = cur->range.address & (pagesize - 1);
+      if (padsize)
+	{
+	  cur->range.address -= padsize;
+	  cur->range.size += padsize;
+	  cur->filesize += padsize;
+
+	  unexec_region_info *prev = cur == unexec_regions ? NULL : cur - 1;
+	  if (prev
+	      && prev->range.address + prev->range.size > cur->range.address)
+	    {
+	      prev->range.size = cur->range.address - prev->range.address;
+	      if (prev->filesize > prev->range.size)
+		prev->filesize = prev->range.size;
+	    }
+	}
     }
-  for (i = 1; i < num_unexec_regions; i++)
+
+  int n = 0;
+  unexec_region_info r = unexec_regions[0];
+  for (int i = 1; i < num_unexec_regions; i++)
     {
       if (r.range.address + r.range.size == unexec_regions[i].range.address
 	  && r.range.size - r.filesize < 2 * pagesize)
@@ -530,17 +542,6 @@ unexec_regions_merge (void)
 	{
 	  unexec_regions[n++] = r;
 	  r = unexec_regions[i];
-	  padsize = r.range.address & (pagesize - 1);
-	  if (padsize)
-	    {
-	      if ((unexec_regions[n-1].range.address
-		   + unexec_regions[n-1].range.size) == r.range.address)
-		unexec_regions[n-1].range.size -= padsize;
-
-	      r.range.address -= padsize;
-	      r.range.size += padsize;
-	      r.filesize += padsize;
-	    }
 	}
     }
   unexec_regions[n++] = r;

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

* Re: Failed to build Emacs v26.3.50 on macOS v10.15.4 with Xcode 11.4.1
  2020-04-28  2:58 Failed to build Emacs v26.3.50 on macOS v10.15.4 with Xcode 11.4.1 ENDOH Hiroaki
@ 2020-04-28  7:30 ` Eli Zaretskii
  2020-04-29  5:47   ` ENDOH Hiroaki
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2020-04-28  7:30 UTC (permalink / raw)
  To: ENDOH Hiroaki; +Cc: emacs-devel

> From: ENDOH Hiroaki <hiroakiendoh@gmail.com>
> Date: Tue, 28 Apr 2020 11:58:41 +0900
> 
> I got the build error of Emacs v26.3.50 on macOS v10.15.4 with Xcode 11.4.1.
> Using the attached diff.patch, you would get success build Emacs v26.3.50.
> 
> The reproduction procedure, error log and workarounds are summarized below.
> https://github.com/hiroakit/emacs-on-apple/issues/1
> 
> Would you be able to check it?

Emacs 26 is no longer developed.  Would it be possible for you to try
the latest pretest of Emacs 27.1?  It is available on alpha.gnu.org.

Thanks.



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

* Re: Failed to build Emacs v26.3.50 on macOS v10.15.4 with Xcode 11.4.1
  2020-04-28  7:30 ` Eli Zaretskii
@ 2020-04-29  5:47   ` ENDOH Hiroaki
  2020-04-29  8:03     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: ENDOH Hiroaki @ 2020-04-29  5:47 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

Dear Mr. Zaretskii,

Thank you for your email.
I got successfully building Emacs 27.1.

Also, am I correct in understanding that the emacs team has devoting
resources to Emacs 27,
thus they doesn't maintein on Emacs 26?

Finally, I'll send you a patch if I get a issue about in Emacs 27 pretest.

Best regards,
Hiroaki.

2020年4月28日(火) 16:30 Eli Zaretskii <eliz@gnu.org>:
>
> > From: ENDOH Hiroaki <hiroakiendoh@gmail.com>
> > Date: Tue, 28 Apr 2020 11:58:41 +0900
> >
> > I got the build error of Emacs v26.3.50 on macOS v10.15.4 with Xcode 11.4.1.
> > Using the attached diff.patch, you would get success build Emacs v26.3.50.
> >
> > The reproduction procedure, error log and workarounds are summarized below.
> > https://github.com/hiroakit/emacs-on-apple/issues/1
> >
> > Would you be able to check it?
>
> Emacs 26 is no longer developed.  Would it be possible for you to try
> the latest pretest of Emacs 27.1?  It is available on alpha.gnu.org.
>
> Thanks.



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

* Re: Failed to build Emacs v26.3.50 on macOS v10.15.4 with Xcode 11.4.1
  2020-04-29  5:47   ` ENDOH Hiroaki
@ 2020-04-29  8:03     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2020-04-29  8:03 UTC (permalink / raw)
  To: ENDOH Hiroaki; +Cc: emacs-devel

> From: ENDOH Hiroaki <hiroakiendoh@gmail.com>
> Date: Wed, 29 Apr 2020 14:47:38 +0900
> Cc: emacs-devel@gnu.org
> 
> I got successfully building Emacs 27.1.

Thanks, this is good news.

> Also, am I correct in understanding that the emacs team has devoting
> resources to Emacs 27,
> thus they doesn't maintein on Emacs 26?

That's correct.

> Finally, I'll send you a patch if I get a issue about in Emacs 27 pretest.

Thanks.



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

end of thread, other threads:[~2020-04-29  8:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28  2:58 Failed to build Emacs v26.3.50 on macOS v10.15.4 with Xcode 11.4.1 ENDOH Hiroaki
2020-04-28  7:30 ` Eli Zaretskii
2020-04-29  5:47   ` ENDOH Hiroaki
2020-04-29  8:03     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).