Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp338857ybi; Fri, 21 Jun 2019 00:15:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDzdp2TBQploVuC0MEY4ES3iOV/yYNunDWPtQg4t7S8PB3gcOR1/ocTmpmtNv7k5ZJf/pT X-Received: by 2002:a17:90a:a385:: with SMTP id x5mr4582906pjp.76.1561101304694; Fri, 21 Jun 2019 00:15:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561101304; cv=none; d=google.com; s=arc-20160816; b=ygVLxefEkwajP+WOU58Hjuz+fmZc7/rJx9X29015T2U5HbkkCtOMeczLsrkSzRZPvA wz7tcM+xXNIH+0MqQzgGdXEpY0onETo+xZso55egl81DY0BgNK27ngDdf3SbdTSvUxW/ JOndjBGEfv2vxsbEutc2bBSu+iDEiCZHlmVUyWouPFO5yYdYpFyI3VOsBAgBxQEOpUY6 HQ3CeB+uGEOQHvcqHtn6E4KOtXkmo84m5Bq4V8eiD9YAxMvqixBnxBxpwug0jN9aeVE2 R3Z73zV8qqcFVzEQVQ9gOWVmcMhjM9sN1J2xq2GRXFrHzhYGQAo8MwlHB4dkOOXBqLAq X0Cg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=1XT/pfvoYcCU99F59K2rs15fGDiUVH52ZV6XFVTDAZg=; b=kZS/9/r9R0gFxLuhdwR1gAxIGPR/ZpK3ysEFhyjrN/6iGDSUGJkIEYJdX7twYTNLQ4 Cog6l8rzulKQvZcgLayWK+D1LPr3CQm1LN4u1C5Cd+woCxpdhT0kzgXrKjg2WH3kCPtW 8RDkHy4QImMtcvuCJ9uX2q6dlVfFM6ik10TAlkN0tq2K51y2pKiLR9IeKKdev5x8JNX+ 8kxkkT+73GfH25PsKq16vGABnVCkMq2MfK7Sj3TeYFZQZCnDzQuRF+vSHscYMu3mUFY/ NRksRC5v/cmu3qxFLZgcaZW5DM/TIz0bImWeDyB3XRu11ZNS/eppneg8eJtcO+S17YDK FFow== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=FNHPZJQT; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p24si1847368plr.255.2019.06.21.00.14.49; Fri, 21 Jun 2019 00:15:04 -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=fail header.i=@gmail.com header.s=20161025 header.b=FNHPZJQT; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726209AbfFUHN4 (ORCPT + 99 others); Fri, 21 Jun 2019 03:13:56 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:34599 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbfFUHNz (ORCPT ); Fri, 21 Jun 2019 03:13:55 -0400 Received: by mail-wr1-f66.google.com with SMTP id k11so5475679wrl.1 for ; Fri, 21 Jun 2019 00:13:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1XT/pfvoYcCU99F59K2rs15fGDiUVH52ZV6XFVTDAZg=; b=FNHPZJQT0oP/iQev1yEfbzz7TBuZfZ/U6l19Qs+u5B4uUVILUj88XveLBnE1cP7phD avkhrE2Nk/QJZ5WTFd9XtYLs8i2uMGwzJog4716PxM9t1zTTHSm08eZ2djwc6Ey6xNVK ysMqi/6adk3t9hKFEV0mEDjWFJKoa4qeHjIzhil/lLLR6ipm+rV9Rb5RiYQJNc3+zHZg 71MlXZ4N8KghHFoGBeSAc4jjai+PyXVFVf7/goaDUPZSUgPVgquWFPoyCg/TBXPLaQJ4 RwmPH2Ez8uxL58aVivHwpMCDxRASNQiqvVkqNa2F0axmXHDjvBdYY8itTDMKcbRTJvH8 oIoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=1XT/pfvoYcCU99F59K2rs15fGDiUVH52ZV6XFVTDAZg=; b=tP0iry0NzHGS6TbzkuIgKfsA0e1NQzvHmyi9apBQsjEiLZX8bGcRJ/kgzJ08GtwCtP qtYdc4JnONpZGQNWKDzTIMaKhKy+WiEuGt7wZZtRWZD1QREzGUhxaMMuRGQb/vQTc6sc BnZyDK4KS63Wz6Wg5TOQXgzKWwAbST6snRrWy5RMJoyIRwD1WWX7qz2OeUr2dUTPzPTE 4PjhdGgMP3VJwQZMCCLfpL/FMSDOkp11OOBdlmd+EjKLFy4+KISe5SALl7LyDKkZ9mYq BPv8u50WOQsi9T03fXMsoXkO+82izRVmT9CjearltItuGfc2eqdFofbsri2W5KotR9jv GXFg== X-Gm-Message-State: APjAAAU+ER0HW0aJ7bBj3NDSCZtbErBs36bCGn3c5hHIEoRsqxDpx29M 2l248zEtp2sBpsXOfeQsOrU= X-Received: by 2002:a5d:65c5:: with SMTP id e5mr39709226wrw.266.1561101233750; Fri, 21 Jun 2019 00:13:53 -0700 (PDT) Received: from macbookpro.malat.net (bru31-1-78-225-224-134.fbx.proxad.net. [78.225.224.134]) by smtp.gmail.com with ESMTPSA id b2sm2202403wrp.72.2019.06.21.00.13.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 21 Jun 2019 00:13:53 -0700 (PDT) Received: by macbookpro.malat.net (Postfix, from userid 1000) id E9CBB11459C7; Fri, 21 Jun 2019 09:13:51 +0200 (CEST) From: Mathieu Malaterre To: Dmitry Kasatkin Cc: Mathieu Malaterre , Joel Stanley , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH] crypto: Fix build for clang Date: Fri, 21 Jun 2019 09:13:42 +0200 Message-Id: <20190621071342.17897-1-malat@debian.org> X-Mailer: git-send-email 2.20.1 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 The header file `longlong.h` makes uses of GNU extensions, this trigger an error when compiling this code with clang. Add a special flag to make clang tolerate this syntax. Silence the following warnings triggered using W=1: CC lib/mpi/generic_mpih-mul1.o ../lib/mpi/generic_mpih-mul1.c:37:13: 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:824:20: note: expanded from macro 'umul_ppmm' : "=r" ((USItype) ph) \ ~~~~~~~~~~^~ and CC lib/mpi/generic_mpih-mul2.o ../lib/mpi/generic_mpih-mul2.c:36:13: 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:824:20: note: expanded from macro 'umul_ppmm' : "=r" ((USItype) ph) \ ~~~~~~~~~~^~ 1 warning generated. CC lib/mpi/generic_mpih-mul3.o ../lib/mpi/generic_mpih-mul3.c:36:13: 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:824:20: note: expanded from macro 'umul_ppmm' : "=r" ((USItype) ph) \ ~~~~~~~~~~^~ Or even: ../lib/mpi/mpih-div.c:99:16: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions sub_ddmmss(n1, n0, n1, n0, d1, d0); ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~ Cc: Joel Stanley Cc: Masahiro Yamada Signed-off-by: Mathieu Malaterre --- lib/mpi/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/mpi/Makefile b/lib/mpi/Makefile index d5874a7f5ff9..de4d96e988a3 100644 --- a/lib/mpi/Makefile +++ b/lib/mpi/Makefile @@ -5,6 +5,13 @@ obj-$(CONFIG_MPILIB) = mpi.o +ifdef CONFIG_CC_IS_CLANG +CFLAGS_generic_mpih-mul1.o += -fheinous-gnu-extensions +CFLAGS_generic_mpih-mul2.o += -fheinous-gnu-extensions +CFLAGS_generic_mpih-mul3.o += -fheinous-gnu-extensions +CFLAGS_mpih-div.o += -fheinous-gnu-extensions +endif + mpi-y = \ generic_mpih-lshift.o \ generic_mpih-mul1.o \ -- 2.20.1