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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 55173 in the body.
You can then email your comments to 55173 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#55173; Package emacs. (Thu, 28 Apr 2022 20:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eugene Ha <eha <at> posteo.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 28 Apr 2022 20:24:02 GMT) Full text and rfc822 format available.

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



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55173; Package emacs. (Thu, 28 Apr 2022 21:50:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eugene Ha <eha <at> posteo.de>
Cc: 55173 <at> debbugs.gnu.org
Subject: Re: bug#55173: Configure --with-native-compilation does not find
 libgccjit.dylib when installed with Homebrew (macOS)
Date: Thu, 28 Apr 2022 23:48:54 +0200
Eugene Ha <eha <at> posteo.de> writes:

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

Thanks; pushed to Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 55173 <at> debbugs.gnu.org and Eugene Ha <eha <at> posteo.de> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 28 Apr 2022 21:50:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 27 May 2022 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 333 days ago.

Previous Next


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