正在运行
nix-shell -p agda在macOS M1 (蒙特利)上,编译似乎运行良好,但是链接失败,出现分段错误。
clang-11: error: linker command failed with exit code 139 (use -v to see invocation)
`cc' failed in phase `Linker'. (Exit code: 139)
error: builder for '/nix/store/0zli7b0k7mdq3aj9yrfk546vr1a1mb34-Agda-2.6.2.2.drv' failed with exit code 1;
last 10 log lines:
> [399 of 401] Compiling Agda.Compiler.JS.Compiler ( src/full/Agda/Compiler/JS/Compiler.hs, dist/build/Agda/Compiler/JS/Compiler.o, dist/build/Agda/Compiler/JS/Compiler.dyn_o )
> [400 of 401] Compiling Agda.Compiler.Builtin ( src/full/Agda/Compiler/Builtin.hs, dist/build/Agda/Compiler/Builtin.o, dist/build/Agda/Compiler/Builtin.dyn_o )
> [401 of 401] Compiling Agda.Main ( src/full/Agda/Main.hs, dist/build/Agda/Main.o, dist/build/Agda/Main.dyn_o )
> Preprocessing executable 'agda' for Agda-2.6.2.2..
> Building executable 'agda' for Agda-2.6.2.2..
> [1 of 1] Compiling Main ( src/main/Main.hs, dist/build/agda/agda-tmp/Main.o )
> Linking dist/build/agda/agda ...
> /nix/store/l1vm9w0y2fdav63xk2nfrwgzrg30hm5x-clang-wrapper-11.1.0/bin/ld: line 256: 1241 Segmentation fault: 11 /nix/store/gwm9iadcyybh7gc4q6djvaz4fb40i90c-cctools-binutils-darwin-949.0.1/bin/ld ${extraBefore+"${extraBefore[@]}"} ${params+"${params[@]}"} ${extraAfter+"${extraAfter[@]}"}
> clang-11: error: linker command failed with exit code 139 (use -v to see invocation)
> `cc' failed in phase `Linker'. (Exit code: 139)在最近版本的macOS中,我确实遇到了与其他Haskell包的链接问题,其中ghc找不到libffi或zlib,我不得不设置env变量,例如
export C_INCLUDE_PATH="`xcrun --show-sdk-path`/usr/include/ffi"¬但是,在agda的情况下,从错误消息中我并不清楚问题是什么:链接器无法定位是由C库造成的吗?如果是,我如何才能发现哪一个?这是M1的问题吗?nix-shell -p agda应该在M1上工作吗?
发布于 2022-12-02 23:31:09
我终于找到了一个跟踪问题的github问题(不容易找到):https://github.com/NixOS/nixpkgs/issues/149692#issuecomment-1177684790
根据票证,目前唯一可用的解决办法是为x86_64编译并使用Rosetta。
https://stackoverflow.com/questions/74621737
复制相似问题