在Ubuntu21.04中编译Tina SDKV1.01 版本 踩坑记录

2024-02-02 15:19:00 浏览数 (1)

前言

本人使用Ubuntu21.04,是在Ubuntu18.04 使用系统升级的方法升级,并非直接安装Ubuntu21.04 系统镜像。希望参考该帖开发者注意。

安装环境提醒

再Ubuntu更新软件包同时,个人不推荐使用清华源,可能会出现一些软件包安装找不到的问题(因为我之前就是),后面改为阿里源,然后就没有出现过软件包依赖的相关问题。切换软件源请自行百度参考帖子。

安装过程踩坑记录

参考全志官方文档:https://d1.docs.allwinnertech.com/study/study_2getsdk/

1、安装软件包问题
代码语言:javascript复制
sudo apt-get install build-essential subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev xsltproc libxml-parser-perl mercurial bzr ecj cvs unzip lib32z1 lib32z1-dev lib32stdc  6 libstdc  6 -y

在软件包安装的时候 建议取消后面-y 选项 ,先看一下有没有自动卸载一些包 如果有建议取消安装,然后一个一个包安装。 如果出现软件包找不到的情况,请自行使用Tab补齐命令查看可以安装的包,并选择何时的包进行安装。 针对于32位的软件包

代码语言:javascript复制
sudo apt-get install libc6:i386 libstdc  6:i386 lib32ncurses5 lib32z1

更有可能出现找不到的情况,依然使用Tab补齐命令,查看当前可以安装的包,并选择何时的包进行安装。

2、编译问题

依然参考官方文档:https://d1.docs.allwinnertech.com/study/study_4compile/


source 环境变量如果有错,请检查文件夹权限,将文件夹权限由root用户更改为普通用户。 如果还有问题,请根据具体信息对照 envsetup.sh文件中的 envsetup函数。一一落实执行过程。


3、make过程中遇到的问题
问题一

报错提示没有记录,查看报错提示,可以定位到 两处文件,修改其源码为:

代码语言:javascript复制
#gdbusmessage.c文件,路径为:./out/d1-nezha/compile_dir/target/host/glib-2.50.1/gio/gdbusmessage.c
gdbusmessage.c:2698:30:
      if (signature_str)
      tupled_signature_str = g_strdup_printf ("(%s)", signature_str);

#这个文件路径还请自行查找
dbusauth.c 1298
      if (line == NULL)
            goto out;
          debug_print ("SERVER: WaitingForBegin, read '%s'", line);
问题二
代码语言:javascript复制
rm: cannot remove '/home/jie/allwinner/tina-d1-open/tmp/info/.overrides-packageinfo-1859194': Permission denied
make[3]: *** No rule to make target '/home/jie/allwinner/tina-d1-open/tmp/info/.files-packageinfo-1861882'.  Stop.
cat: /home/jie/allwinner/tina-d1-open/tmp/info/.files-packageinfo-1861882: No such file or directory
cat: /home/jie/allwinner/tina-d1-open/tmp/info/.overrides-packageinfo-1861882: No such file or directory
rm: cannot remove '/home/jie/allwinner/tina-d1-open/tmp/info/.files-packageinfo.stamp.4ecc855bd5022757c3b7544e2dfb29c7': Permission denied
touch: cannot touch '/home/jie/allwinner/tina-d1-open/tmp/info/.files-packageinfo.stamp.d41d8cd98f00b204e9800998ecf8427e': Permission denied
touch: cannot touch '/home/jie/allwinner/tina-d1-open/tmp/info/.files-packageinfo.stamp': Permission denied
make[2]: *** [build/scan.mk:84: /home/jie/allwinner/tina-d1-open/tmp/info/.files-packageinfo.stamp] Error 1
make[1]: *** [/home/jie/allwinner/tina-d1-open/build/toplevel.mk:84: prepare-tmpinfo] Error 2
make: *** [/home/jie/allwinner/tina-d1-open/build/toplevel.mk:304:world] 错误 2
[2]   已完成               $T/tools/build/buildserver --path $T

#### make failed to build some targets (1 seconds) ####

这个主要是文件夹及文件权限问题,给这几个文件及它的文件夹777权限。 基本是 tmp文件夹的相关属性。

问题三
代码语言:javascript复制
strerror-sym.c:47:9: error: 'errnos_msgstr' undeclared (first use in this function)
  return errnos_msgstr   errnos_msgidx[idx];
         ^~~~~~~~~~~~~
strerror-sym.c:47:9: note: each undeclared identifier is reported only once for eac                                                                                                                        h function it appears in
strerror-sym.c:47:25: error: 'errnos_msgidx' undeclared (first use in this function                                                                                                                           )
  return errnos_msgstr   errnos_msgidx[idx];
                         ^~~~~~~~~~~~~
make[7]: *** [Makefile:946: gpg_error-strerror-sym.o] Error 1

通过查找文件定位 ./out/d1-nezha/compile_dir/target/libgpg-error-1.27/src/errnos-sym.h 这个文件为空 编译不通过 , 相关变量没有定义 感谢全志官方群大佬的鼎力相助发了我一手头文件 这是缺少头文件中的内容

