编译sifive的freedom-u-sdk

Posted imaginemiracle-wxn

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了编译sifive的freedom-u-sdk相关的知识,希望对你有一定的参考价值。

在其它电脑搭建编译该sdk工程的环境,由于所在电脑的linux系统为新装系统(版本:Ubuntu 20.04 LTS),下面记录了编译过程中遇到的问题,以及解决过程供以后参考

问题1:error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."

freadahead.c: In function ‘freadahead‘:
rm -f t-charset.alias charset.alias && /bin/bash ./config.charset ‘x86_64-pc-linux-gnu‘ > t-charset.alias && mv t-charset.alias charset.alias
freadahead.c:91:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
   91 |  #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
      |   ^~~~~
fseeko.c: In function ‘rpl_fseeko‘:
make[7]: *** [Makefile:1842: freadahead.o] Error 1
make[7]: *** Waiting for unfinished jobs....
fseeko.c:109:4: error: #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib."
  109 |   #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib."
      |    ^~~~~
make[7]: *** [Makefile:1842: fseeko.o] Error 1
make[6]: *** [Makefile:1602: all] Error 2
make[5]: *** [Makefile:1506: all-recursive] Error 1
make[4]: *** [Makefile:1461: all] Error 2
make[3]: *** [package/pkg-generic.mk:198: /home/imaginemiracle/Miracle/Linux_Workspace/riscv-object/freedom-u-sdk/work/buildroot_initramfs/build/host-m4-1.4.17/.stamp_built] Error 2
make[2]: *** [Makefile:36: _all] Error 2
make[2]: Leaving directory ‘/home/imaginemiracle/Miracle/Linux_Workspace/riscv-object/freedom-u-sdk/buildroot‘
make[1]: *** [Makefile:115: /home/imaginemiracle/Miracle/Linux_Workspace/riscv-object/freedom-u-sdk/work/buildroot_initramfs/images/rootfs.tar] Error 2
make[1]: Leaving directory ‘/home/imaginemiracle/Miracle/Linux_Workspace/riscv-object/freedom-u-sdk‘
make: *** [Makefile:312: Image] Error 2

解决1:

//进入报错目录
$ cd /home/imaginemiracle/Miracle/Linux_Workspace/riscv-object/freedom-u-sdk/work/buildroot_initramfs/build/host-m4-1.4.17
$ sed -i ‘s/IO_ftrylockfile/IO_EOF_SEEN/‘ lib/*.c
$ echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h

问题2:fatal error: openssl/bio.h: No such file or directory

/home/imaginemiracle/Miracle/Linux_Workspace/riscv-object/freedom-u-sdk/linux/scripts/extract-cert.c:21:10: fatal error: openssl/bio.h: No such file or directory
   21 | #include <openssl/bio.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
make[4]: *** [scripts/Makefile.host:90: scripts/extract-cert] Error 1
make[4]: *** Waiting for unfinished jobs....
  SHIPPED scripts/dtc/dtc-parser.tab.c
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  CHK     scripts/mod/devicetable-offsets.h
  UPD     scripts/mod/devicetable-offsets.h
  MKELF   scripts/mod/elfconfig.h
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/mod/sumversion.o
  UPD     include/config/kernel.release
  Using /home/imaginemiracle/Miracle/Linux_Workspace/riscv-object/freedom-u-sdk/linux as source for kernel
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  CC      kernel/bounds.s
  CHK     include/generated/timeconst.h
  UPD     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  UPD     include/generated/bounds.h
  CC      arch/riscv/kernel/asm-offsets.s
  HOSTLD  scripts/dtc/dtc
  CHK     include/generated/asm-offsets.h
  UPD     include/generated/asm-offsets.h
  CALL    /home/imaginemiracle/Miracle/Linux_Workspace/riscv-object/freedom-u-sdk/linux/scripts/checksyscalls.sh
  HOSTLD  scripts/mod/modpost
make[3]: *** [/home/imaginemiracle/Miracle/Linux_Workspace/riscv-object/freedom-u-sdk/linux/Makefile:556: scripts] Error 2
make[3]: Leaving directory ‘/home/imaginemiracle/Miracle/Linux_Workspace/riscv-object/freedom-u-sdk/work/linux‘
make[2]: *** [Makefile:146: sub-make] Error 2
make[2]: Leaving directory ‘/home/imaginemiracle/Miracle/Linux_Workspace/riscv-object/freedom-u-sdk/linux‘
make[1]: *** [Makefile:164: /home/imaginemiracle/Miracle/Linux_Workspace/riscv-object/freedom-u-sdk/work/linux/vmlinux] Error 2
make[1]: Leaving directory ‘/home/imaginemiracle/Miracle/Linux_Workspace/riscv-object/freedom-u-sdk‘
make: *** [Makefile:312: Image] Error 2

解决2:

出现这个或者fatal error: openssl/名单.h: No such file or directory。都是没有安装libssl-dev
libssl-dev包含libraries, header files and manpages,他是openssl的一部分,而openssl对ssl进行了实现

$ sudo apt-get install libssl-dev

参考文章

[1].https://blog.csdn.net/zmlovelx/article/details/104200565
[2].https://blog.csdn.net/qq_41533289/article/details/82985788



以上是关于编译sifive的freedom-u-sdk的主要内容,如果未能解决你的问题,请参考以下文章

SiFive Unleashed启动

英特尔溢价4倍收购还遭拒!RISC-V芯片公司SiFive说想独立上市

SiFive募集1.75亿美元融资 计划2024年上市

融资1.75亿美元,SiFive成RISC-V芯片阵营首支独角兽

溢价 5 倍欲将 SiFive 收入麾下,英特尔的绝地反击战

溢价 5 倍欲将 SiFive 收入麾下,英特尔的绝地反击战