package: fix src packaging path for nativesdk
PATCH v2 1/3 package: fix src packaging path for nativesdk
From: Maxime Roussin-Belanger <[email protected]>
Directory tree doesn't contain the correct structure when packaging for source files for the sdk. Since the structure is incorrect, they won't be part of the installed sdk.
Having source files in nativesdk is necessary when using it as a development sysroot for debugging. Otherwise, when debugging in an emulation mode it's impossible to step in 3rd party library code.
---
v2: - No change
meta/conf/bitbake.conf | 8 ++++---- meta/lib/oe/package.py | 25 +++++++++++++++++++------ 2 files changed, 23 insertions(+), 10 deletions(-)
meta/conf/bitbake.conf +4 -4
@@ -649,10 +649,10 @@ EXTRA_OEMAKE:prepend:task-install = "${PARALLEL_MAKEINST} " ################################################################## # Beware: applied last to first DEBUG_PREFIX_MAP ?= "-fcanon-prefix-map \ - -fmacro-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \ - -fdebug-prefix-map=${S}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \ - -fmacro-prefix-map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \ - -fdebug-prefix-map=${B}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \ + -fmacro-prefix-map=${S}=${prefix}/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \ + -fdebug-prefix-map=${S}=${prefix}/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \ + -fmacro-prefix-map=${B}=${prefix}/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \ + -fdebug-prefix-map=${B}=${prefix}/src/debug/${PN}/${EXTENDPE}${PV}-${PR} \ -fdebug-prefix-map=${STAGING_DIR_HOST}= \ -fmacro-prefix-map=${STAGING_DIR_HOST}= \ -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
meta/lib/oe/package.py +19 -6
@@ -687,6 +687,10 @@ def split_locales(d): #d.setVar('RDEPENDS:%s' % pn, ' '.join(rdep)) def package_debug_vars(d): + prefix = d.getVar('prefix') + srcdir = ("%s/src/debug" % prefix) + libdir = ("%s/lib/debug" % prefix) + staticlibdir = ("%s/lib/debug-static" % prefix) # We default to '.debug' style if d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-file-directory': # Single debug-file-directory style debug info
@@ -695,9 +699,9 @@ def package_debug_vars(d): "staticappend": "", "dir": "", "staticdir": "", - "libdir": "/usr/lib/debug", - "staticlibdir": "/usr/lib/debug-static", - "srcdir": "/usr/src/debug", + "libdir": libdir, + "staticlibdir": staticlibdir, + "srcdir": srcdir, } elif d.getVar('PACKAGE_DEBUG_SPLIT_STYLE') == 'debug-without-src': # Original OE-core, a.k.a. ".debug", style debug info, but without sources in /usr/src/debug
@@ -718,7 +722,7 @@ def package_debug_vars(d): "staticdir": "/.debug-static", "libdir": "", "staticlibdir": "", - "srcdir": "/usr/src/debug", + "srcdir": srcdir, } else: # Original OE-core, a.k.a. ".debug", style debug info
@@ -729,7 +733,7 @@ def package_debug_vars(d): "staticdir": "/.debug-static", "libdir": "", "staticlibdir": "", - "srcdir": "/usr/src/debug", + "srcdir": srcdir, } return debug_vars
@@ -1257,6 +1261,7 @@ def populate_packages(d): dvar = d.getVar('PKGD') packages = d.getVar('PACKAGES').split() pn = d.getVar('PN') + prefix = d.getVar('prefix') bb.utils.mkdirhier(outdir) os.chdir(dvar)
@@ -1271,7 +1276,7 @@ def populate_packages(d): src_package_name = ('%s-src' % d.getVar('PN')) if not src_package_name in packages: packages.append(src_package_name) - d.setVar('FILES:%s' % src_package_name, '/usr/src/debug') + d.setVar('FILES:%s' % src_package_name, ('%s/src/debug' % prefix)) # Sanity check PACKAGES for duplicates # Sanity should be moved to sanity.bbclass once we have the infrastructure
@@ -1301,6 +1306,7 @@ def populate_packages(d): oldumask = os.umask(0) debug = [] + source = [] for root, dirs, files in cpath.walk(dvar): dir = root[len(dvar):] if not dir:
@@ -1309,6 +1315,11 @@ def populate_packages(d): path = "." + os.path.join(dir, f) if "/.debug/" in path or "/.debug-static/" in path or path.endswith("/.debug"): debug.append(path) + elif ("%s/src/debug" % prefix) in path: + if split_source_package: + source.append(path) + else: + debug.append(path) for pkg in packages: root = os.path.join(pkgdest, pkg)
@@ -1325,6 +1336,8 @@ def populate_packages(d): if autodebug and pkg.endswith("-dbg"): files.extend(debug) + if split_source_package and pkg.endswith("-src"): + files.extend(source) for file in files: if (not cpath.islink(file)) and (not cpath.exists(file)):
Signature · 1 line
2.36.0
PATCH v2 2/3 insane: ignore nativesdk-${PN}-src host contaminated issue
From: Maxime Roussin-Belanger <[email protected]>
nativesdk-${PN}-src will be installed to a different machine and files ownership will change at install. Since the ownership will change based on how the user will install the sdk there is no point in checking ownership
---
v2: New commit
meta/classes-global/insane.bbclass | 3 +++ 1 file changed, 3 insertions(+)
meta/classes-global/insane.bbclass +3 -0
@@ -1116,6 +1116,9 @@ def package_qa_check_host_user(path, name, d, elf, messages): if path == home or path.startswith(home + os.sep): return + if name.startswith("nativesdk-") and name.endswith("-src"): + return + try: stat = os.lstat(path) except OSError as exc:
Signature · 1 line
2.36.0
Re: [OE-core] [PATCH v2 2/3] insane: ignore nativesdk-${PN}-src host contaminated issue
I'm not sure I understand this. The check is to ensure build process works as it should, specifically to prevent build host ownership leaking into packages. Yes this information doesn't matter when these packages are installed, but it matters for correctness of the build.
Alex
Quoted 41 lines · Maxime Roussin-Bélanger
From: Maxime Roussin-Belanger <[email protected]>
nativesdk-${PN}-src will be installed to a different machine and files ownership will change at install. Since the ownership will change based on how the user will install the sdk there is no point in checking ownership
Signed-off-by Maxime Roussin-Belanger <[email protected]>---
v2: New commitmeta/classes-global/insane.bbclass | 3 +++ 1 file changed, 3 insertions(+)meta/classes-global/insane.bbclass +3
-1@@ -1116,6 +1116,9 @@ def package_qa_check_host_user(path, name, d, elf, messages): if path == home or path.startswith(home + os.sep): return + if name.startswith("nativesdk-") and name.endswith("-src"): + return + try: stat = os.lstat(path) except OSError as exc: --2.36.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183264): https://lists.openembedded.org/g/openembedded-core/message/183264
Mute This Topic: https://lists.openembedded.org/mt/99701051/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [PATCH v2 2/3] insane: ignore nativesdk-${PN}-src host contaminated issue
Hello Alex,
Quoted 7 lines · Alexander Kanavin
I'm not sure I understand this. The check is to ensure build process works as it should, specifically to prevent build host ownership leaking into packages. Yes this information doesn't matter when these packages are installed, but it matters for correctness of the build.
Alex
Maybe I don't get how this check is done because everything in the TMPDIR is owned by the user running bitbake.
Max
Quoted 44 lines
Quoted 41 lines · Maxime Roussin-Bélanger
From: Maxime Roussin-Belanger <[email protected]>
nativesdk-${PN}-src will be installed to a different machine and files ownership will change at install. Since the ownership will change based on how the user will install the sdk there is no point in checking ownership
Signed-off-by Maxime Roussin-Belanger <[email protected]>---
v2: New commitmeta/classes-global/insane.bbclass | 3 +++ 1 file changed, 3 insertions(+)meta/classes-global/insane.bbclass +3
-1@@ -1116,6 +1116,9 @@ def package_qa_check_host_user(path, name, d, elf, messages): if path == home or path.startswith(home + os.sep): return + if name.startswith("nativesdk-") and name.endswith("-src"): + return + try: stat = os.lstat(path) except OSError as exc: --2.36.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183264): https://lists.openembedded.org/g/openembedded-core/message/183264
Mute This Topic: https://lists.openembedded.org/mt/99701051/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [PATCH v2 2/3] insane: ignore nativesdk-${PN}-src host contaminated issue
In reply to Alexander KanavinHello Alex,
Quoted 7 lines · Alexander Kanavin
I'm not sure I understand this. The check is to ensure build process works as it should, specifically to prevent build host ownership leaking into packages. Yes this information doesn't matter when these packages are installed, but it matters for correctness of the build.
Alex
Maybe I don't get how this check is done because everything in the TMPDIR is owned by the user running bitbake.
Max
Quoted 44 lines
Quoted 41 lines · Maxime Roussin-Bélanger
From: Maxime Roussin-Belanger <[email protected]>
nativesdk-${PN}-src will be installed to a different machine and files ownership will change at install. Since the ownership will change based on how the user will install the sdk there is no point in checking ownership
Signed-off-by Maxime Roussin-Belanger <[email protected]>---
v2: New commitmeta/classes-global/insane.bbclass | 3 +++ 1 file changed, 3 insertions(+)meta/classes-global/insane.bbclass +3
-1@@ -1116,6 +1116,9 @@ def package_qa_check_host_user(path, name, d, elf, messages): if path == home or path.startswith(home + os.sep): return + if name.startswith("nativesdk-") and name.endswith("-src"): + return + try: stat = os.lstat(path) except OSError as exc: --2.36.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#183264): https://lists.openembedded.org/g/openembedded-core/message/183264
Mute This Topic: https://lists.openembedded.org/mt/99701051/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [PATCH v2 2/3] insane: ignore nativesdk-${PN}-src host contaminated issue
Quoted 9 lines · Maxime Roussin-Bélanger
Quoted 6 lines
I'm not sure I understand this. The check is to ensure build process works as it should, specifically to prevent build host ownership leaking into packages. Yes this information doesn't matter when these packages are installed, but it matters for correctness of the build.
Alex
Maybe I don't get how this check is done because everything in the TMPDIR is owned by the user running bitbake.
Installation and packaging tasks run under 'pseudo', an abstraction that gives the tasks an illusion of running as root and setting file ownership without restrictions. On build host's disk it's all owned by bitbake user, but actual packages contain the desired ownership for the target package installation.
Alex
Re: [OE-core] [PATCH v2 2/3] insane: ignore nativesdk-${PN}-src host contaminated issue
Quoted 10 lines · Alexander Kanavin
Quoted 7 lines · Maxime Roussin-Bélanger
Quoted 6 lines
I'm not sure I understand this. The check is to ensure build process works as it should, specifically to prevent build host ownership leaking into packages. Yes this information doesn't matter when these packages are installed, but it matters for correctness of the build.
Alex
Quoted 8 lines
Quoted 2 lines
Maybe I don't get how this check is done because everything in the TMPDIR is owned by the user running bitbake.
Installation and packaging tasks run under 'pseudo', an abstraction that gives the tasks an illusion of running as root and setting file ownership without restrictions. On build host's disk it's all owned by bitbake user, but actual packages contain the desired ownership for the target package installation.
When you mention packages, do you mean the .rpm, .deb, etc?
What would be proper desired ownership inside those packages for a nativesdk -src package? Is it suppose to be root?
Max.
Quoted 2 lines
Alex
Re: [OE-core] [PATCH v2 2/3] insane: ignore nativesdk-${PN}-src host contaminated issue
Quoted 4 lines · Maxime Roussin-Bélanger
When you mention
packages, do you mean the .rpm, .deb, etc?What would be proper desired ownership inside those packages for a nativesdk -src package? Is it suppose to be root?
You can probably check how these packages get created in the first place? There will be explicit ownership set at that point.
Alex
PATCH v2 3/3 bitbake.conf: add debug symbol for sdk
In reply to Maxime Roussin-BélangerFrom: Maxime Roussin-Belanger <[email protected]>
Without adding debug flag nativesdk dbg package is not packaged since there is no debugging information
---
v2: New commit
meta/conf/bitbake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/bitbake.conf +1 -1
@@ -601,7 +601,7 @@ PATCHRESOLVE = "noop" ################################################################## export BUILD_CPPFLAGS = "-isystem${STAGING_INCDIR_NATIVE}" -BUILDSDK_CPPFLAGS = "" +BUILDSDK_CPPFLAGS ?= "-g" export CPPFLAGS = "${TARGET_CPPFLAGS}" TARGET_CPPFLAGS = ""
Signature · 1 line
2.36.0
Re: [OE-core] [PATCH v2 3/3] bitbake.conf: add debug symbol for sdk
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
Quoted 38 lines · Maxime Roussin-Bélanger
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 commitmeta/conf/bitbake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/conf/bitbake.conf +1
-2@@ -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 (#183265): https://lists.openembedded.org/g/openembedded-core/message/183265
Mute This Topic: https://lists.openembedded.org/mt/99701056/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [PATCH v2 3/3] bitbake.conf: add debug symbol for sdk
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
Quoted 48 lines · Alexander Kanavin
This change is unnecessary, as there is already a mechanism. Just slightly further down you can see that
BUILDSDK_CFLAGSpulls inBUILD_OPTIMIZATION, which sets -g if you enableDEBUG_BUILDin your config.Alex
Quoted 38 lines · Maxime Roussin-Bélanger
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 commitmeta/conf/bitbake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/conf/bitbake.conf +1
-2@@ -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 (#183265): https://lists.openembedded.org/g/openembedded-core/message/183265
Mute This Topic: https://lists.openembedded.org/mt/99701056/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [PATCH v2 3/3] bitbake.conf: add debug symbol for sdk
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
Quoted 59 lines · Maxime Roussin-Bélanger
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
Quoted 48 lines · Alexander Kanavin
This change is unnecessary, as there is already a mechanism. Just slightly further down you can see that
BUILDSDK_CFLAGSpulls inBUILD_OPTIMIZATION, which sets -g if you enableDEBUG_BUILDin your config.Alex
Quoted 38 lines · Maxime Roussin-Bélanger
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 commitmeta/conf/bitbake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/conf/bitbake.conf +1
-2@@ -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 (#183265): https://lists.openembedded.org/g/openembedded-core/message/183265
Mute This Topic: https://lists.openembedded.org/mt/99701056/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [PATCH v2 3/3] bitbake.conf: add debug symbol for sdk
Quoted 6 lines · Alexander Kanavin
But then you can set the parameters as you want them in your local configuration. Setting -g globally in the absence of
DEBUG_BUILDneeds 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.
Quoted 62 lines
Quoted 59 lines · Maxime Roussin-Bélanger
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
Quoted 48 lines · Alexander Kanavin
This change is unnecessary, as there is already a mechanism. Just slightly further down you can see that
BUILDSDK_CFLAGSpulls inBUILD_OPTIMIZATION, which sets -g if you enableDEBUG_BUILDin your config.Alex
Quoted 38 lines · Maxime Roussin-Bélanger
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 commitmeta/conf/bitbake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/conf/bitbake.conf +1
-2@@ -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 (#183265): https://lists.openembedded.org/g/openembedded-core/message/183265
Mute This Topic: https://lists.openembedded.org/mt/99701056/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [OE-core] [PATCH v2 3/3] bitbake.conf: add debug symbol for sdk
Quoted 5 lines · Maxime Roussin-Bélanger
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?
The Yocto SDK manual I suppose?
Alex
Re: [OE-core] [PATCH v2 3/3] bitbake.conf: add debug symbol for sdk
In reply to Maxime Roussin-BélangerHi 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.confBUILDSDK_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
Quoted 74 lines · Maxime Roussin-Bélanger
Quoted 6 lines · Alexander Kanavin
But then you can set the parameters as you want them in your local configuration. Setting -g globally in the absence of
DEBUG_BUILDneeds 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.
Quoted 56 lines
Quoted 53 lines · Maxime Roussin-Bélanger
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
Quoted 42 lines · Alexander Kanavin
This change is unnecessary, as there is already a mechanism. Just slightly further down you can see that
BUILDSDK_CFLAGSpulls inBUILD_OPTIMIZATION, which sets -g if you enableDEBUG_BUILDin your config.Alex
Quoted 32 lines · Maxime Roussin-Bélanger
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 commitmeta/conf/bitbake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meta/conf/bitbake.conf +1
-2@@ -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
Re: [OE-core] [PATCH v2 3/3] bitbake.conf: add debug symbol for sdk
Quoted 8 lines · Christian Eggers
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?
The intended way to debug an app is to actually run it in a target environment or in qemu system emulation. Yes this is more tricky to set up, but allowing native or nativesdk builds of the target stack for the sake of debugging is a can of worms I would not want to open.
Alex