Skip to contentSkip to conversation

package/crash: new package

PATCH In review Alexander Egorenkov 2 participants 2 messages Sep 26, 2020 – Jan 8, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/crash: new package

---
 DEVELOPERS                                    |   1 +
 package/Config.in                             |   1 +
 .../0001-Support-cross-compilation.patch      | 134 ++++++++++++++++++
 package/crash/Config.in                       |  27 ++++
 package/crash/crash.hash                      |   3 +
 package/crash/crash.mk                        |  50 +++++++
 6 files changed, 216 insertions(+)
 create mode 100644 package/crash/0001-Support-cross-compilation.patch
 create mode 100644 package/crash/Config.in
 create mode 100644 package/crash/crash.hash
 create mode 100644 package/crash/crash.mk
DEVELOPERS +1 -0
index 9352d891d3..5d0f93d0d4 100644
@@ -144,6 +144,7 @@ F:	package/libuecc/
 F:	package/putty/
 
 N:	Alexander Egorenkov <[email protected]>
+F:	package/crash/
 F:	package/makedumpfile/
 F:	package/multipath-tools/
 
package/Config.in +1 -0
index 51583d07d6..9ded2a2b4f 100644
@@ -88,6 +88,7 @@ menu "Debugging, profiling and benchmark"
 	source "package/bonnie/Config.in"
 	source "package/cache-calibrator/Config.in"
 	source "package/clinfo/Config.in"
+	source "package/crash/Config.in"
 	source "package/dacapo/Config.in"
 	source "package/dhrystone/Config.in"
 	source "package/dieharder/Config.in"
package/crash/0001-Support-cross-compilation.patch new file +134 -0

134 lines not on this page · raw message

package/crash/Config.in new file +27 -0
new file mode 100644
index 0000000000..7372123937
@@ -0,0 +1,27 @@
+config BR2_PACKAGE_CRASH_ARCH_SUPPORTS
+	bool
+	default y if BR2_aarch64 || BR2_aarch64_be
+	default y if BR2_arm || BR2_armeb
+	default y if BR2_i386 || BR2_x86_64
+	default y if BR2_powerpc || BR2_powerpc64 || BR2_powerpc64le
+	default y if BR2_s390x
+	default y if BR2_sparc64
+
+comment "crash needs a glibc toolchain w/ wchar, dynamic library"
+	depends on BR2_PACKAGE_CRASH_ARCH_SUPPORTS
+	depends on !BR2_USE_WCHAR || BR2_STATIC_LIBS || !BR2_TOOLCHAIN_USES_GLIBC
+
+config BR2_PACKAGE_CRASH
+	bool "crash"
+	depends on BR2_PACKAGE_CRASH_ARCH_SUPPORTS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_STATIC_LIBS # dlopen
+	depends on BR2_USE_WCHAR
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	select BR2_PACKAGE_LESS
+	select BR2_PACKAGE_NCURSES
+	select BR2_PACKAGE_ZLIB
+	help
+	  Analyze Linux crash dump data or a live system
+
+	  https://github.com/crash-utility/crash
package/crash/crash.hash new file +3 -0
new file mode 100644
index 0000000000..1a34cf4421
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256  996d3367764c77e23921c164725e4d0221acc7a15a92a3f825053ea37f2452dc  crash-7.2.8.tar.gz
+sha256  8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  COPYING3
package/crash/crash.mk new file +50 -0

50 lines not on this page · raw message

Signature · 1 line
2.28.0
#1 lore raw

Hi,

Sorry for the slow response.

Quoted 6 lines · Alexander Egorenkov
package/crash/0001-Support-cross-compilation.patch new file +0 -0
new file mode 100644
index 0000000000..7e1bd3f861

package/crash/0001-Support-cross-compilation.patch line 10

