unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Mark Barton <mbarton98@gmail.com>
Cc: 57028@debbugs.gnu.org
Subject: bug#57028: 29.0.50; Build error with configure when brew installed 12.1 libgccjit on macos
Date: Sun, 07 Aug 2022 09:29:04 +0300	[thread overview]
Message-ID: <83les0y3bj.fsf@gnu.org> (raw)
In-Reply-To: <8D1D4879-6FBF-4787-8227-D78BB662348C@gmail.com> (message from Mark Barton on Sat, 6 Aug 2022 22:22:55 -0700)

merge 57028 57015
thanks

> From: Mark Barton <mbarton98@gmail.com>
> Date: Sat, 6 Aug 2022 22:22:55 -0700
> 
> Documenting my resolution to a build error caused when the brew update process upgraded me from libgccjit 11.3 to 12.1.
> 
> Error message from configure
> ============================
> 
>   ,----
>   | 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
>   `----
> 
> 
> config.log section showing linker can't map file
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
>   ,----
>   | configure:19555: checking for gcc_jit_context_acquire in -lgccjit
>   | configure:19578: gcc -o conftest -g3 -O2 -isystem /usr/local/Cellar/libffi/3.4.2/include -isystem /usr/local/Cellar/librsvg/2.54.4/include/librsvg-2.0 -isystem /usr/local/Cellar/gdk-pixbuf/2.42.8_1/include/gdk-pixbuf-2.0 -isystem /usr/local/Cellar/jpeg/9e/include -isystem /usr/local/Cellar/libtiff/4.4.0_1/include -isystem /usr/local/Cellar/glib/2.72.3/include -isystem /usr/local/Cellar/cairo/1.16.0_5/include/cairo -isystem /usr/local/Cellar/glib/2.72.3/include -isystem /usr/local/Cellar/glib/2.72.3/include/glib-2.0 -isystem /usr/local/Cellar/glib/2.72.3/lib/glib-2.0/include -isystem /usr/local/opt/gettext/include -isystem /usr/local/Cellar/pcre/8.45/include -isystem /usr/local/Cellar/pixman/0.40.0/include/pixman-1 -isystem /usr/local/Cellar/fontconfig/2.14.0/include -isystem /usr/loc
 al/opt/freetype/include/freetype2 -isystem /usr/local/Cellar/libpng/1.6.37/include/libpng16 -isystem /usr/local/Cellar/libxcb/1.15/include -isystem /usr/local/Cellar/libxrender/0.9.10/include -isystem /usr/local/Cellar/libxext/1.3.4/include -isystem /usr/local/Cellar/libx11/1.8.1/include -isystem /usr/local/Cellar/libxcb/1.15/include -isystem /usr/local/Cellar/libxau/1.0.9/include -isystem /usr/local/Cellar/libxdmcp/1.1.3/include -isystem /usr/local/Cellar/xorgproto/2022.1/include -isystem /usr/local/Cellar/webp/1.2.3_1/include -I/usr/local/Cellar/libgccjit/12.1.0/include     conftest.c -lgccjit  -lsqlite3   -L/usr/local/Cellar/libgccjit/12.1.0/lib/gcc/current
>   | /usr/local/Cellar/libgccjit/12.1.0/lib/gcc/12 >&5
>   | ld: warning: dylib (/usr/local/Cellar/libgccjit/12.1.0/lib/gcc/current/libgccjit.dylib) was built for newer macOS version (12.4) than being linked (12.0)
>   | ld: can't map file, errno=22 file '/usr/local/Cellar/libgccjit/12.1.0/lib/gcc/12' for architecture x86_64
>   | clang: error: linker command failed with exit code 1 (use -v to see invocation)
>   | configure:19578: $? = 1
>   `----
> 
> 
> configure.ac test for brew installed libgccjit
> ==============================================
> 
>   In the example below the test in configure.ac returns two lines and
>   this appears to be the cause of the linker can't map file error.
>   ,----
>   | (python_training) bartm002@C02FM1E2MD6T ~ % brew ls -v libgccjit | grep -E 'libgccjit\.(so|dylib)$'
>   | /usr/local/Cellar/libgccjit/12.1.0/lib/gcc/current/libgccjit.dylib
>   | /usr/local/Cellar/libgccjit/12.1.0/lib/gcc/12/libgccjit.dylib
>   `----
> 
>   Here is the listing to show that both paths are really the same with
>   symbolic links.
>   ,----
>   |   /usr/local/Cellar/libgccjit/12.1.0/lib/gcc:
>   |   drwxr-xr-x 4 bartm002 admin 128 May  6 00:53 .
>   |   drwxr-xr-x 3 bartm002 admin  96 May  6 00:53 ..
>   |   drwxr-xr-x 4 bartm002 admin 128 May  6 00:53 12
>   |     lrwxr-xr-x 1 bartm002 admin  28 May  6 00:53 libgccjit.0.dylib -> ../current/libgccjit.0.dylib
>   |     lrwxr-xr-x 1 bartm002 admin  26 May  6 00:53 libgccjit.dylib -> ../current/libgccjit.dylib
>   |   drwxr-xr-x 4 bartm002 admin 128 May  6 00:53 current
>   |     -rw-r--r-- 1 bartm002 admin 41M Aug  6 18:47 libgccjit.0.dylib
>   |     lrwxr-xr-x 1 bartm002 admin  17 May  6 00:53 libgccjit.dylib -> libgccjit.0.dylib
>   `----
> 
>   Here I modify the test to return only the first line and the build
>   succeeds after this change.
>   ,----
>   | (python_training) bartm002@C02FM1E2MD6T ~ % brew ls -v libgccjit | grep -E 'libgccjit\.(so|dylib)$' | head -n 1
>   | /usr/local/Cellar/libgccjit/12.1.0/lib/gcc/current/libgccjit.dylib
>   `----
> 
>   ,----
>   | diff --git a/configure.ac b/configure.ac
>   | index 1a264275bd..2d88d0ac15 100644
>   | --- a/configure.ac
>   | +++ b/configure.ac
>   | @@ -4241,7 +4241,8 @@ AC_DEFUN
>   |            MAC_CFLAGS="-I$(dirname $($BREW ls -v libgccjit | \
>   |                                                  grep libgccjit.h))"
>   |            MAC_LIBS="-L$(dirname $($BREW ls -v libgccjit| \
>   | -                                            grep -E 'libgccjit\.(so|dylib)$'))"
>   | +                                            grep -E 'libgccjit\.(so|dylib)$'| \
>   | +					    head -n 1))"
>   |          fi
>   |        fi
>   |  
>   `----

This is the same issue as in bug#57015; I've now merged these two bug
reports.

Other than that, I confess to be utterly confused by the actual issue
that's the root cause of this, and I have no idea which of the
possible suggested solutions we should use, both on master and on the
release branch.  Updated proposals tend to be posted at high
frequency, which doesn't contribute to my sense of reliability of the
solutions.

I hope some macOS expert could chime in and clarify the issues enough
for us to make the decisions.





  reply	other threads:[~2022-08-07  6:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-07  5:22 bug#57028: 29.0.50; Build error with configure when brew installed 12.1 libgccjit on macos Mark Barton
2022-08-07  6:29 ` Eli Zaretskii [this message]
2022-08-07  7:15   ` Mark Barton
2022-08-07  8:49     ` Eli Zaretskii
2022-08-07 16:55       ` Mark Barton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83les0y3bj.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=57028@debbugs.gnu.org \
    --cc=mbarton98@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).