Mac M1中的交叉编译 - 为X86_64构建Linux
我想构建我的回购的cdylib板条A>在我的Mac M1中。
我的操作是:
rustup target add x86_64-unknown-linux-gnu
cargo build --target x86_64-unknown-linux-gnu
但是我遇到了一个问题:
=注意:ld:未知选项: - version-script =/var/folder/df/df/1lz9t40n171_5550cy_f1h3c0000gn/t/t/t/t/rustczqz5tv/list clang:错误:链接器命令因出口代码1失败(使用-V查看调用)
如何在Mac M1中构建x86_64 linux linux lib?
I want to build cdylib crate of my repo https://github.com/doki23/prql-java in my mac m1.
My operations are:
rustup target add x86_64-unknown-linux-gnu
cargo build --target x86_64-unknown-linux-gnu
but I met the problem:
= note: ld: unknown option: --version-script=/var/folders/df/1lz9t40n171_5550cy_f1h3c0000gn/T/rustczqz5TV/list
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How to build a x86_64 linux lib in mac m1?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要配置正确的
链接器
和ar
路径:下行添加到您的
$ {home}/。
将以 另外,如果有的话,请使用跨工具链的
ld
而不是clang,例如gcc
。假设您想为Android
X86_64
构建;将其添加到您的
$ {home}/。货物/config
文件中You need to configure the proper
linker
andar
paths:Add the below lines to your
${HOME}/.cargo/config
:You can also use the
ld
of the cross toolchain instead of clang if you have, saygcc
.Assuming that you want to build for android
x86_64
;Add this to your
${HOME}/.cargo/config
file