How to specify the compiler to use when cross-compiling rustc?

When I compile rustc, there is an option in the configure script to specify other goals for the main libraries ( libcore, libstdetc.), for example:

./configure --target=x86_64-unknown-linux-gnu,i686-unknown-linux-gnu

will compile and install rustlibsfor both of these architectures.

My problem is that this command will use my gcc by default to compile everything (since my system is multilib, it will also compile successfully with i686), but I want to use the toolchain compiler instead, for example:

There are 2 toolchains on my amd64 system: i686-unknown-linux-gnuand arm-unknown-linux-gnueabi.

When I run configure with these parameters:

./configure --target=x86_64-unknown-linux-gnu,i686-unknown-linux-gnu,arm-unknown-linux-gnueabi

When compiling, rustlibsI want the script to use x86_64-unknown-linux-gnu- gcc for x86_64, and i686-unknown-linux-gnu- gcc for i686and arm-unknown-linux-gnueabi- gcc for arm.

Thus, it rustlibwill be compiled using glibcother libraries from the tool chain, and not by default from my system. Is it possible?

+4
source share
1 answer

It is specified using suffix environment variables: see here for what they do in CI.

0
source

Source: https://habr.com/ru/post/1671611/


All Articles