浙工大嵌入式实验报告金艳霞通信2班[1**********]0实验五Linux交叉编译平台一、,:①[******@localhost~]$cd/home/shiyan②[******@localhost~]$tar–zxvfarm-linux-gcc--glib---zxvfarm-linux-gcc--glib--③[******@localhost[1**********]0]$exportPATH=$PATH:/home/shiyan/[1**********]0/opt/crosstool/arm-linux/gcc--glib--linux/bin④[******@localhost[1**********]0]$setOSTYPE=linux-gnuPATH=/usr/lib/qt-:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/shiyan/bin:/home/shiyan/opt/crosstool/arm-linux/gcc--glibc--linux/bin:/home/shiyan/opt/crosstool/arm-linux/gcc--glibc--linux/bin:/home/shiyan/opt/crosstool/arm-linux/gcc--glibc--linux/bin可以看出路径已添加⑤[******@localhost[1**********]0]$arm-linux-g再按tabarm-linux-g++arm-linux-gccarm-linux-gcc--linux-gccbugarm-linux-gcov⑥[******@localhost[1**********]0]$arm-linux-gccarm-linux-gcc:noinputfiles此时出错,①[******@localhost~]$#includeintmain(){printf(“jin123”);return0;}:wq②查看是否生成文件[******@matrix[1**********]0]$lsarm-linux-gcc--glib--③[******@localhost~]$./-bash:/hellocannotexecutebinaryfile表示无法在服务器上执行④[******@localhost~]$arm-linux-gcc-⑤将文件拷贝到nfs下[******@localhost~]$cphello/home/shiyan/nfs⑥挂载服务器到板子上/$mount–tnfs-:/home/shiyan/nfs/mnt/nfs/$cdmnt/nfs⑦打开hello文件/$./hello结果输出:,交叉编译的二进制可以在板子上运行,却不能在服务器上运行,很好的认清了交叉编译的意义和功能。)Armboot①编译armboot--linux--[******@matrixarmboot-]$make②[******@matrixarmboot-]$-linux--
浙工大 嵌入式实验报告 来自淘豆网m.daumloan.com转载请标明出处.