编译sifive的freedom-u-sdk
在其它电脑搭建编译该sdk工程的环境,由于所在电脑的linux系统为新装系统(版本:Ubuntu 20.04 LTS),下面记录了编译过程中遇到的问题,以及解决过程供以后参考
问题1:包含两个报错
(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.”
(2)error “Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, 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/sha.h: No such file or directory。都是没有安装libssl-dev
libssl-dev包含libraries, header files and manpages,他是openssl的一部分,而openssl对ssl进行了实现
$ sudo apt-get install libssl-dev
问题3: libfakeroot.c:99:40: error: ‘_STAT_VER’ undeclared (first use in this function)
详细错误输出如下,不过不重要,全部都是报 _STAT_VER
这个变量没有定义的错误,直接往下看解决方法。
libfakeroot.c: In function 'chown':
libfakeroot.c:99:40: error: '_STAT_VER' undeclared (first use in this function)
99 | #define INT_NEXT_STAT(a,b) NEXT_STAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:9:43: note: in definition of macro 'NEXT_STAT64'
9 | #define NEXT_STAT64(a,b,c) next___xstat64(a,b,c)
| ^
libfakeroot.c:804:5: note: in expansion of macro 'INT_NEXT_STAT'
804 | r=INT_NEXT_STAT(path, &st);
| ^~~~~~~~~~~~~
libfakeroot.c:99:40: note: each undeclared identifier is reported only once for each function it appears in
99 | #define INT_NEXT_STAT(a,b) NEXT_STAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:9:43: note: in definition of macro 'NEXT_STAT64'
9 | #define NEXT_STAT64(a,b,c) next___xstat64(a,b,c)
| ^
libfakeroot.c:804:5: note: in expansion of macro 'INT_NEXT_STAT'
804 | r=INT_NEXT_STAT(path, &st);
| ^~~~~~~~~~~~~
libtool: link: /usr/bin/gcc -O2 -I/home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/work/buildroot_initramfs/host/usr/include -Wl,-rpath -Wl,/home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/work/buildroot_initramfs/host/usr/lib -o simple simple.o -L/home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/work/buildroot_initramfs/host/lib -L/home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/work/buildroot_initramfs/host/usr/lib -ldl
libfakeroot.c: In function 'lchown':
libfakeroot.c:100:42: error: '_STAT_VER' undeclared (first use in this function)
100 | #define INT_NEXT_LSTAT(a,b) NEXT_LSTAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:13:45: note: in definition of macro 'NEXT_LSTAT64'
13 | #define NEXT_LSTAT64(a,b,c) next___lxstat64(a,b,c)
| ^
libfakeroot.c:836:5: note: in expansion of macro 'INT_NEXT_LSTAT'
836 | r=INT_NEXT_LSTAT(path, &st);
| ^~~~~~~~~~~~~~
libfakeroot.c: In function 'fchown':
libfakeroot.c:101:42: error: '_STAT_VER' undeclared (first use in this function)
101 | #define INT_NEXT_FSTAT(a,b) NEXT_FSTAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:11:45: note: in definition of macro 'NEXT_FSTAT64'
11 | #define NEXT_FSTAT64(a,b,c) next___fxstat64(a,b,c)
| ^
libfakeroot.c:857:5: note: in expansion of macro 'INT_NEXT_FSTAT'
857 | r=INT_NEXT_FSTAT(fd, &st);
| ^~~~~~~~~~~~~~
libfakeroot.c: In function 'fchownat':
libfakeroot.c:102:50: error: '_STAT_VER' undeclared (first use in this function)
102 | #define INT_NEXT_FSTATAT(a,b,c,d) NEXT_FSTATAT64(_STAT_VER,a,b,c,d)
| ^~~~~~~~~
fakerootconfig.h:15:53: note: in definition of macro 'NEXT_FSTATAT64'
15 | #define NEXT_FSTATAT64(a,b,c,d,e) next___fxstatat64(a,b,c,d,e)
| ^
libfakeroot.c:883:5: note: in expansion of macro 'INT_NEXT_FSTATAT'
883 | r=INT_NEXT_FSTATAT(dir_fd, path, &st, (flags & AT_SYMLINK_NOFOLLOW));
| ^~~~~~~~~~~~~~~~
libfakeroot.c: In function 'chmod':
libfakeroot.c:99:40: error: '_STAT_VER' undeclared (first use in this function)
99 | #define INT_NEXT_STAT(a,b) NEXT_STAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:9:43: note: in definition of macro 'NEXT_STAT64'
9 | #define NEXT_STAT64(a,b,c) next___xstat64(a,b,c)
| ^
libfakeroot.c:914:5: note: in expansion of macro 'INT_NEXT_STAT'
914 | r=INT_NEXT_STAT(path, &st);
| ^~~~~~~~~~~~~
libfakeroot.c: In function 'lchmod':
libfakeroot.c:100:42: error: '_STAT_VER' undeclared (first use in this function)
100 | #define INT_NEXT_LSTAT(a,b) NEXT_LSTAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:13:45: note: in definition of macro 'NEXT_LSTAT64'
13 | #define NEXT_LSTAT64(a,b,c) next___lxstat64(a,b,c)
| ^
libfakeroot.c:954:5: note: in expansion of macro 'INT_NEXT_LSTAT'
954 | r=INT_NEXT_LSTAT(path, &st);
| ^~~~~~~~~~~~~~
libfakeroot.c: In function 'fchmod':
libfakeroot.c:101:42: error: '_STAT_VER' undeclared (first use in this function)
101 | #define INT_NEXT_FSTAT(a,b) NEXT_FSTAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:11:45: note: in definition of macro 'NEXT_FSTAT64'
11 | #define NEXT_FSTAT64(a,b,c) next___fxstat64(a,b,c)
| ^
libfakeroot.c:988:5: note: in expansion of macro 'INT_NEXT_FSTAT'
988 | r=INT_NEXT_FSTAT(fd, &st);
| ^~~~~~~~~~~~~~
libfakeroot.c: In function 'fchmodat':
libfakeroot.c:102:50: error: '_STAT_VER' undeclared (first use in this function)
102 | #define INT_NEXT_FSTATAT(a,b,c,d) NEXT_FSTATAT64(_STAT_VER,a,b,c,d)
| ^~~~~~~~~
fakerootconfig.h:15:53: note: in definition of macro 'NEXT_FSTATAT64'
15 | #define NEXT_FSTATAT64(a,b,c,d,e) next___fxstatat64(a,b,c,d,e)
| ^
libfakeroot.c:1020:5: note: in expansion of macro 'INT_NEXT_FSTATAT'
1020 | r=INT_NEXT_FSTATAT(dir_fd, path, &st, flags & AT_SYMLINK_NOFOLLOW);
| ^~~~~~~~~~~~~~~~
libfakeroot.c: In function '__xmknod':
libfakeroot.c:100:42: error: '_STAT_VER' undeclared (first use in this function)
100 | #define INT_NEXT_LSTAT(a,b) NEXT_LSTAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:13:45: note: in definition of macro 'NEXT_LSTAT64'
13 | #define NEXT_LSTAT64(a,b,c) next___lxstat64(a,b,c)
| ^
libfakeroot.c:1067:5: note: in expansion of macro 'INT_NEXT_LSTAT'
1067 | r=INT_NEXT_LSTAT(pathname, &st);
| ^~~~~~~~~~~~~~
libfakeroot.c: In function '__xmknodat':
libfakeroot.c:102:50: error: '_STAT_VER' undeclared (first use in this function)
102 | #define INT_NEXT_FSTATAT(a,b,c,d) NEXT_FSTATAT64(_STAT_VER,a,b,c,d)
| ^~~~~~~~~
fakerootconfig.h:15:53: note: in definition of macro 'NEXT_FSTATAT64'
15 | #define NEXT_FSTATAT64(a,b,c,d,e) next___fxstatat64(a,b,c,d,e)
| ^
libfakeroot.c:1107:5: note: in expansion of macro 'INT_NEXT_FSTATAT'
1107 | r=INT_NEXT_FSTATAT(dir_fd, pathname, &st, 0);
| ^~~~~~~~~~~~~~~~
libfakeroot.c: In function 'mkdir':
libfakeroot.c:99:40: error: '_STAT_VER' undeclared (first use in this function)
99 | #define INT_NEXT_STAT(a,b) NEXT_STAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:9:43: note: in definition of macro 'NEXT_STAT64'
9 | #define NEXT_STAT64(a,b,c) next___xstat64(a,b,c)
| ^
libfakeroot.c:1143:5: note: in expansion of macro 'INT_NEXT_STAT'
1143 | r=INT_NEXT_STAT(path, &st);
| ^~~~~~~~~~~~~
libtool: link: /usr/bin/ar cru .libs/libmacosx.a .libs/libfakeroot_inode64.o .libs/libfakeroot_unix2003.o
/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')
libfakeroot.c: In function 'mkdirat':
libfakeroot.c:102:50: error: '_STAT_VER' undeclared (first use in this function)
102 | #define INT_NEXT_FSTATAT(a,b,c,d) NEXT_FSTATAT64(_STAT_VER,a,b,c,d)
| ^~~~~~~~~
fakerootconfig.h:15:53: note: in definition of macro 'NEXT_FSTATAT64'
15 | #define NEXT_FSTATAT64(a,b,c,d,e) next___fxstatat64(a,b,c,d,e)
| ^
libfakeroot.c:1173:5: note: in expansion of macro 'INT_NEXT_FSTATAT'
1173 | r=INT_NEXT_FSTATAT(dir_fd, path, &st, 0);
| ^~~~~~~~~~~~~~~~
libtool: link: /usr/bin/ranlib .libs/libmacosx.a
libfakeroot.c: In function 'unlink':
libfakeroot.c:100:42: error: '_STAT_VER' undeclared (first use in this function)
100 | #define INT_NEXT_LSTAT(a,b) NEXT_LSTAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:13:45: note: in definition of macro 'NEXT_LSTAT64'
13 | #define NEXT_LSTAT64(a,b,c) next___lxstat64(a,b,c)
| ^
libfakeroot.c:1207:5: note: in expansion of macro 'INT_NEXT_LSTAT'
1207 | r=INT_NEXT_LSTAT(pathname, &st);
| ^~~~~~~~~~~~~~
libfakeroot.c: In function 'unlinkat':
libfakeroot.c:102:50: error: '_STAT_VER' undeclared (first use in this function)
102 | #define INT_NEXT_FSTATAT(a,b,c,d) NEXT_FSTATAT64(_STAT_VER,a,b,c,d)
| ^~~~~~~~~
fakerootconfig.h:15:53: note: in definition of macro 'NEXT_FSTATAT64'
15 | #define NEXT_FSTATAT64(a,b,c,d,e) next___fxstatat64(a,b,c,d,e)
| ^
libfakeroot.c:1226:5: note: in expansion of macro 'INT_NEXT_FSTATAT'
1226 | r=INT_NEXT_FSTATAT(dir_fd, pathname, &st, (flags&~AT_REMOVEDIR) | AT_SYMLINK_NOFOLLOW);
| ^~~~~~~~~~~~~~~~
libfakeroot.c: In function 'rmdir':
libfakeroot.c:100:42: error: '_STAT_VER' undeclared (first use in this function)
100 | #define INT_NEXT_LSTAT(a,b) NEXT_LSTAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:13:45: note: in definition of macro 'NEXT_LSTAT64'
13 | #define NEXT_LSTAT64(a,b,c) next___lxstat64(a,b,c)
| ^
libfakeroot.c:1250:5: note: in expansion of macro 'INT_NEXT_LSTAT'
1250 | r=INT_NEXT_LSTAT(pathname, &st);
| ^~~~~~~~~~~~~~
libfakeroot.c: In function 'remove':
libfakeroot.c:100:42: error: '_STAT_VER' undeclared (first use in this function)
100 | #define INT_NEXT_LSTAT(a,b) NEXT_LSTAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:13:45: note: in definition of macro 'NEXT_LSTAT64'
13 | #define NEXT_LSTAT64(a,b,c) next___lxstat64(a,b,c)
| ^
libfakeroot.c:1270:5: note: in expansion of macro 'INT_NEXT_LSTAT'
1270 | r=INT_NEXT_LSTAT(pathname, &st);
| ^~~~~~~~~~~~~~
libfakeroot.c: In function 'rename':
libfakeroot.c:100:42: error: '_STAT_VER' undeclared (first use in this function)
100 | #define INT_NEXT_LSTAT(a,b) NEXT_LSTAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:13:45: note: in definition of macro 'NEXT_LSTAT64'
13 | #define NEXT_LSTAT64(a,b,c) next___lxstat64(a,b,c)
| ^
libfakeroot.c:1300:5: note: in expansion of macro 'INT_NEXT_LSTAT'
1300 | r=INT_NEXT_LSTAT(newpath, &st);
| ^~~~~~~~~~~~~~
libfakeroot.c: In function 'renameat':
libfakeroot.c:102:50: error: '_STAT_VER' undeclared (first use in this function)
102 | #define INT_NEXT_FSTATAT(a,b,c,d) NEXT_FSTATAT64(_STAT_VER,a,b,c,d)
| ^~~~~~~~~
fakerootconfig.h:15:53: note: in definition of macro 'NEXT_FSTATAT64'
15 | #define NEXT_FSTATAT64(a,b,c,d,e) next___fxstatat64(a,b,c,d,e)
| ^
libfakeroot.c:1324:5: note: in expansion of macro 'INT_NEXT_FSTATAT'
1324 | r=INT_NEXT_FSTATAT(newdir_fd, newpath, &st, AT_SYMLINK_NOFOLLOW);
| ^~~~~~~~~~~~~~~~
libtool: link: ( cd ".libs" && rm -f "libmacosx.la" && ln -s "../libmacosx.la" "libmacosx.la" )
libfakeroot.c: In function 'setxattr':
libfakeroot.c:99:40: error: '_STAT_VER' undeclared (first use in this function)
99 | #define INT_NEXT_STAT(a,b) NEXT_STAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:9:43: note: in definition of macro 'NEXT_STAT64'
9 | #define NEXT_STAT64(a,b,c) next___xstat64(a,b,c)
| ^
libfakeroot.c:1658:5: note: in expansion of macro 'INT_NEXT_STAT'
1658 | r=INT_NEXT_STAT(path, &st);
| ^~~~~~~~~~~~~
libfakeroot.c: In function 'lsetxattr':
libfakeroot.c:100:42: error: '_STAT_VER' undeclared (first use in this function)
100 | #define INT_NEXT_LSTAT(a,b) NEXT_LSTAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:13:45: note: in definition of macro 'NEXT_LSTAT64'
13 | #define NEXT_LSTAT64(a,b,c) next___lxstat64(a,b,c)
| ^
libfakeroot.c:1679:5: note: in expansion of macro 'INT_NEXT_LSTAT'
1679 | r=INT_NEXT_LSTAT(path, &st);
| ^~~~~~~~~~~~~~
libfakeroot.c: In function 'fsetxattr':
libfakeroot.c:101:42: error: '_STAT_VER' undeclared (first use in this function)
101 | #define INT_NEXT_FSTAT(a,b) NEXT_FSTAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:11:45: note: in definition of macro 'NEXT_FSTAT64'
11 | #define NEXT_FSTAT64(a,b,c) next___fxstat64(a,b,c)
| ^
libfakeroot.c:1700:5: note: in expansion of macro 'INT_NEXT_FSTAT'
1700 | r=INT_NEXT_FSTAT(fd, &st);
| ^~~~~~~~~~~~~~
libfakeroot.c: In function 'getxattr':
libfakeroot.c:99:40: error: '_STAT_VER' undeclared (first use in this function)
99 | #define INT_NEXT_STAT(a,b) NEXT_STAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:9:43: note: in definition of macro 'NEXT_STAT64'
9 | #define NEXT_STAT64(a,b,c) next___xstat64(a,b,c)
| ^
libfakeroot.c:1721:5: note: in expansion of macro 'INT_NEXT_STAT'
1721 | r=INT_NEXT_STAT(path, &st);
| ^~~~~~~~~~~~~
libfakeroot.c: In function 'lgetxattr':
libfakeroot.c:100:42: error: '_STAT_VER' undeclared (first use in this function)
100 | #define INT_NEXT_LSTAT(a,b) NEXT_LSTAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:13:45: note: in definition of macro 'NEXT_LSTAT64'
13 | #define NEXT_LSTAT64(a,b,c) next___lxstat64(a,b,c)
| ^
libfakeroot.c:1742:5: note: in expansion of macro 'INT_NEXT_LSTAT'
1742 | r=INT_NEXT_LSTAT(path, &st);
| ^~~~~~~~~~~~~~
libfakeroot.c: In function 'fgetxattr':
libfakeroot.c:101:42: error: '_STAT_VER' undeclared (first use in this function)
101 | #define INT_NEXT_FSTAT(a,b) NEXT_FSTAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:11:45: note: in definition of macro 'NEXT_FSTAT64'
11 | #define NEXT_FSTAT64(a,b,c) next___fxstat64(a,b,c)
| ^
libfakeroot.c:1763:5: note: in expansion of macro 'INT_NEXT_FSTAT'
1763 | r=INT_NEXT_FSTAT(fd, &st);
| ^~~~~~~~~~~~~~
libfakeroot.c: In function 'listxattr':
libfakeroot.c:99:40: error: '_STAT_VER' undeclared (first use in this function)
99 | #define INT_NEXT_STAT(a,b) NEXT_STAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:9:43: note: in definition of macro 'NEXT_STAT64'
9 | #define NEXT_STAT64(a,b,c) next___xstat64(a,b,c)
| ^
libfakeroot.c:1784:5: note: in expansion of macro 'INT_NEXT_STAT'
1784 | r=INT_NEXT_STAT(path, &st);
| ^~~~~~~~~~~~~
libfakeroot.c: In function 'llistxattr':
libfakeroot.c:100:42: error: '_STAT_VER' undeclared (first use in this function)
100 | #define INT_NEXT_LSTAT(a,b) NEXT_LSTAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:13:45: note: in definition of macro 'NEXT_LSTAT64'
13 | #define NEXT_LSTAT64(a,b,c) next___lxstat64(a,b,c)
| ^
libfakeroot.c:1805:5: note: in expansion of macro 'INT_NEXT_LSTAT'
1805 | r=INT_NEXT_LSTAT(path, &st);
| ^~~~~~~~~~~~~~
libfakeroot.c: In function 'flistxattr':
libfakeroot.c:101:42: error: '_STAT_VER' undeclared (first use in this function)
101 | #define INT_NEXT_FSTAT(a,b) NEXT_FSTAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:11:45: note: in definition of macro 'NEXT_FSTAT64'
11 | #define NEXT_FSTAT64(a,b,c) next___fxstat64(a,b,c)
| ^
libfakeroot.c:1826:5: note: in expansion of macro 'INT_NEXT_FSTAT'
1826 | r=INT_NEXT_FSTAT(fd, &st);
| ^~~~~~~~~~~~~~
libfakeroot.c: In function 'removexattr':
libfakeroot.c:99:40: error: '_STAT_VER' undeclared (first use in this function)
99 | #define INT_NEXT_STAT(a,b) NEXT_STAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:9:43: note: in definition of macro 'NEXT_STAT64'
9 | #define NEXT_STAT64(a,b,c) next___xstat64(a,b,c)
| ^
libfakeroot.c:1847:5: note: in expansion of macro 'INT_NEXT_STAT'
1847 | r=INT_NEXT_STAT(path, &st);
| ^~~~~~~~~~~~~
libfakeroot.c: In function 'lremovexattr':
libfakeroot.c:100:42: error: '_STAT_VER' undeclared (first use in this function)
100 | #define INT_NEXT_LSTAT(a,b) NEXT_LSTAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:13:45: note: in definition of macro 'NEXT_LSTAT64'
13 | #define NEXT_LSTAT64(a,b,c) next___lxstat64(a,b,c)
| ^
libfakeroot.c:1868:5: note: in expansion of macro 'INT_NEXT_LSTAT'
1868 | r=INT_NEXT_LSTAT(path, &st);
| ^~~~~~~~~~~~~~
libfakeroot.c: In function 'fremovexattr':
libfakeroot.c:101:42: error: '_STAT_VER' undeclared (first use in this function)
101 | #define INT_NEXT_FSTAT(a,b) NEXT_FSTAT64(_STAT_VER,a,b)
| ^~~~~~~~~
fakerootconfig.h:11:45: note: in definition of macro 'NEXT_FSTAT64'
11 | #define NEXT_FSTAT64(a,b,c) next___fxstat64(a,b,c)
| ^
libfakeroot.c:1889:5: note: in expansion of macro 'INT_NEXT_FSTAT'
1889 | r=INT_NEXT_FSTAT(fd, &st);
| ^~~~~~~~~~~~~~
libfakeroot.c: In function 'fts_read':
libfakeroot.c:1953:22: warning: passing argument 1 of 'send_get_stat64' from incompatible pointer type [-Wincompatible-pointer-types]
1953 | SEND_GET_STAT64(r->fts_statp, _STAT_VER);
| ~^~~~~~~~~~~
| |
| struct stat *
libfakeroot.c:89:46: note: in definition of macro 'SEND_GET_STAT64'
89 | #define SEND_GET_STAT64(a,b) send_get_stat64(a)
| ^
In file included from libfakeroot.c:60:
communicate.h:209:44: note: expected 'struct stat64 *' but argument is of type 'struct stat *'
209 | extern void send_get_stat64(struct stat64 *buf);
| ~~~~~~~~~~~~~~~^~~
libfakeroot.c: In function 'fts_children':
libfakeroot.c:1976:24: warning: passing argument 1 of 'send_get_stat64' from incompatible pointer type [-Wincompatible-pointer-types]
1976 | SEND_GET_STAT64(r->fts_statp, _STAT_VER);
| ~^~~~~~~~~~~
| |
| struct stat *
libfakeroot.c:89:46: note: in definition of macro 'SEND_GET_STAT64'
89 | #define SEND_GET_STAT64(a,b) send_get_stat64(a)
| ^
In file included from libfakeroot.c:60:
communicate.h:209:44: note: expected 'struct stat64 *' but argument is of type 'struct stat *'
209 | extern void send_get_stat64(struct stat64 *buf);
| ~~~~~~~~~~~~~~~^~~
make[5]: *** [Makefile:642: libfakeroot.lo] Error 1
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [Makefile:660: all-recursive] Error 1
make[3]: *** [Makefile:434: all] Error 2
make[2]: *** [package/pkg-generic.mk:198: /home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/work/buildroot_initramfs/build/host-fakeroot-1.20.2/.stamp_built] Error 2
make[1]: *** [Makefile:36: _all] Error 2
make[1]: Leaving directory '/home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/buildroot'
make: *** [Makefile:115: /home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/work/buildroot_initramfs/images/rootfs.tar] Error 2
解决3:
先找出这货在哪。
find ./ -name "libfakeroot.c"
然后打开这个文件 “libfakeroot.c”
# 我的文件是在这个目录:./work/buildroot_initramfs/build/host-fakeroot-1.20.2/libfakeroot.c
vim ./work/buildroot_initramfs/build/host-fakeroot-1.20.2/libfakeroot.c
伟大的毛主席说过,没有条件创造条件,它没有定义给它定义就完事了。向文件开头添加如下定义代码。
#ifndef _STAT_VER
#if defined (__aarch64__)
#define _STAT_VER 0
#elif defined (__x86_64__)
#define _STAT_VER 1
#else
#define _STAT_VER 3
#endif
#endif
问题4: scripts/kconfig/zconf.tab.c:2466:10: fatal error: zconf.lex.c: No such file or directory
详细错误信息如下。
imaginemiracle@im-Linux:freedom-u-sdk$ sudo make all
mkdir -p /home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/work/linux/
cp -p /home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/conf/linux_u500_new_defconfig /home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/work/linux/.config
make -C /home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/linux O=/home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/work/linux ARCH=riscv olddefconfig
make[1]: Entering directory '/home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/linux'
make[2]: Entering directory '/home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/work/linux'
HOSTCC scripts/kconfig/zconf.tab.o
scripts/kconfig/zconf.tab.c:2466:10: fatal error: zconf.lex.c: No such file or directory
2466 | #include "zconf.lex.c"
| ^~~~~~~~~~~~~
compilation terminated.
make[3]: *** [scripts/Makefile.host:107: scripts/kconfig/zconf.tab.o] Error 1
make[2]: *** [/home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/linux/Makefile:504: olddefconfig] Error 2
make[2]: Leaving directory '/home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/work/linux'
make[1]: *** [Makefile:146: sub-make] Error 2
make[1]: Leaving directory '/home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/linux'
make: *** [Makefile:150: /home/imaginemiracle/Downloads/Linux_Workspace/riscv-project/freedom-u-sdk-IM/freedom-u-sdk/work/linux/.config] Error 2
解决4:
拷贝一份该文件到所需目录即可。
链接:🔗
参考文章
[1].https://blog.csdn.net/zmlovelx/article/details/104200565
[2].https://blog.csdn.net/qq_41533289/article/details/82985788
觉得这篇文章对你有帮助的话,就留下一个赞吧v*
请尊重作者,转载还请注明出处!感谢配合~
[作者]: Imagine Miracle
[版权]: 本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。
[本文链接]: https://blog.csdn.net/qq_36393978/article/details/106433345