unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Third <alan@idiocy.org>
To: Jean-Christophe Helary <lists@traduction-libre.org>,
	Emacs Devel <emacs-devel@gnu.org>
Subject: Re: ./configure --with-native-compilation on macos (11.5.2 Big Sur)
Date: Sun, 5 Sep 2021 14:07:11 +0100	[thread overview]
Message-ID: <YTTA/0MK77l9V0mN@idiocy.org> (raw)
In-Reply-To: <YSDLyqhe9+vVPJKy@idiocy.org>

[-- Attachment #1: Type: text/plain, Size: 3010 bytes --]

On Sat, Aug 21, 2021 at 10:47:54AM +0100, Alan Third wrote:
> On Sat, Aug 21, 2021 at 01:43:17PM +0900, Jean-Christophe Helary wrote:
> > 
> > Apologies. I guess I was under the influence of my second vaccine shot... I forgot to use the --with-native-compilation when I reconfigured after patching...
> > 
> > And the result, with the patch and the flag, is:
> > 
> > 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.
> > 
> > :(
> 
> Can you send, I think, config.log? There should be an error message
> somewhere from the compiler that may give us a better idea of where
> it's going wrong.

I see this in your config.log:

configure:16825: checking for gcc_jit_context_acquire in -lgccjit
configure:16848: gcc -o conftest -g3 -O2 -I/usr/local/Cellar/libffi/3.3_3/include -I/usr/local/Cellar/librsvg/2.50.7/include/librsvg-2.0 -I/usr/local/Cellar/gdk-pixbuf/2.42.6/include/gdk-pixbuf-2.0 -I/usr/local/Cellar/libpng/1.6.37/include/libpng16 -I/usr/local/Cellar/libtiff/4.3.0/include -I/usr/local/Cellar/glib/2.68.3/include -I/usr/local/Cellar/cairo/1.16.0_5/include/cairo -I/usr/local/Cellar/glib/2.68.3/include -I/usr/local/Cellar/glib/2.68.3/include/glib-2.0 -I/usr/local/Cellar/glib/2.68.3/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.45/include -I/usr/local/Cellar/pixman/0.40.0/include/pixman-1 -I/usr/local/Cellar/fontconfig/2.13.1/include -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/Cellar/libpng/1.6.37/include/libpng16 -I/usr/local/Cellar/libxcb/1.14_1/include -I/usr/local/Cellar/libxrender/0.9.10/include -I/usr/local/Cellar/libxext/1.3.4/include -I/usr/local/Cellar/libx11/1.7.2/include -I/usr/local/Cellar/libxcb/1.14_1/include -I/usr/local/Cellar/libxau/1.0.9/include -I/usr/local/Cellar/libxdmcp/1.1.3/include -I/usr/local/Cellar/xorgproto/2021.4/include -I/usr/local/Cellar/libgccjit/11.2.0/include -I   -I/usr/local/opt/readline/include: -L/usr/local/opt/readline/lib: -L/usr/local/Cellar/libgccjit/11.2.0/lib/gcc/11 -L conftest.c -lgccjit    >&5
ld: warning: directory not found for option '-L/usr/local/opt/readline/lib:'
ld: warning: -L path 'conftest.c' is not a directory
ld: warning: dylib (/usr/local/Cellar/libgccjit/11.2.0/lib/gcc/11/libgccjit.so) was built for newer macOS version (11.5) than being linked (11.0)
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It looks like there's a spare "-L" at end of the gcc flags...

I have a suspicion here. You have both Homebrew and MacPorts
installed. Configure is picking up that you have both of them and is
trying to set up libgcc for both...

Perhaps the attached patch will fix it.
-- 
Alan Third

[-- Attachment #2: 0001-Don-t-add-flags-when-MacPorts-is-installed-but-GCC-i.patch --]
[-- Type: text/x-diff, Size: 1528 bytes --]

From 58940e1d4b53cc3e029b94e2a2e00a5d3f9ff9e1 Mon Sep 17 00:00:00 2001
From: Alan Third <alan@idiocy.org>
Date: Sun, 5 Sep 2021 14:04:45 +0100
Subject: [PATCH] Don't add flags when MacPorts is installed but GCC isn't

* configure.ac: Check whether there is any value in $PORT_PACKAGE
before trying to use it.
---
 configure.ac | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6d204b6103..fc4cf088ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3840,12 +3840,14 @@ AC_DEFUN
       # instance).
       PORT_PACKAGE=$(port installed active | grep '^ *gcc@<:@0-9@:>@* ' | \
                           awk '{ print $1; }')
-      MACPORTS_LIBGCCJIT_INCLUDE=$(dirname $(port contents $PORT_PACKAGE | \
-                                           grep libgccjit.h))
-      MACPORTS_LIBGCCJIT_LIB=$(dirname $(port contents $PORT_PACKAGE | \
+      if test -n $PORT_PACKAGE; then
+        MACPORTS_LIBGCCJIT_INCLUDE=$(dirname $(port contents $PORT_PACKAGE | \
+                                             grep libgccjit.h))
+        MACPORTS_LIBGCCJIT_LIB=$(dirname $(port contents $PORT_PACKAGE | \
                                               grep libgccjit.dylib))
-      CFLAGS="$CFLAGS -I${MACPORTS_LIBGCCJIT_INCLUDE}"
-      LDFLAGS="$LDFLAGS -L${MACPORTS_LIBGCCJIT_LIB}"
+        CFLAGS="$CFLAGS -I${MACPORTS_LIBGCCJIT_INCLUDE}"
+        LDFLAGS="$LDFLAGS -L${MACPORTS_LIBGCCJIT_LIB}"
+      fi
     fi
 
     # Check if libgccjit is available.
-- 
2.30.2


  reply	other threads:[~2021-09-05 13:07 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-15  6:10 ./configure --with-native-compilation on macos (11.5.2 Big Sur) Jean-Christophe Helary
2021-08-16 17:18 ` Alan Third
2021-08-17  0:59   ` Jean-Christophe Helary
2021-08-17  1:02     ` Jean-Christophe Helary
2021-08-17 19:45     ` Alan Third
2021-08-20  6:29       ` Jean-Christophe Helary
2021-08-21  4:43         ` Jean-Christophe Helary
2021-08-21  9:47           ` Alan Third
2021-09-05 13:07             ` Alan Third [this message]
2021-09-05 13:22               ` Jean-Christophe Helary
2021-09-06  3:24                 ` Alan Third
2021-09-06  3:46                   ` Jean-Christophe Helary
2021-09-06  6:27                     ` Jean-Christophe Helary
2021-09-06  6:43                       ` Jean-Christophe Helary
2021-09-06  7:10                         ` Jean-Christophe Helary
2021-09-06  7:34                           ` Stefan Kangas
2021-09-06  7:38                             ` Jean-Christophe Helary
2021-09-06  7:52                               ` Stefan Kangas
2021-09-06 10:33                         ` Eli Zaretskii
2021-09-06 12:12                           ` Jean-Christophe Helary
2021-09-06 12:34                             ` Eli Zaretskii
2021-09-06  9:45                       ` Jean-Christophe Helary
2021-09-06 20:01                         ` Alan Third
2021-09-06 23:50                           ` Jean-Christophe Helary
2021-09-13 22:55                             ` Jean-Christophe Helary
2021-09-08  7:34                           ` Lars Ingebrigtsen
2021-09-08 15:31                         ` Alan Third
2021-09-08 20:59                           ` Alan Third
2021-09-08 21:15                             ` Alan Third
2021-09-08 23:44                           ` Jean-Christophe Helary
2021-09-09 21:07                             ` Alan Third
2021-09-10  0:35                               ` Jean-Christophe Helary
2021-09-10 20:53                                 ` Alan Third
2021-09-11  5:54                                   ` Eli Zaretskii
2021-09-11  0:30                               ` Jean-Christophe Helary
2021-09-11 16:17                                 ` Alan Third
2021-09-12  8:47                                   ` Jean-Christophe Helary
2021-09-12 11:59                                     ` Alan Third
2021-09-13 12:06                                       ` Jean-Christophe Helary
2021-09-13 18:19                                         ` Alan Third
2021-09-13 18:42                                           ` Alan Third
2021-09-13 22:04                                             ` Jean-Christophe Helary
2021-09-13 22:08                                               ` Alan Third
2021-09-13 22:24                                                 ` Jean-Christophe Helary
2021-09-13 22:56                                                   ` Jean-Christophe Helary
2021-09-14 15:22                                           ` Alan Third
2021-09-14 17:10                                             ` Jean-Christophe Helary

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=YTTA/0MK77l9V0mN@idiocy.org \
    --to=alan@idiocy.org \
    --cc=emacs-devel@gnu.org \
    --cc=lists@traduction-libre.org \
    /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).