yocot 开发问题集结

做yocto的linux项目,使用gdb的时候一直提示,no debugging synbols found

yocot 开发问题集结_第1张图片

这个在网上说是在编译的时候要添加-g,但是我已经在makefile里添加了还是不行,后来看google,yocto项目需要添加gdb 的package才能显示:

EXTRA_IMAGE_FEATURES += "\
      dbg-pkgs \       # adds -dbg packages for all installed packages and symbol information for debugging and profiling.
      tools-debug \    # adds debugging tools like gdb and strace.
      tools-profile \  # add profiling tools (oprofile, exmap, lttng valgrind (x86 only))
      tools-testapps \ # add useful testing tools (ts_print, aplay, arecord etc.)
      debug-tweaks \   # make image for suitable of development, like setting an empty root password
      tools-sdk \      # OPTIONAL: adds development tools (gcc, make, pkgconfig, etc)  
      dev-pkgs"        # OPTIONAL: adds -dev packages for all installed packages

# Specifies to build packages with debugging information
DEBUG_BUILD = "1"

# Do not remove debug symbols
INHIBIT_PACKAGE_STRIP = "1"

# OPTIONAL: Do not split debug symbols in a separate file
INHIBIT_PACKAGE_DEBUG_SPLIT= "1"

2. ERROR: taskset-1.0-r0 do_package: QA Issue: File '/usr/bin/taskset' from taskset was already stripped, this will prevent future debugging! [already-stripped]".

Re: adding pre-built application to roots

Actual solution was to add this strings to project-spec/meta-user/recipes-apps/taskset/taskset.bb:

INSANE_SKIP_${PN} = "ldflags"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INHIBIT_PACKAGE_STRIP = "1"

3.QA Issue: -dev package contains non-symlink .so:
non -staticdev package contains static .a library:

添加的软件包中引用了static 库,所以需要在bb文件中添加static的引用声明

FILES_${PN}-staticdev =""    # for static libs

FILES_${PN}-dev =""          # for dynamic libs

FILES_${PN}-dbg =""          # for debug options

FILES_${PN}-staticdev += "/usr/lib/python3.8/config-3.8-arm-linux-gnueabi/*.a"

4.do_package_qa: QA Issue: -dev package contains non-symlink .so

在bb文件添加:INSANE_SKIP_${PN}-dev += "dev-elf"

5.

ERROR: brcm43456-0.1-r0 do_package_qa: QA Issue: non -dev/-dbg/nativesdk- package contains symlink .so: brcm43456 path 'work/cortexa7hf-neon-poky-linux-gnueabi/brcm43456/0.1-r0/packages-split/brcm43456/usr/lib/atlas-base/libatlas.so'
non -dev/-dbg/nativesdk- package contains symlink .so: brcm43456 path 'work/cortexa7hf-neon-poky-linux-gnueabi/brcm43456/0.1-r0/packages-split/brcm43456/usr/lib/atlas-base/liblapack_atlas.so'
non -dev/-dbg/nativesdk- package contains symlink .so: brcm43456 path 'work/cortexa7hf-neon-poky-linux-gnueabi/brcm43456/0.1-r0/packages-split/brcm43456/usr/lib/atlas-base/libf77blas.so'
non -dev/-dbg/nativesdk- package contains symlink .so: brcm43456 path 'work/cortexa7hf-neon-poky-linux-gnueabi/brcm43456/0.1-r0/packages-split/brcm43456/usr/lib/atlas-base/libcblas.so'
 

在相应的路径上添加如下代码即可

  FILES_${PN}-dev += "/usr/lib/*.so"
  FILES_${PN}-dev += "/usr/lib/atlas-base/*.so"
 FILES_${PN}-dev += "/usr/lib/atlas-base/atlas/*.so

yocto 官方文档:https://www.yoctoproject.org/docs/2.7/ref-manual/ref-manual.html#var-AUTOREV

yocto 官方文档中文注解:https://blog.csdn.net/Archer1991/article/details/62423014

https://wiki.phytec.com/pages/viewpage.action?pageId=69500932

6.swupdate-2017.01-r0 do_package_qa: QA Issue: swupdate rdepends on json-c, but it isn't a build dependency, missing json-c in DEPENDS or PACKAGECONFIG? [build-deps]
WARNING: swupdate-2017.01-r0 do_package_qa: QA Issue: swupdate rdepends on libcurl, but it isn't a build dependency, missing curl in DEPENDS or PACKAGECONFIG? [build-deps]

解决方法:INSANE_SKIP_${PN} += "build-deps"

7.ERROR: gpio_ctrl-0-1 do_package_qa: QA Issue: No GNU_HASH in the elf binary: '/home/cxt/code/nxp/imx6ull_morty/imx6ullevk_build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/gpio_ctrl/0-1/packages-split/gpio_ctrl/usr/lib/libgpioctrl.so' [ldflags]

NSANE_SKIP_${PN} = "ldflags"

8.ERROR: gpio_ctrl-0-1 do_package_qa: QA Issue: -dev package contains non-symlink .so: gpio_ctrl-dev path '/work/cortexa7hf-neon-poky-linux-gnueabi/gpio_ctrl/0-1/packages-split/gpio_ctrl-dev/usr/lib/libgpioctrl.so' [dev-elf]

ERROR: gpio_ctrl-0-1 do_package_qa: QA Issue: No GNU_HASH in the elf binary: '/home/cxt/code/nxp/imx6ull_morty/imx6ullevk_build/tmp/work/cortexa7hf-neon-poky-linux-gnueabi/gpio_ctrl/0-1/packages-split/gpio_ctrl-dev/usr/lib/libgpioctrl.so' [ldflags]

FILES_SOLIBSDEV = ""

参考链接:https://wiki.yoctoproject.org/wiki/TipsAndTricks/Packaging_Prebuilt_Libraries

9. Unescaped left brace in regex is illegal here in regex; marked by <– HERE in m/${ <– HERE ([^ \t=:+{}]+)}/ at xxx line xxx

原因

原因是Perl不支持以前的写法。

解决方法

编辑提示的文件xxx的行号xxx
例如 /usr/bin/automake 第 3930 行
将 - $text =~ s/\${([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;
修改为 - $text =~ s/\$[{]([^ \t=:+{}]+)}/substitute_ac_subst_variables_worker ($1)/ge;

10.

git branch parameter "--set-upstream" causes a fetcher error. Replace
it by "--set-upstream-to".
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 2550bde8..7442f844 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -326,7 +326,7 @@  class Git(FetchMethod):
                 branchname =  ud.branches[ud.names[0]]
                 runfetchcmd("%s checkout -B %s %s" % (ud.basecmd, branchname, \
                             ud.revisions[ud.names[0]]), d, workdir=destdir)
-                runfetchcmd("%s branch --set-upstream %s origin/%s" % (ud.basecmd, branchname, \
+                runfetchcmd("%s branch %s --set-upstream-to origin/%s" % (ud.basecmd, branchname, \
                             branchname), d, workdir=destdir)
             else:
                 runfetchcmd("%s checkout %s" % (ud.basecmd, ud.revisions[ud.names[0]]), d, workdir=destdir)

你可能感兴趣的:(debug)