1. 程式人生 > >Ubuntu160403安裝交叉編譯工具鏈後,出錯: ./arm-none-linux-gnueabi-gcc -v bash: ./arm-none-linux-gn

Ubuntu160403安裝交叉編譯工具鏈後,出錯: ./arm-none-linux-gnueabi-gcc -v bash: ./arm-none-linux-gn

cd /etc/apt
  • 1

在修改前先對 sources.list檔案進行備份

sudo cp sources.list sources.list.bak
  • 1

修改sources.list檔案

sudo vi sources.list
  • 1

刪除掉sources.list的其他內容,選擇任意源貼上複製進去,這裡以阿里云為例

這裡寫圖片描述

ubuntu 16.04源

阿里雲:

deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun
.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties deb http://mirrors.aliyun.com/ubuntu/ xenial universe deb http://mirrors.aliyun
.com/ubuntu/ xenial-updates universe deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner deb-src http://archive.canonical.com/ubuntu xenial partner deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

東北大學:

deb-src http://mirror.neu.edu.cn/ubuntu/ xenial main restricted #Added by software-properties

deb http://mirror.neu.edu.cn/ubuntu/ xenial main restricted

deb-src http://mirror.neu.edu.cn/ubuntu/ xenial restricted multiverse universe #Added by software-properties

deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted

deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties

deb http://mirror.neu.edu.cn/ubuntu/ xenial universe

deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates universe

deb http://mirror.neu.edu.cn/ubuntu/ xenial multiverse

deb http://mirror.neu.edu.cn/ubuntu/ xenial-updates multiverse

deb http://mirror.neu.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties

deb http://archive.canonical.com/ubuntu xenial partner deb-src http://archive.canonical.com/ubuntu xenial partner

deb http://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted

deb-src http://mirror.neu.edu.cn/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties

deb http://mirror.neu.edu.cn/ubuntu/ xenial-security universe

deb http://mirror.neu.edu.cn/ubuntu/ xenial-security multiverse


清華大學:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

更新源

sudo apt-get update
  • 1

這裡寫圖片描述

更新軟體(時間較長,慢慢等待!)

sudo apt-get upgrade 
  • 1

這裡寫圖片描述

