yuexiaoban

yuexiaoban

0个粉丝

1

问答

0

专栏

0

资料

yuexiaoban  发布于  2017-01-03 23:53:47
采纳率 0%
1个问答
4583

求助 编译报错

 
本帖最后由 yuexiaoban 于 2017-1-3 23:58 编辑

hello,各位大神,现在编译遇到了这个问题,网上找了一些情况,仍然解决不了,求助各位了,先谢谢了

当前的情况是
编译报错  
环境变量
# Mon Jan  2 17:21:21 CST 2017
# Hisilicon Linux, Cross-Toolchain PATH
export PATH="/opt/hisi-linux/x86-arm/arm-hisiv100-linux/target/bin:$PATH"
#


# Mon Jan  2 17:24:56 CST 2017
# Hisilicon Linux, Cross-Toolchain PATH
#


# Mon Jan  2 17:48:37 CST 2017
# Hisilicon Linux, Cross-Toolchain PATH
export PATH="/opt/hisi-linux-nptl/arm-hisiv100-linux/target/bin:$PATH"
#


# Mon Jan  2 17:52:44 CST 2017
# Hisilicon Linux, Cross-Toolchain PATH
#


# Mon Jan  2 21:36:57 CST 2017
# Hisilicon Linux, Cross-Toolchain PATH
#


# Tue Jan  3 00:01:57 CST 2017
# Hisilicon Linux, Cross-Toolchain PATH
#


# Tue Jan  3 22:47:34 CST 2017
# Hisilicon Linux, Cross-Toolchain PATH
#


# Tue Jan  3 22:49:17 CST 2017
# Hisilicon Linux, Cross-Toolchain PATH
export PATH="/opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/bin:$PATH"
#

编译器安装好了可以使用的 验证如下
xiao@ubuntu:~$ arm-hisiv100nptl-linux-gcc xiao.c -o yuexiaoban.o
xiao@ubuntu:~$ ls
?        Documents  examples.desktop  Music     Program  share      Videos yuexiaoban.o
Desktop  Downloads  hi3521A           Pictures  Public   Templates  xiao.c
xiao@ubuntu:~$


报错信息如下

