From patchwork Sat Sep 26 20:00:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Egorenkov X-Patchwork-Id: 1371857 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=posteo.net Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=posteo.net header.i=@posteo.net header.a=rsa-sha256 header.s=2017 header.b=bnAzihqT; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BzKQX3L3Bz9ryj for ; Sun, 27 Sep 2020 06:00:36 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A6D25871B8; Sat, 26 Sep 2020 20:00:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D185UlxEJti8; Sat, 26 Sep 2020 20:00:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 92A0E871BA; Sat, 26 Sep 2020 20:00:32 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 7C0AB1BF3E3 for ; Sat, 26 Sep 2020 20:00:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7613B871BA for ; Sat, 26 Sep 2020 20:00:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b51oSHsH0f6k for ; Sat, 26 Sep 2020 20:00:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by hemlock.osuosl.org (Postfix) with ESMTPS id 29BDF871B8 for ; Sat, 26 Sep 2020 20:00:28 +0000 (UTC) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id D725F16005C for ; Sat, 26 Sep 2020 22:00:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1601150425; bh=t+4g1d3xnM1VekUvu2B7M7/7K1Wimtm0Ewpl+RZ9MRQ=; h=From:To:Cc:Subject:Date:From; b=bnAzihqTrmg4yfznfJqCEcj597DQlUyx6vrQ+z4ABZS9TKkRbBUuc/zLcdyXFyGSU +KxLZCSZ6WTTXpHO0r7Xds9spJriW557QgotHnYn7tlZYoqOX6j9xJPGqFPe8ndo6B bfbpBVizRfVveAIGMGiYwuun0m2EvEJOxzi5jo8avrstKkenFo7pI2FwbN51thNq7B WJeJ5astJkn6Qqo57XrazK93SlqC35k04mXfuY/b2nsKCQLTaYisgxt5TpCVG9CZOj yL2Cc2b3ybOJmnqzAbLcVzF8VM2YHoX+5O7AFG99R1LQTP9aR+RW2pQPKb0uPaiAIM C1ZhqFrfdsjzQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4BzKQK2B8Yz9rxY; Sat, 26 Sep 2020 22:00:25 +0200 (CEST) From: Alexander Egorenkov To: buildroot@buildroot.org Date: Sat, 26 Sep 2020 22:00:21 +0200 Message-Id: <20200926200021.28930-1-egorenar-dev@posteo.net> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/crash: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Egorenkov Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Alexander Egorenkov --- 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 diff --git a/DEVELOPERS b/DEVELOPERS index 9352d891d3..5d0f93d0d4 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -144,6 +144,7 @@ F: package/libuecc/ F: package/putty/ N: Alexander Egorenkov +F: package/crash/ F: package/makedumpfile/ F: package/multipath-tools/ diff --git a/package/Config.in b/package/Config.in index 51583d07d6..9ded2a2b4f 100644 --- a/package/Config.in +++ b/package/Config.in @@ -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" diff --git a/package/crash/0001-Support-cross-compilation.patch b/package/crash/0001-Support-cross-compilation.patch new file mode 100644 index 0000000000..7e1bd3f861 --- /dev/null +++ b/package/crash/0001-Support-cross-compilation.patch @@ -0,0 +1,134 @@ +From 44cb56ad5bbd78203fb6f346299ccfe45f2568fe Mon Sep 17 00:00:00 2001 +From: Alexander Egorenkov +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 +--- + Makefile | 4 ++- + configure.c | 76 ++++++++++++++++++++++++++++------------------------- + 2 files changed, 43 insertions(+), 37 deletions(-) + +diff --git a/Makefile b/Makefile +index 7455410..402be6e 100644 +--- a/Makefile ++++ b/Makefile +@@ -17,6 +17,8 @@ + # GNU General Public License for more details. + # + ++CONF_CC = ${CC} ++ + PROGRAM=crash + + # +@@ -288,7 +290,7 @@ force: + + make_configure: force + @rm -f configure +- @${CC} ${CONF_FLAGS} -o configure configure.c ${WARNING_ERROR} ${WARNING_OPTIONS} ++ @${CONF_CC} ${CONF_FLAGS} -o configure configure.c ${WARNING_ERROR} ${WARNING_OPTIONS} + + clean: make_configure + @./configure ${CONF_TARGET_FLAG} -q -b +diff --git a/configure.c b/configure.c +index 7f6d19e..d736c56 100644 +--- a/configure.c ++++ b/configure.c +@@ -120,6 +120,45 @@ void add_extra_lib(char *); + #define MIPS 11 + #define SPARC64 12 + ++#ifndef CONF_HOST_ARCH ++#ifdef __alpha__ ++#define CONF_HOST_ARCH ALPHA ++#endif ++#ifdef __i386__ ++#define CONF_HOST_ARCH X86 ++#endif ++#ifdef __powerpc__ ++#define CONF_HOST_ARCH PPC ++#endif ++#ifdef __ia64__ ++#define CONF_HOST_ARCH IA64 ++#endif ++#ifdef __s390__ ++#define CONF_HOST_ARCH S390 ++#endif ++#ifdef __s390x__ ++#define CONF_HOST_ARCH S390X ++#endif ++#ifdef __powerpc64__ ++#define CONF_HOST_ARCH PPC64 ++#endif ++#ifdef __x86_64__ ++#define CONF_HOST_ARCH X86_64 ++#endif ++#ifdef __arm__ ++#define CONF_HOST_ARCH ARM ++#endif ++#ifdef __aarch64__ ++#define CONF_HOST_ARCH ARM64 ++#endif ++#ifdef __mips__ ++#define CONF_HOST_ARCH MIPS ++#endif ++#ifdef __sparc_v9__ ++#define CONF_HOST_ARCH SPARC64 ++#endif ++#endif // #ifndef CONF_HOST_ARCH ++ + #define TARGET_X86 "TARGET=X86" + #define TARGET_ALPHA "TARGET=ALPHA" + #define TARGET_PPC "TARGET=PPC" +@@ -349,42 +388,7 @@ get_current_configuration(struct supported_gdb_version *sp) + static char buf[512]; + char *p; + +-#ifdef __alpha__ +- target_data.target = ALPHA; +-#endif +-#ifdef __i386__ +- target_data.target = X86; +-#endif +-#ifdef __powerpc__ +- target_data.target = PPC; +-#endif +-#ifdef __ia64__ +- target_data.target = IA64; +-#endif +-#ifdef __s390__ +- target_data.target = S390; +-#endif +-#ifdef __s390x__ +- target_data.target = S390X; +-#endif +-#ifdef __powerpc64__ +- target_data.target = PPC64; +-#endif +-#ifdef __x86_64__ +- target_data.target = X86_64; +-#endif +-#ifdef __arm__ +- target_data.target = ARM; +-#endif +-#ifdef __aarch64__ +- target_data.target = ARM64; +-#endif +-#ifdef __mips__ +- target_data.target = MIPS; +-#endif +-#ifdef __sparc_v9__ +- target_data.target = SPARC64; +-#endif ++ target_data.target = CONF_HOST_ARCH; + + set_initial_target(sp); + +-- +2.28.0 + diff --git a/package/crash/Config.in b/package/crash/Config.in new file mode 100644 index 0000000000..7372123937 --- /dev/null +++ b/package/crash/Config.in @@ -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 diff --git a/package/crash/crash.hash b/package/crash/crash.hash new file mode 100644 index 0000000000..1a34cf4421 --- /dev/null +++ b/package/crash/crash.hash @@ -0,0 +1,3 @@ +# Locally computed: +sha256 996d3367764c77e23921c164725e4d0221acc7a15a92a3f825053ea37f2452dc crash-7.2.8.tar.gz +sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING3 diff --git a/package/crash/crash.mk b/package/crash/crash.mk new file mode 100644 index 0000000000..d045417a5e --- /dev/null +++ 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 +CRASH_LICENSE_FILES = COPYING3 + +CRASH_GDB_CONF_FLAGS = \ + --host=$(GNU_TARGET_NAME) + +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) +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 + +CRASH_MAKE_OPTS = \ + CONF_CC="$(HOSTCC_NOCCACHE)" \ + CONF_FLAGS="-DCONF_HOST_ARCH=$(CRASH_TARGET)" \ + GDB_CONF_FLAGS="$(CRASH_GDB_CONF_FLAGS)" \ + "gdb_cv_prfpregset_t_broken=no" + +define CRASH_BUILD_CMDS + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \ + $(CRASH_MAKE_OPTS) +endef + +define CRASH_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) install \ + DESTDIR="$(TARGET_DIR)" +endef + +$(eval $(generic-package))