Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
gccemacs on OSX

gccemacs on OS X

Read this first: http://akrl.sdf.org/gccemacs.html

Prerequisites

1) GCC with libgccjit enabled

For that you need to compile gcc (duh). I edited Homebrew's gcc formula:

diff --git a/Formula/gcc.rb b/Formula/gcc.rb
index 1bd636d496..03ad124218 100644
--- a/Formula/gcc.rb
+++ b/Formula/gcc.rb
@@ -53,7 +53,7 @@ class Gcc < Formula
     #  - Ada, which requires a pre-existing GCC Ada compiler to bootstrap
     #  - Go, currently not supported on macOS
     #  - BRIG
-    languages = %w[c c++ objc obj-c++ fortran]
+    languages = %w[c c++ objc obj-c++ fortran jit]

     osmajor = `uname -r`.split(".").first
     pkgversion = "Homebrew GCC #{pkg_version} #{build.used_options*" "}".strip
@@ -73,6 +73,7 @@ class Gcc < Formula
       --with-system-zlib
       --with-pkgversion=#{pkgversion}
       --with-bugurl=https://github.com/Homebrew/homebrew-core/issues
+      --enable-host-shared
     ]

     # Xcode 10 dropped 32-bit support

(easy way to apply this is to cd into /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core and run pbpaste | git apply - after copying the diff into clipboard 😄)

(or whereever is your Homebrew library set up)

2) Bunch of dependencies

  • giflib
  • jpeg
  • libtiff
  • gnutls

And XQuartz, because GCC is not able to parse Objective-C dialect changes what Apple has done for now and thus Apple Cocoa support is not available. (See: https://lists.gnu.org/archive/html/emacs-devel/2019-08/msg00056.html)

3) Source

Clone https://github.com/emacs-mirror/emacs and checkout feature/native-comp branch

2) Building

Here's the script I used (note to adjust package versions if needed):

libs=(
    /usr/local/Cellar/gcc/9.2.0_2
    /usr/local/Cellar/giflib/5.2.1
    /usr/local/Cellar/jpeg/9c
    /usr/local/Cellar/libtiff/4.1.0
    /usr/local/Cellar/gnutls/3.6.10

    # Required by gnutls
    /usr/local/Cellar/nettle/3.4.1 
    /usr/local/Cellar/libtasn1/4.15.0
    /usr/local/Cellar/p11-kit/0.23.18.1
)

export PATH="/usr/local/Cellar/gcc/9.2.0_2/bin:${PATH}"

export CC="gcc-9"
export CPP="cpp-9"
CFLAGS=""
LDFLAGS=""
PKG_CONFIG_PATH=""

for dir in "${libs[@]}"; do
    CFLAGS="${CFLAGS}-I${dir}/include "
    LDFLAGS="${LDFLAGS}-L${dir}/lib "
    PKG_CONFIG_PATH="${PKG_CONFIG_PATH}${dir}/lib/pkgconfig:"
done

export CPPFLAGS="${CFLAGS}"
export CFLAGS
export LDFLAGS
export PKG_CONFIG_PATH

./configure \
    --prefix="${HOME}"/gccemacs \
    --with-nativecomp \
    --without-ns

Save it into build.sh

Then run: sh build.sh && make bootstrap && make install

And result is in ~/gccemacs. Add ~/gccemacs/bin into PATH and start experimenting with el native building

@brethorne

This comment has been minimized.

Copy link

brethorne commented Mar 5, 2020

What version of macos are you using? Xquartz starts then dies immediately on mojave 10.14.6.

@mikroskeem

This comment has been minimized.

Copy link
Owner Author

mikroskeem commented Mar 5, 2020

I am using Catalina 10.15.3

@brethorne

This comment has been minimized.

Copy link

brethorne commented Mar 5, 2020

Xquartz seems to be very unstable...It will run for a couple of minutes until it crashes and then goes into an infinite loop of crashing and starting. Experiencing anything simliar?

@mikroskeem

This comment has been minimized.

Copy link
Owner Author

mikroskeem commented Mar 5, 2020

No not at all, I don't even remember it crashing when I was using Mojave... I use XQuartz every day with few things running +30h in a row.

@brethorne

This comment has been minimized.

Copy link

brethorne commented Mar 5, 2020

Any suggestions?

@brethorne

This comment has been minimized.

Copy link

brethorne commented Mar 5, 2020

Mmm looking at /private/var/log/system.log it may be chunkwm... I appreciate you making this and responding back.

@mikroskeem

This comment has been minimized.

Copy link
Owner Author

mikroskeem commented Mar 5, 2020

Glad you got it sorted out.

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 6, 2020

Hi @mikroskeem thanks for sharing this!
Just a thought. I think in theory would be also possible to compile libgccjit aside and keep on compiling Emacs with Clang if this helps with Cocoa.

@mikroskeem

This comment has been minimized.

Copy link
Owner Author

mikroskeem commented Mar 6, 2020

In theory it's possible yes, however I have no interest to look into it for now. If someone else wants to look into it, I can freely link to that tutorial, or merge it into this gist (with credits) if allowed 😄

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 6, 2020

Sure legitimate. Just wanted to comment here because I suspect this is for now a little bit the reference page on how to run a gccemacs on OSX ;)

@dylanjm

This comment has been minimized.

Copy link

dylanjm commented Mar 6, 2020

Have you since tried these instructions on the Emacs official branch feature/native-comp? Development of gccemacs has since moved there.

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 6, 2020

Should be all the same with the exception you want to configure emacs with --with-nativecomp

@mikroskeem

This comment has been minimized.

Copy link
Owner Author

mikroskeem commented Mar 6, 2020

Interesting... will update tutorial against the new link. Thanks for letting me know.

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 6, 2020

Super. Thanks

@dylanjm

This comment has been minimized.

Copy link

dylanjm commented Mar 6, 2020

I only bring this up because I've been trying to build with these instructions with the only difference really being I'm using that branch and I keep getting segfaults. I was wondering if there might be a minute difference between the two branches?

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 6, 2020

I only bring this up because I've been trying to build with these instructions with the only difference really being I'm using that branch and I keep getting segfaults. I was wondering if there might be a minute difference between the two branches?

If you are not adding --with-nativecomp to the Emacs configure and you still get segfaults this is not related to the native compiler but to something else. Can you build the master branch?

@dylanjm

This comment has been minimized.

Copy link

dylanjm commented Mar 6, 2020

I was just able to successfully build emacs on the master branch by just removing the --with-nativecomp option from build.sh.

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 6, 2020

Mmmm interesting. I'd like to take a look to the full output if possible (but I'll be able to give you just an opinion not having mac machines).

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 6, 2020

Sorry I meant to the output with the crash thanks.

@dylanjm

This comment has been minimized.

Copy link

dylanjm commented Mar 6, 2020

Same build script except with --with-nativecomp added.

$> git branch -vv
* feature/native-comp dc89f3a0df [origin/feature/native-comp] * Fix build for stock configuration
  master              c996fe1ec6 [origin/master] Remove ancient OS X process-connection-type handling
