From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] eal/x86: fix clang build with -O0 Date: Fri, 03 Jun 2016 10:46:44 +0200 Message-ID: <21865506.clYb8lqSiq@xps13> References: <1464941723-18154-1-git-send-email-thomas.monjalon@6wind.com> <57513CE3.60506@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: Olivier MATZ , Damjan Marion To: dev@dpdk.org Return-path: Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by dpdk.org (Postfix) with ESMTP id 404145686 for ; Fri, 3 Jun 2016 10:46:47 +0200 (CEST) Received: by mail-wm0-f48.google.com with SMTP id n184so115112370wmn.1 for ; Fri, 03 Jun 2016 01:46:47 -0700 (PDT) In-Reply-To: <57513CE3.60506@6wind.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-06-03 10:16, Olivier MATZ: > On 06/03/2016 10:15 AM, Thomas Monjalon wrote: > > From: Damjan Marion > > > > Clang seems to have a bug with asm inside inline function rte_xabort(): > > > > rte_rtm.h:56:15: error: invalid operand for inline asm constraint 'i' > > asm volatile(".byte 0xc6,0xf8,%P0" :: "i" (status) : "memory"); > > ^ > > > > It is seen only when building with EXTRA_CFLAGS=-O0. > > > > The workaround is to replace the inline function by a macro. > > > > Fixes: ba7468997ea6 ("spinlock: add HTM lock elision for x86") > > > > Signed-off-by: Damjan Marion > > Signed-off-by: Thomas Monjalon > > Generally speaking, it's not a good idea to replace a static inline by a > macro because it relaxes type checking. Looks ok in that case to > workaround the clang issue. > > Acked-by: Olivier Matz Thanks, This patch has been appplied very quickly for the purpose of a live demo at a VPP event: https://wiki.fd.io/view/Events