代码语言:javascript复制
/* Output of mkstrtable.awk.  DO NOT EDIT.  */

/* errnos.in - List of system error values.
   Copyright (C) 2003, 2004 g10 Code GmbH

   This file is part of libgpg-error.

   libgpg-error is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public License
   as published by the Free Software Foundation; either version 2.1 of
   the License, or (at your option) any later version.

   libgpg-error is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with libgpg-error; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.  */



/* The purpose of this complex string table is to produce
   optimal code with a minimum of relocations.  */

static const char errnos_msgstr[] =
  "GPG_ERR_E2BIG" ""
  "GPG_ERR_EACCES" ""
  "GPG_ERR_EADDRINUSE" ""
  "GPG_ERR_EADDRNOTAVAIL" ""
  "GPG_ERR_EADV" ""
  "GPG_ERR_EAFNOSUPPORT" ""
  "GPG_ERR_EAGAIN" ""
  "GPG_ERR_EALREADY" ""
  "GPG_ERR_EAUTH" ""
  "GPG_ERR_EBACKGROUND" ""
  "GPG_ERR_EBADE" ""
  "GPG_ERR_EBADF" ""
  "GPG_ERR_EBADFD" ""
  "GPG_ERR_EBADMSG" ""
  "GPG_ERR_EBADR" ""
  "GPG_ERR_EBADRPC" ""
  "GPG_ERR_EBADRQC" ""
  "GPG_ERR_EBADSLT" ""
  "GPG_ERR_EBFONT" ""
  "GPG_ERR_EBUSY" ""
  "GPG_ERR_ECANCELED" ""
  "GPG_ERR_ECHILD" ""
  "GPG_ERR_ECHRNG" ""
  "GPG_ERR_ECOMM" ""
  "GPG_ERR_ECONNABORTED" ""
  "GPG_ERR_ECONNREFUSED" ""
  "GPG_ERR_ECONNRESET" ""
  "GPG_ERR_ED" ""
  "GPG_ERR_EDEADLK" ""
  "GPG_ERR_EDEADLOCK" ""
  "GPG_ERR_EDESTADDRREQ" ""
  "GPG_ERR_EDIED" ""
  "GPG_ERR_EDOM" ""
  "GPG_ERR_EDOTDOT" ""
  "GPG_ERR_EDQUOT" ""
  "GPG_ERR_EEXIST" ""
  "GPG_ERR_EFAULT" ""
  "GPG_ERR_EFBIG" ""
  "GPG_ERR_EFTYPE" ""
  "GPG_ERR_EGRATUITOUS" ""
  "GPG_ERR_EGREGIOUS" ""
  "GPG_ERR_EHOSTDOWN" ""
  "GPG_ERR_EHOSTUNREACH" ""
  "GPG_ERR_EIDRM" ""
  "GPG_ERR_EIEIO" ""
  "GPG_ERR_EILSEQ" ""
  "GPG_ERR_EINPROGRESS" ""
  "GPG_ERR_EINTR" ""
  "GPG_ERR_EINVAL" ""
  "GPG_ERR_EIO" ""
  "GPG_ERR_EISCONN" ""
  "GPG_ERR_EISDIR" ""
  "GPG_ERR_EISNAM" ""
  "GPG_ERR_EL2HLT" ""
  "GPG_ERR_EL2NSYNC" ""
  "GPG_ERR_EL3HLT" ""
  "GPG_ERR_EL3RST" ""
  "GPG_ERR_ELIBACC" ""
  "GPG_ERR_ELIBBAD" ""
  "GPG_ERR_ELIBEXEC" ""
  "GPG_ERR_ELIBMAX" ""
  "GPG_ERR_ELIBSCN" ""
  "GPG_ERR_ELNRNG" ""
  "GPG_ERR_ELOOP" ""
  "GPG_ERR_EMEDIUMTYPE" ""
  "GPG_ERR_EMFILE" ""
  "GPG_ERR_EMLINK" ""
  "GPG_ERR_EMSGSIZE" ""
  "GPG_ERR_EMULTIHOP" ""
  "GPG_ERR_ENAMETOOLONG" ""
  "GPG_ERR_ENAVAIL" ""
  "GPG_ERR_ENEEDAUTH" ""
  "GPG_ERR_ENETDOWN" ""
  "GPG_ERR_ENETRESET" ""
  "GPG_ERR_ENETUNREACH" ""
  "GPG_ERR_ENFILE" ""
  "GPG_ERR_ENOANO" ""
  "GPG_ERR_ENOBUFS" ""
  "GPG_ERR_ENOCSI" ""
  "GPG_ERR_ENODATA" ""
  "GPG_ERR_ENODEV" ""
  "GPG_ERR_ENOENT" ""
  "GPG_ERR_ENOEXEC" ""
  "GPG_ERR_ENOLCK" ""
  "GPG_ERR_ENOLINK" ""
  "GPG_ERR_ENOMEDIUM" ""
  "GPG_ERR_ENOMEM" ""
  "GPG_ERR_ENOMSG" ""
  "GPG_ERR_ENONET" ""
  "GPG_ERR_ENOPKG" ""
  "GPG_ERR_ENOPROTOOPT" ""
  "GPG_ERR_ENOSPC" ""
  "GPG_ERR_ENOSR" ""
  "GPG_ERR_ENOSTR" ""
  "GPG_ERR_ENOSYS" ""
  "GPG_ERR_ENOTBLK" ""
  "GPG_ERR_ENOTCONN" ""
  "GPG_ERR_ENOTDIR" ""
  "GPG_ERR_ENOTEMPTY" ""
  "GPG_ERR_ENOTNAM" ""
  "GPG_ERR_ENOTSOCK" ""
  "GPG_ERR_ENOTSUP" ""
  "GPG_ERR_ENOTTY" ""
  "GPG_ERR_ENOTUNIQ" ""
  "GPG_ERR_ENXIO" ""
  "GPG_ERR_EOPNOTSUPP" ""
  "GPG_ERR_EOVERFLOW" ""
  "GPG_ERR_EPERM" ""
  "GPG_ERR_EPFNOSUPPORT" ""
  "GPG_ERR_EPIPE" ""
  "GPG_ERR_EPROCLIM" ""
  "GPG_ERR_EPROCUNAVAIL" ""
  "GPG_ERR_EPROGMISMATCH" ""
  "GPG_ERR_EPROGUNAVAIL" ""
  "GPG_ERR_EPROTO" ""
  "GPG_ERR_EPROTONOSUPPORT" ""
  "GPG_ERR_EPROTOTYPE" ""
  "GPG_ERR_ERANGE" ""
  "GPG_ERR_EREMCHG" ""
  "GPG_ERR_EREMOTE" ""
  "GPG_ERR_EREMOTEIO" ""
  "GPG_ERR_ERESTART" ""
  "GPG_ERR_EROFS" ""
  "GPG_ERR_ERPCMISMATCH" ""
  "GPG_ERR_ESHUTDOWN" ""
  "GPG_ERR_ESOCKTNOSUPPORT" ""
  "GPG_ERR_ESPIPE" ""
  "GPG_ERR_ESRCH" ""
  "GPG_ERR_ESRMNT" ""
  "GPG_ERR_ESTALE" ""
  "GPG_ERR_ESTRPIPE" ""
  "GPG_ERR_ETIME" ""
  "GPG_ERR_ETIMEDOUT" ""
  "GPG_ERR_ETOOMANYREFS" ""
  "GPG_ERR_ETXTBSY" ""
  "GPG_ERR_EUCLEAN" ""
  "GPG_ERR_EUNATCH" ""
  "GPG_ERR_EUSERS" ""
  "GPG_ERR_EWOULDBLOCK" ""
  "GPG_ERR_EXDEV" ""
  "GPG_ERR_EXFULL";

