Deabian setting cross compiler environment variables

Source: Internet
Author: User
Tags echo command

Download at Linaro website

armv8-64 Cross compiler: Gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu.tar.tar

I uploaded the address in csdn, no way to set 0 points: Gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu.tar.tar

armv7-32 Cross compiler: Gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.tar

Upload address in csdn, no way to set 0 points: Gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.tar

Decompression process: $ TAR-XVF Gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu.tar.tar

Move to opt, and modify the folder name as shown below:


"Three ways to configure environment variables" to add a path to $path, you can do this as follows:

1. Console, do not favor the use of this method, because the shell, your settings are invalid, so this method is only temporary use, and later to use the time to reset, more trouble.

Root privileges in the console add: $ export path= $PATH:/opt/toolchain/\gcc-arch64-linux-gnu/bin
$ Export cross_compile=aarch64-linux-gnu-
$ export path= $PATH:/opt/toolchain/\gcc-arm-linux-gnueabihf/bin

$ Export cross_compile=arm-linux-gnueabihf-

(The shell is closed, path is restored)

2. Modify the/etc/profile file, if your computer is only recommended as a development use, because all the user's shell has the right to use these environment variables, may bring security issues to the system. Here is for all the users, all the shells;

Under Root, add the following and save: Gedit/etc/profile
Add in:
$ export path= $PATH:/opt/toolchain/\gcc-arch64-linux-gnu/bin
$ Export cross_compile=aarch64-linux-gnu-
$ export path= $PATH:/opt/toolchain/\gcc-arm-linux-gnueabihf/bin

$ export cross_compile=arm-linux-gnueabihf-Use the source command to make the modification effective immediately:
Source/etc/profile

3. To modify the. bashrc file, this method is more secure, it can be used to control the permissions of these environment variables to the user level, here is for a specific user, if you need to give a user permissions to use these environment variables, you only need to modify their personal user home directory of the. bashrc file on it.

Root privileges: gedit ~/.BASHRC
Add in:
$ export path= $PATH:/opt/toolchain/\gcc-arch64-linux-gnu/bin
$ Export cross_compile=aarch64-linux-gnu-
$ export path= $PATH:/opt/toolchain/\gcc-arm-linux-gnueabihf/bin

$ Export cross_compile=arm-linux-gnueabihf-
Source/root/.bashrc


The latter two methods generally need to unregister the system to take effect, or you can use the source command to make the modified configuration immediately

Finally, you can test it with the echo command:

$ echo $PATH

The output is already a new path.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.