Skip to contentSkip to conversation

strongswan: add a PACKAGECONFIG for libbfd stack traces

PATCH Superseded Dan Callaghan 2 participants 4 messages Oct 14, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 strongswan: add a PACKAGECONFIG for libbfd stack traces

Strongswan installs a signal handler for SIGSEGV, SIGILL, and SIGBUS which attempts to print a stack trace of the crash. For producing line numbers in the stack trace, it can use libbfd from binutils, or libunwind, or else it falls back to a slower method using /usr/bin/addr2line.

Currently the addr2line method is unlikely to actually work, since there is no RDEPENDS to pull that command into the image.

This patch turns on the libbfd-based stack traces by default, which should be a reasonable choice since binutils is already required for building everything. The setting is nevertheless behind a PACKAGECONFIG in case libbfd is not wanted in the final image.

---
 meta-networking/recipes-support/strongswan/strongswan_5.8.1.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta-networking/recipes-support/strongswan/strongswan_5.8.1.bb +2 -1
index 5408eed27..c8a8d1dc0 100644
@@ -24,10 +24,11 @@ EXTRA_OECONF = " \
 
 EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}"
 
-PACKAGECONFIG ??= "charon curl gmp openssl stroke sqlite3 \
+PACKAGECONFIG ??= "bfd charon curl gmp openssl stroke sqlite3 \
         ${@bb.utils.filter('DISTRO_FEATURES', 'ldap', d)} \
 "
 PACKAGECONFIG[aesni] = "--enable-aesni,--disable-aesni,,${PN}-plugin-aesni"
+PACKAGECONFIG[bfd] = "--enable-bfd-backtraces,--disable-bfd-backtraces,binutils"
 PACKAGECONFIG[charon] = "--enable-charon,--disable-charon,"
 PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,${PN}-plugin-curl"
 PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp,${PN}-plugin-gmp"
Signature · 1 line
2.20.1
#1 lore raw
Quoted 6 lines · Dan Callaghan

Strongswan installs a signal handler for SIGSEGV, SIGILL, and SIGBUS which attempts to print a stack trace of the crash. For producing line numbers in the stack trace, it can use libbfd from binutils, or libunwind, or else it falls back to a slower method using /usr/bin/addr2line.

Quoted 7 lines

Currently the addr2line method is unlikely to actually work, since there is no RDEPENDS to pull that command into the image.

This patch turns on the libbfd-based stack traces by default, which should be a reasonable choice since binutils is already required for building everything. The setting is nevertheless behind a PACKAGECONFIG in case libbfd is not wanted in the final image.

Package config is fine but let’s not enable it by default

Quoted 37 lines
---
 meta-networking/recipes-support/strongswan/strongswan_5.8.1.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

strongswan_5.8.1.bb b/meta-networking/recipes-support/strongswan/ strongswan_5.8.1.bb
index 5408eed27..c8a8d1dc0 100644

meta-networking/recipes-support/strongswan/strongswan_5.8.1.bb +0 -0
@@ -24,10 +24,11 @@ EXTRA_OECONF = " \
 
 EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd',
 '--with-systemdsystemunitdir=${systemd_unitdir}/system/',

'--without-systemdsystemunitdir', d)}"

meta-networking/recipes-support/strongswan/strongswan_5.8.1.bb +1 -1
-PACKAGECONFIG ??= "charon curl gmp openssl stroke sqlite3 \
+PACKAGECONFIG ??= "bfd charon curl gmp openssl stroke sqlite3 \
         ${@bb.utils.filter('DISTRO_FEATURES', 'ldap', d)} \
 "
 PACKAGECONFIG[aesni] =

"--enable-aesni,--disable-aesni,,${PN}-plugin-aesni" +PACKAGECONFIG[bfd] = "--enable-bfd-backtraces,--disable-bfd-backtraces,binutils"
PACKAGECONFIG[charon] = "--enable-charon,--disable-charon," PACKAGECONFIG[curl] =
"--enable-curl,--disable-curl,curl,${PN}-plugin-curl"
PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp,${PN}-plugin-gmp"
--
2.20.1

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

#2 lore raw

Excerpts from Khem Raj's message of 2019-10-14 03:14:32 -07:00:

Quoted 1 line

Package config is fine but let’s not enable it by default

Fair enough, I'll post a new patch which leaves it disabled.

Signature · 3 lines
Dan Callaghan <[email protected]>
Software Engineer
Opengear <https://opengear.com/>
#3 lore raw

PATCH v2 1/1 strongswan: add a PACKAGECONFIG for libbfd stack traces

In reply to Khem Raj

Strongswan installs a signal handler for SIGSEGV, SIGILL, and SIGBUS which attempts to print a stack trace of the crash. For producing line numbers in the stack trace, it can use libbfd from binutils, or libunwind, or else it falls back to a slower method using /usr/bin/addr2line.

Currently the addr2line method is unlikely to actually work, since there is no RDEPENDS to pull that command into the image.

This patch adds a PACKAGECONFIG to enable the libbfd-based stack traces, which is likely the best alternative since binutils is already required for building everything, and it will be faster than the addr2line method (which requires addr2line and libbfd anyway).

---
 meta-networking/recipes-support/strongswan/strongswan_5.8.1.bb | 1 +
 1 file changed, 1 insertion(+)
meta-networking/recipes-support/strongswan/strongswan_5.8.1.bb +1 -0
index 5408eed27..b521633ff 100644
@@ -28,6 +28,7 @@ PACKAGECONFIG ??= "charon curl gmp openssl stroke sqlite3 \
         ${@bb.utils.filter('DISTRO_FEATURES', 'ldap', d)} \
 "
 PACKAGECONFIG[aesni] = "--enable-aesni,--disable-aesni,,${PN}-plugin-aesni"
+PACKAGECONFIG[bfd] = "--enable-bfd-backtraces,--disable-bfd-backtraces,binutils"
 PACKAGECONFIG[charon] = "--enable-charon,--disable-charon,"
 PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,${PN}-plugin-curl"
 PACKAGECONFIG[gmp] = "--enable-gmp,--disable-gmp,gmp,${PN}-plugin-gmp"
Signature · 1 line
2.20.1