Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3301707ybl; Sun, 11 Aug 2019 20:34:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqh6CPNZAvRpuR0fnd5D8mAQFf/aNnoy7VQqAa2eLq25PCb75gCTIxPIBXVPDtLtCV0RuM X-Received: by 2002:a62:db43:: with SMTP id f64mr17583485pfg.38.1565580864206; Sun, 11 Aug 2019 20:34:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565580864; cv=none; d=google.com; s=arc-20160816; b=EW9PAJkQavHRS48ylgcnZw7QSkCPBaeSbsLz85rUcmecOnW2cSfNpXxye3PKSOUl4z 5mSej+YZRZDHsmU31TB0DJ2WFJ5igqUgUCceb8v9VNuD2h3VFvHoic2eKlmenM4P6T7C cmdBM2yo3D9/7517bZOnGZ+GWcSqcmdOyHrFWA/9GCvYUf9LP7PnkFWAk5GhUL0e1xqG M7Ng8H5fTnQ6Ds+aMVygHY7KWp0ss9kHzaxvQW063l0ntnCT5TH1+mMxMzLyelxGSFmp c0c5q8IQPHQ/wtTDuhkSUyyGohp585HLNqqHuqTFlGTDB3o293hJWgbwGkRZXAbb2NkF m7sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pX+X19b0YkyFPAZFTnPH3TVfzRvutgNdCw+9iXgOsdU=; b=GEz7mvaEU3ZOQ/wTmm7IgV/wBZ9F27ztSxbmO/OnQW/yoqs2BUDNo+UBLSwfkBH/2F aOYc9AgMs0v4ZkbBabQP43B9cBQRyxHR31iGJao6hY86t0tLuFSlJHIALIcSUIvVy8a3 k1YZNRi2lyLceRhmiIGSZdaZpL2uKI0r3ot2GYkGxtDYZJ2Lk47TV12jbdQsU+f8g0x2 oZIAuTO9rHQXMEiiE2oToeW+/0nc0NF3tGL7catYZwkatK66fb4yIPcunoMAKiPlvpeK qd0dLPKB1MfSnXMtiWAiyShF01NAXOUfUNNT+Jq8eegAo9nR1mpYYiyLGHV6m+UYXVgX Hh/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Lpamp3vw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1si10383142pjq.17.2019.08.11.20.34.09; Sun, 11 Aug 2019 20:34:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Lpamp3vw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726770AbfHLDbi (ORCPT + 99 others); Sun, 11 Aug 2019 23:31:38 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:40379 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726602AbfHLDbg (ORCPT ); Sun, 11 Aug 2019 23:31:36 -0400 Received: by mail-wr1-f65.google.com with SMTP id r1so4223967wrl.7; Sun, 11 Aug 2019 20:31:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pX+X19b0YkyFPAZFTnPH3TVfzRvutgNdCw+9iXgOsdU=; b=Lpamp3vwhT6x6dNvYdI8KXfkPXFp3I/7a5n3xAvi8vvW7qbgTAiRVJVwHcBDS0QT17 6K58SPa1RiEEEUerqHKSs3K0Lcfl1g7mp4QgrtoFF/YsJDlcPLQ78v2SLYSiits6PD+e 9I2LL3B5b0nW6hNNgH9oXaoTmGOtmr6Jwa4MQ9OlmFBzxjTMopq6O7L3DteVnyvWtGBQ GvDlBFM0+e/a7Yb0p7ReWk+e/EtcPT8QoxMylka6UUGkfwEU/Ib3KkwVmgSevFJ/gKYS 5f/sJEZw9Xnqsj45MH7KLCLuNwP/XAIc3NNy3thRGB5XY/98q2i8AzpqiiJbk9yakcpI 99FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pX+X19b0YkyFPAZFTnPH3TVfzRvutgNdCw+9iXgOsdU=; b=AhaiZJIOAXmG4WC9vVgIMoA6W6T+pt9DsRXEMUZn819aDLjBCpPF8dVurg7KF+GAyp IYp9eslQ9CjoHojtdt64oe7AeljA+aPeqe3/TZEuYZ8Ir0FqIVKwWG590newTqmYqXEw 5FdVnVoTs9H5yhunX8JippNxlQz2aXTibtKlk4qXRfIdK6gdfyJYgxquFRxbL7Oax2DN ZVG3be+fi0zOolSdgzfgyV4NCgFdonlomWfG/SfU7pb6CBpDjTEqZ3o1mG7jnwobu7x0 qirQerJ9TaHAy0AeT3BiL3vDeZEhww67oFQ1b3Dp+TmkKrLy4LL5vbtJTLdS7w/eF86s Srdw== X-Gm-Message-State: APjAAAWD61mRgWYn+E/7qjTguFCtqPyxOJPF0h07OgaLeMgTgIUnlSI7 u3bHiV43kEATLMcwy8IUvKU= X-Received: by 2002:adf:b613:: with SMTP id f19mr5713852wre.192.1565580694370; Sun, 11 Aug 2019 20:31:34 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:222:2f1b::2]) by smtp.gmail.com with ESMTPSA id f12sm117299330wrg.5.2019.08.11.20.31.33 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 11 Aug 2019 20:31:33 -0700 (PDT) From: Nathan Chancellor To: Ralf Baechle , Paul Burton , James Hogan Cc: Nick Desaulniers , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Vladimir Serbinenko , Jussi Kivilinna , Nathan Chancellor Subject: [PATCH 3/5] lib/mpi: Fix for building for MIPS32 with Clang Date: Sun, 11 Aug 2019 20:31:18 -0700 Message-Id: <20190812033120.43013-4-natechancellor@gmail.com> X-Mailer: git-send-email 2.23.0.rc2 In-Reply-To: <20190812033120.43013-1-natechancellor@gmail.com> References: <20190812033120.43013-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vladimir Serbinenko clang doesn't recognise =l / =h assembly operand specifiers but apparently handles C version well. lib/mpi/generic_mpih-mul1.c:37:24: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb); ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ lib/mpi/longlong.h:652:20: note: expanded from macro 'umul_ppmm' : "=l" ((USItype)(w0)), \ ~~~~~~~~~~^~~ lib/mpi/generic_mpih-mul1.c:37:3: error: invalid output constraint '=h' in asm umul_ppmm(prod_high, prod_low, s1_ptr[j], s2_limb); ^ lib/mpi/longlong.h:653:7: note: expanded from macro 'umul_ppmm' "=h" ((USItype)(w1)) \ ^ 2 errors generated. Fixes: 5ce3e312ec5c ("crypto: GnuPG based MPI lib - header files (part 2)") Link: https://github.com/ClangBuiltLinux/linux/issues/605 Link: https://github.com/gpg/libgcrypt/commit/1ecbd0bca31d462719a2a6590c1d03244e76ef89 Signed-off-by: Vladimir Serbinenko [jk: add changelog, rebase on libgcrypt repository, reformat changed line so it does not go over 80 characters] Signed-off-by: Jussi Kivilinna [nc: Added build error and tags to commit message Added Vladimir's signoff with his permission Adjusted Jussi's comment to wrap at 73 characters Modified commit subject to mirror MIPS64 commit Removed space between defined and (__clang__)] Signed-off-by: Nathan Chancellor --- lib/mpi/longlong.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h index 3bb6260d8f42..8a1507fc94dd 100644 --- a/lib/mpi/longlong.h +++ b/lib/mpi/longlong.h @@ -639,7 +639,8 @@ do { \ ************** MIPS ***************** ***************************************/ #if defined(__mips__) && W_TYPE_SIZE == 32 -#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4) +#if defined(__clang__) || (__GNUC__ >= 5) || (__GNUC__ == 4 && \ + __GNUC_MINOR__ >= 4) #define umul_ppmm(w1, w0, u, v) \ do { \ UDItype __ll = (UDItype)(u) * (v); \ -- 2.23.0.rc2