xiao@ubuntu:~/hi3521A/Hi3531_SDK_V1.0.D.0$ cd osdrv/
xiao@ubuntu:~/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv$ sudo make OSDRV_CROSS=arm-hisiv100nptl-linux all
[sudo] password for xiao:
mkdir /home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/pub/image_uclibc -p
mkdir /home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/pub/bin/board_uclibc -p
mkdir /home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/pub/bin/pc -p
---------task [1]       build boot
rm /home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06 -rf
tar xzf /home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06.tgz -C /home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot
find /home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06 | xargs touch
make -C /home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06 ARCH=arm CROSS_COMPILE=arm-hisiv100nptl-linux- godnet_config
make[1]: Entering directory `/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06'
Configuring for godnet board...
make[1]: Leaving directory `/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06'
pushd /home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06;make ARCH=arm CROSS_COMPILE=arm-hisiv100nptl-linux- -j 20 >/dev/null;popd
~/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06 ~/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv
make[1]: arm-hisiv100nptl-linux-gcc: Command not found
make[1]: Entering directory `/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06'
/bin/sh: arm-hisiv100nptl-linux-gcc: command not found
dirname: missing operand
Try 'dirname --help' for more information.
/bin/sh: line 3: arm-hisiv100nptl-linux-gcc: command not found
/bin/sh: arm-hisiv100nptl-linux-gcc: command not found
dirname: missing operand
Try 'dirname --help' for more information.
/bin/sh: line 3: arm-hisiv100nptl-linux-gcc: command not found
make[1]: arm-hisiv100nptl-linux-gcc: Command not found
make[1]: Entering directory `/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06'
/bin/sh: arm-hisiv100nptl-linux-gcc: command not found
dirname: missing operand
Try 'dirname --help' for more information.
/bin/sh: arm-hisiv100nptl-linux-gcc: command not found
dirname: missing operand
Try 'dirname --help' for more information.
/bin/sh: arm-hisiv100nptl-linux-gcc: command not found
dirname: missing operand
Try 'dirname --help' for more information.
make[2]: arm-hisiv100nptl-linux-gcc: Command not found
make[2]: Entering directory `/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06/tools'
make[2]: arm-hisiv100nptl-linux-gcc: Command not found
make[2]: Entering directory `/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06/tools'
make[2]: arm-hisiv100nptl-linux-gcc: Command not found
make[2]: Entering directory `/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06/examples/standalone'
/bin/sh: arm-hisiv100nptl-linux-gcc: command not found
dirname: missing operand
Try 'dirname --help' for more information.
/bin/sh: line 2: arm-hisiv100nptl-linux-gcc: command not found
/bin/sh: line 2: arm-hisiv100nptl-linux-gcc: command not found
make[2]: *** No rule to make target `.depend', needed by `_depend'.  Stop.
make[2]: arm-hisiv100nptl-linux-gcc: Command not found
make[2]: Entering directory `/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06/examples/api'
/bin/sh: arm-hisiv100nptl-linux-gcc: command not found
dirname: missing operand
Try 'dirname --help' for more information.
make[2]: arm-hisiv100nptl-linux-gcc: Command not found
make[2]: Entering directory `/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06/arch/arm/cpu/godnet'
/bin/sh: line 2: arm-hisiv100nptl-linux-gcc: command not found
/bin/sh: line 2: arm-hisiv100nptl-linux-gcc: command not found
make[2]: *** No rule to make target `.depend', needed by `_depend'.  Stop.
make[2]: arm-hisiv100nptl-linux-gcc: Command not found
make[2]: Entering directory `/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06/arch/arm/cpu/godnet'
/bin/sh: arm-hisiv100nptl-linux-gcc: command not found
dirname: missing operand
Try 'dirname --help' for more information.
/bin/sh: arm-hisiv100nptl-linux-gcc: command not found
dirname: missing operand
Try 'dirname --help' for more information.
make[2]: arm-hisiv100nptl-linux-gcc: Command not found
make[2]: Entering directory `/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06/tools'
/bin/sh: arm-hisiv100nptl-linux-gcc: command not found
dirname: missing operand
Try 'dirname --help' for more information.
make[2]: arm-hisiv100nptl-linux-gcc: Command not found
make[2]: Entering directory `/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06/examples/standalone'
/bin/sh: arm-hisiv100nptl-linux-gcc: command not found
dirname: missing operand
Try 'dirname --help' for more information.
make[2]: arm-hisiv100nptl-linux-gcc: Command not found
make[2]: Entering directory `/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06/examples/api'
/bin/sh: arm-hisiv100nptl-linux-gcc: command not found
dirname: missing operand
Try 'dirname --help' for more information.
make[2]: /bin/sh: arm-hisiv100nptl-linux-gcc: command not found
arm-hisiv100nptl-linux-gcc: Command not found
make[2]: Entering directory `/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06/arch/arm/cpu/godnet'
dirname: missing operand
Try 'dirname --help' for more information.
/bin/sh: arm-hisiv100nptl-linux-gcc: command not found
dirname: missing operand
Try 'dirname --help' for more information.
make[2]: arm-hisiv100nptl-linux-gcc: Command not found
make[2]: *** [hello_world.o] Error 127
make[1]: *** [examples/standalone] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: arm-hisiv100nptl-linux-gcc: Command not found
make[2]: Entering directory `/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06/arch/arm/cpu/godnet'
make[2]: arm-hisiv100nptl-linux-gcc: Command not found
make[2]: *** [start.o] Error 127
make[1]: *** [arch/arm/cpu/godnet/start.o] Error 2
/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06/lib/md5.c: In function ‘MD5Final’:
/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06/lib/md5.c:156:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  ((__u32 *) ctx->in)[14] = ctx->bits[0];
  ^
/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06/lib/md5.c:157:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  ((__u32 *) ctx->in)[15] = ctx->bits[1];
  ^
kwbimage.c: In function ‘kwbimage_verify_header’:
kwbimage.c:350:10: warning: variable ‘calc_exthdrcsum’ set but not used [-Wunused-but-set-variable]
  uint8_t calc_exthdrcsum;
          ^
