From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uEc2H2LSjmHSCQEAgWs5BA (envelope-from ) for ; Fri, 12 Nov 2021 21:45:22 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id uNr3GmLSjmEGRQAA1q6Kng (envelope-from ) for ; Fri, 12 Nov 2021 20:45:22 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D9BAAE902 for ; Fri, 12 Nov 2021 21:45:21 +0100 (CET) Received: from localhost ([::1]:52700 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mldQG-0001e3-HF for larch@yhetil.org; Fri, 12 Nov 2021 15:45:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mldPy-0001db-WA for guix-patches@gnu.org; Fri, 12 Nov 2021 15:45:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:34515) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mldPy-0008Hi-Nd for guix-patches@gnu.org; Fri, 12 Nov 2021 15:45:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mldPy-0005T2-Ln for guix-patches@gnu.org; Fri, 12 Nov 2021 15:45:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51241] [PATCH v2 1/1] gnu: ragel: Fix build of knot on aarch64-linux. Resent-From: Simon South Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 12 Nov 2021 20:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51241 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51241@debbugs.gnu.org Received: via spool by 51241-submit@debbugs.gnu.org id=B51241.163674990020980 (code B ref 51241); Fri, 12 Nov 2021 20:45:02 +0000 Received: (at 51241) by debbugs.gnu.org; 12 Nov 2021 20:45:00 +0000 Received: from localhost ([127.0.0.1]:46060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mldPw-0005SJ-7l for submit@debbugs.gnu.org; Fri, 12 Nov 2021 15:45:00 -0500 Received: from mailout.easymail.ca ([64.68.200.34]:37408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mldPr-0005Rq-HJ for 51241@debbugs.gnu.org; Fri, 12 Nov 2021 15:44:59 -0500 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 1C8836FF25 for <51241@debbugs.gnu.org>; Fri, 12 Nov 2021 20:44:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at emo05-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo05-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v9lRdokr36YT for <51241@debbugs.gnu.org>; Fri, 12 Nov 2021 20:44:49 +0000 (UTC) Received: from localhost.localdomain (unknown [108.162.141.208]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id C667A70911 for <51241@debbugs.gnu.org>; Fri, 12 Nov 2021 20:44:49 +0000 (UTC) From: Simon South Date: Fri, 12 Nov 2021 15:44:40 -0500 Message-Id: X-Mailer: git-send-email 2.33.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1636749922; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=+SNW+UpcemR4DNYdiqKhA8dF5ghkXle7+xshr8U6SEs=; b=tKwrw9b3r6A51At6CSRX1RNnaRwsbwC5UwMwuZ6zewGHbSTCCGZK3eqORcKtZNc1MQGFyl +YvgS1MSMMVTtS6H7NjBTW3d743xsupnyCkvdCju0nejOfsSHEGdwRHelzorkAQfH+4vYC acUODTYcxU5e82y/as70U0QlK27Gt5Gbd/1cWYLOOtOQQxFzxKENxK4FKnLV4ugAkZ8i5o PmZgDCbqr5FeGQKcI0HzRLvHDkFjz9lZprKuzZQEnzzEzBpxH0ZN9bi5yeETNrXYcA9lb3 Rk2/XdRgy1yTTBu3zfZit7i3EW6S+DAkPXsVbmT3mmfYM2X1jc8113u552iPlg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636749922; a=rsa-sha256; cv=none; b=D3G9eXVi3FnFHtsUYqYD65cU7oK/t+gKKBODOyFF3GQn4GB8gitBjLfHmNTESXzDuosmn9 YHprerSMWcAjnWEHk6cOVDRsN1F9+m8Np6JpXF/GLxrx1jqlPRWVT08E1xZ9fwGRW2aHIw op9zvARBuSLizNRp7lsfkPLfpe1Qh7jtX/yMqLGUEHeO4tAm5kbluoSNxfcldtT8QmB6ak OqWiMma5rp/CWYdIt3V+eh4jafJuqpfqASywF3I2V/y+3uAalQSDdwCTWH9IsXX8Z/aceQ hjAG9UKNb3cVIM7xt2jczkl5Tigy+Myw0bfeWLfbZ5M3upq5uVA7vZ6Qh/ya0A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.53 Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: D9BAAE902 X-Spam-Score: -1.53 X-Migadu-Scanner: scn0.migadu.com X-TUID: 99G+ChxfEhRI Apply a patch backported from Ragel's "ragel-6" branch that allows it to reliably generate usable code on systems such as aarch64-linux where the C/C++ "char" type is unsigned by default, fixing the build of Knot on these systems. * gnu/packages/patches/ragel-decide-signedness-of-char.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/ragel.scm (ragel)[source]: Apply it. --- gnu/local.mk | 1 + .../ragel-decide-signedness-of-char.patch | 42 +++++++++++++++++++ gnu/packages/ragel.scm | 7 +++- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/ragel-decide-signedness-of-char.patch diff --git a/gnu/local.mk b/gnu/local.mk index 208875754b..2b66d7c07c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1717,6 +1717,7 @@ dist_patch_DATA = \ %D%/packages/patches/quassel-qt-514-compat.patch \ %D%/packages/patches/quickswitch-fix-dmenu-check.patch \ %D%/packages/patches/qtwebkit-pbutils-include.patch \ + %D%/packages/patches/ragel-decide-signedness-of-char.patch \ %D%/packages/patches/randomjungle-disable-static-build.patch \ %D%/packages/patches/rapicorn-isnan.patch \ %D%/packages/patches/rapidjson-gcc-compat.patch \ diff --git a/gnu/packages/patches/ragel-decide-signedness-of-char.patch b/gnu/packages/patches/ragel-decide-signedness-of-char.patch new file mode 100644 index 0000000000..b3b2bf958a --- /dev/null +++ b/gnu/packages/patches/ragel-decide-signedness-of-char.patch @@ -0,0 +1,42 @@ +From 2e638fccd81e96ce09841adc4b295b5ce694ea73 Mon Sep 17 00:00:00 2001 +From: Adrian Thurston +Date: Sat, 6 Nov 2021 12:20:05 -0700 +Subject: [PATCH] C char type: decide signedness of char based on CHAR_MIN + +Previously had char fixed to signed char, this is not useful on ARM as it does +not align with the host type. Instead, decide at runtime (or probably compile +time) if char is signed or not. +--- + ragel/common.cpp | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/ragel/common.cpp b/ragel/common.cpp +index 8e9f8ed0..55875c06 100644 +--- a/ragel/common.cpp ++++ b/ragel/common.cpp +@@ -27,14 +27,14 @@ + + HostType hostTypesC[] = + { +- { "char", 0, "char", true, true, false, CHAR_MIN, CHAR_MAX, 0, 0, sizeof(char) }, +- { "unsigned", "char", "uchar", false, true, false, 0, 0, 0, UCHAR_MAX, sizeof(unsigned char) }, +- { "short", 0, "short", true, true, false, SHRT_MIN, SHRT_MAX, 0, 0, sizeof(short) }, +- { "unsigned", "short", "ushort", false, true, false, 0, 0, 0, USHRT_MAX, sizeof(unsigned short) }, +- { "int", 0, "int", true, true, false, INT_MIN, INT_MAX, 0, 0, sizeof(int) }, +- { "unsigned", "int", "uint", false, true, false, 0, 0, 0, UINT_MAX, sizeof(unsigned int) }, +- { "long", 0, "long", true, true, false, LONG_MIN, LONG_MAX, 0, 0, sizeof(long) }, +- { "unsigned", "long", "ulong", false, true, false, 0, 0, 0, ULONG_MAX, sizeof(unsigned long) } ++ { "char", 0, "char", (CHAR_MIN != 0), true, false, SCHAR_MIN, SCHAR_MAX, 0, UCHAR_MAX, sizeof(char) }, ++ { "unsigned", "char", "uchar", false, true, false, 0, 0, 0, UCHAR_MAX, sizeof(unsigned char) }, ++ { "short", 0, "short", true, true, false, SHRT_MIN, SHRT_MAX, 0, 0, sizeof(short) }, ++ { "unsigned", "short", "ushort", false, true, false, 0, 0, 0, USHRT_MAX, sizeof(unsigned short) }, ++ { "int", 0, "int", true, true, false, INT_MIN, INT_MAX, 0, 0, sizeof(int) }, ++ { "unsigned", "int", "uint", false, true, false, 0, 0, 0, UINT_MAX, sizeof(unsigned int) }, ++ { "long", 0, "long", true, true, false, LONG_MIN, LONG_MAX, 0, 0, sizeof(long) }, ++ { "unsigned", "long", "ulong", false, true, false, 0, 0, 0, ULONG_MAX, sizeof(unsigned long) } + }; + + #define S8BIT_MIN -128 +-- +2.33.1 + diff --git a/gnu/packages/ragel.scm b/gnu/packages/ragel.scm index 1d9b67a6e0..8b5100330a 100644 --- a/gnu/packages/ragel.scm +++ b/gnu/packages/ragel.scm @@ -34,7 +34,12 @@ (define-public ragel version ".tar.gz")) (sha256 (base32 - "0gvcsl62gh6sg73nwaxav4a5ja23zcnyxncdcdnqa2yjcpdnw5az")))) + "0gvcsl62gh6sg73nwaxav4a5ja23zcnyxncdcdnqa2yjcpdnw5az")) + (patches + (search-patches + ;; A backported fix for aarch64-linux, where the C/C++ "char" + ;; type is unsigned by default. + "ragel-decide-signedness-of-char.patch")))) (build-system gnu-build-system) (home-page "https://www.colm.net/open-source/ragel/") (synopsis "State machine compiler") -- 2.33.1