unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#55173: Configure --with-native-compilation does not find libgccjit.dylib when installed with Homebrew (macOS)
@ 2022-04-28 19:42 Eugene Ha
  2022-04-28 21:48 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Eugene Ha @ 2022-04-28 19:42 UTC (permalink / raw)
  To: 55173

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




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

end of thread, other threads:[~2022-04-28 21:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-28 19:42 bug#55173: Configure --with-native-compilation does not find libgccjit.dylib when installed with Homebrew (macOS) Eugene Ha
2022-04-28 21:48 ` Lars Ingebrigtsen

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

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

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