Cross compiling error?

hi
I wanna macOS cross-compiling to linux,my step is:
1.download linux tooltains "x86_64-linux-musl-cross" and expend the path right. execute cmd "x86_64-linux-musl-gcc -v" print the version.
2.then rustup add target and modify project's Cargo.toml,add:
[target.x86_64-unknown-linux-musl]
linker = "x86_64-linux-musl-gcc"
3.execute "cargo build --release --target x86_64-unknown-linux-musl"

but when I cmd "cargo build --release --target x86_64-unknown-linux-musl",occurs error, message is:
**error** **: linking with `cc` failed: exit code: 1** **note** : "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-Wl,--eh-frame-hdr" "-m64" "-nostdlib" "/Users/tangjian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-unknown-linux-musl/lib/crt1.o" "/Users/tangjian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-unknown-linux-musl/lib/crti.o" "-L" "/Users/tangjian/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/x86_64-unknown-linux-musl/lib" "/Users/tangjian/git/MyRust/net_test/target/x86_64-unknown-linux-musl/release/deps/net_test-8d10b2b9f09fee1c.net_test.b1aycne3-cgu.0.rcgu.o"

so, what's the problem?what I did wrong is?pls help!
thanks for that!

That configuration needs to go into .cargo/config. See Configuration.

Tip: Add 3 backticks (```) before and after your code samples, then it will be rendered nicely.

thanks!
I change config to .cargo/config,and it is work! it's so import for me!
and thanks for (```),it's very helpfull!
wish you have a nice day!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.