bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#55173: Configure --with-native-compilation does not find libgccjit.d


From: Eugene Ha
Subject: bug#55173: 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]