本文主要是介绍解决A40i/T3 SDK 编译报错问题,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
脚本功能:解决A40i/T3 SDK 编译报错问题
1、编译报错 freadahead.c:91:3: error
2、编译报错 lib/fseterr.c:77:3: error
3、编译报错 pipe.cpp:86:22: error
4、编译报错gdbusauth.c:1298:11: error
5、编译报错gdbusmessage.c:2698:30: error
6、编译报错gdbusmessage.c:2698:30: error
7、编译报错 ismounted.c:(.text+0x23d): undefined reference to ‘major’
8、编译报错create_inode.c:395:18: error: conflicting types for ‘copy_file_range’
9、编译报错 create_inode.c:(.text+0x2d4): undefined reference to ‘minor’
10、编译报错gawk: fatal: cannot use gawk builtin `namespace’ as variable name
11、编译报错 strerror-sym.c:47:25: error:
脚本中6个函数分别解决以下6个目录遇到的编译遇到的上述的11个问题!!!
脚本函数function1 处理:out/sun8iw11p1/linux/common/buildroot/build/host-m4-1.4.17
脚本函数function2 处理:out/sun8iw11p1/linux/common/buildroot/build/host-bison-3.0.4
脚本函数function3 处理:out/sun8iw11p1/linux/common/buildroot/build/host-dbus-cpp-0.9.0/src
脚本函数function4 处理:out/sun8iw11p1/linux/common/buildroot/build/host-libglib2-2.50.1/gio
脚本函数function5 处理:out/sun8iw11p1/linux/common/buildroot/build/host-e2fsprogs-1.43.3
脚本函数function6 处理:out/sun8iw11p1/linux/common/buildroot/build/libgpg-error-1.24
脚本使用:处理上述问题执行一次本文中的脚本即可,其中./build.sh
是执行sdk的编译脚本。
#!/bin/bash
build_ret="build ok !!!"
Download="Need Rebuild to Download: "
err_dir1="out/sun8iw11p1/linux/common/buildroot/build/host-m4-1.4.17"
err_dir2="out/sun8iw11p1/linux/common/buildroot/build/host-bison-3.0.4"
err_dir3="out/sun8iw11p1/linux/common/buildroot/build/host-dbus-cpp-0.9.0/src"
err_dir4="out/sun8iw11p1/linux/common/buildroot/build/host-libglib2-2.50.1/gio"
err_dir5="out/sun8iw11p1/linux/common/buildroot/build/host-e2fsprogs-1.43.3"
err_dir6="out/sun8iw11p1/linux/common/buildroot/build/libgpg-error-1.24"
function function1(){
grep -rnH "_IO_IN_BACKUP" $err_dir1/lib/stdio-impl.h > /dev/null 2>&1
if [ $? -eq 0 ];then echo 1
elsels $err_dir1/lib/stdio-impl.h > /dev/null 2>&1if [ $? -eq 0 ];then sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' $err_dir1/lib/*.cecho "#define _IO_IN_BACKUP 0x100" >> $err_dir1/lib/stdio-impl.h elseecho 0 fi
fi
}function function2(){
grep -rnH "IO_EOF_SEEN" $err_dir2/lib/*.c > /dev/null 2>&1
if [ $? -eq 0 ];then echo 1
elsels $err_dir2/lib > /dev/null 2>&1if [ $? -eq 0 ];then sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' $err_dir2/lib/*.cecho "#define _IO_IN_BACKUP 0x100" >> $err_dir2/lib/stdio-impl.h elseecho 0fi
fi
}function function3(){
grep -rnH "build ok" $err_dir3/pipe.cpp > /dev/null 2>&1
if [ $? -eq 0 ];then echo 1
else ls $err_dir3/pipe.cpp > /dev/null 2>&1if [ $? -eq 0 ];then sed -i '86c\::write(_fd_write, (char*)'\0', 1);//build ok' $err_dir3/pipe.cpp elseecho 0 fi
fi
} function function4(){
grep -rnH "build ok" $err_dir4 > /dev/null 2>&1
if [ $? -eq 0 ];then echo 1
else ls $err_dir4/gdbusauth.c > /dev/null 2>&1if [ $? -eq 0 ];then sed -i '1298c\if(line != NULL ) debug_print ("SERVER: WaitingForBegin, read '%s'", line);' $err_dir4/gdbusauth.c sed -i '2698c\if(signature_str != NULL )tupled_signature_str = g_strdup_printf("(%s)",signature_str);//build ok' $err_dir4/gdbusmessage.celseecho 0 fi
fi
}function function5(){
grep -rnH "build ok" $err_dir5/debugfs/debugfs.c > /dev/null 2>&1
if [ $? -eq 0 ];then echo 1
else ls $err_dir5 > /dev/null 2>&1if [ $? -eq 0 ];then sed -i '1c\#include <sys/types.h>' $err_dir5/lib/ext2fs/ismounted.csed -i '2c\#include <sys/sysmacros.h>/*' $err_dir5/lib/ext2fs/ismounted.csed -i '19c\//#include <unistd.h>' $err_dir5/misc/create_inode.c sed -i '1c\#include <sys/types.h>' $err_dir5/misc/create_inode.c sed -i '2c\#include <sys/sysmacros.h>/*' $err_dir5/misc/create_inode.csed -i '1c\#include <sys/types.h>' $err_dir5/debugfs/debugfs.csed -i '2c\#include <sys/sysmacros.h>/*build ok' $err_dir5/debugfs/debugfs.c elseecho 0 fi
fi
}function function6(){
grep -rnH "build ok" $err_dir6/src/strerror-sym.c > /dev/null 2>&1
if [ $? -eq 0 ];then echo 1
else ls $err_dir6 > /dev/null 2>&1if [ $? -eq 0 ];then sed -i '88c\sub (/#.+/, "");' $err_dir6/src/mkerrcodes.awksed -i '125c\sub (/#.+/, "");' $err_dir6/lang/cl/mkerrcodes.awk sed -i '45c\idx = msgidxof (code);' $err_dir6/src/strerror-sym.csed -i '47c\return msgstr + msgidx[idx];//build ok' $err_dir6/src/strerror-sym.c elseecho 0 fi
fi
}
function rebuild(){
if [ $1 -gt 0 ]; thenecho "build: "$2" ok "
elseecho "rebuild: "$2"..."./build.sh
fi
}
./build.sh "$@"
rebuild $(function1) $err_dir1
rebuild $(function2) $err_dir2
rebuild $(function3) $err_dir3
rebuild $(function4) $err_dir4
rebuild $(function5) $err_dir5
rebuild $(function6) $err_dir6
这篇关于解决A40i/T3 SDK 编译报错问题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!