static const int errnos_msgidx[] =
  {
    0,
    14,
    29,
    48,
    70,
    83,
    104,
    119,
    136,
    150,
    170,
    184,
    198,
    213,
    229,
    243,
    259,
    275,
    291,
    306,
    320,
    338,
    353,
    368,
    382,
    403,
    424,
    443,
    454,
    470,
    488,
    509,
    523,
    536,
    552,
    567,
    582,
    597,
    611,
    626,
    646,
    664,
    682,
    703,
    717,
    731,
    746,
    766,
    780,
    795,
    807,
    823,
    838,
    853,
    868,
    885,
    900,
    915,
    931,
    947,
    964,
    980,
    996,
    1011,
    1025,
    1045,
    1060,
    1075,
    1092,
    1110,
    1131,
    1147,
    1165,
    1182,
    1200,
    1220,
    1235,
    1250,
    1266,
    1281,
    1297,
    1312,
    1327,
    1343,
    1358,
    1374,
    1392,
    1407,
    1422,
    1437,
    1452,
    1472,
    1487,
    1501,
    1516,
    1531,
    1547,
    1564,
    1580,
    1598,
    1614,
    1631,
    1647,
    1662,
    1679,
    1693,
    1712,
    1730,
    1744,
    1765,
    1779,
    1796,
    1817,
    1839,
    1860,
    1875,
    1899,
    1918,
    1933,
    1949,
    1965,
    1983,
    2000,
    2014,
    2035,
    2053,
    2077,
    2092,
    2106,
    2121,
    2136,
    2153,
    2167,
    2185,
    2206,
    2222,
    2238,
    2254,
    2269,
    2289,
    2303,

  };

static GPG_ERR_INLINE int
errnos_msgidxof (int code)
{
  return (0 ? 0
  : ((code >= 0) && (code <= 140)) ? (code - 0)
  : -1);
}

谨此,更改之后,D1 SDK 编译通过。 非常感谢官方群 大佬们的帮助!

代码语言:javascript复制
#### make completed successfully (15:51 (mm:ss)) ####

原贴链接:https://bbs.aw-ol.com/topic/102/

0 人点赞