drinker 发表于 2023-9-19 15:12:51

rk3588 sdk升级至最新版本后 buildroot编译报错


ubuntu20.04环境下
配置板卡:./build.sh itx-3588j-BE45-A1-buildroot.mk
执行编译:./build.sh
编译buildroot时报下面错误,请问是什么原因呢
2023-09-19T14:43:05 >>> host-gawk 5.1.0 Downloading
2023-09-19T14:43:08 >>> host-gawk 5.1.0 Extracting
2023-09-19T14:43:08 >>> host-gawk 5.1.0 Patching
2023-09-19T14:43:08 >>> host-gawk 5.1.0 Updating config.sub and config.guess
2023-09-19T14:43:08 >>> host-gawk 5.1.0 Patching libtool
2023-09-19T14:43:08 >>> host-gawk 5.1.0 Configuring
2023-09-19T14:43:19 >>> host-gawk 5.1.0 Building
Done in 3min 44s(error code: 2)
Failed to build /home/dyk/rk3588/buildroot/output/firefly_rk3588/.config:
2023-09-19T14:43:21 readdir_test.c: In function 'ftype':
2023-09-19T14:43:21 readdir_test.c:120:21: error: dereferencing pointer to incomplete type 'struct dirent'
2023-09-19T14:43:21 120 |strcat(fname, entry->d_name);
2023-09-19T14:43:21 |                     ^~
2023-09-19T14:43:21 readdir_test.c: At top level:
2023-09-19T14:43:21 readdir_test.c:147:18: warning: 'struct dirent' declared inside parameter list will not be visible outside of this definition or declaration
2023-09-19T14:43:21 147 | get_inode(struct dirent *entry, const char *dirname)
2023-09-19T14:43:21 |                  ^~~~~~
2023-09-19T14:43:21 readdir_test.c: In function 'get_inode':
2023-09-19T14:43:21 readdir_test.c:169:14: error: dereferencing pointer to incomplete type 'struct dirent'
2023-09-19T14:43:21 169 |return entry->d_ino;
2023-09-19T14:43:21 |            ^~
2023-09-19T14:43:21 readdir_test.c: In function 'dir_get_record':
2023-09-19T14:43:21 readdir_test.c:180:2: error: unknown type name 'DIR'
2023-09-19T14:43:21 180 |DIR *dp;
2023-09-19T14:43:21 |^~~
2023-09-19T14:43:21 readdir_test.c:202:11: warning: implicit declaration of function 'readdir'; did you mean 'rmdir'? [-Wimplicit-function-declaration]
2023-09-19T14:43:21 202 |dirent = readdir(dp);
2023-09-19T14:43:21 |         ^~~~~~~
2023-09-19T14:43:21 |         rmdir
2023-09-19T14:43:21 readdir_test.c:202:9: warning: assignment to 'struct dirent *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
2023-09-19T14:43:21 202 |dirent = readdir(dp);
2023-09-19T14:43:21 |         ^
2023-09-19T14:43:21 readdir_test.c:208:18: warning: passing argument 1 of 'get_inode' from incompatible pointer type [-Wincompatible-pointer-types]
2023-09-19T14:43:21 208 |ino = get_inode(dirent, iobuf->name);
2023-09-19T14:43:21 |                  ^~~~~~
2023-09-19T14:43:21 |                  |
2023-09-19T14:43:21 |                  struct dirent *
2023-09-19T14:43:21 readdir_test.c:147:26: note: expected 'struct dirent *' but argument is of type 'struct dirent *'
2023-09-19T14:43:21 147 | get_inode(struct dirent *entry, const char *dirname)
2023-09-19T14:43:21 |         ~~~~~~~~~~~~~~~^~~~~
2023-09-19T14:43:21 readdir_test.c:216:58: error: dereferencing pointer to incomplete type 'struct dirent'
2023-09-19T14:43:21 216 |len += (flen = sprintf(the_dir->buf + len, "/%s", dirent->d_name));
2023-09-19T14:43:21 |                                                          ^~
2023-09-19T14:43:21 readdir_test.c:219:16: warning: passing argument 1 of 'ftype' from incompatible pointer type [-Wincompatible-pointer-types]
2023-09-19T14:43:21 219 |ftstr = ftype(dirent, iobuf->name);
2023-09-19T14:43:21 |                ^~~~~~
2023-09-19T14:43:21 |                |
2023-09-19T14:43:21 |                struct dirent *
2023-09-19T14:43:21 readdir_test.c:99:22: note: expected 'struct dirent *' but argument is of type 'struct dirent *'
2023-09-19T14:43:21 99 | ftype(struct dirent *entry, const char *dirname)
2023-09-19T14:43:21 |       ~~~~~~~~~~~~~~~^~~~~
2023-09-19T14:43:21 readdir_test.c: In function 'dir_close':
2023-09-19T14:43:21 readdir_test.c:244:2: warning: implicit declaration of function 'closedir'; did you mean 'close'? [-Wimplicit-function-declaration]
2023-09-19T14:43:21 244 |closedir(the_dir->dp);
2023-09-19T14:43:21 |^~~~~~~~
2023-09-19T14:43:21 |close
2023-09-19T14:43:21 readdir_test.c: In function 'dir_take_control_of':
2023-09-19T14:43:21 readdir_test.c:271:2: error: unknown type name 'DIR'
2023-09-19T14:43:21 271 |DIR *dp;
2023-09-19T14:43:21 |^~~
2023-09-19T14:43:21 readdir_test.c:279:7: warning: implicit declaration of function 'opendir' [-Wimplicit-function-declaration]
2023-09-19T14:43:21 279 |dp = opendir(iobuf->name);
2023-09-19T14:43:21 |       ^~~~~~~
2023-09-19T14:43:21 readdir_test.c:279:5: warning: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
2023-09-19T14:43:21 279 |dp = opendir(iobuf->name);
2023-09-19T14:43:21 |   ^
2023-09-19T14:43:21 readdir_test.c:281:15: warning: implicit declaration of function 'dirfd' [-Wimplicit-function-declaration]
2023-09-19T14:43:21 281 |   iobuf->fd = dirfd(dp);
2023-09-19T14:43:21 |               ^~~~~
2023-09-19T14:43:21 readdir_test.c:298:16: error: invalid application of 'sizeof' to incomplete type 'struct dirent'
2023-09-19T14:43:21 298 |size = sizeof(struct dirent) + 21 /* max digits in inode */ + 2 /* slashes */;
2023-09-19T14:43:21 |                ^~~~~~
2023-09-19T14:43:21 readdir_test.c: In function 'get_inode':
2023-09-19T14:43:21 readdir_test.c:171:1: warning: control reaches end of non-void function [-Wreturn-type]
2023-09-19T14:43:21 171 | }
2023-09-19T14:43:21 | ^
2023-09-19T14:43:21 /bin/bash ./libtool--tag=CC   --mode=compile /home/dyk/rk3588/buildroot/output/firefly_rk3588/host/bin/ccache /usr/bin/gcc -DHAVE_CONFIG_H -I.-I./.. -I/home/dyk/rk3588/buildroot/output/firefly_rk3588/host/include-O2 -I/home/dyk/rk3588/buildroot/output/firefly_rk3588/host/include -Wall -c -o gawkfts.lo gawkfts.c
2023-09-19T14:43:21 make: *** Error 1
2023-09-19T14:43:21 make: *** Waiting for unfinished jobs....
2023-09-19T14:43:21 In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
2023-09-19T14:43:21 from /usr/include/stdio.h:27,
2023-09-19T14:43:21 from filefuncs.c:68:
2023-09-19T14:43:21 /usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
2023-09-19T14:43:21 187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
2023-09-19T14:43:21 |   ^~~~~~~
2023-09-19T14:43:21 filefuncs.c: In function 'fill_stat_array':
2023-09-19T14:43:21 filefuncs.c:417:37: warning: implicit declaration of function 'major' [-Wimplicit-function-declaration]
2023-09-19T14:43:21 417 |   array_set_numeric(array, "major", major(sbuf->st_rdev));
2023-09-19T14:43:21 |                                     ^~~~~
2023-09-19T14:43:21 filefuncs.c:418:37: warning: implicit declaration of function 'minor' [-Wimplicit-function-declaration]
2023-09-19T14:43:21 418 |   array_set_numeric(array, "minor", minor(sbuf->st_rdev));
2023-09-19T14:43:21 |                                     ^~~~~
2023-09-19T14:43:21 libtool: compile:/home/dyk/rk3588/buildroot/output/firefly_rk3588/host/bin/ccache /usr/bin/gcc -DHAVE_CONFIG_H -I. -I./.. -I/home/dyk/rk3588/buildroot/output/firefly_rk3588/host/include -O2 -I/home/dyk/rk3588/buildroot/output/firefly_rk3588/host/include -Wall -c gawkfts.c-fPIC -DPIC -o .libs/gawkfts.o
2023-09-19T14:43:21 In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
2023-09-19T14:43:21 from /usr/include/limits.h:26,
2023-09-19T14:43:21 from /usr/lib/gcc/x86_64-linux-gnu/9/include/limits.h:194,
2023-09-19T14:43:21 from /usr/lib/gcc/x86_64-linux-gnu/9/include/syslimits.h:7,
2023-09-19T14:43:21 from /usr/lib/gcc/x86_64-linux-gnu/9/include/limits.h:34,
2023-09-19T14:43:21 from gawkfts.c:44:
2023-09-19T14:43:21 /usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
2023-09-19T14:43:21 187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
2023-09-19T14:43:21 |   ^~~~~~~
2023-09-19T14:43:21 make: *** Error 1
2023-09-19T14:43:21 make: *** Error 2
2023-09-19T14:43:21 make: *** Error 1
2023-09-19T14:43:21 make: *** Error 2
2023-09-19T14:43:21 make: *** Error 2
2023-09-19T14:43:21 make: *** Error 2
2023-09-19T14:43:21 make: Leaving directory '/home/dyk/rk3588/buildroot'
Please check details in /home/dyk/rk3588/.buildroot/br.log
Command exited with non-zero status 1
you take 3:46.33 to build builroot
ERROR: Running build_buildroot failed!
ERROR: exit code 1 from line 1320:
    /usr/bin/time -f "you take %E to build builroot" $COMMON_DIR/mk-buildroot.sh $RK_CFG_BUILDROOT $DST_DIR

drinker 发表于 2023-9-19 19:48:15

原因找到了,配置的qt环境影响了buildroot,把/etc/profile.d/host_qtEnv.sh 删掉就行了
页: [1]
查看完整版本: rk3588 sdk升级至最新版本后 buildroot编译报错