scons编译rv32m1_vega ri5cy内核报错

发表在 内核学习营2019-7-6 19:13 [复制链接] 5 77

编译主机: win107 o* x3 [5 Q: K  L2 m! O( ~$ h
env版本: env_released_1.1.2
& i6 o* S' w: S/ Z内核目录: rt-thread\rt-thread\bsp\rv32m1_vega\ri5cy! N) K4 ~! p9 L1 |0 S8 [, _. t
  j( @, T7 r  M5 U6 m- U
操作步骤:7 I3 T' P8 h! m( `) o) ]
step0:  执行env.bat
6 b# e1 |# o2 _% c  m
# Z9 t5 }; I* l/ ?. ]( Q: J! |3 y( B; r6 I+ R
step1:  执行scons, 报错如下:- R2 n9 e: \! u5 p! F7 L
> scons
& t4 X9 @( P5 g5 r  t8 z7 Cscons: Reading SConscript files ..., l4 L0 |$ o7 x9 y3 u5 H
scons: done reading SConscript files.
( ^7 H/ }7 J. Wscons: Building targets ...0 {; e* {; m- B# n5 o3 e6 t# M+ b
scons: building associated VariantDir targets: build2 ]3 a7 |' n2 [) o0 Z" ]
CC build\applications\main.o0 \$ x' F! v% K; Q# }: \
Error in calling command:riscv-none-embed-gcc
0 @7 _5 b' J) Z" v8 x6 TException: No such file or directory* P, p5 [, v  j- W; b

6 X) o! y9 y. ^Please check Toolchains PATH setting.( z. t0 @9 s7 j& C4 W; ?- N9 {

$ d, H/ l" l0 Y3 P0 v2 v) Fscons: *** [build\applications\main.o] Error 2: w) u- U* f0 @  i
scons: building terminated because of errors.  @" `! [& t& ~# y1 W" o! y1 Q

. D/ O0 h. f1 E/ ]9 N$ B8 E/ v. G8 T  L' b: V+ T9 m! U1 w
问题:$ i% K0 e% m4 g6 Z8 ?  N
riscv-none-embed-gcc 已加入系统变量% \/ n$ X: W) S9 i
PS C:\Users\Administrator> riscv-none-embed-gcc. T' @+ T9 L. F) A& v
riscv-none-embed-gcc.exe: fatal error: no input files. g9 J& J# Q. I4 e5 `6 |# h
compilation terminated./ Z4 Y; e7 P6 B
6 z; N6 e. H7 W& c- Y
; }4 j. I; ?9 v! N, y" O- d
还有什么设置要做?  麻烦各位了。; V6 G( W' D% a& F9 G
使用道具 举报 显示全部楼层 回复
最新评论 | 正序浏览
显示全部楼层 |楼层直达:
发表于 2019-7-8 08:56:08 | 显示全部楼层
env是属于主动设置环境变量,所以你需要在env里把环境变量设置下,指向到你按照RISC-V GCC的目录5 _+ ^. q% ^$ D' O  v" h

7 O: h- {4 C2 ~+ c# N5 {: Y例如在env终端控制台下,输入命令进行设置:
' U: [. J7 H- P4 E
, V% M0 u8 G! Z* _' ^7 bset RTT_EXEC_PATH=E:\Tools\env\tools\ConEmu\ConEmu\..\..\..\tools\gnu_gcc\riscv64\bin
$ T0 o/ k9 T& ^6 h' M% t5 M9 W
9 ~  j2 S9 h+ T5 q& J$ A5 M# e方便起见,你也可以在env/conemu中主动配置一项RISC-V相关的配置。可以把
* X7 P7 u; b8 p3 f6 L6 V' M; r+ t2 N1 t% h: {
env\tools\ConEmu\ConEmu\CmdInit.cmd2 a* P, m) T9 G2 g7 h6 G3 v

3 R7 P4 T* Y" s0 X! S3 E修改下,命名成CmdInitRV.cmd(如果你只用RISC-V,则直接改上面文件也就可以了)
使用道具 举报 回复
发表于 2019-7-8 09:26:01 | 显示全部楼层
scons 会在 rtconfig.py 里面获取工具链
+ H! x+ n0 D0 T. f8 p. v+ h! e/ K7 p: c$ v
  1. if  CROSS_TOOL == 'gcc':
    ! p8 O# r" Z# j
  2.     PLATFORM    = 'gcc'
    6 s0 `9 `3 s1 ?/ m6 Z% \* j
  3.     EXEC_PATH   = r'/opt/unknown-gcc/bin'1 O! g0 c& X  o! ]
  4. else:
    " a; y' k/ Q; R7 W) H* D& Y, d
  5.     print('Please make sure your toolchains is GNU GCC!')' X' K4 v9 R1 e" h' S- A
  6.     exit(0)
    + \. Q2 j, E" I: K! x& ^
  7. ! d! I9 E) C0 e2 |3 o* g5 b
  8. if os.getenv('RTT_EXEC_PATH'):5 ?% I  y, Q! }2 _
  9.     EXEC_PATH = os.getenv('RTT_EXEC_PATH')
复制代码
使用道具 举报 回复
发表于 2019-7-8 09:48:48 | 显示全部楼层
wuhanstudio 发表于 2019-7-8 09:26, X4 E( n, P& n8 l- x' _6 {3 U/ H
scons 会在 rtconfig.py 里面获取工具链

/ {. c/ ^  x/ e( j3 I& i6 |; h& @但是会优先使用环境变量的,所以对于env,还是一定得配环境变量,仅rtconfig.py中配置会被覆盖掉的。
使用道具 举报 回复
发表于 2019-7-8 11:08:37 | 显示全部楼层
bernard 发表于 2019-7-8 09:481 o  d0 ~) P: i( y
但是会优先使用环境变量的,所以对于env,还是一定得配环境变量,仅rtconfig.py中配置会被覆盖掉的。 ...
% c$ T: a6 N8 ]( i4 }0 Z
哈哈,熊大说得对,RTT_EXEC_PATH 得要,想和他说明一下 scons 的配置文件在哪里可以找到
使用道具 举报 回复
发表于 2019-7-8 15:26:47 | 显示全部楼层
感谢各位的帮助, 已成功构建:: X1 |9 S; w8 H. M
! x  i. V  ~5 o5 F- ~+ E/ N5 ]
> scons! e, p! \3 Z0 j. }" [, e
scons: Reading SConscript files ...
( \" C4 O5 e3 Z7 G- oscons: done reading SConscript files.
9 ]1 J6 a. G9 V1 r) x9 }! |scons: Building targets ...
" E. A8 M6 `/ s; b4 Z( Qscons: building associated VariantDir targets: build
2 j( v' w) S( f- M/ QCC build\applications\main.o* R, O" H6 d" F# `$ G. w+ W0 F' ?2 T5 a
CC build\applications\mnt.o
1 F" B1 u1 ?% e$ [" W" B9 b* t/ rCC build\board\board.o  Q! [8 ?: \# L4 z  S- ?# a
CC build\board\clock_config.o
1 n7 w" B8 f, L' Z2 _CC build\board\fsl_host.o( n$ K; t, w5 ?  M3 P# N" g
CC build\board\pin_mux.o
0 W) a# U0 E+ }4 _% R3 xCC build\driver\drv_gpio.o
* ~# j: T: V4 K) s4 xCC build\driver\drv_sdcard.o# q  e8 d8 E: \  u, {4 ]
CC build\driver\drv_uart.o9 W: C! ]' f0 s  j- c6 X8 V
CC build\kernel\components\dfs\filesystems\devfs\devfs.o
* S5 X7 |9 O- d/ XCC build\kernel\components\dfs\filesystems\elmfat\dfs_elm.o
- }4 e8 e- r6 B, T8 qCC build\kernel\components\dfs\filesystems\elmfat\ff.o* u/ J& \% _' M
CC build\kernel\components\dfs\filesystems\elmfat\option\ccsbcs.o+ @' A( M' Z* d0 Q, ]
CC build\kernel\components\dfs\src\dfs.o
, F# M& Z. l6 r+ _- W; R/ HCC build\kernel\components\dfs\src\dfs_file.o
2 Y: f$ p/ H. @; U2 s# lCC build\kernel\components\dfs\src\dfs_fs.o
4 v/ {6 R! [6 b$ j' B/ h/ m1 _CC build\kernel\components\dfs\src\dfs_posix.o
  A. v' ]7 {2 `2 z) |  p) FCC build\kernel\components\dfs\src\poll.o( r0 }; |' a0 H+ \$ p! b$ `
CC build\kernel\components\dfs\src\select.o
0 O/ x' G9 ~: c3 `: b$ s, x6 vCC build\kernel\components\drivers\misc\pin.o" z" ~6 i3 _% I0 i/ W; F$ A$ h
CC build\kernel\components\drivers\rtc\rtc.o
* T5 T- R6 ?5 N  N, A: }CC build\kernel\components\drivers\serial\serial.o2 }* \/ C; Q8 ]* _) g4 {4 p. j
CC build\kernel\components\drivers\src\completion.o' T/ a+ C. N' w
CC build\kernel\components\drivers\src\dataqueue.o% j) T# Y& ~  n  y- w! f0 Q
CC build\kernel\components\drivers\src\pipe.o% W5 j# _, W( q
CC build\kernel\components\drivers\src\ringblk_buf.o
0 H$ ^# j: \. r) B) Y& PCC build\kernel\components\drivers\src\ringbuffer.o& ]* }1 ]4 N) s0 _; W# S
CC build\kernel\components\drivers\src\waitqueue.o
& z- ^+ `3 Y  e9 ^+ P  ^CC build\kernel\components\drivers\src\workqueue.o+ B, G' y! G% Q6 u5 c1 }
CC build\kernel\components\finsh\cmd.o, x0 d0 S' [! l/ x7 `' f
CC build\kernel\components\finsh\msh.o5 x) e- m# H  i  @3 i$ D  b
CC build\kernel\components\finsh\msh_cmd.o
8 [% ]7 q& M/ PCC build\kernel\components\finsh\msh_file.o* l0 U* V' [( v" g5 C
CC build\kernel\components\finsh\shell.o
0 v7 i) N/ \$ X# p' r4 m' O5 gCC build\kernel\components\finsh\symbol.o
/ _; O% P+ Q% E, d  D0 c% lCC build\kernel\components\libc\compilers\common\gmtime_r.o
7 b0 d  j/ b; q( B- K# R% ~$ oCC build\kernel\components\libc\compilers\newlib\libc.o
1 g* r9 V. p0 I+ `5 E7 g' SCC build\kernel\components\libc\compilers\newlib\libc_syms.o
/ q- |% G9 a4 k9 I! x2 a" [CC build\kernel\components\libc\compilers\newlib\stdio.o
$ r2 ~7 J0 j# l0 x/ p# J9 p- mCC build\kernel\components\libc\compilers\newlib\syscalls.o0 B2 c* Y6 n8 N9 D4 W. }) T0 x
CC build\kernel\components\libc\compilers\newlib\time.o
* K$ k6 z  b* _; L0 o( ^9 a% \CC build\kernel\components\utilities\ulog\backend\console_be.o
% h  p8 m- L8 Z* z1 `; ]CC build\kernel\components\utilities\ulog\ulog.o
2 P% @8 Y# p1 t7 N) k2 V( zAS build\kernel\libcpu\risc-v\common\context_gcc.o
- R, [/ Y  g; xCC build\kernel\libcpu\risc-v\common\cpuport.o: _/ i7 V& Y5 k+ E
CC build\kernel\libcpu\risc-v\rv32m1\interrupt.o
9 F9 K+ n- C4 i& n; fAS build\kernel\libcpu\risc-v\rv32m1\interrupt_gcc.o
; u, a7 y1 N; O/ M0 jCC build\kernel\src\clock.o! s/ T' |- k: f3 G- v8 o4 K- T+ N
CC build\kernel\src\components.o. @, E5 g) u3 K& e- p1 r  Z
CC build\kernel\src\cpu.o( s6 m1 g3 T" o# [
CC build\kernel\src\device.o
/ g8 b5 h7 x) K0 `+ M9 s1 sCC build\kernel\src\idle.o
, c6 v- z) ], q3 iCC build\kernel\src\ipc.o
7 J- j7 X9 L: kCC build\kernel\src\irq.o
+ p4 x/ Q5 v9 V" q$ k/ RCC build\kernel\src\kservice.o
- S2 E6 U4 n4 V# t; ^CC build\kernel\src\mem.o
# x9 l$ Q2 P; L+ ~" z  m9 ?2 }1 vCC build\kernel\src\mempool.o6 f" S5 B8 K' ~3 m* I! I" T
CC build\kernel\src\object.o$ r8 S, X5 f8 B: V
CC build\kernel\src\scheduler.o7 V( g8 m& D" O: V5 {6 }
CC build\kernel\src\signal.o
5 z  A1 c6 V% ]$ i% }CC build\kernel\src\thread.o
. Q8 Y0 R$ D. u' ?9 C0 ECC build\kernel\src\timer.o& n0 k% q( B; \1 }( h
CC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\system_RV32M1_ri5cy.o) o( R' A3 ^0 d- q& ^( _
CC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\drivers\fsl_clock.o
" a$ @" F: h) q% O2 p7 TCC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\drivers\fsl_common.o
: i( H7 X4 a" I1 {. q* sCC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\drivers\fsl_lpuart.o
; z6 F8 s. [9 j5 yCC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\drivers\fsl_gpio.o
" f4 n% ^/ T% J! M# f8 {2 dCC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\drivers\fsl_msmc.o3 O+ w3 D# A1 e
CC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\drivers\fsl_usdhc.o
- u* h, h9 o9 w0 D- V% @- qCC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\drivers\fsl_intmux.o
* g& g) C  R0 \4 k( F6 `AS E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\devices\RV32M1\gcc\startup_RV32M1_ri5cy.o' ]3 a( p7 I8 p( r
CC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\sdmmc_2.1.2\src\fsl_sd.o
. d% L; S9 J+ T3 `+ {CC E:\rt-thread\bsp\rv32m1_vega\rv32m1_sdk_riscv\sdmmc_2.1.2\src\fsl_sdmmc.o; k3 u" G9 }* w! f9 Q0 Q
LINK rtthread.elf
6 Y: ~3 z7 I9 S8 [4 J- s" Mriscv-none-embed-size rtthread.elf
! V# i- {0 X5 j! y+ l2 s; f/ D   text    data     bss     dec     hex filename
2 n0 h- Y% U, S; m% x& y. w 241008    2452    7684  251144   3d508 rtthread.elf3 ?1 i/ p! ?3 W" ^$ e7 S
scons: done building targets.
使用道具 举报 回复
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|RT-Thread开发者社区  

© 2013-2017 上海睿赛德电子科技有限公司 沪ICP备13014002号-1

Powered by RT-Thread

快速回复 返回顶部 返回列表