From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KOv0Mw4Ha2HbsAAAgWs5BA (envelope-from ) for ; Sat, 16 Oct 2021 19:08:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id sF6ALw4Ha2HrJgAAbx9fmQ (envelope-from ) for ; Sat, 16 Oct 2021 17:08:30 +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 6E1AF2F658 for ; Sat, 16 Oct 2021 19:08:30 +0200 (CEST) Received: from localhost ([::1]:58998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mbnAb-0005Yv-Gr for larch@yhetil.org; Sat, 16 Oct 2021 13:08:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbnAB-0005Xn-M5 for guix-patches@gnu.org; Sat, 16 Oct 2021 13:08:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59661) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mbnAB-0007p0-BP for guix-patches@gnu.org; Sat, 16 Oct 2021 13:08:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mbnAB-0002af-5q for guix-patches@gnu.org; Sat, 16 Oct 2021 13:08:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51241] [PATCH 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: Sat, 16 Oct 2021 17:08:03 +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.16344040329838 (code B ref 51241); Sat, 16 Oct 2021 17:08:03 +0000 Received: (at 51241) by debbugs.gnu.org; 16 Oct 2021 17:07:12 +0000 Received: from localhost ([127.0.0.1]:42958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbn9L-0002Yc-QE for submit@debbugs.gnu.org; Sat, 16 Oct 2021 13:07:12 -0400 Received: from mailout.easymail.ca ([64.68.200.34]:34250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mbn9J-0002YN-Jt for 51241@debbugs.gnu.org; Sat, 16 Oct 2021 13:07:10 -0400 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id B8EFEA94EE for <51241@debbugs.gnu.org>; Sat, 16 Oct 2021 17:07:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at emo04-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo04-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2EWHH_Yvp79O for <51241@debbugs.gnu.org>; Sat, 16 Oct 2021 17:07:03 +0000 (UTC) Received: from localhost.localdomain (unknown [108.162.141.208]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 747D9A8DDA for <51241@debbugs.gnu.org>; Sat, 16 Oct 2021 17:07:03 +0000 (UTC) From: Simon South Date: Sat, 16 Oct 2021 13:06:39 -0400 Message-Id: <8d3c7556a41b12a899c52181a5f6689111f036b4.1634402642.git.simon@simonsouth.net> X-Mailer: git-send-email 2.25.2 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1634404110; 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=D7fG+UyaBchPhMQp9Wzj7hkcX4b5sZpy3X12uTm2tyw=; b=TyekW2f9J8x9NO7MooUNlMCKyagZfgJNaVWhSh3itX+ImsMUvFhyKNQYtM9lZI/bhX1kFP Y8141snxiB0uYMkKPuJhG6FcVITp+CnwaRxYXaCuiiNE92K6TfSC0X/C6orOiG2Az57+8/ VqEM5RNrHoY24Gr+6TesGKuhRHywZVHLyBaoP2tN87v8c482TG1aQLt9GaqJwKPMkE8Onn xANguDHK4ejw+XAfO/CiD/3LgzqKvGjV7r/qdyifH1fbiYwoVbjHzWCd+Y3tktboU4HJnQ VzGqYhnGlH0jMaZ5xp7s+N/6nwRwglGMzMrHtRlspNoiNmlKJ2s+80ZxZhJDJg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1634404110; a=rsa-sha256; cv=none; b=peqb3x3qpCPA1xNsOql8wOzwEs2ZZvXMibSiLvLEJwrK6ZhcyKAxC61omWWeSbbgbUzNFl mBKE7dbEq7jWgX5T3P36CkVNiG+rkcPKBCC2PzLDgj09IqPVGISMwCsPCEdx8wXUFrr6Ia FZx5kaL2JtPN8aXZ6aos0+V6Eo06J/S9PMoExfWRl/bGApJ7vLcBd9J1xTjZr+CnJqRmzo XFPQyUzpQiG3Om78aZHBhaa05Ojd7ElRkp4hSHX6ReSfUinEuMA+FFm0OH7NoQ75ov2T3A MrrPbWhgGOdYFq8dNSS0FQ9Vs7C9DKzJN2+UvA6rDakcIGY1fHUdL8ckSGui3A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 2.58 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 6E1AF2F658 X-Spam-Score: 2.58 X-Migadu-Scanner: scn0.migadu.com X-TUID: pwDBlL4JROeB Make explicit Ragel's assumption of the "char" type being signed on both its build and target platforms, allowing the current version of Knot and perhaps other dependent packages to build successfully on aarch64-linux where "char" is unsigned by default. * gnu/packages/patches/ragel-specify-char-signedness.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/ragel.scm (ragel)[source]: Apply it. --- gnu/local.mk | 1 + .../ragel-specify-char-signedness.patch | 58 +++++++++++++++++++ gnu/packages/ragel.scm | 4 +- 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/ragel-specify-char-signedness.patch diff --git a/gnu/local.mk b/gnu/local.mk index d1803e7f59..a4dd01a40f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1716,6 +1716,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-specify-char-signedness.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-specify-char-signedness.patch b/gnu/packages/patches/ragel-specify-char-signedness.patch new file mode 100644 index 0000000000..fccb79d432 --- /dev/null +++ b/gnu/packages/patches/ragel-specify-char-signedness.patch @@ -0,0 +1,58 @@ +Ragel assumes C and C++'s "char" type is signed by default but this is not +true for every architecture gcc supports. Prevent build failures of dependent +packages (on architectures such as AArch64 where "char" is normally unsigned) +by making explicit Ragel's assumption of character signedness. + +This is functionally very similar to upstream commit e2650a7, "common: Fix +ambiguous CHAR_MIN/MAX definition", which is also meant to address this issue. +However this patch applies to Ragel version 6 and it removes altogether the +ambiguous "char" type from generated C code, causing Ragel to instead specify +"signed char" or "unsigned char" as appropriate. + +diff --git a/ragel/common.cpp b/ragel/common.cpp +index 8e9f8ed0..649f388c 100644 +--- a/ragel/common.cpp ++++ b/ragel/common.cpp +@@ -27,7 +27,7 @@ + + HostType hostTypesC[] = + { +- { "char", 0, "char", true, true, false, CHAR_MIN, CHAR_MAX, 0, 0, sizeof(char) }, ++ { "signed", "char", "char", true, true, false, SCHAR_MIN, SCHAR_MAX, 0, 0, sizeof(signed 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) }, +@@ -66,7 +66,7 @@ HostType hostTypesC[] = + + HostType hostTypesD[] = + { +- { "byte", 0, "byte", true, true, false, CHAR_MIN, CHAR_MAX, 0, 0, 1 }, ++ { "byte", 0, "byte", true, true, false, SCHAR_MIN, SCHAR_MAX, 0, 0, 1 }, + { "ubyte", 0, "ubyte", false, true, false, 0, 0, 0, UCHAR_MAX, 1 }, + { "char", 0, "char", false, true, false, 0, 0, 0, UCHAR_MAX, 1 }, + { "short", 0, "short", true, true, false, SHRT_MIN, SHRT_MAX, 0, 0, 2 }, +@@ -93,7 +93,7 @@ HostType hostTypesGo[] = + + HostType hostTypesJava[] = + { +- { "byte", 0, "byte", true, true, false, CHAR_MIN, CHAR_MAX, 0, 0, 1 }, ++ { "byte", 0, "byte", true, true, false, SCHAR_MIN, SCHAR_MAX, 0, 0, 1 }, + { "short", 0, "short", true, true, false, SHRT_MIN, SHRT_MAX, 0, 0, 2 }, + { "char", 0, "char", false, true, false, 0, 0, 0, USHRT_MAX, 2 }, + { "int", 0, "int", true, true, false, INT_MIN, INT_MAX, 0, 0, 4 }, +@@ -102,13 +102,13 @@ HostType hostTypesJava[] = + /* What are the appropriate types for ruby? */ + HostType hostTypesRuby[] = + { +- { "char", 0, "char", true, true, false, CHAR_MIN, CHAR_MAX, 0, 0, 1 }, ++ { "char", 0, "char", true, true, false, SCHAR_MIN, SCHAR_MAX, 0, 0, 1 }, + { "int", 0, "int", true, true, false, INT_MIN, INT_MAX, 0, 0, 4 }, + }; + + HostType hostTypesCSharp[] = + { +- { "sbyte", 0, "sbyte", true, true, false, CHAR_MIN, CHAR_MAX, 0, 0, 1 }, ++ { "sbyte", 0, "sbyte", true, true, false, SCHAR_MIN, SCHAR_MAX, 0, 0, 1 }, + { "byte", 0, "byte", false, true, false, 0, 0, 0, UCHAR_MAX, 1 }, + { "short", 0, "short", true, true, false, SHRT_MIN, SHRT_MAX, 0, 0, 2 }, + { "ushort", 0, "ushort", false, true, false, 0, 0, 0, USHRT_MAX, 2 }, diff --git a/gnu/packages/ragel.scm b/gnu/packages/ragel.scm index 1d9b67a6e0..e3fc980bd7 100644 --- a/gnu/packages/ragel.scm +++ b/gnu/packages/ragel.scm @@ -34,7 +34,9 @@ (define-public ragel version ".tar.gz")) (sha256 (base32 - "0gvcsl62gh6sg73nwaxav4a5ja23zcnyxncdcdnqa2yjcpdnw5az")))) + "0gvcsl62gh6sg73nwaxav4a5ja23zcnyxncdcdnqa2yjcpdnw5az")) + (patches + (search-patches "ragel-specify-char-signedness.patch")))) (build-system gnu-build-system) (home-page "https://www.colm.net/open-source/ragel/") (synopsis "State machine compiler") -- 2.33.0