Hi Max,
I use the following lines in my local.conf file (on kirkstone). Maybe that this
is not
optimal as it may cause silent side effects in case the original values for
BUILDSDK_OPTIMIZATION/_CFLAGS/_CXXFALGS will change same day.
# Build -nativesdk packages with debug info (required for generating -dbg/-src
packages)
# BUILDSDK_OPTIMIZATION is based on BUILD_OPTIMIZATION in bitbake.conf
BUILDSDK_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-Og', '-O2', d)}
-g -feliminate-unused-debug-types -pipe"
BUILDSDK_CFLAGS = "${BUILDSDK_CPPFLAGS} ${BUILDSDK_OPTIMIZATION}
${DEBUG_PREFIX_MAP}"
BUILDSDK_CXXFLAGS = "${BUILDSDK_CFLAGS}"
Additionally I have to manually select all available nativesdk-*-dbg/-src
packages in my
nativesdk-packagegroup-sdk-host.bbappend file. Unfortunately these packages are
not added
automatically to my SDK image (SDKIMAGE_FEATURES only applies for target
packages, not for
nativesdk packages). Maybe you'll find a better solution for that.
In my project I have added BBCLASSEXTEND="nativesdk" to many bbappends in order
to have most
libraries I use on my target also for nativesdk (I can compile my embedded
application also
for nativesdk then). As debugging performance using gdbserver is quite poor on
my system,
developing my application with nativesdk is a welcome alternative (that's why
I also have
enabled debug information nativesdk).
But from some previous comments on the OE list it seems that nativesdk is not
really intended
for this purpose. But what is the alternative? Having two SDKs?
regards
Christian
On Friday, 23 June 2023, 16:58:56 CEST, Maxime Roussin-Bélanger wrote:
> On Fri, Jun 23, 2023 at 3:50 AM Alexander Kanavin
> <[email protected]> wrote:
> >
> > But then you can set the parameters as you want them in your local
> > configuration. Setting -g globally in the absence of DEBUG_BUILD needs
> > a use case that applies to most users.
> >
> > Alex
>
> If user wants to install nativesdk dgb/src package you need to add that flag,
> so instead of modifying the `BUILDSDK_CPPFLAGS`, it should probably be
> documented.
>
> Do you have any pointers where it could be documented?
>
> Max.
>
> >
> > On Thu, 22 Jun 2023 at 19:11, Maxime Roussin-Bélanger
> > <[email protected]> wrote:
> > >
> > > Hi Alex,
> > >
> > > I don't want a complete debug build. I want to keep optimization and
> > > have the debug symbols. I don't think I can achieve that with
> > > DEBUG_BUILD.
> > >
> > > Max
> > >
> > > On Thu, Jun 22, 2023 at 12:30 PM Alexander Kanavin
> > > <[email protected]> wrote:
> > > >
> > > > This change is unnecessary, as there is already a mechanism. Just
> > > > slightly further down you can see that BUILDSDK_CFLAGS pulls in
> > > > BUILD_OPTIMIZATION, which sets -g if you enable DEBUG_BUILD in your
> > > > config.
> > > >
> > > > Alex
> > > >
> > > > On Thu, 22 Jun 2023 at 18:20, Maxime Roussin-Bélanger
> > > > <[email protected]> wrote:
> > > > >
> > > > > From: Maxime Roussin-Belanger <[email protected]>
> > > > >
> > > > > Without adding debug flag nativesdk dbg package is not packaged since
> > > > > there is no debugging information
> > > > >
> > > > > Signed-off-by: Maxime Roussin-Belanger
> > > > > <[email protected]>
> > > > > ---
> > > > > v2: New commit
> > > > >
> > > > > meta/conf/bitbake.conf | 2 +-
> > > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > > > > index 9d9b268858..0635affbc1 100644
> > > > > --- a/meta/conf/bitbake.conf
> > > > > +++ b/meta/conf/bitbake.conf
> > > > > @@ -601,7 +601,7 @@ PATCHRESOLVE = "noop"
> > > > > ##################################################################
> > > > >
> > > > > export BUILD_CPPFLAGS = "-isystem${STAGING_INCDIR_NATIVE}"
> > > > > -BUILDSDK_CPPFLAGS = ""
> > > > > +BUILDSDK_CPPFLAGS ?= "-g"
> > > > > export CPPFLAGS = "${TARGET_CPPFLAGS}"
> > > > > TARGET_CPPFLAGS = ""
> > > > >
> > > > > --
> > > > > 2.36.0
> > > > >
> > > > >
> > > > >
> > > > >
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183334):
https://lists.openembedded.org/g/openembedded-core/message/183334
Mute This Topic: https://lists.openembedded.org/mt/99701056/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-