提供最後一部分提示:Unpacking lib32quadmath0 (5.4.0-6ubuntu1~16.04.9) ...
Selecting previously unselected package libx32quadmath0.
Preparing to unpack .../libx32quadmath0_5.4.0-6ubuntu1~16.04.9_amd64.deb ...
Unpacking libx32quadmath0 (5.4.0-6ubuntu1~16.04.9) ...
Selecting previously unselected package lib32gcc-5-dev.
Preparing to unpack .../lib32gcc-5-dev_5.4.0-6ubuntu1~16.04.9_amd64.deb ...
Unpacking lib32gcc-5-dev (5.4.0-6ubuntu1~16.04.9) ...
Selecting previously unselected package libx32gcc-5-dev.
Preparing to unpack .../libx32gcc-5-dev_5.4.0-6ubuntu1~16.04.9_amd64.deb ...
Unpacking libx32gcc-5-dev (5.4.0-6ubuntu1~16.04.9) ...
Selecting previously unselected package gcc-5-multilib.
Preparing to unpack .../gcc-5-multilib_5.4.0-6ubuntu1~16.04.9_amd64.deb ...
Unpacking gcc-5-multilib (5.4.0-6ubuntu1~16.04.9) ...
Selecting previously unselected package lib32stdc++-5-dev.
Preparing to unpack .../lib32stdc++-5-dev_5.4.0-6ubuntu1~16.04.9_amd64.deb ...
Unpacking lib32stdc++-5-dev (5.4.0-6ubuntu1~16.04.9) ...
Selecting previously unselected package libx32stdc++-5-dev.
Preparing to unpack .../libx32stdc++-5-dev_5.4.0-6ubuntu1~16.04.9_amd64.deb ...
Unpacking libx32stdc++-5-dev (5.4.0-6ubuntu1~16.04.9) ...
Selecting previously unselected package g++-5-multilib.
Preparing to unpack .../g++-5-multilib_5.4.0-6ubuntu1~16.04.9_amd64.deb ...
Unpacking g++-5-multilib (5.4.0-6ubuntu1~16.04.9) ...
Selecting previously unselected package gcc-multilib.
Preparing to unpack .../gcc-multilib_4%3a5.3.1-1ubuntu1_amd64.deb ...
Unpacking gcc-multilib (4:5.3.1-1ubuntu1) ...
Selecting previously unselected package g++-multilib.
Preparing to unpack .../g++-multilib_4%3a5.3.1-1ubuntu1_amd64.deb ...
Unpacking g++-multilib (4:5.3.1-1ubuntu1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Setting up libc6-dev-i386 (2.23-0ubuntu10) ...
Setting up libc6-x32 (2.23-0ubuntu10) ...
Setting up libc6-dev-x32 (2.23-0ubuntu10) ...
Setting up lib32gcc1 (1:6.0.1-0ubuntu1) ...
Setting up libx32gcc1 (1:6.0.1-0ubuntu1) ...
Setting up lib32gomp1 (5.4.0-6ubuntu1~16.04.9) ...
Setting up libx32gomp1 (5.4.0-6ubuntu1~16.04.9) ...
Setting up lib32itm1 (5.4.0-6ubuntu1~16.04.9) ...
Setting up libx32itm1 (5.4.0-6ubuntu1~16.04.9) ...
Setting up lib32atomic1 (5.4.0-6ubuntu1~16.04.9) ...
Setting up libx32atomic1 (5.4.0-6ubuntu1~16.04.9) ...
Setting up lib32asan2 (5.4.0-6ubuntu1~16.04.9) ...
Setting up libx32asan2 (5.4.0-6ubuntu1~16.04.9) ...
Setting up lib32stdc++6 (5.4.0-6ubuntu1~16.04.9) ...
Setting up lib32ubsan0 (5.4.0-6ubuntu1~16.04.9) ...
Setting up libx32stdc++6 (5.4.0-6ubuntu1~16.04.9) ...
Setting up libx32ubsan0 (5.4.0-6ubuntu1~16.04.9) ...
Setting up lib32cilkrts5 (5.4.0-6ubuntu1~16.04.9) ...
Setting up libx32cilkrts5 (5.4.0-6ubuntu1~16.04.9) ...
Setting up lib32mpx0 (5.4.0-6ubuntu1~16.04.9) ...
Setting up lib32quadmath0 (5.4.0-6ubuntu1~16.04.9) ...
Setting up libx32quadmath0 (5.4.0-6ubuntu1~16.04.9) ...
Setting up lib32gcc-5-dev (5.4.0-6ubuntu1~16.04.9) ...
Setting up libx32gcc-5-dev (5.4.0-6ubuntu1~16.04.9) ...
Setting up gcc-5-multilib (5.4.0-6ubuntu1~16.04.9) ...
Setting up lib32stdc++-5-dev (5.4.0-6ubuntu1~16.04.9) ...
Setting up libx32stdc++-5-dev (5.4.0-6ubuntu1~16.04.9) ...
Setting up g++-5-multilib (5.4.0-6ubuntu1~16.04.9) ...
Setting up gcc-multilib (4:5.3.1-1ubuntu1) ...
Setting up g++-multilib (4:5.3.1-1ubuntu1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...

至此更新軟體結束。
[email protected]:/usr/local/arm/arm-2009q3/bin# ls
arm-none-linux-gnueabi-addr2line  arm-none-linux-gnueabi-gprof

第二步: 2766人閱讀 評論(2) 收藏 舉報

在ubuntu16.04中安裝arm-none-linux-gnueabi有兩種方法,一種是apt-get,安裝容易但是不易成功,一種是下載壓縮包或安裝程式,這裡,我用的是下載壓縮包,從官網上下載會非常慢,這裡提供一個國內雲盤下載的連結:下載各種版本

下載之後我們進行解壓:tar -xjf ***.tar.bz2, 後邊不寫引數就代表解壓到當前路徑下(我解壓到了/usr/mygnueabi/下)。

由於下載的是解壓版,不用安裝(安裝版需要),也不用編譯(原始碼版需要)。我們直接設定環境變數即可。

設定環境變數可以通過:

export PATH=$PATH:/usr/mygnueabi/***your_gnueabi_name/bin

但是這隻會在當前的cmd視窗下生效,再開啟一個shell還得重新設定,所以我直接更改了~/.bashrc檔案,這樣就相當於永遠生效了:

vim ~/.bashrc

新增一句:

export PATH=/usr/mygnueabi/***your_gnueabi_name/bin:$PATH

儲存退出,注意要讓bashrc生效,還需要輸入:

source ~/.bashrc

當然,~代表當前使用者目錄,如果想讓所有使用你這個linux系統的使用者的環境變數都加上交叉工具鏈路徑,也可以更改/etc/profile檔案,還是加上export那句話,之後也要執行source命令使之生效.

新增完環境變數之後,我試著編譯一個程式,發現還是不對, ./arm-none-linux-gnueabi-gcc -v bash: ./arm-none-linux-gn提示找不到arm-none-linux-gnueabi-gcc,(自己新增的:

 [email protected]:/usr/local/arm/arm-2009q3/bin# ./arm-none-linux-gnueabi-gcc -v
bash: ./arm-none-linux-gnueabi-gcc: No such file or directory
網上查了一下,發現是因為ubuntu為64位的,需要安裝一些32bit支援的庫:

輸入:

apt-get install lib32ncurses5 lib32z1

apt-get install gcc-multilib g++-multilib

之後再編譯程式就可以了。輸入arm-none-linux-按tab鍵,會列出所有的編譯器:


第三步:在/usr/local/arm/arm-2009q3/bin# 目錄下執行

./arm-none-linux-gnueabi-gcc -v

顯示:

[email protected]:/usr/local/arm/arm-2009q3/bin# ./arm-none-linux-gnueabi-gcc -v
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with: /scratch/julian/2009q3-respin-linux-lite/src/gcc-4.4/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-extra-sgxxlite-multilibs --with-arch=armv5te --with-gnu-as --with-gnu-ld --with-specs='%{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables} %{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' --enable-languages=c,c++ --enable-shared --disable-lto --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 2009q3-67' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/julian/2009q3-respin-linux-lite/install/arm-none-linux-gnueabi/libc --with-gmp=/scratch/julian/2009q3-respin-linux-lite/obj/host-libs-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-mpfr=/scratch/julian/2009q3-respin-linux-lite/obj/host-libs-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-ppl=/scratch/julian/2009q3-respin-linux-lite/obj/host-libs-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-cloog=/scratch/julian/2009q3-respin-linux-lite/obj/host-libs-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/julian/2009q3-respin-linux-lite/install/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/julian/2009q3-respin-linux-lite/install/arm-none-linux-gnueabi/bin
Thread model: posix
gcc version 4.4.1 (Sourcery G++ Lite 2009q3-67) 

出現了gcc version 4.4.1 (Sourcery G++ Lite 2009q3-67)

任務完成。

OKOKOK

相關推薦

Ubuntu160403安裝交叉編譯工具出錯 ./arm-none-linux-gnueabi-gcc -v bash: ./arm-none-linux-gn

cd /etc/apt1在修改前先對 sources.list檔案進行備份sudo cp sources.list sources.list.bak1修改sources.list檔案sudo vi sources.list1刪除掉sources.list的其他內容,選擇任意源貼上複製進去,這裡以阿里云為例ub

自己動手安裝交叉編譯工具

一、安裝步驟: 步驟1:開啟虛擬機器,在/usr/local/下建立/usr/local/arm資料夾 步驟2:先將安裝包從Windows中弄到linux中去。可以用共享資料夾,也可以  用Samba,也可以cuteftp。 步驟3:解壓。tar -jxvf arm-

ubuntu 14.04 安裝交叉編譯工具arm-none-linux-gnueabi

使用解壓版安裝方式,下載工具鏈壓縮包: arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2,參考連結。 解壓縮到/opt/下 ,出現/opt/arm-2014.05 目錄。 #

彙總(之四)交叉編譯工具arm-none-linux-gnueabi-, Qt交叉編譯安裝和移植Qt桌面版編譯安裝QTcreator安裝和配置

4. QTcreator2.5.2安裝和配置 首先,從官網下載了qt-creator-linux-x86-opensource-2.5.2.bin檔案。 下面的安裝就比較簡單了,首先更改檔案屬性,使它可執行。 chmod u+x qt-creator-linux

交叉編譯工具安裝成功的標誌是什麼

在ubuntu和arm聯合開發時,使用交叉編譯工具鏈,使用了兩個工具鏈aarch64-himix100-linux.tgz和gcc-arm-none-eabi-4_9-2015q3.tgz。 交叉編譯工具鏈安裝成功的標誌是: aarch64-himix100-linux.tgz工

ZYBOZ7從入門到進階-5 zyboz7交叉編譯工具安裝

版權宣告:本文為博主原創文章,未經博主允許不得轉載。https://blog.csdn.net/a646123070        前面幾篇文章我們已經熟悉了PL端和PS端的操作流程,下面,我們要進行系統移植了。而進行系統移植的前提就是安裝交叉編譯工具鏈。

自己動手安裝ARM交叉編譯工具

一,首先說一下在linux中安裝軟體的特點: 相比windows下安裝要稍顯複雜,linux中安裝一般有以下幾種方法: 1.線上安裝,譬如ubuntu中使用apt-get install vim 來安裝vim軟體 2.自己下載安裝包來安裝。這種方式的缺陷就是你不

嵌入式Linux-根檔案系統2_(利用交叉編譯工具構建/lib目錄)

光有應用程式(命令)是不夠的,因為應用程式本身需要使用C庫的庫函式,因此還必需製作for ARM的C庫,並將其放置於/lib目錄。my god,要自己寫C庫的原始碼嗎?不用!還記得交叉編譯工具鏈的3個組成部分嗎?交叉編譯器、for ARM的C庫和二進位制工具。我們只需要把嵌入式的C庫拷貝過來就可

Ubuntu 18.04安裝i686-elf交叉編譯工具的方法

致謝:wby大佬 一、準備 系統:Ubuntu 18.04 LTS 64位 Ubuntu releases gcc 7.3.0、g++ 7.3.0: # 切換到超級使用者模式,可以Ctrl+D切回普通使用者 sudo -s add-apt-

安裝Linux交叉編譯工具

1、linux中裝軟體的特點     linux中安裝軟體比windows中複雜。linux中安裝軟體一般有以下幾種方法:     第一種:線上安裝。譬如ubuntu中使用apt-get install vim來安裝vim軟體。     第二種:自己下載安裝包來安裝。這種方

arm-linux-gcc 交叉編譯工具安裝

1. 解壓arm-linux-gcc x.x.x  2.拷貝到你要儲存的路徑 也可以在第1步中 加-C引數指定解壓到的路徑 參照別人的做法我把它放到/usr/local/toolchain下面 3.要

Linux下獲取arm交叉編譯工具

win 5.1 app應用 地址 打開 release nbsp 最新 component 轉載請註明文章:Linux下獲取arm的交叉編譯工具鏈 出處:多客博圖 這裏介紹,Linux下獲取arm的交叉編譯工具鏈,比如arm-linux-gnueabihf-gcc、a

linux 安裝交叉編譯工具

目錄 ges 終端 如果 -name images 使用 linux tab鍵 以arm-linux-gcc-3.4.5-glibc-2.3.6.tar.bz2為例 1、獲取要安裝的交叉編譯工具。(一般芯片廠商提供,也可自行下載) 2、使用tar命令:tar jxvf ar

ubuntu安裝交叉編譯工具

手裡有一塊樹莓派3b+,想用來學習嵌入式開發,雖然可以在上面直接安裝gcc,編譯原始碼,但一想到早晚會用到交叉編譯工具,還是學學怎麼裝吧。 網上一大堆亂七八糟的裝法,有的去github下載安裝,有的不知道什麼鬼,看不懂。 開啟ubuntu終端 使用sudo apt list gcc-

cross compiler Toolchain 交叉編譯工具 的建立

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow 也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!        

交叉編譯工具readelf

readelf -A 可檢視檔案執行架構、大小端等資訊: [email protected]:~/CodeBackup/openni2.3/Bin/Arm-Release$ /home/guanlin/arm-hisiv300-linux/bin/arm-hisiv300-linu

ARM交叉編譯工具 gnueabinone-eabi、arm-eabi、gnueabihf、gnueabi區別

為什麼要用交叉編譯器? 交叉編譯通俗地講就是在一種平臺上編譯出能執行在體系結構不同的另一種平臺上的程式,比如在PC平臺(X86 CPU)上編譯出能執行在以ARM為核心的CPU平臺上的程式,編譯得到的程式在X86 CPU平臺上是不能執行的,必須放到ARM CPU平臺上才能執行,雖然兩個平臺用的都是

ARM交叉編譯工具的製作

今天是10.24程式設計師節日。獎勵一下自己,寫一篇實踐部落格。製作arm交叉編譯工具鏈。 目前比較新的製作交叉編譯工具鏈的軟體是crosstool-NG,非常方便,還可以編譯高版本的核心,比如4.16及以上。 Crosstool-NG的下載地址:http://crosstool-ng.gi

Linux--配置交叉編譯工具

配置交叉編譯工具鏈 安裝 我的交叉編譯軟體包為arm-2009q3.tar.bz2,首先在/usr/local目錄下建立arm目錄,將軟體包解壓到該目錄下。linux中所有目錄性質都是一樣的,裝在哪個目錄下都是可以的,為了方便管理,一般軟體之類的都裝在/usr目

ubuntu16.04 64bit安裝交叉編譯工具arm-none-linux-gnueabi-2014.05(最新版)

安裝方式: 將下載好的安裝包拷貝到linux環境下,此處可以藉助設定虛擬機器與主機之間的共享資料夾實現。(設定方式自行百度) 實現的過程並不像網上說的那麼一帆風順,因為我的ubuntu是64bit,