GNU bug report logs - #79836
31.0.50; Native compilation fails on MacOS Tahoe 26.1: lib emutls_w not found

Previous Next

Package: emacs;

Reported by: Gary Oberbrunner <garyo <at> oberbrunner.com>

Date: Fri, 14 Nov 2025 20:21:02 UTC

Severity: normal

Found in version 31.0.50

To reply to this bug, email your comments to 79836 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#79836; Package emacs. (Fri, 14 Nov 2025 20:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gary Oberbrunner <garyo <at> oberbrunner.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 14 Nov 2025 20:21:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gary Oberbrunner <garyo <at> oberbrunner.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; Native compilation fails on MacOS Tahoe 26.1: lib emutls_w
 not found
Date: Fri, 14 Nov 2025 15:20:05 -0500
[Message part 1 (text/plain, inline)]
I'm running a locally-built version of Emacs master branch from Nov 7, 2025.
After updating my M1 Mac to Tahoe (26.1) (note: Emacs was built with
previous release), native compilation fails with this error:

Compiling
/Users/garyo/.config/emacs/var/elpaca/builds/doom-modeline/doom-modeline.el...
ld: library 'emutls_w' not found
libgccjit.so: error: error invoking gcc driver
"/Users/garyo/.config/emacs/var/elpaca/builds/doom-modeline/doom-modeline.el":
Error Internal native compiler error: "failed to compile",
"/Users/garyo/.config/emacs/var/eln-cache/31_0_50-58a4792a/doom-modeline-4a5bba13-1da7deef.eln",
"error invoking gcc driver"

There is no emutls_w library on my system.
I rebuilt Emacs from scratch using today's latest commit, on Tahoe, and
still get the same error.

In the Emacs build tree, I can see some references to this lib:

>>>>>>>>>>>>>>>>>>>>>>>>
% rg -uuu emutls_w
builds/Emacs.2025-11-14.f83c357.master.macOS-26.arm64/Emacs.app/Contents/Frameworks/gcc/lib/apple-darwin/plugin/
libcp1plugin.0.so: binary file matches (found "\0" byte around offset 5)

builds/Emacs.2025-11-14.f83c357.master.macOS-26.arm64/Emacs.app/Contents/Frameworks/gcc/lib/apple-darwin/plugin/
libcc1plugin.0.so: binary file matches (found "\0" byte around offset 5)

builds/Emacs.2025-11-14.f83c357.master.macOS-26.arm64/Emacs.app/Contents/Frameworks/gcc/lib/apple-darwin/plugin/include/config/darwin.h
334:"%{%:version-compare(>= 10.11 mmacosx-version-min= -lemutls_w): \
540:   we find the emutls impl from lemutls_w. In either case, the builtins
etc.
575:    %{%:version-compare(>= 10.6 mmacosx-version-min= -lemutls_w):  \
577:   : -lemutls_w " DARWIN_HEAP_T_LIB "  \

builds/Emacs.2025-11-14.f83c357.master.macOS-26.arm64/Emacs.app/Contents/Frameworks/libgccjit.0.dylib:
binary file matches (found "\0" byte around offset 5)

builds/Emacs.2025-11-14.f83c357.master.macOS-26.arm64/Emacs.app/Contents/_CodeSignature/CodeResources
19175: <key>Frameworks/gcc/lib/apple-darwin/libemutls_w.a</key>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

======================================================
In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin25.1.0, NS
appkit-2685.20 Version 26.1 (Build 25B78)) of 2025-11-07 built on
MacBookPro.home.oberbrunner.com
Repository revision: 4367d6b80ed562995be16b4a017c25e2baf73931
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2685
System Description:  macOS 26.1

Configured using:
 'configure --with-ns --with-modules
'--enable-locallisppath=/Library/Application
Support/Emacs/${version}/site-lisp:/Library/Application
Support/Emacs/site-lisp:/usr/local/share/emacs/site-lisp:/opt/homebrew/share/emacs/site-lisp'
--with-xwidgets --with-tree-sitter --with-native-compilation=yes
'CFLAGS=-O2 -I/opt/homebrew/opt/gcc/include
-I/opt/homebrew/opt/libgccjit/include -DFD_SETSIZE=10000
-DDARWIN_UNLIMITED_SELECT' 'LDFLAGS=-Wl,-headerpad_max_install_names
-L/opt/homebrew/opt/gcc/lib/gcc/15
-L/opt/homebrew/opt/gcc/lib/gcc/15/gcc/aarch64-apple-darwin24/15
-L/opt/homebrew/opt/libgccjit/lib/gcc/15 -I/opt/homebrew/opt/gcc/include
-I/opt/homebrew/opt/libgccjit/include''

-- 
Gary Oberbrunner
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79836; Package emacs. (Fri, 14 Nov 2025 21:22:02 GMT) Full text and rfc822 format available.

Message #8 received at 79836 <at> debbugs.gnu.org (full text, mbox):