$> ./build.sh |& tee gccemacs.log
Checking whether you have the necessary tools...
(Read INSTALL.REPO for more details on building Emacs)
Checking for autoconf (need at least version 2.65) ... ok
Your system has the required tools.
Building aclocal.m4 ...
Running 'autoreconf -fi -I m4' ...
You can now run './configure'.
checking for xcrun... xcrun
checking for make... yes
checking for GNU Make... gmake
checking build system type... x86_64-apple-darwin18.7.0
checking host system type... x86_64-apple-darwin18.7.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc-9 accepts -g... yes
checking for gcc-9 option to enable C11 features... none needed
checking whether the compiler is clang... no
checking for compiler option needed when checking for declarations... none
checking for ar... ar
checking whether gcc-9 and cc understand -c and -o together... yes
checking how to run the C preprocessor... cpp-9
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking for Minix Amsterdam compiler... no
checking for ranlib... ranlib
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking whether the compiler is clang... no
checking whether C compiler handles -Werror -Wunknown-warning-option... no
checking whether -Wno-missing-field-initializers is supported... yes
checking whether -Wno-missing-field-initializers is needed... no
checking whether -Wuninitialized is supported... yes
checking max safe object size... 9223372036854775807
checking whether C compiler handles -fno-common... yes
checking whether C compiler handles -W... yes
checking whether C compiler handles -Wabsolute-value... yes
checking whether C compiler handles -Waddress... yes
checking whether C compiler handles -Waddress-of-packed-member... yes
checking whether C compiler handles -Waggressive-loop-optimizations... yes
checking whether C compiler handles -Wall... yes
checking whether C compiler handles -Wattribute-warning... yes
checking whether C compiler handles -Wattributes... yes
checking whether C compiler handles -Wbool-compare... yes
checking whether C compiler handles -Wbool-operation... yes
checking whether C compiler handles -Wbuiltin-declaration-mismatch... yes
checking whether C compiler handles -Wbuiltin-macro-redefined... yes
checking whether C compiler handles -Wcannot-profile... yes
checking whether C compiler handles -Wcast-function-type... yes
checking whether C compiler handles -Wchar-subscripts... yes
checking whether C compiler handles -Wclobbered... yes
checking whether C compiler handles -Wcomment... yes
checking whether C compiler handles -Wcomments... yes
checking whether C compiler handles -Wcoverage-mismatch... yes
checking whether C compiler handles -Wcpp... yes
checking whether C compiler handles -Wdangling-else... yes
checking whether C compiler handles -Wdate-time... yes
checking whether C compiler handles -Wdeprecated... yes
checking whether C compiler handles -Wdeprecated-declarations... yes
checking whether C compiler handles -Wdesignated-init... yes
checking whether C compiler handles -Wdisabled-optimization... yes
checking whether C compiler handles -Wdiscarded-array-qualifiers... yes
checking whether C compiler handles -Wdiscarded-qualifiers... yes
checking whether C compiler handles -Wdiv-by-zero... yes
checking whether C compiler handles -Wdouble-promotion... yes
checking whether C compiler handles -Wduplicated-cond... yes
checking whether C compiler handles -Wduplicate-decl-specifier... yes
checking whether C compiler handles -Wempty-body... yes
checking whether C compiler handles -Wendif-labels... yes
checking whether C compiler handles -Wenum-compare... yes
checking whether C compiler handles -Wexpansion-to-defined... yes
checking whether C compiler handles -Wextra... yes
checking whether C compiler handles -Wformat-contains-nul... yes
checking whether C compiler handles -Wformat-extra-args... yes
checking whether C compiler handles -Wformat-security... yes
checking whether C compiler handles -Wformat-signedness... yes
checking whether C compiler handles -Wformat-y2k... yes
checking whether C compiler handles -Wformat-zero-length... yes
checking whether C compiler handles -Wframe-address... yes
checking whether C compiler handles -Wfree-nonheap-object... yes
checking whether C compiler handles -Whsa... yes
checking whether C compiler handles -Wif-not-aligned... yes
checking whether C compiler handles -Wignored-attributes... yes
checking whether C compiler handles -Wignored-qualifiers... yes
checking whether C compiler handles -Wimplicit... yes
checking whether C compiler handles -Wimplicit-function-declaration... yes
checking whether C compiler handles -Wimplicit-int... yes
checking whether C compiler handles -Wincompatible-pointer-types... yes
checking whether C compiler handles -Winit-self... yes
checking whether C compiler handles -Wint-conversion... yes
checking whether C compiler handles -Wint-in-bool-context... yes
checking whether C compiler handles -Wint-to-pointer-cast... yes
checking whether C compiler handles -Winvalid-memory-model... yes
checking whether C compiler handles -Winvalid-pch... yes
checking whether C compiler handles -Wlogical-not-parentheses... yes
checking whether C compiler handles -Wlogical-op... yes
checking whether C compiler handles -Wmain... yes
checking whether C compiler handles -Wmaybe-uninitialized... yes
checking whether C compiler handles -Wmemset-elt-size... yes
checking whether C compiler handles -Wmemset-transposed-args... yes
checking whether C compiler handles -Wmisleading-indentation... yes
checking whether C compiler handles -Wmissing-attributes... yes
checking whether C compiler handles -Wmissing-braces... yes
checking whether C compiler handles -Wmissing-declarations... yes
checking whether C compiler handles -Wmissing-include-dirs... yes
checking whether C compiler handles -Wmissing-parameter-type... yes
checking whether C compiler handles -Wmissing-profile... yes
checking whether C compiler handles -Wmissing-prototypes... yes
checking whether C compiler handles -Wmultichar... yes
checking whether C compiler handles -Wmultistatement-macros... yes
checking whether C compiler handles -Wnarrowing... yes
checking whether C compiler handles -Wnested-externs... yes
checking whether C compiler handles -Wnonnull... yes
checking whether C compiler handles -Wnonnull-compare... yes
checking whether C compiler handles -Wnull-dereference... yes
checking whether C compiler handles -Wodr... yes
checking whether C compiler handles -Wold-style-declaration... yes
checking whether C compiler handles -Wold-style-definition... yes
checking whether C compiler handles -Wopenmp-simd... yes
checking whether C compiler handles -Woverflow... yes
checking whether C compiler handles -Wpacked... yes
checking whether C compiler handles -Wpacked-bitfield-compat... yes
checking whether C compiler handles -Wpacked-not-aligned... yes
checking whether C compiler handles -Wparentheses... yes
checking whether C compiler handles -Wpointer-arith... yes
checking whether C compiler handles -Wpointer-compare... yes
checking whether C compiler handles -Wpointer-sign... yes
checking whether C compiler handles -Wpointer-to-int-cast... yes
checking whether C compiler handles -Wpragmas... yes
checking whether C compiler handles -Wpsabi... yes
checking whether C compiler handles -Wrestrict... yes
checking whether C compiler handles -Wreturn-local-addr... yes
checking whether C compiler handles -Wreturn-type... yes
checking whether C compiler handles -Wscalar-storage-order... yes
checking whether C compiler handles -Wsequence-point... yes
checking whether C compiler handles -Wshift-count-negative... yes
checking whether C compiler handles -Wshift-count-overflow... yes
checking whether C compiler handles -Wshift-negative-value... yes
checking whether C compiler handles -Wsizeof-array-argument... yes
checking whether C compiler handles -Wsizeof-pointer-div... yes
checking whether C compiler handles -Wsizeof-pointer-memaccess... yes
checking whether C compiler handles -Wstrict-aliasing... yes
checking whether C compiler handles -Wstrict-prototypes... yes
checking whether C compiler handles -Wstringop-truncation... yes
checking whether C compiler handles -Wsuggest-attribute=format... yes
checking whether C compiler handles -Wsuggest-attribute=malloc... yes
checking whether C compiler handles -Wsuggest-attribute=noreturn... yes
checking whether C compiler handles -Wsuggest-final-methods... yes
checking whether C compiler handles -Wsuggest-final-types... yes
checking whether C compiler handles -Wswitch-bool... yes
checking whether C compiler handles -Wswitch-unreachable... yes
checking whether C compiler handles -Wtautological-compare... yes
checking whether C compiler handles -Wtrampolines... yes
checking whether C compiler handles -Wtrigraphs... yes
checking whether C compiler handles -Wuninitialized... yes
checking whether C compiler handles -Wunknown-pragmas... yes
checking whether C compiler handles -Wunused... yes
checking whether C compiler handles -Wunused-but-set-parameter... yes
checking whether C compiler handles -Wunused-but-set-variable... yes
checking whether C compiler handles -Wunused-function... yes
checking whether C compiler handles -Wunused-label... yes
checking whether C compiler handles -Wunused-local-typedefs... yes
checking whether C compiler handles -Wunused-macros... yes
checking whether C compiler handles -Wunused-result... yes
checking whether C compiler handles -Wunused-value... yes
checking whether C compiler handles -Wunused-variable... yes
checking whether C compiler handles -Wvarargs... yes
checking whether C compiler handles -Wvariadic-macros... yes
checking whether C compiler handles -Wvector-operation-performance... yes
checking whether C compiler handles -Wvolatile-register-var... yes
checking whether C compiler handles -Wwrite-strings... yes
checking whether C compiler handles -Walloc-size-larger-than=9223372036854775807... yes
checking whether C compiler handles -Warray-bounds=2... yes
checking whether C compiler handles -Wattribute-alias=2... yes
checking whether C compiler handles -Wformat-truncation=2... yes
checking whether C compiler handles -Wimplicit-fallthrough=5... yes
checking whether C compiler handles -Wnormalized=nfc... yes
checking whether C compiler handles -Wshift-overflow=2... yes
checking whether C compiler handles -Wstringop-overflow=2... yes
checking whether C compiler handles -Wvla-larger-than=4031... yes
checking whether C compiler handles -Wredundant-decls... yes
checking whether C compiler handles -Wno-missing-field-initializers... yes
checking whether C compiler handles -Wno-override-init... yes
checking whether C compiler handles -Wno-sign-compare... yes
checking whether C compiler handles -Wno-type-limits... yes
checking whether C compiler handles -Wno-unused-parameter... yes
checking whether C compiler handles -Wno-format-nonliteral... yes
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking command to symlink files in the same directory... ln -s
checking for install-info... /usr/bin/install-info
checking for gzip... /usr/bin/gzip
checking for 'find' args to delete a file... -delete
checking for brew... brew
checking for makeinfo... /usr/local/opt/texinfo/bin/makeinfo
checking for -znocombreloc... not needed
checking whether addresses are sanitized... no
checking for library containing sqrt... none required
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for machine/soundcard.h... no
checking for sys/soundcard.h... no
checking for soundcard.h... no
checking for mmsystem.h... no
checking for _oss_ioctl in -lossaudio... no
checking for alsa >= 1.0.0... no
checking for linux/fs.h... no
checking for malloc.h... no
checking for sys/systeminfo.h... no
checking for sys/sysinfo.h... no
checking for coff.h... no
checking for pty.h... no
checking for sys/resource.h... yes
checking for sys/utsname.h... yes
checking for pwd.h... yes
checking for utmp.h... yes
checking for util.h... yes
checking for sys/socket.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for pthread.h... yes
checking for malloc/malloc.h... yes
checking for sys/un.h... yes
checking for dirent.h... yes
checking for execinfo.h... yes
checking for stdio_ext.h... no
checking for sys/vfs.h... no
checking for sys/fs_types.h... no
checking for getopt.h... yes
checking for sys/cdefs.h... yes
checking for sys/time.h... yes
checking for ieee754.h... no
checking for limits.h... yes
checking for wchar.h... yes
checking for stdint.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for sys/select.h... yes
checking for sys/stat.h... (cached) yes
checking for ADDR_NO_RANDOMIZE... no
checking for term.h... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether sys_siglist is declared... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for net/if.h... yes
checking for ifaddrs.h... yes
checking for net/if_dl.h... yes
checking for struct ifreq.ifr_flags... yes
checking for struct ifreq.ifr_hwaddr... no
checking for struct ifreq.ifr_netmask... no
checking for struct ifreq.ifr_broadaddr... yes
checking for struct ifreq.ifr_addr... yes
checking for struct ifreq.ifr_addr.sa_len... yes
checking whether gcc understands -MMD -MF... yes
checking for X... libraries /usr/X11/lib, headers /usr/X11/include
checking whether malloc is Doug Lea style... no
checking for getpagesize... yes
checking for working mmap... yes
checking for main in -lXbsd... no
checking for pthread library... none needed
checking for thread support... yes
checking for Xkb... yes
checking for XrmSetDatabase... yes
checking for XScreenResourceString... yes
checking for XScreenNumberOfScreen... yes
checking X11 version 6... 6 or newer
checking for librsvg-2.0 >= 2.14.0... no
checking for getaddrinfo_a in -lanl... no
checking for gtk+-3.0 >= 3.10 glib-2.0 >= 2.37.5... no
checking for gtk+-2.0 >= 2.24 glib-2.0 >= 2.28... no
checking for dbus-1 >= 1.0... yes
checking for dbus_watch_get_unix_fd... yes
checking for dbus_type_is_valid... yes
checking for dbus_validate_bus_name... yes
checking for dbus_validate_path... yes
checking for dbus_validate_interface... yes
checking for dbus_validate_member... yes
checking for gio-2.0 >= 2.26... yes
checking whether GSettings is in gio... yes
checking for gobject-2.0 >= 2.0... yes
checking for lgetfilecon in -lselinux... no
checking for gnutls >= 2.12.2... yes
checking for libsystemd >= 222... no
checking for jansson >= 2.7... yes
checking sys/inotify.h usability... no
checking sys/inotify.h presence... no
checking for sys/inotify.h... no
checking for libkqueue... no
checking for library containing kqueue... none required
checking for XawScrollbarSetThumb in -lXaw3d... yes
checking for xaw3d... yes; using Lucid toolkit
checking X11 toolkit version... 6 or newer
checking for library containing XmuConvertStandardSelection... -lXmu
checking X11/extensions/Xrender.h usability... yes
checking X11/extensions/Xrender.h presence... yes
checking for X11/extensions/Xrender.h... yes
checking for XRenderQueryExtension in -lXrender... yes
checking for cairo >= 1.8.0... no
configure: WARNING: cairo requested but not found.
checking for fontconfig >= 2.2.0... yes
checking for xft >= 0.13.0... no
checking X11/Xlib-xcb.h usability... yes
checking X11/Xlib-xcb.h presence... yes
checking for X11/Xlib-xcb.h... yes
checking for xcb_translate_coordinates in -lxcb... yes
checking for XGetXCBConnection in -lX11-xcb... yes
checking X11/xpm.h usability... yes
checking X11/xpm.h presence... yes
checking for X11/xpm.h... yes
checking for XpmReadFileToPixmap in -lXpm... yes
checking for XpmReturnAllocPixels preprocessor define... yes
checking for jpeglib 6b or later... -ljpeg
checking for lcms2... yes
checking for library containing inflateEnd... -lz
checking for dladdr... yes
checking for dlfunc... no
checking libgccjit.h usability... yes
checking libgccjit.h presence... yes
checking for libgccjit.h... yes
checking for gcc_jit_context_acquire in -lgccjit... yes
checking for libpng >= 1.0.0... yes
checking whether png_longjmp is declared... yes
checking tiffio.h usability... yes
checking tiffio.h presence... yes
checking for tiffio.h... yes
checking for TIFFGetVersion in -ltiff... yes
checking gif_lib.h usability... yes
checking gif_lib.h presence... yes
checking for gif_lib.h... yes
checking for GifMakeMapObject in -lgif... yes
checking gpm.h usability... no
checking gpm.h presence... no
checking for gpm.h... no
checking X11/SM/SMlib.h usability... yes
checking X11/SM/SMlib.h presence... yes
checking for X11/SM/SMlib.h... yes
checking for SmcOpenConnection in -lSM... yes
checking for xrandr >= 1.2.2... no
checking for X11/extensions/Xrandr.h... yes
checking for XRRGetScreenResources in -lXrandr... yes
checking for xinerama >= 1.0.2... no
checking X11/extensions/Xinerama.h usability... yes
checking X11/extensions/Xinerama.h presence... yes
checking for X11/extensions/Xinerama.h... yes
checking for XineramaQueryExtension in -lXinerama... yes
checking for xfixes >= 4.0.0... no
checking X11/extensions/Xfixes.h usability... yes
checking X11/extensions/Xfixes.h presence... yes
checking for X11/extensions/Xfixes.h... yes
checking for XFixesHideCursor in -lXfixes... yes
checking for X11/extensions/Xdbe.h... yes
checking for XdbeAllocateBackBufferName in -lXext... yes
checking for libxml-2.0 > 2.6.17... yes
checking for htmlReadMemory in -lxml2... yes
checking for accept4... no
checking for fchdir... yes
checking for gethostname... yes
checking for getrusage... yes
checking for get_current_dir_name... no
checking for lrand48... yes
checking for random... yes
checking for rint... yes
checking for trunc... yes
checking for select... yes
checking for getpagesize... (cached) yes
checking for setlocale... yes
checking for newlocale... yes
checking for getrlimit... yes
checking for setrlimit... yes
checking for shutdown... yes
checking for pthread_sigmask... (cached) yes
checking for strsignal... yes
checking for setitimer... yes
checking for timer_getoverrun... no
checking for sendto... yes
checking for recvfrom... yes
checking for getsockname... yes
checking for getifaddrs... yes
checking for freeifaddrs... yes
checking for gai_strerror... yes
checking for sync... yes
checking for getpwent... yes
checking for endpwent... yes
checking for getgrent... yes
checking for endgrent... yes
checking for cfmakeraw... yes
checking for cfsetspeed... yes
checking for __executable_start... no
checking for log2... yes
checking for pthread_setname_np... yes
checking whether pthread_setname_np takes a single argument... yes
checking for aligned_alloc... no
checking for posix_memalign... yes
checking whether aligned_alloc is declared... no
checking for posix_madvise... yes
checking for __builtin_frame_address... yes
checking for __builtin_unwind_init... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for grantpt... yes
checking for getpt... no
checking for posix_openpt... yes
checking for library containing tputs... -lncurses
checking for timerfd interface... no
checking whether signals can be handled on alternate stack... yes
checking gmp.h usability... no
checking gmp.h presence... no
checking for gmp.h... no
checking valgrind/valgrind.h usability... no
checking valgrind/valgrind.h presence... no
checking for valgrind/valgrind.h... no
checking for struct unipair.unicode... no
checking for sbrk... yes
checking for fchmod... yes
checking for canonicalize_file_name... no
checking for getcwd... yes
checking for readlink... yes
checking for realpath... yes
checking for readlinkat... yes
checking for explicit_bzero... no
checking for faccessat... yes
checking for fchmodat... yes
checking for lchmod... yes
checking for fcntl... yes
checking for fdopendir... yes
checking for fstatat... yes
checking for fsync... yes
checking for gettimeofday... yes
checking for lstat... yes
checking for mkostemp... yes
checking for tzset... yes
checking for pipe2... no
checking for pselect... yes
checking for isblank... yes
checking for iswctype... yes
checking for strtoimax... yes
checking for symlink... yes
checking for localtime_r... yes
checking for timegm... yes
checking for futimes... yes
checking for futimesat... no
checking for futimens... yes
checking for utimensat... yes
checking for lutimes... yes
checking for getdtablesize... yes
checking for pid_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for snprintf... yes
checking whether GLib is linked in... yes
checking for nl_langinfo and CODESET... yes
checking for nl_langinfo and _NL_PAPER_WIDTH... no
checking for mbstate_t... yes
checking for _setjmp... yes
checking for sigsetjmp... yes
checking for usable FIONREAD... yes
checking for usable SIGIO... yes
checking for struct alignment... yes
checking for typeof syntax and keyword spelling... typeof
checking for statement expressions... yes
checking for working alloca.h... yes
checking for alloca... yes
checking whether // is distinct from /... no
checking whether realpath works... no
checking for C/C++ restrict keyword... __restrict
checking whether byte ordering is bigendian... no
checking whether the preprocessor supports include_next... yes
checking whether system header files limit the line length... no
checking if environ is properly declared... no
checking for complete errno.h... yes
checking whether lstat correctly handles trailing slash... no
checking for mode_t... yes
checking for st_dm_mode in struct stat... no
checking whether strmode is declared... yes
checking for gawk... gawk
checking for getopt.h... (cached) yes
checking for getopt_long_only... yes
checking whether getopt is POSIX compatible... no
checking for struct timeval... yes
checking for wide-enough struct timeval.tv_sec member... yes
checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... yes
checking whether stdint.h conforms to C99... yes
checking whether stdint.h predates C++11... no
checking whether stdint.h has UINTMAX_WIDTH etc.... no
checking whether memmem is declared... yes
checking whether memrchr is declared... no
checking whether <limits.h> defines MIN and MAX... no
checking whether <sys/param.h> defines MIN and MAX... yes
checking whether time_t is signed... yes
checking whether alarm is declared... yes
checking for working mktime... no
checking whether struct tm is in sys/time.h or time.h... time.h
checking for struct tm.tm_zone... yes
checking for struct tm.tm_gmtoff... yes
checking whether <sys/select.h> is self-contained... yes
checking for inline... inline
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking whether we are using the GNU C Library >= 2.1 or uClibc... no
checking for sigset_t... yes
checking for wchar_t... yes
checking whether strnlen is declared... yes
checking whether strtoimax is declared... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking whether stat file-mode macros are broken... no
checking for struct timespec in <time.h>... yes
checking whether clearerr_unlocked is declared... yes
checking whether feof_unlocked is declared... yes
checking whether ferror_unlocked is declared... yes
checking whether fflush_unlocked is declared... no
checking whether fgets_unlocked is declared... no
checking whether fputc_unlocked is declared... no
checking whether fputs_unlocked is declared... no
checking whether fread_unlocked is declared... no
checking whether fwrite_unlocked is declared... no
checking whether getc_unlocked is declared... yes
checking whether getchar_unlocked is declared... yes
checking whether putc_unlocked is declared... yes
checking whether putchar_unlocked is declared... yes
checking whether the utimes function works... yes
checking type of array argument to getgroups... gid_t
checking whether getdtablesize is declared... yes
checking for O_CLOEXEC... yes
checking for promoted mode_t type... int
checking sys/acl.h usability... yes
checking sys/acl.h presence... yes
checking for sys/acl.h... yes
checking for library containing acl_get_file... none required
checking for acl_get_file... yes
checking for acl_get_fd... yes
checking for acl_set_file... yes
checking for acl_set_fd... yes
checking for acl_free... yes
checking for acl_from_mode... no
checking for acl_from_text... yes
checking for acl_delete_def_file... yes
checking for acl_extended_file... no
checking for acl_delete_fd_np... yes
checking for acl_delete_file_np... yes
checking for acl_copy_ext_native... yes
checking for acl_create_entry_np... yes
checking for acl_to_short_text... no
checking for acl_free_text... no
checking for working acl_get_file... yes
checking acl/libacl.h usability... no
checking acl/libacl.h presence... no
checking for acl/libacl.h... no
checking for acl_entries... no
checking for ACL_FIRST_ENTRY... yes
checking for ACL_TYPE_EXTENDED... yes
checking for alloca as a compiler built-in... yes
checking for __builtin_expect... yes
checking byteswap.h usability... no
checking byteswap.h presence... no
checking for byteswap.h... no
checking for library containing clock_gettime... none required
checking for clock_gettime... yes
checking for clock_settime... yes
checking for copy_file_range... no
checking for d_type member in directory struct... yes
checking whether // is distinct from /... (cached) no
checking whether dup2 works... yes
checking for library containing backtrace_symbols_fd... none required
checking for explicit_memset... no
checking for access... yes
checking whether fchmodat+AT_SYMLINK_NOFOLLOW works on non-symlinks... yes
checking whether fcntl handles F_DUPFD correctly... yes
checking whether fcntl understands F_DUPFD_CLOEXEC... yes
checking whether fdopendir is declared... yes
checking whether fdopendir works... yes
checking for flexible array member... yes
checking for __fpending... no
checking whether fstatat (..., 0) works... yes
checking for sys/mount.h... yes
checking how to get file system space usage... checking for statvfs function (SVR4)... no
checking for two-argument statfs with statfs.f_frsize member... no
checking for 3-argument statfs function (DEC OSF/1)... no
checking for two-argument statfs with statfs.f_bsize member (AIX, 4.3BSD)... yes
checking sys/fs/s5param.h usability... no
checking sys/fs/s5param.h presence... no
checking for sys/fs/s5param.h... no
checking sys/statfs.h usability... no
checking sys/statfs.h presence... no
checking for sys/statfs.h... no
checking for statfs that truncates block counts... no
checking for getloadavg... yes
checking sys/loadavg.h usability... no
checking sys/loadavg.h presence... no
checking for sys/loadavg.h... no
checking whether getloadavg is declared... yes
checking whether gettimeofday clobbers localtime buffer... no
checking for gettimeofday with POSIX signature... yes
checking for memmem... yes
checking whether memmem works... no
checking for mempcpy... no
checking for memrchr... no
checking whether signature of pselect conforms to POSIX... yes
checking whether pselect detects invalid fds... yes
checking whether pthread_sigmask is a macro... no
checking whether pthread_sigmask works without -lpthread... yes
checking whether pthread_sigmask returns error numbers... yes
checking whether pthread_sigmask unblocks signals correctly... guessing yes
checking whether readlink signature is correct... yes
checking whether readlink handles trailing slash correctly... no
checking whether readlinkat signature is correct... yes
checking for working re_compile_pattern... no
checking libintl.h usability... no
checking libintl.h presence... no
checking for libintl.h... no
checking whether isblank is declared... yes
checking for sig2str... no
checking for volatile sig_atomic_t... yes
checking for sighandler_t... no
checking for socklen_t... yes
checking for ssize_t... yes
checking for struct stat.st_atim.tv_nsec... no
checking for struct stat.st_atimespec.tv_nsec... yes
checking for struct stat.st_birthtimespec.tv_nsec... yes
checking for working stdalign.h... yes
checking for good max_align_t... yes
checking whether NULL can be used in arbitrary expressions... yes
checking which flavor of printf attribute matches inttypes macros... system
checking for stpcpy... yes
checking for working strnlen... yes
checking whether strtoimax works... yes
checking whether symlink handles trailing slash correctly... no
checking for nlink_t... yes
checking whether localtime_r is declared... yes
checking whether localtime_r is compatible with its POSIX signature... yes
checking whether localtime loops forever near extrema... no
checking for timezone_t... no
checking for library containing timer_settime... no
checking for timer_settime... no
checking for variable-length arrays... yes
checking whether open recognizes a trailing slash... no
checking for euidaccess... no
checking libgen.h usability... yes
checking libgen.h presence... yes
checking for libgen.h... yes
checking for getgroups... yes
checking for working getgroups... yes
checking for library containing eaccess... no
checking for eaccess... no
checking for group_member... no
checking for getgroups... (cached) yes
checking for working getgroups... (cached) yes
checking whether getgroups handles negative values... no
checking whether the compiler supports the __inline keyword... yes
checking for __mktime_internal... no
checking for gcc-9 option to disable position independent executables... not needed

Configured for 'x86_64-apple-darwin18.7.0'.

  Where should the build process find the source code?    .
  What compiler should emacs be built with?               gcc-9 -I/usr/local/Cellar/gcc/9.2.0_3/include -I/usr/local/Cellar/giflib/5.2.1/include -I/usr/local/Cellar/jpeg/9d/include -I/usr/local/Cellar/libtiff/4.1.0/include -I/usr/local/Cellar/gnutls/3.6.12/include -I/usr/local/Cellar/nettle/3.4.1/include -I/usr/local/Cellar/libtasn1/4.16.0/include -I/usr/local/Cellar/p11-kit/0.23.20/include 
  Should Emacs use the GNU version of malloc?             no
    (The GNU allocators don't work with this system configuration.)
  Should Emacs use a relocating allocator for buffers?    no
  Should Emacs use mmap(2) for buffer allocation?         no
  What window system should Emacs use?                    x11
  What toolkit should Emacs use?                          LUCID
  Where do we find X Windows header files?                /usr/X11/include
  Where do we find X Windows libraries?                   /usr/X11/lib
  Does Emacs use -lXaw3d?                                 yes
  Does Emacs use -lXpm?                                   yes
  Does Emacs use -ljpeg?                                  yes
  Does Emacs use -ltiff?                                  yes
  Does Emacs use a gif library?                           yes -lgif
  Does Emacs use a png library?                           yes -L/usr/local/Cellar/libpng/1.6.37/lib -lpng16 -lz
  Does Emacs use -lrsvg-2?                                no
  Does Emacs use cairo?                                   no
  Does Emacs use -llcms2?                                 yes
  Does Emacs use imagemagick?                             no
  Does Emacs support sound?                               no
  Does Emacs use -lgpm?                                   no
  Does Emacs use -ldbus?                                  yes
  Does Emacs use -lgconf?                                 no
  Does Emacs use GSettings?                               yes
  Does Emacs use a file notification library?             yes (kqueue)
  Does Emacs use access control lists?                    yes 
  Does Emacs use -lselinux?                               no
  Does Emacs use -lgnutls?                                yes
  Does Emacs use -lxml2?                                  yes
  Does Emacs use -lfreetype?                              no
  Does Emacs use HarfBuzz?                                no
  Does Emacs use -lm17n-flt?                              no
  Does Emacs use -lotf?                                   no
  Does Emacs use -lxft?                                   no
  Does Emacs use -lsystemd?                               no
  Does Emacs use -ljansson?                               yes
  Does Emacs use -lgmp?                                   no
  Does Emacs directly use zlib?                           yes
  Does Emacs have dynamic modules support?                yes
  Does Emacs use toolkit scroll bars?                     yes
  Does Emacs support Xwidgets (requires gtk3)?            no
  Does Emacs have threading support in lisp?              yes
  Does Emacs support the portable dumper?                 yes
  Does Emacs support legacy unexec dumping?               no
  Which dumping strategy does Emacs use?                  pdumper
  Does Emacs have native lisp compiler?                   yes


configure: creating ./config.status
config.status: creating src/emacs-module.h
config.status: creating Makefile
config.status: creating lib/gnulib.mk
config.status: creating ./doc/man/emacs.1
config.status: creating lib/Makefile
config.status: creating lib-src/Makefile
config.status: creating oldXMenu/Makefile
config.status: creating doc/emacs/Makefile
config.status: creating doc/misc/Makefile
config.status: creating doc/lispintro/Makefile
config.status: creating doc/lispref/Makefile
config.status: creating src/Makefile
config.status: creating lwlib/Makefile
config.status: creating lisp/Makefile
config.status: creating leim/Makefile
config.status: creating nextstep/Makefile
config.status: creating nt/Makefile
config.status: creating test/Makefile
config.status: creating admin/charsets/Makefile
config.status: creating admin/unidata/Makefile
config.status: creating admin/grammars/Makefile
config.status: creating src/config.h
config.status: executing src/epaths.h commands
config.status: executing src/.gdbinit commands
config.status: executing doc/emacs/emacsver.texi commands
config.status: executing etc-refcards-emacsver.tex commands
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C lib all
/Applications/Xcode.app/Contents/Developer/usr/bin/make info-real info-dir
  GEN      alloca.h
  GEN      byteswap.h
  GEN      dirent.h
  GEN      fcntl.h
  GEN      getopt.h
  GEN      getopt-cdefs.h
  GEN      ieee754.h
  GEN      inttypes.h
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C doc/lispref info
  GEN      limits.h
  GEN      signal.h
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C doc/lispintro info
  GEN      stdint.h
  GEN      stdio.h
  GEN      stdlib.h
  GEN      string.h
/usr/local/bin/gmkdir -p ../../info
/usr/local/bin/gmkdir -p ../../info
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C doc/emacs info
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C doc/misc info
  GEN      ../../info/eintr.info
  GEN      ../../info/elisp.info
  GEN      sys/select.h
  GEN      ../../info/emacs.info
  GEN      sys/stat.h
  GEN      sys/time.h
  GEN      time.h
  GEN      ../../info/auth.info
  GEN      unistd.h
  GEN      info/dir
  GEN      sys/types.h
  GEN      ../../info/autotype.info
  GEN      ../../info/bovine.info
  GEN      ../../info/calc.info
  GEN      ../../info/ccmode.info
  GEN      ../../info/cl.info
  GEN      ../../info/dbus.info
  GEN      ../../info/dired-x.info
  GEN      ../../info/ebrowse.info
  GEN      ../../info/ede.info
  GEN      ../../info/ediff.info
  CC       fingerprint.o
  GEN      ../../info/edt.info
  CC       acl_entries.o
  CC       canonicalize-lgpl.o
  CC       copy-file-range.o
  CC       euidaccess.o
  CC       explicit_bzero.o
  GEN      ../../info/eieio.info
  CC       faccessat.o
  GEN      ../../info/emacs-mime.info
  CC       fpending.o
  GEN      ../../info/epa.info
  CC       fstatat.o
  CC       fsusage.o
  GEN      ../../info/erc.info
  GEN      ../../info/ert.info
  GEN      ../../info/eshell.info
  CC       getgroups.o
  CC       getopt.o
  GEN      ../../info/eudc.info
  CC       getopt1.o
  GEN      ../../info/efaq.info
  CC       group-member.o
  GEN      ../../info/eww.info
  CC       lstat.o
  GEN      ../../info/flymake.info
  CC       memmem.o
  GEN      ../../info/forms.info
  CC       mempcpy.o
  CC       memrchr.o
  GEN      ../../info/gnus.info
  GEN      ../../info/emacs-gnutls.info
  CC       mktime.o
  GEN      ../../info/htmlfontify.info
  CC       open.o
  CC       readlink.o
  GEN      ../../info/idlwave.info
  CC       readlinkat.o
  GEN      ../../info/ido.info
  GEN      ../../info/info.info
  CC       regex.o
  CC       sig2str.o
  CC       symlink.o
  CC       time_rz.o
  GEN      ../../info/mairix-el.info
  CC       timegm.o
  GEN      ../../info/message.info
  GEN      ../../info/mh-e.info
  GEN      ../../info/newsticker.info
  CC       acl-errno-valid.o
  CC       acl-internal.o
  GEN      ../../info/nxml-mode.info
  GEN      ../../info/octave-mode.info
  CC       get-permissions.o
  CC       set-permissions.o
  CC       allocator.o
  GEN      ../../info/org.info
  GEN      ../../info/pcl-cvs.info
  GEN      ../../info/pgg.info
  CC       openat-proc.o
  CC       binary-io.o
  CC       c-ctype.o
  GEN      ../../info/rcirc.info
  GEN      ../../info/remember.info
  CC       c-strcasecmp.o
  CC       c-strncasecmp.o
  CC       careadlinkat.o
  GEN      ../../info/reftex.info
  CC       cloexec.o
  GEN      ../../info/sasl.info
  CC       close-stream.o
  CC       count-leading-zeros.o
  CC       count-one-bits.o
  GEN      ../../info/sc.info
  CC       count-trailing-zeros.o
  GEN      ../../info/semantic.info
  GEN      ../../info/ses.info
  CC       md5.o
  CC       sha1.o
  GEN      ../../info/sieve.info
  CC       sha256.o
  CC       sha512.o
  GEN      ../../info/smtpmail.info
  GEN      ../../info/speedbar.info
  GEN      ../../info/srecode.info
  CC       dtoastr.o
  CC       dtotimespec.o
  CC       filemode.o
  GEN      ../../info/todo-mode.info
  CC       filevercmp.o
  CC       gettime.o
  GEN      ../../info/tramp.info
  GEN      ../../info/url.info
  CC       malloca.o
  GEN      ../../info/vhdl-mode.info
  CC       nstrftime.o
  GEN      ../../info/vip.info
  CC       pipe2.o
  GEN      ../../info/viper.info
  CC       qcopy-acl.o
  CC       stat-time.o
  GEN      ../../info/widget.info
  CC       tempname.o
  CC       timespec.o
  GEN      ../../info/wisent.info
  CC       timespec-add.o
  CC       timespec-sub.o
  CC       u64.o
  GEN      ../../info/woman.info
  GEN      ../../info/efaq-w32.info
  CC       unistd.o
  CC       utimens.o
  CC       openat-die.o
  CC       save-cwd.o
  AR       libgnu.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libgnu.a(u64.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libgnu.a(unistd.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libgnu.a(u64.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libgnu.a(unistd.o) has no symbols
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C lib-src all
  CCLD     etags
  CCLD     ctags
  CCLD     emacsclient
  CCLD     ebrowse
  CCLD     hexl
  CCLD     make-docfile
  CCLD     make-fingerprint
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C src VCSWITNESS='$(srcdir)/../.git/logs/HEAD' all
  GEN      lisp.mk
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../admin/charsets all
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../admin/unidata charscript.el
  GEN      globals.h
  GEN      buildobj.h
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../admin/charsets cp51932.el
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../admin/charsets eucjp-ms.el
  GEN      ../../etc/charsets/8859-2.map
  GEN      ../../etc/charsets/8859-3.map
  GEN      ../../etc/charsets/8859-4.map
  GEN      ../../etc/charsets/8859-5.map
  GEN      ../../lisp/international/eucjp-ms.el
  GEN      ../../etc/charsets/8859-6.map
  GEN      ../../etc/charsets/CP932-2BYTE.map
  GEN      ../../etc/charsets/8859-7.map
  GEN      ../../lisp/international/charscript.el
  GEN      ../../etc/charsets/8859-8.map
  GEN      ../../etc/charsets/8859-9.map
  GEN      ../../etc/charsets/8859-10.map
  GEN      ../../etc/charsets/8859-11.map
  GEN      ../../etc/charsets/8859-13.map
  GEN      ../../etc/charsets/8859-14.map
  GEN      ../../etc/charsets/8859-15.map
  GEN      ../../etc/charsets/8859-16.map
  GEN      ../../etc/charsets/IBM037.map
  GEN      ../../etc/charsets/IBM038.map
  GEN      ../../etc/charsets/IBM256.map
  GEN      ../../etc/charsets/IBM273.map
  GEN      ../../etc/charsets/IBM274.map
  GEN      ../../etc/charsets/IBM275.map
  GEN      ../../etc/charsets/IBM277.map
  GEN      ../../etc/charsets/IBM278.map
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../lwlib/ liblw.a
  GEN      ../../etc/charsets/IBM280.map
  GEN      ../../lisp/international/cp51932.el
  CC       dispnew.o
  CC       lwlib.o
  CC       frame.o
  CC       lwlib-Xlw.o
  CC       scroll.o
  CC       xdisp.o
  GEN      ../../etc/charsets/IBM281.map
  CC       xlwmenu.o
  CC       menu.o
  CC       lwlib-Xaw.o
  GEN      ../../etc/charsets/IBM284.map
  GEN      ../../etc/charsets/IBM285.map
  GEN      ../../etc/charsets/IBM290.map
  GEN      ../../etc/charsets/IBM297.map
  GEN      ../../etc/charsets/IBM420.map
  GEN      ../../etc/charsets/IBM423.map
  GEN      ../../etc/charsets/IBM424.map
  GEN      ../../etc/charsets/IBM437.map
  GEN      ../../etc/charsets/IBM500.map
  GEN      ../../etc/charsets/IBM850.map
  GEN      ../../etc/charsets/IBM851.map
  GEN      ../../etc/charsets/IBM852.map
  GEN      ../../etc/charsets/IBM855.map
  CC       lwlib-utils.o
  GEN      ../../etc/charsets/IBM856.map
  GEN      ../../etc/charsets/IBM857.map
  CC       xmenu.o
  GEN      ../../etc/charsets/IBM860.map
  CC       window.o
  GEN      ../../etc/charsets/IBM861.map
  GEN      ../../etc/charsets/IBM862.map
  CC       charset.o
  GEN      ../../etc/charsets/IBM863.map
  GEN      ../../etc/charsets/IBM864.map
  GEN      ../../etc/charsets/IBM865.map
  GEN      ../../etc/charsets/IBM866.map
  GEN      ../../etc/charsets/IBM868.map
  CC       coding.o
  GEN      ../../etc/charsets/IBM869.map
  GEN      ../../etc/charsets/IBM870.map
  CC       category.o
  GEN      ../../etc/charsets/IBM871.map
  GEN      ../../etc/charsets/IBM874.map
  GEN      ../../etc/charsets/IBM875.map
  GEN      liblw.a
  GEN      ../../etc/charsets/IBM880.map
  GEN      ../../etc/charsets/IBM891.map
  GEN      ../../etc/charsets/IBM903.map
  GEN      ../../etc/charsets/IBM904.map
  CC       ccl.o
  CC       character.o
  GEN      ../../etc/charsets/IBM905.map
  GEN      ../../etc/charsets/IBM918.map
  GEN      ../../etc/charsets/IBM1004.map
  GEN      ../../etc/charsets/IBM1026.map
  GEN      ../../etc/charsets/IBM1047.map
  GEN      ../../etc/charsets/CP737.map
  GEN      ../../etc/charsets/CP775.map
  GEN      ../../etc/charsets/CP1125.map
  GEN      ../../etc/charsets/CP1250.map
  GEN      ../../etc/charsets/CP1251.map
  GEN      ../../etc/charsets/CP1252.map
  GEN      ../../etc/charsets/CP1253.map
  GEN      ../../etc/charsets/CP1254.map
  GEN      ../../etc/charsets/CP1255.map
  GEN      ../../etc/charsets/CP1256.map
  CC       chartab.o
  GEN      ../../etc/charsets/CP1257.map
  CC       bidi.o
  GEN      ../../etc/charsets/CP1258.map
  GEN      ../../etc/charsets/CP10007.map
  GEN      ../../etc/charsets/CP720.map
  CC       cm.o
  GEN      ../../etc/charsets/CP858.map
  GEN      ../../etc/charsets/GB2312.map
  GEN      ../../etc/charsets/GBK.map
  CC       term.o
  GEN      ../../etc/charsets/GB180302.map
  GEN      ../../etc/charsets/BIG5.map
  GEN      ../../etc/charsets/BIG5-HKSCS.map
  CC       terminal.o
  CC       xfaces.o
  CC       xterm.o
  GEN      ../../etc/charsets/CNS-1.map
  GEN      ../../etc/charsets/CNS-2.map
  CC       xfns.o
  CC       xselect.o
  GEN      ../../etc/charsets/CNS-3.map
  GEN      ../../etc/charsets/CNS-4.map
  CC       xrdb.o
  GEN      ../../etc/charsets/CNS-5.map
  CC       xsmfns.o
xterm.c: In function 'x_create_toolkit_scroll_bar':
xterm.c:6219:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 6219 |       XtSetArg (av[ac], XtNbeNiceToColormap,
      |       ^~~~~~~~
xterm.c:6230:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 6230 |       XtSetArg (av[ac], XtNbeNiceToColormap, False);
      |       ^~~~~~~~
xterm.c:6237:4: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 6237 |    XtSetArg (av[ac], XtNtopShadowPixel, pixel);
      |    ^~~~~~~~
xterm.c:6243:4: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 6243 |    XtSetArg (av[ac], XtNbottomShadowPixel, pixel);
      |    ^~~~~~~~
xterm.c: In function 'x_create_horizontal_toolkit_scroll_bar':
xterm.c:6420:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 6420 |       XtSetArg (av[ac], XtNbeNiceToColormap,
      |       ^~~~~~~~
xterm.c:6431:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 6431 |       XtSetArg (av[ac], XtNbeNiceToColormap, False);
      |       ^~~~~~~~
xterm.c:6438:4: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 6438 |    XtSetArg (av[ac], XtNtopShadowPixel, pixel);
      |    ^~~~~~~~
xterm.c:6444:4: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 6444 |    XtSetArg (av[ac], XtNbottomShadowPixel, pixel);
      |    ^~~~~~~~
  GEN      ../../etc/charsets/CNS-6.map
  CC       xsettings.o
  GEN      ../../etc/charsets/CNS-7.map
  GEN      ../../etc/charsets/CNS-F.map
xterm.c: In function 'x_parse_color':
xterm.c:2424:61: warning: '%.*s' directive output may be truncated writing up to 2147483647 bytes into a region of size 28 [-Wformat-truncation=]
 2424 |       snprintf (rgb_color_name, sizeof rgb_color_name, "rgb:%.*s/%.*s/%.*s",
      |                                                             ^~~~
xterm.c:2424:56: note: assuming directive output of 1 byte
 2424 |       snprintf (rgb_color_name, sizeof rgb_color_name, "rgb:%.*s/%.*s/%.*s",
      |                                                        ^~~~~~~~~~~~~~~~~~~~
xterm.c:2424:56: note: assuming directive output of 1 byte
xterm.c:2424:56: note: assuming directive output of 1 byte
xterm.c:2424:7: note: 'snprintf' output between 7 and 6442450948 bytes into a destination of size 32
 2424 |       snprintf (rgb_color_name, sizeof rgb_color_name, "rgb:%.*s/%.*s/%.*s",
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2425 |   digits_per_channel, color_name + 1,
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2426 |   digits_per_channel, color_name + digits_per_channel + 1,
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2427 |   digits_per_channel, color_name + 2 * digits_per_channel + 1);
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  GEN      ../../etc/charsets/JISX0201.map
  CC       dbusbind.o
  GEN      ../../etc/charsets/JISX0208.map
  GEN      ../../etc/charsets/JISX0212.map
  CC       emacs.o
  GEN      ../../etc/charsets/JISX2132.map
  GEN      ../../etc/charsets/JISC6226.map
  CC       keyboard.o
  GEN      ../../etc/charsets/JISX213A.map
  CC       macros.o
  GEN      ../../etc/charsets/KSC5601.map
  CC       keymap.o
  GEN      ../../etc/charsets/KSC5636.map
  CC       sysdep.o
  GEN      ../../etc/charsets/JOHAB.map
  GEN      ../../etc/charsets/KOI-8.map
  CC       bignum.o
  GEN      ../../etc/charsets/KOI8-R.map
  GEN      ../../etc/charsets/KOI8-U.map
  GEN      ../../etc/charsets/KOI8-T.map
  GEN      ../../etc/charsets/ALTERNATIVNYJ.map
  GEN      ../../etc/charsets/MIK.map
  CC       buffer.o
  GEN      ../../etc/charsets/PTCP154.map
  GEN      ../../etc/charsets/TIS-620.map
  GEN      ../../etc/charsets/VISCII.map
  GEN      ../../etc/charsets/VSCII.map
  GEN      ../../etc/charsets/VSCII-2.map
  GEN      ../../etc/charsets/KA-PS.map
  GEN      ../../etc/charsets/KA-ACADEMY.map
  CC       filelock.o
  GEN      ../../etc/charsets/HP-ROMAN8.map
  GEN      ../../etc/charsets/NEXTSTEP.map
  GEN      ../../etc/charsets/MACINTOSH.map
  CC       insdel.o
  GEN      ../../etc/charsets/EBCDICUK.map
  GEN      ../../etc/charsets/EBCDICUS.map
  GEN      ../../etc/charsets/stdenc.map
  GEN      ../../etc/charsets/symbol.map
  GEN      ../../etc/charsets/CP949-2BYTE.map
  GEN      ../../etc/charsets/BIG5-1.map
  CC       marker.o
  CC       minibuf.o
  GEN      ../../etc/charsets/BIG5-2.map
  CC       fileio.o
  GEN      ../../etc/charsets/MULE-ethiopic.map
  GEN      ../../etc/charsets/MULE-ipa.map
  GEN      ../../etc/charsets/MULE-is13194.map
  GEN      ../../etc/charsets/MULE-sisheng.map
  GEN      ../../etc/charsets/MULE-tibetan.map
  GEN      ../../etc/charsets/MULE-lviscii.map
  GEN      ../../etc/charsets/MULE-uviscii.map
  GEN      ../../etc/charsets/GB180304.map
  GEN      ../../etc/charsets/JISX2131.map
  CC       dired.o
  CC       cmds.o
  CC       casetab.o
  GEN      charsets.stamp
  CC       casefiddle.o
filelock.c:70: warning: macro "WTMP_FILE" is not used [-Wunused-macros]
   70 | #define WTMP_FILE "/var/log/wtmp"
      | 
  CC       indent.o
  CC       search.o
  CC       regex-emacs.o
  CC       undo.o
  CC       alloc.o
  CC       pdumper.o
  CC       data.o
  CC       doc.o
  CC       editfns.o
  CC       callint.o
  CC       eval.o
  CC       floatfns.o
  CC       fns.o
  CC       font.o
  CC       print.o
  CC       lread.o
  CC       dynlib.o
  CC       emacs-module.o
  CC       syntax.o
  CC       bytecode.o
  CC       comp.o
  CC       process.o
  CC       gnutls.o
  CC       callproc.o
  CC       region-cache.o
  CC       sound.o
  CC       timefns.o
  CC       atimer.o
  CC       doprnt.o
  CC       intervals.o
  CC       textprop.o
  CC       composite.o
  CC       xml.o
  CC       lcms.o
  CC       kqueue.o
  CC       profiler.o
  CC       decompress.o
  CC       thread.o
  CC       systhread.o
  CC       xfont.o
  CC       fontset.o
  CC       fringe.o
  CC       image.o
  CC       xgselect.o
  CC       json.o
  CC       mini-gmp-emacs.o
  CC       terminfo.o
  CC       lastfile.o
  CC       widget.o
  CCLD     temacs
/usr/local/bin/gmkdir -p ../etc
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../lisp update-subdirs
cp -f temacs bootstrap-emacs
rm -f bootstrap-emacs.pdmp
./temacs --batch  -l loadup --temacs=pbootstrap
Loading loadup.el (source)...
dump mode: pbootstrap
Using load-path (/Users/mcdodj/Documents/forked_github/emacs/lisp /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp /Users/mcdodj/Documents/forked_github/emacs/lisp/progmodes /Users/mcdodj/Documents/forked_github/emacs/lisp/language /Users/mcdodj/Documents/forked_github/emacs/lisp/international /Users/mcdodj/Documents/forked_github/emacs/lisp/textmodes /Users/mcdodj/Documents/forked_github/emacs/lisp/vc)
Loading emacs-lisp/byte-run (source)...
Loading emacs-lisp/backquote (source)...
Loading subr (source)...
Loading version (source)...
Loading widget (source)...
Loading custom (source)...
Loading emacs-lisp/map-ynp (source)...
Loading international/mule (source)...
Loading international/mule-conf (source)...
Loading env (source)...
Loading format (source)...
Loading bindings (source)...
Loading window (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/files.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/macroexp.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/pcase.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/macroexp.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/cus-face.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/faces.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/button.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/ldefs-boot.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/nadvice.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/cl-preloaded.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/obarray.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/abbrev.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/simple.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/help.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/jka-cmpr-hook.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/epa-hook.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/international/mule-cmds.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/case-table.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/international/characters.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/international/charscript.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/composite.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/chinese.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/cyrillic.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/indian.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/sinhala.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/english.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/ethiopic.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/european.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/czech.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/slovak.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/romanian.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/greek.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/hebrew.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/international/cp51932.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/international/eucjp-ms.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/japanese.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/korean.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/lao.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/tai-viet.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/thai.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/tibetan.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/vietnamese.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/misc-lang.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/utf-8-lang.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/georgian.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/khmer.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/burmese.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/language/cham.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/indent.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/cl-generic.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/minibuffer.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/frame.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/startup.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/term/tty-colors.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/font-core.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/facemenu.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/syntax.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/font-lock.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/jit-lock.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/mouse.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/scroll-bar.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/select.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/timer.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/isearch.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/rfn-eshadow.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/menu-bar.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/tab-bar.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/lisp.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/textmodes/page.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/register.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/textmodes/paragraphs.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/progmodes/prog-mode.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/lisp-mode.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/progmodes/elisp-mode.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/textmodes/text-mode.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/textmodes/fill.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/newcomment.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/replace.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/tabulated-list.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/buff-menu.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/fringe.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/regexp-opt.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/image.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/international/fontset.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/dnd.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/tool-bar.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/dynamic-setting.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/x-dnd.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/term/common-win.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/term/x-win.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/mwheel.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/float-sup.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/vc/vc-hooks.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/vc/ediff-hook.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/uniquify.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/electric.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/eldoc.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/cus-start.el (source)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/tooltip.el (source)...
Finding pointers to doc strings...
Finding pointers to doc strings...done
Dumping under the name bootstrap-emacs.pdmp
dumping fingerprint: cac5357e3412540604d70607034c4917d63fcb61a2e22f407a84b3d435485d61
Dump complete
Byte counts: header=96 hot=13917816 discardable=136696 cold=9581920
Reloc counts: hot=963702 discardable=4867
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../lisp compile-first EMACS="../src/bootstrap-emacs"
 ELC+ELN   emacs-lisp/macroexp.elc
 ELC+ELN   emacs-lisp/cconv.elc
 ELC+ELN   emacs-lisp/byte-opt.elc
 ELC+ELN   emacs-lisp/bytecomp.elc
 ELC+ELN   emacs-lisp/comp.elc
 ELC+ELN   emacs-lisp/autoload.elc
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../lisp autoloads EMACS="../src/bootstrap-emacs"
 ELC+ELN   ../lisp/abbrev.elc
 ELC+ELN   international/titdic-cnv.elc
 ELC+ELN   ../lisp/bindings.elc
 ELC+ELN   ../lisp/button.elc
 ELC+ELN   ../lisp/buff-menu.elc
 ELC+ELN   ../lisp/case-table.elc
 ELC+ELN   ../lisp/cus-face.elc
 ELC+ELN   ../lisp/disp-table.elc
 ELC+ELN   ../lisp/composite.elc
 ELC+ELN   ../lisp/dnd.elc
 ELC+ELN   ../lisp/custom.elc
 ELC+ELN   ../lisp/cus-start.elc
 ELC+ELN   ../lisp/dos-vars.elc
 ELC+ELN   ../lisp/dynamic-setting.elc
 ELC+ELN   ../lisp/dos-fns.elc
 ELC+ELN   ../lisp/dos-w32.elc
Reloading stale comp.eln
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/x86_64-apple-darwin18.7.0-e90f729ca514de64/comp.eln (native compiled elisp)...
Reloading stale comp.eln
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/x86_64-apple-darwin18.7.0-e90f729ca514de64/comp.eln (native compiled elisp)...
Reloading stale comp.eln
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/x86_64-apple-darwin18.7.0-e90f729ca514de64/comp.eln (native compiled elisp)...
Reloading stale comp.eln
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/x86_64-apple-darwin18.7.0-e90f729ca514de64/comp.eln (native compiled elisp)...
Reloading stale comp.eln
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/x86_64-apple-darwin18.7.0-e90f729ca514de64/comp.eln (native compiled elisp)...
Reloading stale comp.eln
Reloading stale comp.eln
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/x86_64-apple-darwin18.7.0-e90f729ca514de64/comp.eln (native compiled elisp)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/x86_64-apple-darwin18.7.0-e90f729ca514de64/comp.eln (native compiled elisp)...
Reloading stale comp.eln
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/x86_64-apple-darwin18.7.0-e90f729ca514de64/comp.eln (native compiled elisp)...
Reloading stale comp.eln
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/x86_64-apple-darwin18.7.0-e90f729ca514de64/comp.eln (native compiled elisp)...
Reloading stale comp.eln
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/x86_64-apple-darwin18.7.0-e90f729ca514de64/comp.eln (native compiled elisp)...
Reloading stale comp.eln
Reloading stale comp.eln
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/x86_64-apple-darwin18.7.0-e90f729ca514de64/comp.eln (native compiled elisp)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/x86_64-apple-darwin18.7.0-e90f729ca514de64/comp.eln (native compiled elisp)...
Reloading stale comp.eln
Reloading stale comp.eln
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/x86_64-apple-darwin18.7.0-e90f729ca514de64/comp.eln (native compiled elisp)...
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/x86_64-apple-darwin18.7.0-e90f729ca514de64/comp.eln (native compiled elisp)...
Reloading stale comp.eln
Loading /Users/mcdodj/Documents/forked_github/emacs/lisp/emacs-lisp/x86_64-apple-darwin18.7.0-e90f729ca514de64/comp.eln (native compiled elisp)...
Fatal error 11: Segmentation fault
/bin/sh: line 1: 46573 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f byte-compile-refresh-preloaded -f batch-byte-native-compile-for-bootstrap ../lisp/dos-vars.el
make[2]: *** [../lisp/dos-vars.elc] Error 139
make[1]: *** [../lisp/dos-vars.elc] Error 2
make[1]: *** Waiting for unfinished jobs....
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../admin/grammars all EMACS="../../src/bootstrap-emacs"
  GEN      ../../lisp/cedet/semantic/bovine/c-by.el
Fatal error 11: Segmentation fault
/bin/sh: line 1: 46575 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f byte-compile-refresh-preloaded -f batch-byte-native-compile-for-bootstrap ../lisp/dynamic-setting.el
make[2]: *** [../lisp/dynamic-setting.elc] Error 139
make[1]: *** [../lisp/dynamic-setting.elc] Error 2
  GEN      calendar/cal-loaddefs.el
Fatal error 11: Segmentation fault
/bin/sh: line 1: 46572 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f byte-compile-refresh-preloaded -f batch-byte-native-compile-for-bootstrap ../lisp/cus-start.el
make[2]: *** [../lisp/cus-start.elc] Error 139
make[1]: *** [../lisp/cus-start.elc] Error 2
  GEN      ../../lisp/cedet/semantic/bovine/make-by.el
Fatal error 11: Segmentation fault
/bin/sh: line 1: 46566 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f byte-compile-refresh-preloaded -f batch-byte-native-compile-for-bootstrap ../lisp/case-table.el
make[2]: *** [../lisp/case-table.elc] Error 139
make[1]: *** [../lisp/case-table.elc] Error 2
  GEN      mh-e/mh-loaddefs.el
Fatal error 11: Segmentation fault
/bin/sh: line 1: 46563 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f byte-compile-refresh-preloaded -f batch-byte-native-compile-for-bootstrap ../lisp/button.el
make[2]: *** [../lisp/button.elc] Error 139
make[1]: *** [../lisp/button.elc] Error 2
  GEN      ../../lisp/cedet/semantic/bovine/scm-by.el
Fatal error 11: Segmentation fault
/bin/sh: line 1: 46562 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f byte-compile-refresh-preloaded -f batch-byte-native-compile-for-bootstrap ../lisp/buff-menu.el
make[2]: *** [../lisp/buff-menu.elc] Error 139
make[1]: *** [../lisp/buff-menu.elc] Error 2
  GEN      net/tramp-loaddefs.el
  GEN      ../../lisp/cedet/semantic/wisent/javat-wy.el
  GEN      ../../lisp/cedet/semantic/wisent/js-wy.el
  GEN      ../../lisp/cedet/semantic/wisent/python-wy.el
  GEN      ../../lisp/cedet/srecode/srt-wy.el
Fatal error 11: Segmentation fault
/bin/sh: line 1: 46556 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f byte-compile-refresh-preloaded -f batch-byte-native-compile-for-bootstrap ../lisp/abbrev.el
make[2]: *** [../lisp/abbrev.elc] Error 139
make[1]: *** [../lisp/abbrev.elc] Error 2
  INFO     Scraping files for cal-loaddefs.el... 
Loading macroexp.elc...
Fatal error 11: Segmentation fault
/bin/sh: line 1: 46582 Abort trap: 6           EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp -l autoload --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"calendar/cal-loaddefs.el\")))" -f batch-update-autoloads ./calendar
make[2]: *** [calendar/cal-loaddefs.el] Error 134
make[2]: *** Waiting for unfinished jobs....
  INFO     Scraping files for mh-loaddefs.el... 
Loading macroexp.elc...
'condition-case:0:0: error: wrong-type-argument: (stringp 'condition-case)
make[2]: *** [mh-e/mh-loaddefs.el] Error 255
Fatal error 11: Segmentation fault
/bin/sh: line 1: 46574 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f byte-compile-refresh-preloaded -f batch-byte-native-compile-for-bootstrap ../lisp/custom.el
make[2]: *** [../lisp/custom.elc] Error 139
make[1]: *** [../lisp/custom.elc] Error 2
  INFO     Scraping files for tramp-loaddefs.el... 
Fatal error 11: Segmentation fault
/bin/sh: line 1: 46557 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f batch-byte-native-compile-for-bootstrap international/titdic-cnv.el
make[2]: *** [international/titdic-cnv.elc] Error 139
Loading macroexp.elc...
Fatal error 11: Segmentation fault
/bin/sh: line 1: 46612 Abort trap: 6           EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp -l autoload --eval "(setq generate-autoload-cookie \";;;###tramp-autoload\")" --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"net/tramp-loaddefs.el\")))" -f batch-update-autoloads ./net
make[2]: *** [net/tramp-loaddefs.el] Error 134
make[1]: *** [../lisp/loaddefs.el] Error 2
make: *** [src] Error 2
@mikroskeem

This comment has been minimized.

Copy link
Owner Author

mikroskeem commented Mar 6, 2020

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 6, 2020

Mmmm it doesn't look good.
In the sense that is failing native compiling the first files compiled using the native compiled compiler... (yeah :) )
Probably is just related to the fact that this is the first piece of native code loaded. Very hard to say more without debugging it.
Anyway is strange that for mikroskeem is working.

@mikroskeem

This comment has been minimized.

Copy link
Owner Author

mikroskeem commented Mar 6, 2020

I can only confirm that it was working for me when I created this gist.

image

I haven't tried to build it since then 😄 However, I'll try to put together a Nix derivation, or try building (with updated dependencies) using Homebrew when I find time.

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 6, 2020

Thanks @mikroskeem

@dylanjm may I ask you to check out 6664f98821 and have a last run?

@mikroskeem

This comment has been minimized.

Copy link
Owner Author

mikroskeem commented Mar 7, 2020

Yep I'm running into segfaults as well currently. Even with updated dependencies (what Homebrew provides right now, but that shouldn't make any difference really) and unneeded features turned off (dbus etc.)

make[2]: Leaving directory '/Users/mark/gccemacs/build/emacs-build/lisp'
make -C ../lisp autoloads EMACS="../src/bootstrap-emacs"
make[2]: Entering directory '/Users/mark/gccemacs/build/emacs-build/lisp'
 ELC+ELN   ../../emacs/lisp/international/titdic-cnv.elc
 ELC+ELN   ../../emacs/lisp/disp-table.elc
 ELC+ELN   ../../emacs/lisp/bindings.elc
 ELC+ELN   ../../emacs/lisp/composite.elc
 ELC+ELN   ../../emacs/lisp/button.elc
 ELC+ELN   ../../emacs/lisp/buff-menu.elc
 ELC+ELN   ../../emacs/lisp/case-table.elc
 ELC+ELN   ../../emacs/lisp/cus-start.elc
 ELC+ELN   ../../emacs/lisp/dnd.elc
 ELC+ELN   ../../emacs/lisp/abbrev.elc
 ELC+ELN   ../../emacs/lisp/custom.elc
 ELC+ELN   ../../emacs/lisp/cus-face.elc
Reloading stale comp.eln
Loading /Users/mark/gccemacs/build/emacs/lisp/emacs-lisp/x86_64-apple-darwin19.3.0-2114589b31fa2d4e/comp.eln (native compiled elisp)...
Reloading stale comp.eln
Loading /Users/mark/gccemacs/build/emacs/lisp/emacs-lisp/x86_64-apple-darwin19.3.0-2114589b31fa2d4e/comp.eln (native compiled elisp)...
Reloading stale comp.eln
Reloading stale comp.eln
Loading /Users/mark/gccemacs/build/emacs/lisp/emacs-lisp/x86_64-apple-darwin19.3.0-2114589b31fa2d4e/comp.eln (native compiled elisp)...
Loading /Users/mark/gccemacs/build/emacs/lisp/emacs-lisp/x86_64-apple-darwin19.3.0-2114589b31fa2d4e/comp.eln (native compiled elisp)...
Reloading stale comp.eln
Loading /Users/mark/gccemacs/build/emacs/lisp/emacs-lisp/x86_64-apple-darwin19.3.0-2114589b31fa2d4e/comp.eln (native compiled elisp)...
Reloading stale comp.eln
Loading /Users/mark/gccemacs/build/emacs/lisp/emacs-lisp/x86_64-apple-darwin19.3.0-2114589b31fa2d4e/comp.eln (native compiled elisp)...
Reloading stale comp.eln
Reloading stale comp.eln
Loading /Users/mark/gccemacs/build/emacs/lisp/emacs-lisp/x86_64-apple-darwin19.3.0-2114589b31fa2d4e/comp.eln (native compiled elisp)...
Reloading stale comp.eln
Reloading stale comp.eln
Reloading stale comp.eln
Loading /Users/mark/gccemacs/build/emacs/lisp/emacs-lisp/x86_64-apple-darwin19.3.0-2114589b31fa2d4e/comp.eln (native compiled elisp)...
Loading /Users/mark/gccemacs/build/emacs/lisp/emacs-lisp/x86_64-apple-darwin19.3.0-2114589b31fa2d4e/comp.eln (native compiled elisp)...
Loading /Users/mark/gccemacs/build/emacs/lisp/emacs-lisp/x86_64-apple-darwin19.3.0-2114589b31fa2d4e/comp.eln (native compiled elisp)...
Loading /Users/mark/gccemacs/build/emacs/lisp/emacs-lisp/x86_64-apple-darwin19.3.0-2114589b31fa2d4e/comp.eln (native compiled elisp)...
/bin/sh: line 2: 30288 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f byte-compile-refresh-preloaded -f batch-byte-native-compile-for-bootstrap ../../emacs/lisp/cus-start.el
make[2]: *** [Makefile:290: ../../emacs/lisp/cus-start.elc] Error 139
make[1]: *** [Makefile:788: ../../emacs/lisp/cus-start.elc] Error 2
make[1]: *** Waiting for unfinished jobs....
make -C ../admin/grammars all EMACS="../../src/bootstrap-emacs"
make[3]: Entering directory '/Users/mark/gccemacs/build/emacs-build/admin/grammars'
  GEN      ../../../emacs/lisp/cedet/semantic/bovine/c-by.el
/bin/sh: line 2: 30286 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f byte-compile-refresh-preloaded -f batch-byte-native-compile-for-bootstrap ../../emacs/lisp/case-table.el
make[2]: *** [Makefile:290: ../../emacs/lisp/case-table.elc] Error 139
make[1]: *** [Makefile:788: ../../emacs/lisp/case-table.elc] Error 2
  GEN      ../../emacs/lisp/calendar/cal-loaddefs.el
/bin/sh: line 2: 30284 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f byte-compile-refresh-preloaded -f batch-byte-native-compile-for-bootstrap ../../emacs/lisp/button.el
make[2]: *** [Makefile:290: ../../emacs/lisp/button.elc] Error 139
make[1]: *** [Makefile:788: ../../emacs/lisp/button.elc] Error 2
  GEN      ../../emacs/lisp/mh-e/mh-loaddefs.el
/bin/sh: line 2: 30285 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f byte-compile-refresh-preloaded -f batch-byte-native-compile-for-bootstrap ../../emacs/lisp/buff-menu.el
make[2]: *** [Makefile:290: ../../emacs/lisp/buff-menu.elc] Error 139
make[1]: *** [Makefile:788: ../../emacs/lisp/buff-menu.elc] Error 2
  GEN      ../../emacs/lisp/net/tramp-loaddefs.el
  GEN      ../../../emacs/lisp/cedet/semantic/bovine/make-by.el
  GEN      ../../../emacs/lisp/cedet/semantic/bovine/scm-by.el
  GEN      ../../../emacs/lisp/cedet/semantic/wisent/javat-wy.el
/bin/sh: line 2: 30289 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f byte-compile-refresh-preloaded -f batch-byte-native-compile-for-bootstrap ../../emacs/lisp/abbrev.el
make[2]: *** [Makefile:290: ../../emacs/lisp/abbrev.elc] Error 139
make[1]: *** [Makefile:788: ../../emacs/lisp/abbrev.elc] Error 2
  GEN      ../../../emacs/lisp/cedet/semantic/wisent/js-wy.el
  GEN      ../../../emacs/lisp/cedet/semantic/wisent/python-wy.el
  GEN      ../../../emacs/lisp/cedet/srecode/srt-wy.el
  INFO     Scraping files for cal-loaddefs.el...
  INFO     Scraping files for cal-loaddefs.el...14%
/bin/sh: line 3: 30296 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp -l autoload --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"../../emacs/lisp/calendar/cal-loaddefs.el\")))" -f batch-update-autoloads ../../emacs/lisp/calendar
make[2]: *** [Makefile:470: ../../emacs/lisp/calendar/cal-loaddefs.el] Error 139
make[2]: *** Waiting for unfinished jobs....
  INFO     Scraping files for mh-loaddefs.el...
Loading macroexp.elc...
/bin/sh: line 2: 30290 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f byte-compile-refresh-preloaded -f batch-byte-native-compile-for-bootstrap ../../emacs/lisp/custom.el
make[2]: *** [Makefile:290: ../../emacs/lisp/custom.elc] Error 139
make[1]: *** [Makefile:788: ../../emacs/lisp/custom.elc] Error 2
Wrong type argument: listp, level
make[2]: *** [Makefile:445: ../../emacs/lisp/mh-e/mh-loaddefs.el] Error 255
Fatal error 11: Segmentation fault
/bin/sh: line 1: 30279 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f batch-byte-native-compile-for-bootstrap ../../emacs/lisp/international/titdic-cnv.el
make[2]: *** [Makefile:312: ../../emacs/lisp/international/titdic-cnv.elc] Error 139
  INFO     Scraping files for tramp-loaddefs.el...
Loading macroexp.elc...
Wrong type argument: listp, /bin/sh: line 3: 30300 Segmentation fault: 11  EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp -l autoload --eval "(setq generate-autoload-cookie \";;;###tramp-autoload\")" --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"../../emacs/lisp/net/tramp-loaddefs.el\")))" -f batch-update-autoloads ../../emacs/lisp/net
make[2]: *** [Makefile:458: ../../emacs/lisp/net/tramp-loaddefs.el] Error 139
make[3]: Leaving directory '/Users/mark/gccemacs/build/emacs-build/admin/grammars'
make[2]: Leaving directory '/Users/mark/gccemacs/build/emacs-build/lisp'
make[1]: *** [Makefile:802: ../../emacs/lisp/loaddefs.el] Error 2
make[1]: Leaving directory '/Users/mark/gccemacs/build/emacs-build/src'
make: *** [Makefile:424: src] Error 2

I'll try building 6664f98821 in few moments

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 7, 2020

As a test would be interesting to try 6664f98821

@mikroskeem

This comment has been minimized.

Copy link
Owner Author

mikroskeem commented Mar 7, 2020

Also fails with SIGSEGV

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 7, 2020

Okay then I've no specific ideas. Should debug or bisect

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 7, 2020

Another big difference since you had it working is that now comp-speed is 2 by default. Obviously I've no idea if this makes a difference

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 7, 2020

with comp-speed 1 there are also segmentation faults on both latest native-comp branch and 6664f98821.

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 7, 2020

If you are in the tests give a try to speed 0 too so we know what's the situation.

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 7, 2020

with comp-speed 0 it works on 6664f98821. Will try latest native-comp branch.

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 7, 2020

Looks like make clean doesn't clean all needed files and I have strange errors like:

Loading emacs-lisp/byte-run (native compiled elisp)...
Symbol’s function definition is void: byte-run--unescaped-character-literals-warning
make[1]: *** [bootstrap-emacs.pdmp] Error 255
make: *** [src] Error 2

Will retry on clean repo.

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 7, 2020

This is very possible especially since we have moved the eln into different sub folders, I take note to fix it

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 7, 2020

with comp-speed 0 it works on latest native-comp branch. Will continue experimenting.

@mikroskeem

This comment has been minimized.

Copy link
Owner Author

mikroskeem commented Mar 7, 2020

I'm sorry, where/how should I set comp-speed? Modify emacs/lisp/emacs-lisp/comp.el?

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 7, 2020

I'm sorry, where/how should I set comp-speed? Modify emacs/lisp/emacs-lisp/comp.el?

A little raw but I think this is the easiest way.

Otherwise should work also setting the environment variable BYTE_COMPILE_EXTRA_FLAGS to --eval '(setq comp-speed 0)'

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 7, 2020

with comp-speed 1 segmentation faults are here on latest feature/native-comp branch. Will try to use version with comp-speed 0. Looks like it's the only option for native comp emacs on mac os.

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 7, 2020

with comp-speed 0 it works on latest native-comp branch. Will continue experimenting.

Cool at least we have something. I can't debug but the next step would be to do a build like CFLAGS'-O0 -g3' make V=1 -j1 and take the first command invocation that fails. Once you have this you can run it as many times you want and also obtain a backtrace.

Here starts the fun! :)

@mikroskeem

This comment has been minimized.

Copy link
Owner Author

mikroskeem commented Mar 7, 2020

If you don't have OSX machine (or vm) around then https://github.com/kholia/OSX-KVM might be a good start for getting your own test environment if you're interested 😄

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 7, 2020

Wow that's interesting!

Now I'm a little task saturated but in the future I could have a look

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 7, 2020

I can't debug but the next step would be to do a build like CFLAGS'-O0 -g3' make V=1 -j1 and take the first command invocation that fails.

with comp-speed 1?

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 7, 2020

I can't debug but the next step would be to do a build like CFLAGS'-O0 -g3' make V=1 -j1 and take the first command invocation that fails.

with comp-speed 1?

I think at this point 1 or 2 should be probably the same

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 7, 2020

Loading /Users/feofan/projects/emacs_debug/lisp/emacs-lisp/eldoc.el (source)...
Loading /Users/feofan/projects/emacs_debug/lisp/cus-start.el (source)...
Loading /Users/feofan/projects/emacs_debug/lisp/tooltip.el (source)...
Finding pointers to doc strings...
Finding pointers to doc strings...done
Dumping under the name bootstrap-emacs.pdmp
dumping fingerprint: 4ea3ec6447e1c24ecadbd8e548b5aa376b58ae26e229f075d70fb4e0fd5e4f88
Dump complete
Byte counts: header=96 hot=13912432 discardable=135272 cold=9577232
Reloc counts: hot=963568 discardable=4827
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ../lisp compile-first EMACS="../src/bootstrap-emacs"
EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)'  \
	-l comp -f batch-byte-native-compile-for-bootstrap emacs-lisp/macroexp.el
EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)'  \
	-l comp -f batch-byte-native-compile-for-bootstrap emacs-lisp/cconv.el
EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)'  \
	-l comp -f batch-byte-native-compile-for-bootstrap emacs-lisp/byte-opt.el
EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)'  \
	-l comp -f batch-byte-native-compile-for-bootstrap emacs-lisp/bytecomp.el
EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)'  \
	-l comp -f batch-byte-native-compile-for-bootstrap emacs-lisp/comp.el
EMACSLOADPATH= '../src/bootstrap-emacs' -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)'  \
	-l comp -f batch-byte-native-compile-for-bootstrap emacs-lisp/autoload.el
Fatal error 11: Segmentation fault
make[2]: *** [emacs-lisp/autoload.elc] Segmentation fault: 11
make[1]: *** [bootstrap-emacs.pdmp] Error 2
make: *** [src] Error 2

or you need all the output?

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 7, 2020

Okay if this was compiled at -j1 the last is the crashing one. You should be able to run:

../src/bootstrap-emacs -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f batch-byte-native-compile-for-bootstrap emacs-lisp/autoload.el from the lisp directory.

At this point you can also run it under gdb and see what's going on

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 7, 2020

(gdb) run  -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f batch-byte-native-compile-for-bootstrap emacs-lisp/autoload.el
Starting program: /Users/feofan/projects/emacs_debug/src/bootstrap-emacs -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f batch-byte-native-compile-for-bootstrap emacs-lisp/autoload.el
[New Thread 0xe03 of process 22594]

and nothing happens. gdb works strange on mac os. Or I don't know how to use it rigth.

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 7, 2020

I've zero experience with mac os sorry. Maybe is just slow?

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 8, 2020

Maybe is just slow?

How many hours should it take? =)

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 8, 2020

:) About the same it takes for crashing from the command line, gdb should add just a small startup overhead.

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 8, 2020

Looks like 9 hours is not enough :) Maybe there is another solution to debug segmentation fault on Mac os

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 8, 2020

Just curiosity: If I understand correctly from command line it crash quickly but on gdb looks its hanging correct?

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 8, 2020

I have found that I should use lldb instead. Results:

%  sudo lldb ../src/bootstrap-emacs
Password:
(lldb) target create "../src/bootstrap-emacs"
Current executable set to '../src/bootstrap-emacs' (x86_64).
(lldb) run -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f batch-byte-native-compile-for-bootstrap emacs-lisp/autoload.el
Process 23036 launched: '/Users/feofan/projects/emacs_debug/src/bootstrap-emacs' (x86_64)
Process 23036 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x000000010011b75a bootstrap-emacs`count_size_as_multibyte(str=0x0000000000000000, len=5514467840) at character.c:644:15
   641 	
   642 	  for (bytes = 0; str < endp; str++)
   643 	    {
-> 644 	      int n = *str < 0x80 ? 1 : 2;
   645 	      if (INT_ADD_WRAPV (bytes, n, &bytes))
   646 	        string_overflow ();
   647 	    }
Target 0: (bootstrap-emacs) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x000000010011b75a bootstrap-emacs`count_size_as_multibyte(str=0x0000000000000000, len=5514467840) at character.c:644:15
    frame #1: 0x00000001002e71b4 bootstrap-emacs`concat(nargs=4, args=0x00007ffeefbfc330, target_type=Lisp_String, last_special=false) at fns.c:726:19
    frame #2: 0x00000001002e6a94 bootstrap-emacs`Fconcat(nargs=4, args=0x00007ffeefbfc330) at fns.c:566:10
    frame #3: 0x0000000144cd0292 comp.eln`F636f6d702d632d66756e632d6e616d65_comp_c_func_name + 642
    frame #4: 0x00000001002d9512 bootstrap-emacs`funcall_subr(subr=0x00000001450283a0, numargs=2, args=0x00007ffeefbfc4c8) at eval.c:2878:19
    frame #5: 0x00000001002d90cf bootstrap-emacs`Ffuncall(nargs=3, args=0x00007ffeefbfc4c0) at eval.c:2803:11
    frame #6: 0x000000010034e337 bootstrap-emacs`declare_imported_func(subr_sym=0x0000000046d63b30, ret_type=0x0000000144817f00, nargs=1, types=0x00007ffeefbfc490) at comp.c:494:5
    frame #7: 0x00000001003520c8 bootstrap-emacs`emit_ctxt_code at comp.c:1999:29
    frame #8: 0x00000001003552cd bootstrap-emacs`Fcomp__compile_ctxt_to_file(base_name=0x0000000144924394) at comp.c:3252:3
    frame #9: 0x00000001002d94eb bootstrap-emacs`funcall_subr(subr=0x00000001009956c0, numargs=1, args=0x00007ffeefbfca68) at eval.c:2876:19
    frame #10: 0x00000001002d90cf bootstrap-emacs`Ffuncall(nargs=2, args=0x00007ffeefbfca60) at eval.c:2803:11
    frame #11: 0x0000000144c93f82 comp.eln`F636f6d702d636f6d70696c652d637478742d746f2d66696c65_comp_compile_ctxt_to_file + 338
    frame #12: 0x00000001002d94eb bootstrap-emacs`funcall_subr(subr=0x0000000145030c70, numargs=1, args=0x00007ffeefbfcbb8) at eval.c:2876:19
    frame #13: 0x00000001002d90cf bootstrap-emacs`Ffuncall(nargs=2, args=0x00007ffeefbfcbb0) at eval.c:2803:11
    frame #14: 0x0000000144c93e05 comp.eln`F636f6d702d66696e616c_comp_final + 613
    frame #15: 0x00000001002d94eb bootstrap-emacs`funcall_subr(subr=0x0000000145030cb0, numargs=1, args=0x00007ffeefbfcd30) at eval.c:2876:19
    frame #16: 0x00000001002d90cf bootstrap-emacs`Ffuncall(nargs=2, args=0x00007ffeefbfcd28) at eval.c:2803:11
    frame #17: 0x0000000100345c75 bootstrap-emacs`exec_byte_code(bytestr=0x000000014492ba04, vector=0x0000000145035995, maxdepth=0x0000000000000016, args_template=0x0000000000000406, nargs=1, args=0x00007ffeefbfd1d0) at bytecode.c:633:12
    frame #18: 0x00000001002d9b71 bootstrap-emacs`funcall_lambda(fun=0x00000001450359c5, nargs=1, arg_vector=0x00007ffeefbfd1c8) at eval.c:2998:11
    frame #19: 0x00000001002d9113 bootstrap-emacs`Ffuncall(nargs=2, args=0x00007ffeefbfd1c0) at eval.c:2805:11
    frame #20: 0x00000001002d897e bootstrap-emacs`call1(fn=0x00000001450359c5, arg1=0x0000000044ed3260) at eval.c:2663:10
    frame #21: 0x00000001002ed440 bootstrap-emacs`mapcar1(leni=9, vals=0x0000000000000000, fn=0x00000001450359c5, seq=0x0000000145886b73) at fns.c:2661:12
    frame #22: 0x00000001002ed86b bootstrap-emacs`Fmapc(function=0x00000001450359c5, sequence=0x0000000145886b73) at fns.c:2734:3
    frame #23: 0x00000001002d9512 bootstrap-emacs`funcall_subr(subr=0x0000000100993b00, numargs=2, args=0x00007ffeefbfd3b8) at eval.c:2878:19
    frame #24: 0x00000001002d90cf bootstrap-emacs`Ffuncall(nargs=3, args=0x00007ffeefbfd3b0) at eval.c:2803:11
    frame #25: 0x0000000144c9305e comp.eln`F6e61746976652d636f6d70696c65_native_compile + 830
    frame #26: 0x00000001002d94eb bootstrap-emacs`funcall_subr(subr=0x0000000145034a00, numargs=1, args=0x00007ffeefbfd538) at eval.c:2876:19
    frame #27: 0x00000001002d90cf bootstrap-emacs`Ffuncall(nargs=2, args=0x00007ffeefbfd530) at eval.c:2803:11
    frame #28: 0x00000001002d897e bootstrap-emacs`call1(fn=0x0000000044f1aca0, arg1=0x000000014491d1b4) at eval.c:2663:10
    frame #29: 0x00000001002ed440 bootstrap-emacs`mapcar1(leni=1, vals=0x0000000000000000, fn=0x0000000044f1aca0, seq=0x0000000145801763) at fns.c:2661:12
    frame #30: 0x00000001002ed86b bootstrap-emacs`Fmapc(function=0x0000000044f1aca0, sequence=0x0000000145801763) at fns.c:2734:3
    frame #31: 0x00000001002d94d2 bootstrap-emacs`funcall_subr(subr=0x0000000145034a40, numargs=0, args=0x00007ffeefbfd718) at eval.c:2874:19
    frame #32: 0x00000001002d90cf bootstrap-emacs`Ffuncall(nargs=1, args=0x00007ffeefbfd710) at eval.c:2803:11
    frame #33: 0x0000000144c92c83 comp.eln`F62617463682d627974652d6e61746976652d636f6d70696c652d666f722d626f6f747374726170_batch_byte_native_compile_for_bootstrap + 259
    frame #34: 0x00000001002d94d2 bootstrap-emacs`funcall_subr(subr=0x0000000145034a80, numargs=0, args=0x00007ffeefbfd848) at eval.c:2874:19
    frame #35: 0x00000001002d90cf bootstrap-emacs`Ffuncall(nargs=1, args=0x00007ffeefbfd840) at eval.c:2803:11
    frame #36: 0x00000001002d7913 bootstrap-emacs`eval_sub(form=0x00000001477af4fb) at eval.c:2254:10
    frame #37: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #38: 0x00000001002d387e bootstrap-emacs`Fif(args=0x00000001477af4cb) at eval.c:427:10
    frame #39: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477af4bb) at eval.c:2235:30
    frame #40: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #41: 0x00000001002d3909 bootstrap-emacs`Fcond(args=0x00000001477acf7b) at eval.c:451:12
    frame #42: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477acf4b) at eval.c:2235:30
    frame #43: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x00000001477aceab) at eval.c:471:13
    frame #44: 0x00000001002d49c6 bootstrap-emacs`FletX(args=0x00000001477ace6b) at eval.c:927:9
    frame #45: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477ace5b) at eval.c:2235:30
    frame #46: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #47: 0x00000001002d39b6 bootstrap-emacs`prog_ignore(body=0x00000001477ace4b) at eval.c:482:3
    frame #48: 0x00000001002d4de7 bootstrap-emacs`Fwhile(args=0x00000001477acdcb) at eval.c:1016:7
    frame #49: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477acdbb) at eval.c:2235:30
    frame #50: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #51: 0x00000001002d49c6 bootstrap-emacs`FletX(args=0x00000001477acd7b) at eval.c:927:9
    frame #52: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477acd6b) at eval.c:2235:30
    frame #53: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #54: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477acd4b) at eval.c:2235:30
    frame #55: 0x00000001002d3860 bootstrap-emacs`Fif(args=0x00000001477acd2b) at eval.c:426:12
    frame #56: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477acd1b) at eval.c:2235:30
    frame #57: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #58: 0x00000001002d4d87 bootstrap-emacs`Flet(args=0x00000001477accfb) at eval.c:995:9
    frame #59: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477acceb) at eval.c:2235:30
    frame #60: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x00000001477a3a1b) at eval.c:471:13
    frame #61: 0x00000001002d4d87 bootstrap-emacs`Flet(args=0x00000001477a39fb) at eval.c:995:9
    frame #62: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477a39eb) at eval.c:2235:30
    frame #63: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #64: 0x00000001002d9ebf bootstrap-emacs`funcall_lambda(fun=0x00000001477a398b, nargs=1, arg_vector=0x00007ffeefbfe920) at eval.c:3069:11
    frame #65: 0x00000001002d98a4 bootstrap-emacs`apply_lambda(fun=0x00000001477a397b, args=0x00000001477a391b, count=15) at eval.c:2935:9
    frame #66: 0x00000001002d7ee9 bootstrap-emacs`eval_sub(form=0x00000001477a390b) at eval.c:2357:9
    frame #67: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x00000001477a257b) at eval.c:471:13
    frame #68: 0x00000001002d4d87 bootstrap-emacs`Flet(args=0x00000001477a239b) at eval.c:995:9
    frame #69: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477a238b) at eval.c:2235:30
    frame #70: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #71: 0x00000001002d9ebf bootstrap-emacs`funcall_lambda(fun=0x00000001477a234b, nargs=0, arg_vector=0x00007ffeefbfeda0) at eval.c:3069:11
    frame #72: 0x00000001002d98a4 bootstrap-emacs`apply_lambda(fun=0x00000001477a233b, args=0x0000000000000000, count=11) at eval.c:2935:9
    frame #73: 0x00000001002d7ee9 bootstrap-emacs`eval_sub(form=0x0000000147bc1a03) at eval.c:2357:9
    frame #74: 0x00000001002d527a bootstrap-emacs`Funwind_protect(args=0x0000000147bc0bc3) at eval.c:1221:9
    frame #75: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x0000000147bc0bb3) at eval.c:2235:30
    frame #76: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #77: 0x00000001002d4d87 bootstrap-emacs`Flet(args=0x0000000147bc0b93) at eval.c:995:9
    frame #78: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x0000000147bc0b83) at eval.c:2235:30
    frame #79: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000147bc0603) at eval.c:471:13
    frame #80: 0x00000001002d387e bootstrap-emacs`Fif(args=0x0000000147bc04a3) at eval.c:427:10
    frame #81: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x0000000147bc0493) at eval.c:2235:30
    frame #82: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #83: 0x00000001002d9ebf bootstrap-emacs`funcall_lambda(fun=0x0000000147bc0453, nargs=0, arg_vector=0x00007ffeefbff4e0) at eval.c:3069:11
    frame #84: 0x00000001002d98a4 bootstrap-emacs`apply_lambda(fun=0x0000000147bc0443, args=0x0000000000000000, count=4) at eval.c:2935:9
    frame #85: 0x00000001002d7ee9 bootstrap-emacs`eval_sub(form=0x0000000147d2174b) at eval.c:2357:9
    frame #86: 0x00000001002d7151 bootstrap-emacs`Feval(form=0x0000000147d2174b, lexical=0x0000000000000000) at eval.c:2111:10
    frame #87: 0x00000001001b3a58 bootstrap-emacs`top_level_2 at keyboard.c:1100:10
    frame #88: 0x00000001002d57a4 bootstrap-emacs`internal_condition_case(bfun=(bootstrap-emacs`top_level_2 at keyboard.c:1099:1), handlers=0x0000000000000090, hfun=(bootstrap-emacs`cmd_error at keyboard.c:919:1)) at eval.c:1364:25
    frame #89: 0x00000001001b3aa7 bootstrap-emacs`top_level_1(ignore=0x0000000000000000) at keyboard.c:1108:5
    frame #90: 0x00000001002d5015 bootstrap-emacs`internal_catch(tag=0x000000000000d410, func=(bootstrap-emacs`top_level_1 at keyboard.c:1105:1), arg=0x0000000000000000) at eval.c:1125:25
    frame #91: 0x00000001001b3974 bootstrap-emacs`command_loop at keyboard.c:1069:2
    frame #92: 0x00000001001b2fcc bootstrap-emacs`recursive_edit_1 at keyboard.c:714:9
    frame #93: 0x00000001001b3169 bootstrap-emacs`Frecursive_edit at keyboard.c:786:3
    frame #94: 0x00000001001ab4d6 bootstrap-emacs`main(argc=<unavailable>, argv=<unavailable>) at emacs.c:2046:3
    frame #95: 0x00007fff6a5067fd libdyld.dylib`start + 1
(lldb) 

I hope it can help.

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 8, 2020

Just curiosity: If I understand correctly from command line it crash quickly but on gdb looks its hanging correct?

yes

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 8, 2020

Ok, if I can bet something is going wrong with the the lisp immediate object within the eln file that gets relocated at every startup.
By the way this is different for non zero speeds.

You see this is dying into the native compiled version of comp-c-func-name where is trying to perform a string concatenation.

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 8, 2020

If you are interested I can guide you on how to go further into the debugging

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 8, 2020

If you are interested I can guide you on how to go further into the debugging

Yes. I would like to see native comp emacs working on mac os.

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 8, 2020

Okay, then next step is to repeat the whole process using.
comp-speed 2
comp-debug 1
the second one will make the system generating .c files for each eln we can debug with the normal C debugger.

I also suggest to go into comp.c:3230 and change

  gcc_jit_context_set_int_option (comp.ctxt,
				  GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL,
				  SPEED);

into

  gcc_jit_context_set_int_option (comp.ctxt,
				  GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL,
				  0);

This will force gcc not to optimize anything on its side making the compilation alot faster and the debug easier.

With this we will see exactly where we are failing into comp-c-func-name to confirm my guess.

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 8, 2020

With this changes it doesn't segfaults on the same step of compilation. Compilation still in progress. Differences: comp-debug 1 and patched comp.c

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 8, 2020

All right, then the trick is likely gcc optimizing or not. Could you undo the modification into comp.c and confirm?

Typically this is a symptom of something that works correctly just if compiled as volatile (not optimizing everything is equivalent to volatile).

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 8, 2020

without modification comp.c:

%  sudo lldb ../src/bootstrap-emacs
(lldb) target create "../src/bootstrap-emacs"
Current executable set to '../src/bootstrap-emacs' (x86_64).
(lldb) run -batch --no-site-file --no-site-lisp --eval '(setq load-prefer-newer t)' -l comp -f batch-byte-native-compile-for-bootstrap emacs-lisp/autoload.el
Process 66912 launched: '/Users/feofan/projects/emacs_debug_2/src/bootstrap-emacs' (x86_64)
Process 66912 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x000000010011b75a bootstrap-emacs`count_size_as_multibyte(str=0x0000000000000000, len=5514080320) at character.c:644:15
   641 	
   642 	  for (bytes = 0; str < endp; str++)
   643 	    {
-> 644 	      int n = *str < 0x80 ? 1 : 2;
   645 	      if (INT_ADD_WRAPV (bytes, n, &bytes))
   646 	        string_overflow ();
   647 	    }
Target 0: (bootstrap-emacs) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x000000010011b75a bootstrap-emacs`count_size_as_multibyte(str=0x0000000000000000, len=5514080320) at character.c:644:15
    frame #1: 0x00000001002e71b4 bootstrap-emacs`concat(nargs=4, args=0x00007ffeefbfc320, target_type=Lisp_String, last_special=false) at fns.c:726:19
    frame #2: 0x00000001002e6a94 bootstrap-emacs`Fconcat(nargs=4, args=0x00007ffeefbfc320) at fns.c:566:10
    frame #3: 0x0000000144cd0292 comp.eln`F636f6d702d632d66756e632d6e616d65_comp_c_func_name + 642
    frame #4: 0x00000001002d9512 bootstrap-emacs`funcall_subr(subr=0x0000000145820e60, numargs=2, args=0x00007ffeefbfc4b8) at eval.c:2878:19
    frame #5: 0x00000001002d90cf bootstrap-emacs`Ffuncall(nargs=3, args=0x00007ffeefbfc4b0) at eval.c:2803:11
    frame #6: 0x000000010034e337 bootstrap-emacs`declare_imported_func(subr_sym=0x0000000046cd1d10, ret_type=0x0000000144937e60, nargs=1, types=0x00007ffeefbfc480) at comp.c:494:5
    frame #7: 0x00000001003520c8 bootstrap-emacs`emit_ctxt_code at comp.c:1999:29
    frame #8: 0x00000001003552cd bootstrap-emacs`Fcomp__compile_ctxt_to_file(base_name=0x000000014480c264) at comp.c:3252:3
    frame #9: 0x00000001002d94eb bootstrap-emacs`funcall_subr(subr=0x00000001009956c0, numargs=1, args=0x00007ffeefbfca58) at eval.c:2876:19
    frame #10: 0x00000001002d90cf bootstrap-emacs`Ffuncall(nargs=2, args=0x00007ffeefbfca50) at eval.c:2803:11
    frame #11: 0x0000000144c93f82 comp.eln`F636f6d702d636f6d70696c652d637478742d746f2d66696c65_comp_compile_ctxt_to_file + 338
    frame #12: 0x00000001002d94eb bootstrap-emacs`funcall_subr(subr=0x0000000145840850, numargs=1, args=0x00007ffeefbfcba8) at eval.c:2876:19
    frame #13: 0x00000001002d90cf bootstrap-emacs`Ffuncall(nargs=2, args=0x00007ffeefbfcba0) at eval.c:2803:11
    frame #14: 0x0000000144c93e05 comp.eln`F636f6d702d66696e616c_comp_final + 613
    frame #15: 0x00000001002d94eb bootstrap-emacs`funcall_subr(subr=0x0000000145840890, numargs=1, args=0x00007ffeefbfcd20) at eval.c:2876:19
    frame #16: 0x00000001002d90cf bootstrap-emacs`Ffuncall(nargs=2, args=0x00007ffeefbfcd18) at eval.c:2803:11
    frame #17: 0x0000000100345c75 bootstrap-emacs`exec_byte_code(bytestr=0x0000000144813504, vector=0x00000001458467c5, maxdepth=0x0000000000000016, args_template=0x0000000000000406, nargs=1, args=0x00007ffeefbfd1c0) at bytecode.c:633:12
    frame #18: 0x00000001002d9b71 bootstrap-emacs`funcall_lambda(fun=0x00000001458457c5, nargs=1, arg_vector=0x00007ffeefbfd1b8) at eval.c:2998:11
    frame #19: 0x00000001002d9113 bootstrap-emacs`Ffuncall(nargs=2, args=0x00007ffeefbfd1b0) at eval.c:2805:11
    frame #20: 0x00000001002d897e bootstrap-emacs`call1(fn=0x00000001458457c5, arg1=0x0000000044692660) at eval.c:2663:10
    frame #21: 0x00000001002ed440 bootstrap-emacs`mapcar1(leni=9, vals=0x0000000000000000, fn=0x00000001458457c5, seq=0x0000000145062ba3) at fns.c:2661:12
    frame #22: 0x00000001002ed86b bootstrap-emacs`Fmapc(function=0x00000001458457c5, sequence=0x0000000145062ba3) at fns.c:2734:3
    frame #23: 0x00000001002d9512 bootstrap-emacs`funcall_subr(subr=0x0000000100993b00, numargs=2, args=0x00007ffeefbfd3a8) at eval.c:2878:19
    frame #24: 0x00000001002d90cf bootstrap-emacs`Ffuncall(nargs=3, args=0x00007ffeefbfd3a0) at eval.c:2803:11
    frame #25: 0x0000000144c9305e comp.eln`F6e61746976652d636f6d70696c65_native_compile + 830
    frame #26: 0x00000001002d94eb bootstrap-emacs`funcall_subr(subr=0x00000001458409d0, numargs=1, args=0x00007ffeefbfd528) at eval.c:2876:19
    frame #27: 0x00000001002d90cf bootstrap-emacs`Ffuncall(nargs=2, args=0x00007ffeefbfd520) at eval.c:2803:11
    frame #28: 0x00000001002d897e bootstrap-emacs`call1(fn=0x00000000447054a0, arg1=0x0000000144802774) at eval.c:2663:10
    frame #29: 0x00000001002ed440 bootstrap-emacs`mapcar1(leni=1, vals=0x0000000000000000, fn=0x00000000447054a0, seq=0x0000000146802763) at fns.c:2661:12
    frame #30: 0x00000001002ed86b bootstrap-emacs`Fmapc(function=0x00000000447054a0, sequence=0x0000000146802763) at fns.c:2734:3
    frame #31: 0x00000001002d94d2 bootstrap-emacs`funcall_subr(subr=0x0000000145840a10, numargs=0, args=0x00007ffeefbfd708) at eval.c:2874:19
    frame #32: 0x00000001002d90cf bootstrap-emacs`Ffuncall(nargs=1, args=0x00007ffeefbfd700) at eval.c:2803:11
    frame #33: 0x0000000144c92c83 comp.eln`F62617463682d627974652d6e61746976652d636f6d70696c652d666f722d626f6f747374726170_batch_byte_native_compile_for_bootstrap + 259
    frame #34: 0x00000001002d94d2 bootstrap-emacs`funcall_subr(subr=0x0000000145840a50, numargs=0, args=0x00007ffeefbfd838) at eval.c:2874:19
    frame #35: 0x00000001002d90cf bootstrap-emacs`Ffuncall(nargs=1, args=0x00007ffeefbfd830) at eval.c:2803:11
    frame #36: 0x00000001002d7913 bootstrap-emacs`eval_sub(form=0x00000001477d42f3) at eval.c:2254:10
    frame #37: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #38: 0x00000001002d387e bootstrap-emacs`Fif(args=0x00000001477d42c3) at eval.c:427:10
    frame #39: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477d42b3) at eval.c:2235:30
    frame #40: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #41: 0x00000001002d3909 bootstrap-emacs`Fcond(args=0x00000001477d1c63) at eval.c:451:12
    frame #42: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477d1c33) at eval.c:2235:30
    frame #43: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x00000001477d1b93) at eval.c:471:13
    frame #44: 0x00000001002d49c6 bootstrap-emacs`FletX(args=0x00000001477d1b53) at eval.c:927:9
    frame #45: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477d1b43) at eval.c:2235:30
    frame #46: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #47: 0x00000001002d39b6 bootstrap-emacs`prog_ignore(body=0x00000001477d1b33) at eval.c:482:3
    frame #48: 0x00000001002d4de7 bootstrap-emacs`Fwhile(args=0x00000001477d1ab3) at eval.c:1016:7
    frame #49: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477d1aa3) at eval.c:2235:30
    frame #50: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #51: 0x00000001002d49c6 bootstrap-emacs`FletX(args=0x00000001477d1a63) at eval.c:927:9
    frame #52: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477d1a53) at eval.c:2235:30
    frame #53: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #54: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477d1a33) at eval.c:2235:30
    frame #55: 0x00000001002d3860 bootstrap-emacs`Fif(args=0x00000001477d1a13) at eval.c:426:12
    frame #56: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477d1a03) at eval.c:2235:30
    frame #57: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #58: 0x00000001002d4d87 bootstrap-emacs`Flet(args=0x00000001477d19e3) at eval.c:995:9
    frame #59: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477d19d3) at eval.c:2235:30
    frame #60: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x00000001477c79c3) at eval.c:471:13
    frame #61: 0x00000001002d4d87 bootstrap-emacs`Flet(args=0x00000001477c79a3) at eval.c:995:9
    frame #62: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477c7993) at eval.c:2235:30
    frame #63: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #64: 0x00000001002d9ebf bootstrap-emacs`funcall_lambda(fun=0x00000001477c7933, nargs=1, arg_vector=0x00007ffeefbfe910) at eval.c:3069:11
    frame #65: 0x00000001002d98a4 bootstrap-emacs`apply_lambda(fun=0x00000001477c7923, args=0x00000001477c78c3, count=15) at eval.c:2935:9
    frame #66: 0x00000001002d7ee9 bootstrap-emacs`eval_sub(form=0x00000001477c78b3) at eval.c:2357:9
    frame #67: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x00000001477c6603) at eval.c:471:13
    frame #68: 0x00000001002d4d87 bootstrap-emacs`Flet(args=0x00000001477c6423) at eval.c:995:9
    frame #69: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x00000001477c6413) at eval.c:2235:30
    frame #70: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #71: 0x00000001002d9ebf bootstrap-emacs`funcall_lambda(fun=0x00000001477c63d3, nargs=0, arg_vector=0x00007ffeefbfed90) at eval.c:3069:11
    frame #72: 0x00000001002d98a4 bootstrap-emacs`apply_lambda(fun=0x00000001477c63c3, args=0x0000000000000000, count=11) at eval.c:2935:9
    frame #73: 0x00000001002d7ee9 bootstrap-emacs`eval_sub(form=0x0000000147bc1a03) at eval.c:2357:9
    frame #74: 0x00000001002d527a bootstrap-emacs`Funwind_protect(args=0x0000000147bc0bc3) at eval.c:1221:9
    frame #75: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x0000000147bc0bb3) at eval.c:2235:30
    frame #76: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #77: 0x00000001002d4d87 bootstrap-emacs`Flet(args=0x0000000147bc0b93) at eval.c:995:9
    frame #78: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x0000000147bc0b83) at eval.c:2235:30
    frame #79: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000147bc0603) at eval.c:471:13
    frame #80: 0x00000001002d387e bootstrap-emacs`Fif(args=0x0000000147bc04a3) at eval.c:427:10
    frame #81: 0x00000001002d7748 bootstrap-emacs`eval_sub(form=0x0000000147bc0493) at eval.c:2235:30
    frame #82: 0x00000001002d3986 bootstrap-emacs`Fprogn(body=0x0000000000000000) at eval.c:471:13
    frame #83: 0x00000001002d9ebf bootstrap-emacs`funcall_lambda(fun=0x0000000147bc0453, nargs=0, arg_vector=0x00007ffeefbff4d0) at eval.c:3069:11
    frame #84: 0x00000001002d98a4 bootstrap-emacs`apply_lambda(fun=0x0000000147bc0443, args=0x0000000000000000, count=4) at eval.c:2935:9
    frame #85: 0x00000001002d7ee9 bootstrap-emacs`eval_sub(form=0x0000000147d2174b) at eval.c:2357:9
    frame #86: 0x00000001002d7151 bootstrap-emacs`Feval(form=0x0000000147d2174b, lexical=0x0000000000000000) at eval.c:2111:10
    frame #87: 0x00000001001b3a58 bootstrap-emacs`top_level_2 at keyboard.c:1100:10
    frame #88: 0x00000001002d57a4 bootstrap-emacs`internal_condition_case(bfun=(bootstrap-emacs`top_level_2 at keyboard.c:1099:1), handlers=0x0000000000000090, hfun=(bootstrap-emacs`cmd_error at keyboard.c:919:1)) at eval.c:1364:25
    frame #89: 0x00000001001b3aa7 bootstrap-emacs`top_level_1(ignore=0x0000000000000000) at keyboard.c:1108:5
    frame #90: 0x00000001002d5015 bootstrap-emacs`internal_catch(tag=0x000000000000d410, func=(bootstrap-emacs`top_level_1 at keyboard.c:1105:1), arg=0x0000000000000000) at eval.c:1125:25
    frame #91: 0x00000001001b3974 bootstrap-emacs`command_loop at keyboard.c:1069:2
    frame #92: 0x00000001001b2fcc bootstrap-emacs`recursive_edit_1 at keyboard.c:714:9
    frame #93: 0x00000001001b3169 bootstrap-emacs`Frecursive_edit at keyboard.c:786:3
    frame #94: 0x00000001001ab4d6 bootstrap-emacs`main(argc=<unavailable>, argv=<unavailable>) at emacs.c:2046:3
    frame #95: 0x00007fff6a5067fd libdyld.dylib`start + 1
    frame #96: 0x00007fff6a5067fd libdyld.dylib`start + 1
(lldb) 
@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 8, 2020

Perfect now in the debugger you should move frame up into

frame #3: 0x0000000144cd0292 comp.elnF636f6d702d632d66756e632d6e616d65_comp_c_func_name + 642`

And print where we are there into the dumped pseudo c file.

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 8, 2020

