GNU bug report logs - #55173
Configure --with-native-compilation does not find libgccjit.dylib when installed with Homebrew (macOS)

Previous Next

Package: emacs;

Reported by: Eugene Ha <eha <at> posteo.de>

Date: Thu, 28 Apr 2022 20:24:02 UTC

Severity: normal

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Eugene Ha <eha <at> posteo.de>
To: bug-gnu-emacs <at> gnu.org
Subject: Configure --with-native-compilation does not find libgccjit.dylib
 when installed with Homebrew (macOS)
Date: Thu, 28 Apr 2022 19:42:28 +0000
Dear Emacs maintainers,

Emacs 29.0.50 (a41a181db5f3aca043ed42b228dc56a6403c21a5) fails to build on macOS 12.3.1 when configured with the following invocation:

./configure --with-native-compilation
...
usage: dirname string [...]
checking for gcc_jit_context_acquire in -lgccjit... no
configure: error: ELisp native compiler was requested, but libgccjit was not found.
Please try installing libgccjit or a similar package.
If you are sure you want Emacs be compiled without ELisp native compiler,
pass the --without-native-compilation option to configure.
make: *** [config.status] Error 1

The relevant lines in config.log are the following:

configure:19396: checking for gcc_jit_context_acquire in -lgccjit
configure:19419: gcc -o conftest -g3 -O2 -isystem [...TRUNCATED...]
-I/usr/local/Cellar/libgccjit/11.3.0/include     conftest.c -lgccjit  -lsqlite3   -L >&5
clang: error: argument to '-L' is missing (expected 1 value)

The clang error refers to the dangling "-L ", which should in fact reference the path of libgccjit.so or libgccjit.dylib, depending on what's installed. configure.ac, on the contrary, only checks for libgccjit.so, whereas Homebrew's (3.4.9-17-g80e5327) libgccjit 11.3.0 (bottled) installs libgccjit.dylib.

The following patch enables configure to find the Homebrew-installed libgccjit:

diff --git a/configure.ac b/configure.ac
index 7c8638a471..53e5779e2f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4126,7 +4126,7 @@ AC_DEFUN
           MAC_CFLAGS="-I$(dirname $($BREW ls -v libgccjit | \
                                                 grep libgccjit.h))"
           MAC_LIBS="-L$(dirname $($BREW ls -v libgccjit| \
-                                            grep libgccjit.so\$))"
+                                            grep -E 'libgccjit\.(so|dylib)$'))"
         fi
       fi

Thanks,
Eugene Ha



This bug report was last modified 3 years and 85 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.