From: Gary Oberbrunner <garyo <at> oberbrunner.com>
To: 79836 <at> debbugs.gnu.org
Subject: Update: native comp works when invoked from Terminal
Date: Fri, 14 Nov 2025 16:21:06 -0500
[Message part 1 (text/plain, inline)]
Weirdly, native-comp works fine when invoked from my Terminal. Just not
from the Finder by double-clicking. Maybe environment vars, $PATH or
something?

-- 
Gary
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79836; Package emacs. (Sat, 15 Nov 2025 07:07:02 GMT) Full text and rfc822 format available.

Message #11 received at 79836 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gary Oberbrunner <garyo <at> oberbrunner.com>
Cc: 79836 <at> debbugs.gnu.org
Subject: Re: bug#79836: 31.0.50;
 Native compilation fails on MacOS Tahoe 26.1: lib emutls_w not found
Date: Sat, 15 Nov 2025 09:05:57 +0200
> From: Gary Oberbrunner <garyo <at> oberbrunner.com>
> Date: Fri, 14 Nov 2025 15:20:05 -0500
> 
> I'm running a locally-built version of Emacs master branch from Nov 7, 2025.
> After updating my M1 Mac to Tahoe (26.1) (note: Emacs was built with previous release), native compilation
> fails with this error:
>  
> Compiling /Users/garyo/.config/emacs/var/elpaca/builds/doom-modeline/doom-modeline.el...
> ld: library 'emutls_w' not found
> libgccjit.so: error: error invoking gcc driver
> "/Users/garyo/.config/emacs/var/elpaca/builds/doom-modeline/doom-modeline.el": Error Internal native
> compiler error: "failed to compile",
> "/Users/garyo/.config/emacs/var/eln-cache/31_0_50-58a4792a/doom-modeline-4a5bba13-1da7deef.eln",
> "error invoking gcc driver"
> 
> There is no emutls_w library on my system. 
> I rebuilt Emacs from scratch using today's latest commit, on Tahoe, and still get the same error.
> 
> In the Emacs build tree, I can see some references to this lib:
> 
> >>>>>>>>>>>>>>>>>>>>>>>>
> % rg -uuu emutls_w
> builds/Emacs.2025-11-14.f83c357.master.macOS-26.arm64/Emacs.app/Contents/Frameworks/gcc/lib/apple-darwin/plugin/libcp1plugin.0.so:
> binary file matches (found "\0" byte around offset 5)
> 
> builds/Emacs.2025-11-14.f83c357.master.macOS-26.arm64/Emacs.app/Contents/Frameworks/gcc/lib/apple-darwin/plugin/libcc1plugin.0.so:
> binary file matches (found "\0" byte around offset 5)
> 
> builds/Emacs.2025-11-14.f83c357.master.macOS-26.arm64/Emacs.app/Contents/Frameworks/gcc/lib/apple-darwin/plugin/include/config/darwin.h
> 
> 334:"%{%:version-compare(>= 10.11 mmacosx-version-min= -lemutls_w): \
> 540:   we find the emutls impl from lemutls_w. In either case, the builtins etc.
> 575:    %{%:version-compare(>= 10.6 mmacosx-version-min= -lemutls_w):  \
> 577:   : -lemutls_w " DARWIN_HEAP_T_LIB "  \
> 
> builds/Emacs.2025-11-14.f83c357.master.macOS-26.arm64/Emacs.app/Contents/Frameworks/libgccjit.0.dylib:
> binary file matches (found "\0" byte around offset 5)
> 
> builds/Emacs.2025-11-14.f83c357.master.macOS-26.arm64/Emacs.app/Contents/_CodeSignature/CodeResources
> 
> 19175: <key>Frameworks/gcc/lib/apple-darwin/libemutls_w.a</key>
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

This seems to be a macOS specific issue with libgccjit.  Emacs doesn't
have this library and doesn't reference it anywhere.  Maybe you need
to upgrade your libgccjit installation to adapt it to the new version
of the OS and tools.  Or maybe it's a bug in libgccjit for macOS which
you should take up with the developers of libgccjit.

One thing I suggest to try is remove all the *.eln files in the
eln-cache and see if that solves the problem: perhaps the problem is
in the *.eln files compiled under the previous OS version, which
therefore reference a library that no longer exists.

In any case, I don't think this is an Emacs bug.

Could macOS users who successfully build Emacs with native compilation
on M1 Mac Tahoe please chime in and share their experience?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79836; Package emacs. (Sat, 15 Nov 2025 07:30:02 GMT) Full text and rfc822 format available.

Message #14 received at 79836 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gary Oberbrunner <garyo <at> oberbrunner.com>
Cc: 79836 <at> debbugs.gnu.org
Subject: Re: bug#79836: 31.0.50;
 Native compilation fails on MacOS Tahoe 26.1: lib emutls_w not found
Date: Sat, 15 Nov 2025 09:29:21 +0200
> From: Gary Oberbrunner <garyo <at> oberbrunner.com>
> Date: Fri, 14 Nov 2025 16:21:06 -0500
> 
> Weirdly, native-comp works fine when invoked from my Terminal. Just not from the Finder by
> double-clicking. Maybe environment vars, $PATH or something? 

Thanks, but please do not change the Subject when you respond to a bug
discussion.  Changing the Subject makes it harder to find related
messages, and can also disrupt the records at our bug tracker.

I've restored the original Subject in my response; please use it from
now opn.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79836; Package emacs. (Sat, 15 Nov 2025 13:34:01 GMT) Full text and rfc822 format available.

Message #17 received at 79836 <at> debbugs.gnu.org (full text, mbox):

From: Stéphane Marks <shipmints <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 79836 <at> debbugs.gnu.org, Gary Oberbrunner <garyo <at> oberbrunner.com>
Subject: Re: bug#79836: 31.0.50; Native compilation fails on MacOS Tahoe 26.1:
 lib emutls_w not found
Date: Sat, 15 Nov 2025 08:33:30 -0500
[Message part 1 (text/plain, inline)]
On Sat, Nov 15, 2025 at 2:32 AM Eli Zaretskii <eliz <at> gnu.org> wrote:

> > From: Gary Oberbrunner <garyo <at> oberbrunner.com>
> > Date: Fri, 14 Nov 2025 16:21:06 -0500
> >
> > Weirdly, native-comp works fine when invoked from my Terminal. Just not
> from the Finder by
> > double-clicking. Maybe environment vars, $PATH or something?
>
> Thanks, but please do not change the Subject when you respond to a bug
> discussion.  Changing the Subject makes it harder to find related
> messages, and can also disrupt the records at our bug tracker.
>
> I've restored the original Subject in my response; please use it from
> now opn.
>

I have an M1 machine but started with macOS 26 and don't see this issue.
However a couple of questions and suggestions.

I assume you're a homebrew user.  Did you upgrade your homebrew or did you
leave the old one before the os upgrade intact?  If you upgraded, and
didn't recompile your Emacs, that is a likely culprit, as the paths to
default gcc versions moved from 14 to 15, I think.

You can try putting this in your early-init.el file (setq
native-comp-enable-subr-trampolines nil) and see if that has a positive
effect.

Do you use https://elpa.nongnu.org/nongnu/exec-path-from-shell.html ?  If
not, you might want to consider it, as the package unifies your environment
variables for both Terminal and launcher originated Emacs sessions.  That
might satisfy PATH requirements.  Put this very early in your init.el,
before async native compilation will kick off.

-Stéphane
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79836; Package emacs. (Sat, 15 Nov 2025 18:06:02 GMT) Full text and rfc822 format available.

Message #20 received at 79836 <at> debbugs.gnu.org (full text, mbox):

From: Rudolf Adamkovič <rudolf <at> adamkovic.org>
To: Stéphane Marks <shipmints <at> gmail.com>, Eli Zaretskii
 <eliz <at> gnu.org>
Cc: Gary Oberbrunner <garyo <at> oberbrunner.com>, 79836 <at> debbugs.gnu.org
Subject: Re: bug#79836: 31.0.50; Native compilation fails on MacOS Tahoe
 26.1: lib emutls_w not found
Date: Sat, 15 Nov 2025 19:05:34 +0100
Stéphane Marks <shipmints <at> gmail.com> writes:

> Do you use https://elpa.nongnu.org/nongnu/exec-path-from-shell.html ?  If
> not, you might want to consider it, as the package unifies your environment
> variables for both Terminal and launcher originated Emacs sessions.  That
> might satisfy PATH requirements.  Put this very early in your init.el,
> before async native compilation will kick off.

Using Bash, I have replaced `exec-path-from-shell' with:

  (dolist (line (process-lines "bash" "-l" "-c" "export"))
    (when (string-match "^.* \\(.*?\\)=\\\"\\(.*\\)\\\"$" line)
      (let ((name (match-string 1 line))
            (value (match-string 2 line)))
        (setenv name value)
        (when (string= name "PATH")
          (setopt exec-path (split-string value path-separator))))))

It would be great to have something like this built-in, as virtually
every new Emacs user suffers from this problem on Mac OS.  The typical
Internet advice is to either install the aforementioned non-GNU ELPA
package, on which Emacs effectively depends on Mac OS, or install some
high-quality Emacs distro that does not have the problem.

(Of course, the code above is not the right solution.  The default shell
on Mac OS is now Zsh and not Bash anyway.  What is needed is something
that does the same job, in a shell-agnostic way, if possible.)

Rudy
-- 
"'Contrariwise,' continued Tweedledee, 'if it was so, it might be; and
if it were so, it would be; but as it isn't, it ain't.  That's logic.'"

--- Lewis Carroll, Through the Looking Glass, 1871/1872

Rudolf Adamkovič <rudolf <at> adamkovic.org> [he/him]
http://adamkovic.org




This bug report was last modified 1 day ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.