Skip to contentSkip to conversation

package/uclibc: add backtrace support option

PATCH New Andrea Ricchi 2 participants 5 messages Jan 11, 2021 – Jan 23, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 package/uclibc: add backtrace support option

Add toolchain configuration to support execinfo.h and backtrace features.

---
Changes v2 -> v3:
- Remove BR2_USE_BACKTRACE selection (suggested by Angelo Compagnucci)

Changes v1 -> v2:
- add shared library dependency (suggested by Yann Morin)

 package/uclibc/Config.in |  7 +++++++
 package/uclibc/uclibc.mk | 11 +++++++++++
 2 files changed, 18 insertions(+)
package/uclibc/Config.in +7 -0
index e59fef3c69..dedd58f940 100644
@@ -39,6 +39,13 @@ config BR2_TOOLCHAIN_BUILDROOT_LOCALE
 	  Enable this option if you want your toolchain to support
 	  localization and internationalization.
 
+config BR2_TOOLCHAIN_BUILDROOT_BACKTRACE
+	bool "Enable backtrace support"
+	depends on !BR2_STATIC_LIBS
+	help
+	  Enable this option if you want your toolchain to support
+	  execinfo.h and backtrace features.
+
 choice
 	prompt "Thread library implementation"
 	help
package/uclibc/uclibc.mk +11 -0
index 53983e852d..b6f6c0f824 100644
@@ -359,6 +359,16 @@ else
 UCLIBC_SHARED_LIBS_CONFIG = $(call KCONFIG_ENABLE_OPT,HAVE_SHARED)
 endif
 
+#
+# backtrace support
+#
+
+ifeq ($(BR2_TOOLCHAIN_BUILDROOT_BACKTRACE),y)
+UCLIBC_BACKTRACE_CONFIG = $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_BACKTRACE)
+else
+UCLIBC_BACKTRACE_CONFIG = $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_BACKTRACE)
+endif
+
 #
 # Commands
 #
@@ -401,6 +411,7 @@ define UCLIBC_KCONFIG_FIXUP_CMDS
 	$(UCLIBC_LOCALE_CONFIG)
 	$(UCLIBC_WCHAR_CONFIG)
 	$(UCLIBC_SHARED_LIBS_CONFIG)
+	$(UCLIBC_BACKTRACE_CONFIG)
 endef
 
 define UCLIBC_BUILD_CMDS
Signature · 1 line
2.25.1
#1 lore raw

PATCH v3 1/1 package/uclibc: add backtrace support option

Andrea, All,

On 2021-01-11 14:07 +0100, Andrea Ricchi spake thusly:

Quoted 7 lines

Add toolchain configuration to support execinfo.h and backtrace features.

---
Changes v2 -> v3:
- Remove BR2_USE_BACKTRACE selection (suggested by Angelo Compagnucci)

Ah, you noticed already, good. :-)

I did not see the review mail by Angelo, so internal review I guess. In that case, it would have been nice that you Cc-ed him on the v3, with a
Cc: tag right below your own SoB line, so that git sends the Cc
automatically. Basically, it is customary to add people that provided a review as Cc of your respins.

Thanks!

Regards,
Yann E. MORIN.

Quoted 61 lines

Changes v1 -> v2:
- add shared library dependency (suggested by Yann Morin)

 package/uclibc/Config.in |  7 +++++++
 package/uclibc/uclibc.mk | 11 +++++++++++
 2 files changed, 18 insertions(+)
package/uclibc/Config.in +7 -0
index e59fef3c69..dedd58f940 100644
@@ -39,6 +39,13 @@ config BR2_TOOLCHAIN_BUILDROOT_LOCALE
 	  Enable this option if you want your toolchain to support
 	  localization and internationalization.
 
+config BR2_TOOLCHAIN_BUILDROOT_BACKTRACE
+	bool "Enable backtrace support"
+	depends on !BR2_STATIC_LIBS
+	help
+	  Enable this option if you want your toolchain to support
+	  execinfo.h and backtrace features.
+
 choice
 	prompt "Thread library implementation"
 	help
package/uclibc/uclibc.mk +11 -0
index 53983e852d..b6f6c0f824 100644
@@ -359,6 +359,16 @@ else
 UCLIBC_SHARED_LIBS_CONFIG = $(call KCONFIG_ENABLE_OPT,HAVE_SHARED)
 endif
 
+#
+# backtrace support
+#
+
+ifeq ($(BR2_TOOLCHAIN_BUILDROOT_BACKTRACE),y)
+UCLIBC_BACKTRACE_CONFIG = $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_BACKTRACE)
+else
+UCLIBC_BACKTRACE_CONFIG = $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_BACKTRACE)
+endif
+
 #
 # Commands
 #
@@ -401,6 +411,7 @@ define UCLIBC_KCONFIG_FIXUP_CMDS
 	$(UCLIBC_LOCALE_CONFIG)
 	$(UCLIBC_WCHAR_CONFIG)
 	$(UCLIBC_SHARED_LIBS_CONFIG)