Quoted 10 lines
package/crash/0001-Support-cross-compilation.patch new file +10 -0
@@ -0,0 +1,134 @@
+From 44cb56ad5bbd78203fb6f346299ccfe45f2568fe Mon Sep 17 00:00:00 2001
+From: Alexander Egorenkov <[email protected]>
+Date: Sat, 26 Sep 2020 14:29:49 +0200
+Subject: [PATCH 1/1] Support cross-compilation
+
+- Introduce CONF_CC variable to compile configure.c
+- Introduce CONF_HOST_ARCH to configure.c to enable overriding target
+  at compile time
+
+Signed-off-by: Alexander Egorenkov <[email protected]>

I noticed that this patch is not yet upstream / I don't see a PR for it. Are you still interested in this package?

The patch could be quite a bit smaller if you didn't move the ! CONF_HOST_ARCH lines, but otherwise it looks fine to me.

package/crash/0001-Support-cross-compilation.patch line 19

Quoted 9 lines
package/crash/0001-Support-cross-compilation.patch new file +9 -0
+++ b/package/crash/Config.in
+config BR2_PACKAGE_CRASH
+       bool "crash"
+       depends on BR2_PACKAGE_CRASH_ARCH_SUPPORTS
+       depends on BR2_TOOLCHAIN_HAS_THREADS
+       depends on !BR2_STATIC_LIBS # dlopen
+       depends on BR2_USE_WCHAR
+       depends on BR2_TOOLCHAIN_USES_GLIBC
+       select BR2_PACKAGE_LESS

The dependency on less looks odd. Presumably you mean this as a runtime dependency which we normally mark with a # runtime comment and then don't add to _DEPENDENCIES, but looking at the code it seems to work without less as well or with the busybox less applet?

package/crash/0001-Support-cross-compilation.patch line 10

Quoted 12 lines
package/crash/0001-Support-cross-compilation.patch new file +11 -0
+++ b/package/crash/crash.mk
@@ -0,0 +1,50 @@
+################################################################################
+#
+# crash
+#
+################################################################################
+
+CRASH_VERSION = 7.2.8
+CRASH_SITE = $(call github,crash-utility,crash,$(CRASH_VERSION))
+CRASH_DEPENDENCIES = host-bison less ncurses zlib
+CRASH_LICENSE = GPL-3.0

Most of the code seems to come from the kernel and is marked as GPL-2.0+.

package/crash/0001-Support-cross-compilation.patch line 14

Quoted 4 lines
package/crash/0001-Support-cross-compilation.patch new file +4 -0
+CRASH_LICENSE_FILES = COPYING3
+
+CRASH_GDB_CONF_FLAGS = \
+       --host=$(GNU_TARGET_NAME)

That looked odd to me. It apparently downloads a GDB tarball during the build step, patches and builds that, completely sidestepping the download / mirror logic of Buildroot (and our existing gdb patches), so that is not good. What is this needed for exactly? Can it instead use our existing gdb package?

Quoted 7 lines
package/crash/0001-Support-cross-compilation.patch new file +7 -0
+ifeq ($(BR2_i386),y)
+CRASH_TARGET = X86
+else ifeq ($(BR2_x86_64),y)
+CRASH_TARGET = X86_64
+else ifeq ($(BR2_arm)$(BR2_armeb),y)
+CRASH_TARGET = ARM
+else ifeq ($(BR2_aarch64)$(BR2_aarch64_be),y)

package/crash/0001-Support-cross-compilation.patch line 31

Quoted 10 lines
package/crash/0001-Support-cross-compilation.patch new file +10 -0
+CRASH_TARGET = ARM64
+else ifeq ($(BR2_powerpc),y)
+CRASH_TARGET = PPC
+else ifeq ($(BR2_powerpc64)$(BR2_powerpc64le),y)
+CRASH_TARGET = PPC64
+else ifeq ($(BR2_s390x),y)
+CRASH_TARGET = S390X
+else ifeq ($(BR2_sparc64),y)
+CRASH_TARGET = SPARC64
+endif

NIT: such conditional logic is a bit clearer / shorter in Config.in instead of in the .mk.

What is the use case for this exactly? You are building it for the target, but wouldn't this make more sense as a host utility?

The gdb download is a show stopper, so I have marked this as changes requested.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot