From: Alexander Adolf <alexander.adolf@condition-alpha.com>
To: emacs-devel@gnu.org
Subject: [PATCH] unbreak macOS w/homebrew --with-native-compilation build
Date: Thu, 18 Aug 2022 22:31:44 +0200 [thread overview]
Message-ID: <176af309fa415603c2a284e3cf3bffda@condition-alpha.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 775 bytes --]
Hello,
I upgraded the homebrew packages on my macOS today, and after that could
not build --with-native-compilation any more. It turns out that there is
more than one location for libgccjit.dylib:
---------------------------- Begin Quote -----------------------------
example$ brew ls 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
----------------------------- End Quote ------------------------------
This causes MAC_LIBS to end up being set to just '-L' because dirname
throws up an error message when presented with a multi-line string.
The patch below fixes this by simply picking the first line.
Hoping to have helped,
--alexander
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-finding-libgccjit.dylib-on-homebrew-macOS.patch --]
[-- Type: text/x-patch, Size: 1142 bytes --]
From 48aa2035094e713cac1f2d9499d7feeba1b9c5dc Mon Sep 17 00:00:00 2001
From: Alexander Adolf <alexander.adolf@condition-alpha.com>
Date: Thu, 18 Aug 2022 22:09:34 +0200
Subject: [PATCH] Fix finding libgccjit.dylib on homebrew macOS
* configure.ac: when more than one path to libgccjit.dylib is
available, use the first one only
---
configure.ac | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 1a264275bd..42c5ee6c76 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4240,8 +4240,9 @@ AC_DEFUN
if test -n "`$BREW --prefix --installed libgccjit 2>/dev/null`"; then
MAC_CFLAGS="-I$(dirname $($BREW ls -v libgccjit | \
grep libgccjit.h))"
- MAC_LIBS="-L$(dirname $($BREW ls -v libgccjit| \
- grep -E 'libgccjit\.(so|dylib)$'))"
+ MAC_LIBS="-L$(dirname $($BREW ls -v libgccjit | \
+ grep -E 'libgccjit\.(so|dylib)$' | \
+ head -n 1))"
fi
fi
--
2.37.2
reply other threads:[~2022-08-18 20:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=176af309fa415603c2a284e3cf3bffda@condition-alpha.com \
--to=alexander.adolf@condition-alpha.com \
--cc=emacs-devel@gnu.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).