Nasy
                
              
              
                  
                  
              85
              
             
            
              一个办法是手动
install_name_tool -change libgccjit.so.0 /path/to/libgccjit.so.0 ./temacs
或者
Install_name_tool -id "/path/to/libgccjit.so.0" libgccjit.so.0
不过,推荐设置 DYLD_FALLBACK_LIBRARY_PATH (可以看 man dlopen)
export DYLD_FALLBACK_LIBRARY_PATH=$HOME/lib:/usr/local/lib:/usr/lib:/path/to/gcc/lib
虽然,我也不知道为什么会没有找到(
             
            
              
              
              
            
           
          
            
            
              我用下面这个configure编译成功了
export PATH=“/usr/local/opt/gnu-sed/libexec/gnubin:${PATH}”
export CFLAGS=“-I/usr/local/Cellar/gcc/10.1.0/include”
export LDFLAGS=“-L/usr/local/Cellar/gcc/10.1.0/lib/gcc/10 -I/usr/local/Cellar/gcc/10.1.0/include”
./autogen.sh
CC=‘clang-10’ 
./configure 
–disable-dependency-tracking 
–disable-silent-rules 
–enable-locallisppath=/usr/local/share/emacs/28.0.50/site-lisp 
–infodir=/usr/local/share/emacs/28.0.50/share/info/emacs 
–prefix=“$HOME/gccemacs”  
–with-nativecomp 
–with-json 
–with-ns 
–disable-ns-self-contained 
–with-xml2 
–with-gnutls 
–with-imagemagick  
–with-modules  
–with-rsvg
make -j4
make install
但是双击运行 ./nextstep/Emacs.app 所有文字都不显示
使用 ./nextstep/Emacs.app/Content/MacOS/emacs -nw 在终端里运行正常
这会是啥问题?折腾了几个小时没头绪……
             
            
              
              
              
            
           
          
            
            
              
emacsclient 连不上 daemon, native-comp 分支编译的
             
            
              
              
              
            
           
          
            
            
              27不用native也会变快,因为27里json是用C处理,不再用emacs lisp
             
            
              
              
              
            
           
          
            
            
              Mac 用户可以不必折腾编译了,已有多种方案可选:
- 
Nix 
- 
Homebrew 
 
            
              
              
              3 个赞
            
           
          
            
            
              最近写 elixir 发现 emacs 性能不是很够,观望中。
             
            
              
              
              
            
           
          
            
            
              native-comp 我估计入 master 是板上钉钉的事情了, 今天看见 emacs-devel 上讨论, emacs 主要开发者好像都支持 native-comp,
             
            
              
              
              
            
           
          
            
            
              今天在win10上编译了最新的native-comp分支(update12),开始编译lisp文件就segment fault,不知道哪里有问题,可能和gcc版本有关。唉,折腾不起,继续用update11的代码。
             
            
              
              
              
            
           
          
            
            
              在macOS上用这个https://github.com/jimeh/build-emacs-for-macos,使用最新的代码编译native-comp,用一段时间总是莫名其妙闪退,报INVALID_ADDRESS错误,感觉是空指针,不知道是哪里出问题了。不得不还是用回了稳定版。用master分支编译也没有遇到这个问题。有人遇到类似的吗?
             
            
              
              
              
            
           
          
            
              
                jixiuf
                
              
              
                  
                  
              97
              
             
            
              我也遇到很多次 通常是切换窗口到emacs的时候我
             
            
              
              
              
            
           
          
            
            
              最新的gcc吗?我之前也出乱七八糟的问题(不过好像没有闪退过),但是新的好像还没有出现过。
             
            
              
              
              
            
           
          
            
            
              最新的brew版本gcc,小问题很多,闪退,连击……
             
            
              
              
              
            
           
          
            
            
              新编译了最新版本,使用了 ./build-emacs-for-macos --native-full-aot --native-comp-macos-fixes feature/native-comp,效果好上不少,但是仍然还是会闪退。用一段时间之后还是会奔溃,错误如下:
Process:               Emacs [28066]
Path:                  /Applications/Emacs 28.app/Contents/MacOS/Emacs
Identifier:            org.gnu.Emacs
Version:               Version 28.0.50 (9.0)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Emacs [28066]
User ID:               501
Date/Time:             2020-10-16 00:40:12.526 +0800
OS Version:            Mac OS X 10.15.7 (19H2)
Report Version:        12
Bridge OS Version:     4.6 (17P6610)
Anonymous UUID:        862B174E-5D5F-B253-26C9-571A139C0182
Sleep/Wake UUID:       DD959E68-A207-42B4-B536-B893F8A046C8
Time Awake Since Boot: 650000 seconds
Time Since Wake:       46000 seconds
System Integrity Protection: enabled
Crashed Thread:        0  Dispatch queue: com.apple.main-thread
Exception Type:        EXC_BAD_ACCESS (SIGABRT)
Exception Codes:       KERN_INVALID_ADDRESS at 0x00000000000000c0
Exception Note:        EXC_CORPSE_NOTIFY
VM Regions Near 0xc0:
--> 
    __TEXT                 00000001000ad000-0000000100319000 [ 2480K] r-x/r-x SM=COW  /Applications/Emacs 28.app/Contents/MacOS/Emacs
             
            
              
              
              
            
           
          
            
            
              macOS不太熟悉,怎么感觉比windows还要不稳定。windows上编译的native-comp分支,用了这么就基本没有出现过core dump。