frame #3: 0x0000000144d7a292 comp.eln`F636f6d702d632d66756e632d6e616d65_comp_c_func_name + 642
comp.eln`F636f6d702d632d66756e632d6e616d65_comp_c_func_name:
->  0x144d7a292 <+642>: addq   $0xd8, %rsp
    0x144d7a299 <+649>: popq   %rbx
    0x144d7a29a <+650>: popq   %rbp
    0x144d7a29b <+651>: popq   %r12
@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 8, 2020

Mmmm In gdb on GNU/linux the debugger should show the presudo C source of comp.eln.
Is this C source file generated aside the eln one?

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 8, 2020

line 642:

  union comp_Lisp_Object (*) (union comp_Lisp_Object, union comp_Lisp_Object) R7365742d70726f636573732d66696c746572_set_process_filter;

Снимок экрана 2020-03-08 в 19 33 38

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 8, 2020

I think 642 is the offset of the address of the program counter in the function

@s-kostyaev

This comment has been minimized.

Copy link

s-kostyaev commented Mar 8, 2020

Maybe. How can I help then?

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Mar 8, 2020

I think probably is better I look into it when I find the time using the qemu suggesiton from @mikroskeem.

Ideally the best would be to report the bug as suggested in https://debbugs.gnu.org/Emacs.html prefixing into the subject that this is related to the feature/native-comp branch. In this way everybody will know this bug exists and I'll have under my todo list.

For the testing I'd keep on verifying for now that compiling with make bootstrap BYTE_COMPILE_EXTRA_FLAGS='--eval "(setq comp-speed 0)"' all the rest is functional. I'd update also this tutorial accordingly with this command.

@wazdra

This comment has been minimized.

Copy link

wazdra commented May 1, 2020

it's pbpaste, not pbcopy

@wazdra

This comment has been minimized.

Copy link

wazdra commented May 1, 2020

Also, you should put * instead of version numbers in paths in libs in build.sh. This might break when you have multiple versions, but at least it doesn't when you're up-to-date :p

@mikroskeem

This comment has been minimized.

Copy link
Owner Author

mikroskeem commented May 1, 2020

It's not very big effort to update them manually. This gist is not really meant for copy pasting, like most of the things online anyway.

@wazdra

This comment has been minimized.

Copy link

wazdra commented May 1, 2020

Haha yeah, must be my wildcard OCDs talking !

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented May 2, 2020

Hi all,

did somebody recently tried compiling speed 2 on Mac?

I ask that because I tried compiling yesterday on FreeBSD for this bug that looks very similar and to my surprise I succeeded with no errors in contrast with what is observed by the bug reporter.

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40462

Also I see here https://emacs-china.org/t/macos-emacs-28-native-comp/12201/68 (yes I read you guys : ) wanglm succeeded compiling on Mac (speed 3 !!).

At this point I start suspecting some difference in the compilation processes is leading to this symptom.

@wazdra

This comment has been minimized.

Copy link

wazdra commented May 2, 2020

Indeed, it works at speed2 using wanglm's solution, and it doesn't work with this gist. It even works with cocoa. I compiled with NATIVE_FAST_BOOT=1. Next week I'll be able to try a full compilation, still at speed2.

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented May 2, 2020

Thanks wazdra.

I think mikroskeem did a very useful job with this gist pioneering gccemacs on mac so we have thank him :)

I think what we have to do now is:

  • Investigate what's the difference and understand why this is not working.

  • Update this guide or write a new one elsewhere on how to compile it from scratch. I'd like to report the link on my dev blog too so it can be found.

@wazdra

This comment has been minimized.

Copy link

wazdra commented May 2, 2020

I think it might lie in the use of gnu-sed rather than the sed shipped with mac OS, which basically would mean :

  • adding gnu-sed in Dependencies
  • adding this in $PATH : /usr/local/opt/gnu-sed/libexec/gnubin
@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented May 2, 2020

Mmmhh that would be very curious.

Other differences are the compiler and LDFLAGS.

There are 3 options: debug, do some experimentation or manage to register on emacs-china and ask wanglm :) :)

@akermu

This comment has been minimized.

Copy link

akermu commented May 2, 2020

So I also got it to compile under MAC OS X (commit sha: 02e3ffad6d9f757599bb441704b6cf6494183174) and also had the segfaults/buserrors mentioned in this thread. What helped was a clean build directory (git clean -dxf). Compiling with the native MAC OS X clang (LDFLAGS='-L/usr/local/Cellar/gcc/9.3.0_1/lib/gcc/9' /configure --with-modules --with-nativecomp --with-imagemagick --with-xml2 --with-gnutls --with-jansson --with-ns). For me it works perfect with comp-speed 2 and the native cocoa gui.

Also the build error happened to me also when I configured accidently without --with-nativecomp, so it might actually a unrelated issue.

@mikroskeem

This comment has been minimized.

Copy link
Owner Author

mikroskeem commented May 2, 2020

So you managed to build actually with clang and simply linked against libgccjit?

@akermu

This comment has been minimized.

Copy link

akermu commented May 2, 2020

Yep, I the gcc is also build with the system clang, so there shouldn't be any issues. And since libgccjit is a shared library, you don't have to actually use gcc.

@mikroskeem

This comment has been minimized.

Copy link
Owner Author

mikroskeem commented May 2, 2020

Neat, so it works. I'll adapt the gist at some point to link against the libgccjit instead, because building with cocoa UI is a lot better in terms of usability (should always target native gui toolkit instead of poorly supported one).

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented May 2, 2020

Super!

Maybe ping me, I'll link the updated gist in my next blog update.

@sjrmanning

This comment has been minimized.

Copy link

sjrmanning commented May 4, 2020

Just to confirm, I just ran through this for the first time today and @akermu's comment worked for me (macOS 10.15.4). There was an issue with the installed app looking for the lisp directory in the wrong place (looking for Contents/lisp instead of Contents/Resources/lisp). There's a comment about this on the emacs-china link, though I don't know exactly what they're saying, I had the same error:

./nextstep/Emacs.app/Contents/MacOS/Emacs
 emacs: dlopen(/Users/sde/src/emacs/nextstep/Emacs.app/Contents/MacOS/../lisp/eln-x86_64-apple-darwin19.5.0-3e45ce4a4d47424c/custom.eln, 1): image not found

Kind of hacky, but for now I copied the lisp dir up to test it out and it ran fine.

@sjrmanning

This comment has been minimized.

Copy link

sjrmanning commented May 5, 2020

Update: the latest commit (introducing a libgccjit smoke test) broke configuring on my system.

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented May 5, 2020

Is it really the last commit or the merge?

If you could file a bug with the complete error would be great.

@d12frosted

This comment has been minimized.

Copy link

d12frosted commented May 5, 2020

Update: the latest commit (introducing a libgccjit smoke test) broke configuring on my system.

The same.

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented May 5, 2020

Please open a bug with [feature/native-comp] in the subject including the full error.

For this you can just send a mail to bug-gnu-emacs@gnu.org or use M-x report-emacs-bug.

Thanks

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented May 5, 2020

EDIT: sorry I'm still sleeping...

Anyway please retry after pulling and add the config.log to the bug report, it will certainly help.

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented May 5, 2020

I think it should be fixed by now. Please give it a try when you can.

@d12frosted

This comment has been minimized.

Copy link

d12frosted commented May 5, 2020

I am still getting this error. Though I never managed to build it, so not sure if it's still the same issue or not. So will wait for others to share their experience 😸

@shshkn

This comment has been minimized.

Copy link

shshkn commented May 7, 2020

I've managed to build with comp-speed 3 and NATIVE_FAST_BOOT flag using

CC="clang" LDFLAGS="-L/usr/local/Cellar/gcc/9.3.0_1/lib/gcc/9"

But full build fails both on macOS and linux (gcc 9.3.0) with:

 ELC+ELN   vc/ediff.elc
Symbol’s value as variable is void: ediff-ignore-case
make[2]: *** [Makefile:312: vc/ediff.elc] Error 255
make[2]: *** Waiting for unfinished jobs....

some notes and benchmarks

@mattsawyer77

This comment has been minimized.

Copy link

mattsawyer77 commented May 7, 2020

@shshkn I tried your approach on macOS (thanks for documenting that, btw!). I seem to get much further in the build process than before, but then the build just stops after the following, with no error message that I can see:

subdir=/Users/sawyer/.local/emacs/emacs-source-feature_native-comp/nextstep/Emacs.app/Contents/Resources/site-lisp && if [ -f "${subdir}/subdirs.el" ]; then true; else umask 022; /usr/local/bin/gmkdir -p "${subdir}"; (echo "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; echo "    (normal-top-level-add-subdirs-to-load-path))") > "${subdir}/subdirs.el"; fi
rm -rf /Users/sawyer/.local/emacs/emacs-source-feature_native-comp/nextstep/Emacs.app/Contents/Resources/share
/Library/Developer/CommandLineTools/usr/bin/make -C lib-src maybe-blessmail
make[1]: Nothing to be done for `maybe-blessmail'.
@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented May 7, 2020

Hi Guys,

thanks for the macos exploration.

Wanted to point out that speed 3 is not meant to be used to compile whole Emacs but typically selected pieces of code.

Redefining functions could not take effect due to inlining and I do not test it on Emacs bootstrap on a regular base.

I do recommend speed 2 as default and 0 for constrained machines.

Andrea

@shshkn

This comment has been minimized.

Copy link

shshkn commented May 7, 2020

@mattsawyer77 It looks like your build succeeded. Check Emacs.app in ~/.local/emacs/emacs-source-feature_native-comp/nextstep. ~/.local/emacs is where build script saves all the data.

@mattsawyer77

This comment has been minimized.

Copy link

mattsawyer77 commented May 7, 2020

@shshkn ah, so it did -- thanks! I was thrown by the exit code of 1 and the empty ~/.local/emacs/emacs-bin-feature_native-comp dir.

I am now able to run the custom emacs via the terminal and macOS GUI.

@atanasj

This comment has been minimized.

Copy link

atanasj commented May 7, 2020

@shshkn, apologies for my very novice questions here, but how and where do you add this flag? Also, did you build from the brew or from the emacs repo… And, finally, what kinds of improvements have you noticed so far…?

@shshkn

This comment has been minimized.

Copy link

shshkn commented May 8, 2020

@atanasj

did you build from the brew or from the emacs repo

gcc via brew and emacs from source

how and where do you add this flag?

Here is about NATIVE_FAST_BOOT http://akrl.sdf.org/gccemacs.html#org2c87b55

what kinds of improvements have you noticed so far…?

Well, I haven't been using Emacs on macos much lately. So far I can't tell any noticeable improvements aside from what benchmarks tell. Maybe autocomplete, sorting and filtering candidates look faster and stuff like that. The major problem for me is still rendering like discussed here hlissner/doom-emacs#2217 that ruins whole experience with gui emacs.

@atanasj

This comment has been minimized.

Copy link

atanasj commented May 11, 2020

Thanks @shshkn.

@Grekkor

This comment has been minimized.

Copy link

Grekkor commented Jun 15, 2020

I get the following error after a successfull build. This makes emacs not load properly after restarting it the first time.

Native elisp load failed: "/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/eln-x86_64-apple-darwin19.5.0-0d5d423ea4500a50/subr-x.eln", "dlopen(/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/eln-x86_64-apple-darwin19.5.0-0d5d423ea4500a50/subr-x.eln, 1): no suitable image found.  Did find:	/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/eln-x86_64-apple-darwin19.5.0-0d5d423ea4500a50/subr-x.eln: file too short	/Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/eln-x86_64-apple-darwin19.5.0-0d5d423ea4500a50/subr-x.eln: file too short"

The file subr-x.eln is empty. When removing it, emacs loads again but the error above is spammed in the async compile log buffer.
Any ideas on this? I did create the symbolic link from Resources/elisp to elisp in the Emacs.app folder.

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Jun 16, 2020

Maybe @shshkn has an idea of what is going on.

PS @shshkn I wanted to ask why is necessary to create this link and if you think we could avoid that with some workaround on the Emacs side.

@adriancaruana

This comment has been minimized.

Copy link

adriancaruana commented Jun 17, 2020

@Grekkor I experienced this issue with comp-speed of 3, 1, and 0. With 2, I didn't see these issues, but the elisp-benchmarks pidigits benchmark was super slow. See benchmark below:

without native-comp

  | test           | non-gc avg (s) | gc avg (s) | gcs avg | tot avg (s) | tot avg err (s) |
  |----------------+----------------+------------+---------+-------------+-----------------|
  | bubble-no-cons |           6.29 |       0.00 |       0 |        6.29 |            0.08 |
  | bubble         |           3.01 |       0.67 |       3 |        3.68 |            0.11 |
  | dhrystone      |           7.23 |       0.00 |       0 |        7.23 |            0.19 |
  | fibn-rec       |           5.82 |       0.00 |       0 |        5.82 |            0.10 |
  | fibn-tc        |           5.11 |       0.00 |       0 |        5.11 |            0.07 |
  | fibn           |           8.11 |       0.00 |       0 |        8.11 |            0.18 |
  | inclist        |           8.12 |       0.00 |       0 |        8.12 |            0.21 |
  | listlen-tc     |           5.51 |       0.00 |       0 |        5.51 |            0.28 |
  | nbody          |           3.11 |       0.65 |       6 |        3.76 |            0.17 |
  | pidigits       |           0.54 |       0.00 |       0 |        0.54 |            0.02 |
  |----------------+----------------+------------+---------+-------------+-----------------|
  | total          |          52.86 |       1.32 |       9 |       54.18 |            0.51 |

with native-comp and comp-speed of 2

  | test           | non-gc avg (s) | gc avg (s) | gcs avg | tot avg (s) | tot avg err (s) |
  |----------------+----------------+------------+---------+-------------+-----------------|
  | bubble-no-cons |           2.71 |       0.02 |       1 |        2.74 |            0.08 |
  | bubble         |           1.94 |       0.23 |       1 |        2.18 |            0.16 |
  | dhrystone      |           3.84 |       0.00 |       0 |        3.84 |            0.20 |
  | fibn-rec       |           2.07 |       0.00 |       0 |        2.07 |            0.11 |
  | fibn-tc        |           1.46 |       0.00 |       0 |        1.46 |            0.06 |
  | fibn           |           4.37 |       0.00 |       0 |        4.37 |            0.17 |
  | inclist        |           1.96 |       0.00 |       0 |        1.96 |            0.10 |
  | listlen-tc     |           0.20 |       0.00 |       0 |        0.20 |            0.01 |
  | nbody          |           1.78 |       0.45 |       1 |        2.24 |            0.16 |
  | pidigits       |          19.17 |      31.46 |       1 |       50.62 |            3.82 |
  |----------------+----------------+------------+---------+-------------+-----------------|
  | total          |          39.51 |      32.17 |       4 |       71.67 |            3.84 |
@Grekkor

This comment has been minimized.

Copy link

Grekkor commented Jun 20, 2020

I have solved the issue. Though the solution is not very nice. I hope that this can be improved in the future.
It is crucial to start emacs from the console and create a symbolic link from /usr/local/lisp to the Emacs.app/Contents/Resources/lisp folder where Emacs was compiled to. gccemacs expects lisp files to reside in a hardcoded location which is ../lisp/XYZ, since /usr/local/bin/emacs points to the emacs executable but lies inside /usr/local/bin, he searches for lisp files inside /usr/local/lisp/*
I also disabled Native fast boot. Comp speed is set to 3.

@ptn

This comment has been minimized.

Copy link

ptn commented Jul 2, 2020

@AndreaCorallo is this still the recommended way to compile on mac osx?

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Jul 2, 2020

Hi @ptn,

there is no raccomanded way and I never compiled for macOS :)

My undestanding was this is the most up to date guide https://github.com/shshkn/emacs.d/blob/master/docs/nativecomp.md
tho I do not raccomend to bootstrap at speed 3 but I suggest to leave the default instead.

@ptn

This comment has been minimized.

Copy link

ptn commented Jul 2, 2020

Thanks for the quick reply! I'll give that a try.

And let me piggy-back a giant THANK YOU for all your work 🏆

@AndreaCorallo

This comment has been minimized.

Copy link

AndreaCorallo commented Jul 2, 2020

My pleasure :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.