make[1]: INTERNAL: Exiting with 21 jobserver tokens available; should be 20!
~/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv
cp /home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06/u-boot.bin /home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/pub/image_uclibc
cp: cannot stat ‘/home/xiao/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv/uboot/u-boot-2010.06/u-boot.bin’: No such file or directory
make: *** [hiboot] Error 1
xiao@ubuntu:~/hi3521A/Hi3531_SDK_V1.0.D.0/osdrv$

补充内容 (2017-1-4 22:43):
使用的编译系统是xiao@ubuntu:/$ uname -a
Linux ubuntu 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
xiao@ubuntu:/$
我来回答
回答6个
时间排序
认可量排序

falloutmx

1个粉丝

15

问答

0

专栏

0

资料

falloutmx 2017-01-04 10:27:37
认可0
你的环境变量里都没包含arm-hisiv100nptl

hanfei69882

2个粉丝

26

问答

0

专栏

2

资料

hanfei69882 2017-01-04 10:55:48
认可0
是否是bash和dash的问题, SDK发布的脚本都是基于bash的

ls -l /bin/sh   //当前bash/dash设置

yuexiaoban

0个粉丝

1

问答

0

专栏

0

资料

yuexiaoban 2017-01-04 21:05:30
认可0

在这个位置
# Hisilicon Linux, Cross-Toolchain PATH
#


# Mon Jan  2 17:48:37 CST 2017
# Hisilicon Linux, Cross-Toolchain PATH
export PATH="/opt/hisi-linux-nptl/arm-hisiv100-linux/target/binPATH"

yuexiaoban

0个粉丝

1

问答

0

专栏

0

资料

yuexiaoban 2017-01-04 21:06:25
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=43710&ptid=13857]hanfei69882 发表于 2017-1-4 10:55[/url]
是否是bash和dash的问题, SDK发布的脚本都是基于bash的

ls -l /bin/sh   //当前bash/dash设置[/quote]

xiao@ubuntu:~$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Jan  2 17:15 /bin/sh -> bash
xiao@ubuntu:~$

yuexiaoban

0个粉丝

1

问答

0

专栏

0

资料

yuexiaoban 2017-01-04 22:57:52
认可0
手动在root用户下 增加临时的,env查询到了编译器在路径上。按照教程可以编译了,
现在我有两个疑问,
第一:/ect/profile 文件已经有了该路径了,为什么root下就是查询不到,非得我手动添加下才可以查询得到;
第二:怎么把该路径添加到sudo 权限下,下次启动不用再临时添加。谢谢!


root@ubuntu:~# export PATH="/opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/bin:$PATH"
root@ubuntu:~# env

SHELL=/bin/bash
TERM=linux
USER=root
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
SUDO_USER=xiao
SUDO_UID=1000
USERNAME=root
MAIL=/var/mail/root
PATH=/opt/hisi-linux/x86-arm/arm-hisiv200-linux/target/bin:/usr/local/sbin:/usr/local/bin:

laocheng

1个粉丝

14

问答

0

专栏

0

资料

laocheng 2017-02-13 10:56:48
认可0
[quote][url=forum.php?mod=redirect&goto=findpost&pid=43759&ptid=13857]yuexiaoban 发表于 2017-1-4 22:57[/url]
手动在root用户下 增加临时的,env查询到了编译器在路径上。按照教程可以编译了,
现在我有两个疑问,
第 ...[/quote]

env是对应每个用户下的环境变量,当你简单(直接)切换用户时,环境变量同时也会更换。所以,你从普通用户切换到root用户,是不会继承(环境变量)你已经在/etc/profile上的路径配置。
再深刻一层是说,你使用sudo -s,它会以另外一个使用者(具有超级权限,所以你需要输入当前用户密码)来打开一个新的shell,而这个新的shell下同样也不会继承环境变量。
那么,如何解决环境变量不会继承的问题呢?
假设,你现在处于普通用户,并且env已经有你的正确路径,那么,你将输入su - root(输入root密码),就会进入root(此时,将继承你在/etc/profile上的路径(查看env验证)。
那么,你可以一直待在这个root状态下执行你编译等操作,然后返回普通用户。
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
+ 添加网盘链接/附件

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
相关问答
无更多相似问答 去提问
举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

易百纳技术社区