+	$(UCLIBC_BACKTRACE_CONFIG)
 endef
 
 define UCLIBC_BUILD_CMDS
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH v3 1/1 package/uclibc: add backtrace support option

Hi Yann,

Quoted 19 lines · Yann E. MORIN

Andrea, All,

On 2021-01-11 14:07 +0100, Andrea Ricchi spake thusly:

Quoted 7 lines

Add toolchain configuration to support execinfo.h and backtrace features.

---
Changes v2 -> v3:
- Remove BR2_USE_BACKTRACE selection (suggested by Angelo Compagnucci)

Ah, you noticed already, good. :-)

I did not see the review mail by Angelo, so internal review I guess. In that case, it would have been nice that you Cc-ed him on the v3, with a
Cc: tag right below your own SoB line, so that git sends the Cc
automatically. Basically, it is customary to add people that provided a review as Cc of your respins.

Quoted 5 lines

Thanks!

Regards,
Yann E. MORIN.

Understood. This is my first patch and I'm getting used to this review process.
Let me know if other changes are needed.

Thanks!

Andrea Ricchi.

Quoted 76 lines
Quoted 30 lines

Changes v1 -> v2:
- add shared library dependency (suggested by Yann Morin)

 package/uclibc/Config.in |  7 +++++++
 package/uclibc/uclibc.mk | 11 +++++++++++
 2 files changed, 18 insertions(+)
package/uclibc/Config.in +7 -0
index e59fef3c69..dedd58f940 100644
@@ -39,6 +39,13 @@ config BR2_TOOLCHAIN_BUILDROOT_LOCALE
        Enable this option if you want your toolchain to support
        localization and internationalization.
 
+config BR2_TOOLCHAIN_BUILDROOT_BACKTRACE
+     bool "Enable backtrace support"
+     depends on !BR2_STATIC_LIBS
+     help
+       Enable this option if you want your toolchain to support
+       execinfo.h and backtrace features.
+
 choice
      prompt "Thread library implementation"
      help
package/uclibc/uclibc.mk +0 -0
index 53983e852d..b6f6c0f824 100644

package/uclibc/uclibc.mk else · line 367

Quoted 9 lines
package/uclibc/uclibc.mk +6 -0
@@ -359,6 +359,16 @@ else
 UCLIBC_SHARED_LIBS_CONFIG = $(call KCONFIG_ENABLE_OPT,HAVE_SHARED)
 endif
 
+#
+# backtrace support
+#
+
+ifeq ($(BR2_TOOLCHAIN_BUILDROOT_BACKTRACE),y)
+UCLIBC_BACKTRACE_CONFIG = $(call

KCONFIG_ENABLE_OPT,UCLIBC_HAS_BACKTRACE)

package/uclibc/uclibc.mk else · line 369

Quoted 2 lines
package/uclibc/uclibc.mk +2 -0
+else
+UCLIBC_BACKTRACE_CONFIG = $(call

KCONFIG_DISABLE_OPT,UCLIBC_HAS_BACKTRACE)

Quoted 16 lines
package/uclibc/uclibc.mk +3 -1
+endif
+
 #
 # Commands
 #
@@ -401,6 +411,7 @@ define UCLIBC_KCONFIG_FIXUP_CMDS
      $(UCLIBC_LOCALE_CONFIG)
      $(UCLIBC_WCHAR_CONFIG)
      $(UCLIBC_SHARED_LIBS_CONFIG)
+     $(UCLIBC_BACKTRACE_CONFIG)
 endef
 
 define UCLIBC_BUILD_CMDS
--

2.25.1

Quoted 4 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

--

.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___
     |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is
no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v
 conspiracy.  |
Quoted 2 lines

'------------------------------^-------^------------------^--------------------'

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210111/b0527cca/attachment.html>

#3 lore raw

PATCH v3 1/1 package/uclibc: add backtrace support option

Andrea, All,

+Peter, +Thomas, +Arnout for additional feedback: question toward the end of the mail...

On 2021-01-11 20:49 +0100, Andrea Ricchi spake thusly:

Quoted 9 lines · Yann E. MORIN
Quoted 8 lines

On 2021-01-11 14:07 +0100, Andrea Ricchi spake thusly:

Quoted 7 lines

Add toolchain configuration to support execinfo.h and backtrace features.

---
Changes v2 -> v3:
? ?- Remove BR2_USE_BACKTRACE selection (suggested by Angelo Compagnucci)

Quoted 7 lines
Quoted 6 lines

Ah, you noticed already, good. :-)
I did not see the review mail by Angelo, so internal review I guess. In that case, it would have been nice that you Cc-ed him on the v3, with a ?Cc: tag right below your own SoB line, so that git sends the Cc automatically. Basically, it is customary to add people that provided a review as Cc of your respins.

Understood. This is my first patch and I'm getting used to this review process.?

Sure, hence my comments. ;-)

Quoted 1 line

Let me know if other changes are needed.

No, that's OK.

