禁用 Emacs native-compile
Contents
前言
升级 Mac 到最新版本后,也顺便了升级了 Xcode、gcc、libgccgit,然后还升级了 Emacs。
升级之后发现 native-compile 老是报错,最常见的错误就是
(duplicate LC_RPATH '/opt/homebrew/Cellar/gcc/16.2.0/lib/gcc/current/gcc/aarch64-apple-darwin25/16'),
和
(native-lisp-load-failed ".emacs.d/eln-cache/31.1-e2c98f52/text-property-search-db1383f6-5b330230.eln"
"dlopen(.emacs.d/eln-cache/31.1-e2c98f52/text-property-search-db1383f6-5b330230.eln, 0x0001):
tried: '.emacs.d/eln-cache/31.1-e2c98f52/text-property-search-db1383f6-5b330230.eln'
(mis-aligned LINKEDIT string pool, fileOffset=0x00010794), '.emacs.d/eln-cache/31.1-e2c98f52/text-property-search-db1383f6-5b330230.eln'
(no such file), '.emacs.d/eln-cache/31.1-e2c98f52/text-property-search-db1383f6-5b330230.eln'
(mis-aligned LINKEDIT string pool, fileOffset=0x00010794)")
调了好几天也没搞好,我感觉提升也不大,而且每次升级都需要重新编译一次实在影响体验,而且没什么收益。
在 Emacs-plus@31 上发现禁用也不行,与是干脆切换到 Emacs-Plus@32 版本了,目前也没什么问题。
我使用如下代码来禁用 native-compile
(setq native-comp-jit-compilation nil
native-comp-deferred-compilation nil
native-comp-enable-subr-trampolines nil
comp-enable-subr-trampolines nil)
这段代码在 Emacs-Plus@32 上可用,Emacs-Plus@31 还是有部分代码会编译,一启动就会报错。