[opensuse] x86_64 to MIPS cross-compilation struggles
Hello community, I am unable to cross-compile to MIPS via 'cross-mips-gcc9-9.1.1+r274111-1.1.x86_64' package from official repositories. Consider this example:
% cat main.cc #include <cstdlib> #include <iostream>
int main(int argc, char** argv) { std::cout << argv[0] << ": hello world\n"; return EXIT_SUCCESS; }
Compilation attempts:
% mips-suse-linux-g++ main.cc -o hello-world In file included from main.cc:1: /usr/include/c++/9/cstdlib:41:10: fatal error: bits/c++config.h: No such file or directory 41 | #include <bits/c++config.h> | ^~~~~~~~~~~~~~~~~~ compilation terminated.
% mips-suse-linux-g++ -I/usr/lib64/gcc/mips-suse-linux/9/include main.cc -o hello-world In file included from main.cc:1: /usr/include/c++/9/cstdlib:41:10: fatal error: bits/c++config.h: No such file or directory 41 | #include <bits/c++config.h> | ^~~~~~~~~~~~~~~~~~ compilation terminated.
% mips-suse-linux-g++ -nostdinc -I/usr/lib64/gcc/mips-suse-linux/9/include main.cc -o hello-world main.cc:1:10: fatal error: cstdlib: No such file or directory 1 | #include <cstdlib> | ^~~~~~~~~ compilation terminated.
% mips-suse-linux-g++ -nostdinc++ -I/usr/lib64/gcc/mips-suse-linux/9/include main.cc -o hello-world main.cc:1:10: fatal error: cstdlib: No such file or directory 1 | #include <cstdlib> | ^~~~~~~~~ compilation terminated.
What am I doing wrong? -- Regards Oleksii Vilchanskyi -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 28/08/2019 11:27, Oleksii Vilchanskyi wrote:
Hello community,
I am unable to cross-compile to MIPS via 'cross-mips-gcc9-9.1.1+r274111-1.1.x86_64' package from official repositories.
Consider this example:
% cat main.cc #include <cstdlib> #include <iostream>
int main(int argc, char** argv) { std::cout << argv[0] << ": hello world\n"; return EXIT_SUCCESS; }
Compilation attempts:
% mips-suse-linux-g++ main.cc -o hello-world In file included from main.cc:1: /usr/include/c++/9/cstdlib:41:10: fatal error: bits/c++config.h: No such file or directory 41 | #include <bits/c++config.h> | ^~~~~~~~~~~~~~~~~~ compilation terminated.
% mips-suse-linux-g++ -I/usr/lib64/gcc/mips-suse-linux/9/include main.cc -o hello-world In file included from main.cc:1: /usr/include/c++/9/cstdlib:41:10: fatal error: bits/c++config.h: No such file or directory 41 | #include <bits/c++config.h> | ^~~~~~~~~~~~~~~~~~ compilation terminated.
% mips-suse-linux-g++ -nostdinc -I/usr/lib64/gcc/mips-suse-linux/9/include main.cc -o hello-world main.cc:1:10: fatal error: cstdlib: No such file or directory 1 | #include <cstdlib> | ^~~~~~~~~ compilation terminated.
% mips-suse-linux-g++ -nostdinc++ -I/usr/lib64/gcc/mips-suse-linux/9/include main.cc -o hello-world main.cc:1:10: fatal error: cstdlib: No such file or directory 1 | #include <cstdlib> | ^~~~~~~~~ compilation terminated.
What am I doing wrong?
The reply from the toolchain maintainer said that the toolchain is only suited to build freestanding programs. Using toolchain-ng I've built a functional cross-compiler. 10/10 tool, can recommend. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (1)
-
Oleksii Vilchanskyi