But looking from a wider perspective, there is the question of how many uClibc configure options we want to have in the Buildroot config (as raised by Thomas on IRC).

There are already two ways to customize the uClibc configuration:

- BR2_UCLIBC_CONFIG, which allows one to use a (def)config that differs from the one bundled in Buildroot, and

- BR2_UCLIBC_CONFIG_FRAGMENT_FILES, which allows one to provide additional fragments (def)config that apply on top of BR2_UCLIBC_CONFIG.

Adding yet a third way, options in the Buidlroot main menu, will make the thing even more complex to manage.

We can argue that we currently have four options to configure uClibc from the Buildroot's own config:

- BR2_TOOLCHAIN_BUILDROOT_WCHAR, that drives whether wide chars are available,

- BR2_TOOLCHAIN_BUILDROOT_LOCALE, which drives whether locales are supported,

- BR2_PTHREADS_NATIVE, BR2_PTHREADS, and BR2_PTHREAD_DEBUG, which drive whether threads ara vailable, and which flavour to use, and

- BR2_TOOLCHAIN_BUILDROOT_USE_SSP, which drives whether stack-smashing protection is enabled.

However, those four options are fundamental features of the C library, that impact the features present in the toolchain. We must know about those to know whether a package will build/work or not, and hide/show it appropriately. No need to show a package to the user if it is known that package will not build or run.

I.e. without the knowledge about those features, the configuration of Buildroot would be very incomplete.

On the other hand, support for libubacktrace in uClibc is not so much a core feature. If we add such an option, we could end up having quite a lot of additional options too, and we definitely can't duplicate the whole uClibc config setup in Buildroot.

An often-brought excuse for adding such an option, is that it makes it that the configuration is nicely packed into a single file. I find this to be a bit overblown, tbh, because that configuration file has to be stored somewhere (in a VCS most probably), and there are already other additional files that will be needed for a real-world system, like the runtime configuration files, but also users tables, post-build scripts, genimage setupcriptions, and a whole lot more. Adding another (def)config and/or fragment is not that much a hurdle I would say.

So, even if the patch is looking good from a technical point of view, is it a good feature to add, or is that use-case not better served using the existing BR2_UCLIBC_CONFIG and/or BR2_UCLIBC_CONFIG_FRAGMENT_FILES mechanisms?

On my part I'm still about 50/50, maybe still leaning a bit toward 'no', but I'm not dead-set...

Peter, Thomas, Arnout, others: quid?

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH v3 1/1 package/uclibc: add backtrace support option

In reply to Andrea Ricchi

Andrea, All,

On 2021-01-11 14:07 +0100, Andrea Ricchi spake thusly:

Quoted 4 lines

Add toolchain configuration to support execinfo.h and backtrace features.

We've discussed this amongst maintainers, and as I explained in my lengthy reply earlier, we believe this does not warrant a new option in the menuconfig.

Thank you for your contribution nonetheless!

Regards,
Yann E. MORIN.

Quoted 65 lines

---
Changes v2 -> v3:
- Remove BR2_USE_BACKTRACE selection (suggested by Angelo Compagnucci)

Changes v1 -> v2:
- add shared library dependency (suggested by Yann Morin)

 package/uclibc/Config.in |  7 +++++++
 package/uclibc/uclibc.mk | 11 +++++++++++
 2 files changed, 18 insertions(+)
package/uclibc/Config.in +7 -0
index e59fef3c69..dedd58f940 100644
@@ -39,6 +39,13 @@ config BR2_TOOLCHAIN_BUILDROOT_LOCALE
 	  Enable this option if you want your toolchain to support
 	  localization and internationalization.
 
+config BR2_TOOLCHAIN_BUILDROOT_BACKTRACE
+	bool "Enable backtrace support"
+	depends on !BR2_STATIC_LIBS
+	help
+	  Enable this option if you want your toolchain to support
+	  execinfo.h and backtrace features.
+
 choice
 	prompt "Thread library implementation"
 	help
package/uclibc/uclibc.mk +11 -0
index 53983e852d..b6f6c0f824 100644
@@ -359,6 +359,16 @@ else
 UCLIBC_SHARED_LIBS_CONFIG = $(call KCONFIG_ENABLE_OPT,HAVE_SHARED)
 endif
 
+#
+# backtrace support
+#
+
+ifeq ($(BR2_TOOLCHAIN_BUILDROOT_BACKTRACE),y)
+UCLIBC_BACKTRACE_CONFIG = $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_BACKTRACE)
+else
+UCLIBC_BACKTRACE_CONFIG = $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_BACKTRACE)
+endif
+
 #
 # Commands
 #
@@ -401,6 +411,7 @@ define UCLIBC_KCONFIG_FIXUP_CMDS
 	$(UCLIBC_LOCALE_CONFIG)
 	$(UCLIBC_WCHAR_CONFIG)
 	$(UCLIBC_SHARED_LIBS_CONFIG)
+	$(UCLIBC_BACKTRACE_CONFIG)
 endef
 
 define UCLIBC_BUILD_CMDS
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'