0

I'm using bitbake to build an application and I'd like to troubleshoot some segfaults that are taking place. I've set up gdbserver on a virtual machine running the application and can connect. My problem is that I cannot seem to get the image to build my binaries without stripping the symbol table.

Whenever I run:

objdump -t _binary_

it shows 'no symbols' under 'SYMBOL TABLE'.

So far I've added the following to build/conf/local.conf

EXTRA_IMAGE_FEATURES = "debug-tweaks dbg-pkgs tools-sdk tools-debug "

INHIBIT_PACKAGE_STRIP = "1"

INHIBIT_PACKAGE_DEBUG_SPLIT= "1"

I also tried adding the following to bitbake.conf:

export CFLAGS = "${TARGET_CFLAGS} -g"

export LDFLAGS = "${TARGET_LDFLAGS} -g"

Strangely, the size of the binary I'm looking at has increased. Since making these changes and the new build took much longer to run.

Running bitbake -e _recipe_ shows the environment of my recipe and reflects the changes made in local.conf.

Is there a way I can look at the exact gcc command that is being run to make sure it's not still being stripped somewhere? I can't seem to see it in the logs.

Fraser11
  • 1
  • 1

1 Answers1

0

Is there a way I can look at the exact gcc command that is being run to make sure it's not still being stripped somewhere? I can't seem to see it in the logs.

The task scripts which are being run are stored in directory ${T} (e.g., .../build/tmp/work/apalis_imx8-tdx-linux/base-files/3.0.14-r89/temp). There are logs (log.*) and also run.* files. You can find the gcc command called in the run.do_compile file. The stripping itself is done in run.do_package.

The source code of the stripping is located in openembedded-core/meta/classes/package.bbclass. It is basically partially copied to run.do_package.

BTW, the INHIBIT_PACKAGE_STRIP = "1" is the right way to go, so please let us know what went wrong. And BTW, did you try to to build your binary outside of OE to check the resulting symbol table?

Tomas Novotny
  • 1,771
  • 9
  • 11