- to build command:
cargo build --release --target x86_64-unknown-linux-gnu -p rmaker
- then i get like
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-m64" "C:\\Users\\x\\AppData\\Local\\Temp\\rustc2cUKcS\\symbols.o" "~\\target\\x86_64-unknown-linux-gnu\\release\\deps\\rmaker-22b7e16c5185da64.rmaker.04359c71-cgu.7.rcgu.o" "-Wl,--as-needed" "-L" "~\\target\\x86_64-unknown-linux-gnu\\release\\deps" "-L" "~\\target\\release\\deps" "-L" "D:\\AppData\\rust\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-unknown-linux-gnu\\lib" "-Wl,-Bstatic" "D:\\AppData\\rust\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-unknown-linux-gnu\\lib\\libcompiler_builtins-919e055b306699ae.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "D:\\AppData\\rust\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-unknown-linux-gnu\\lib" "-o" "~\\target\\x86_64-unknown-linux-gnu\\release\\deps\\rmaker-22b7e16c5185da64" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,--strip-all" "-nodefaultlibs"
= note: D:/Program Files/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unrecognized option '--eh-frame-hdr'
D:/Program Files/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: use the --help option for usage information
collect2.exe: error: ld returned 1 exit status
- I have checked the issue in Github again but have not found a relevant solution. Some answers are somewhat vague and I have tried, but still cannot overcome it. I have also checked the documents on the doc.rust-lang.org website, but I still cannot find a solution.
I try a way follow example /usr/bin/avr-ld: unrecognized option '--eh-frame-hdr', and make set like that:
[target.x86_64-unknown-linux-gnu]
eh-frame-header = false
but don't work.
-
I suddenly feel that cross compilation is so difficult (complex), and I am very grateful if you can provide guidance.
-
my rust env
rustup target list --installed
# x86_64-pc-windows-gnu