From owner-freebsd-drivers@freebsd.org Wed Jun 17 01:53:58 2020 Return-Path: Delivered-To: freebsd-drivers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5CE233E693; Wed, 17 Jun 2020 01:53:58 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49mp5K3KtZz45r9; Wed, 17 Jun 2020 01:53:57 +0000 (UTC) (envelope-from rajfbsd@gmail.com) Received: by mail-wm1-x344.google.com with SMTP id t194so302517wmt.4; Tue, 16 Jun 2020 18:53:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=6PduLYl0E/uXBeZ4Ru83tEmhhHQtCwscThVsc8amwIM=; b=bTRUxKGWtbddqUqNu86fn8m5+JhV2vneNZeIVtU/P5c4F5iTgkC/oiY5XH6qiNVl0O bbUX1XEPCG/ItStmpQNU0Wvz+mf0dkbb3SHw9Ubhk/yTHkcowxzWid31QnweCrKdwGlP /Axtv/4CYqHlFtJpnOcCp0m2FxLN+8c9nLdJXt9Xrut1CmDoqaP9JYEdrj5bUOFIjwY7 SRaDUoEQzvViJlHhUdh0tZNNyxhEqGBRQJAIK4VSgc6GU1BMhgUqT+yroG9eM/Nf8tHj Nqq0Nl40dkAw4QTSGdjaumETp1E+XgY0dQ8Yib0Le+cZepAT1/lOpDIK4sxhSoIYfQjU cWlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=6PduLYl0E/uXBeZ4Ru83tEmhhHQtCwscThVsc8amwIM=; b=KQxS5MjDaQ2iD8NFPF14DUjaJEjf48CHFYZHNOSRQiG/SmIUvxgkJs5w7tKjhu+4XX zkUHJI2ZVxzBe6oYP/lTwRRb7g8Ty20G6bw4KSP3IjX64vDTHbr/FFYD6P8IA+c84TgG 6azYDu40I04k+6eZQ9QIOmy9wYqF4iyLDuhTlZzlxTaYB0kOBgmxemBK742BAaNECnLd LkL13vjFIvNWdIgaS2ICU8g03eX2TzzJRWAHnG3k2SbtWerTdACVJHTJVNWUMmeMK3Jv b4j0CFsQ+WQBDMr6VEu7hWjw/NEkja9snoQAugUKNxMqT73GvJKW0Ge19BxAu2lPFrr7 Kdig== X-Gm-Message-State: AOAM533x+pQcFrgSwoeUDHqJuhzojiLpm4DggLenr0PXs+0jgPA6/cgH QtJGPdI7/z3Mpo8zgE5LLsx8fhil6ykSt21zHECS7nIr X-Google-Smtp-Source: ABdhPJzzEMT2htPSQdjbbFdHOJuY1mNFcZI7evCb+BPT0rMCHWv4H0h8XRgo3XtLRB2V4gh/YycU+Ml+fhVZlYol6dE= X-Received: by 2002:a1c:2644:: with SMTP id m65mr5794517wmm.178.1592358835795; Tue, 16 Jun 2020 18:53:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Rajesh Kumar Date: Wed, 17 Jun 2020 07:23:44 +0530 Message-ID: Subject: Re: Building modules gives error: "invalid output constraint '=@cce' in asm" To: freebsd-current@freebsd.org, freebsd-drivers@freebsd.org X-Rspamd-Queue-Id: 49mp5K3KtZz45r9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=bTRUxKGW; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rajfbsd@gmail.com designates 2a00:1450:4864:20::344 as permitted sender) smtp.mailfrom=rajfbsd@gmail.com X-Spamd-Result: default: False [-2.95 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.88)[-0.881]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.987]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; DKIM_TRACE(0.00)[gmail.com:+]; MIME_BASE64_TEXT(0.10)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::344:from]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.18)[-0.184]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 01:53:58 -0000 Hi, Has anyone faced a similar issue? I had a 12.0-RELEASE kernel earlier. I cloned the master branch and built world, built kernel and installed kernel with a different kernel name (INSTKERNNAME) and rebooted the machine and see it booting to 13.0-CURRENT as expected. Then, I am trying to compile the driver modules and hit the compilation error. I haven't done "install world" as I don't want the base 12.0 to be disturbed. When I compared the /usr/include/machine/atomic.h and the atomic.h from the OBJ directory, I see the below highlighted change. Looks like, building module is trying to use the headers in OBJ directory as expected, but hitting the compilation issue. *12.0 base installation atomic.h* static __inline int \ atomic_fcmpset_##TYPE(volatile u_##TYPE *dst, u_##TYPE *expect, u_##TYPE src) \ { \ u_char res; \ \ __asm __volatile( \ " " MPLOCKED " " \ " cmpxchg %3,%1 ; " \ " sete %0 ; " \ "# atomic_fcmpset_" #TYPE " " \ *: "=q" (res), /* 0 */ \ * "+m" (*dst), /* 1 */ \ "+a" (*expect) /* 2 */ \ : "r" (src) /* 3 */ \ : "memory", "cc"); \ return (res); \ } *13.0- CURRENT atomic.h in OBJ dir* static __inline int \ atomic_fcmpset_##TYPE(volatile u_##TYPE *dst, u_##TYPE *expect, u_##TYPE src) \ { \ u_char res; \ \ __asm __volatile( \ " " MPLOCKED " " \ "# atomic_fcmpset_" #TYPE " " \ *: "=@cce" (res), /* 0 */ \* "+m" (*dst), /* 1 */ \ "+a" (*expect) /* 2 */ \ : "r" (src) /* 3 */ \ : "memory", "cc"); \ return (res); \ } Any clue would be really helpful? Thanks, Rajesh On Tue, Jun 16, 2020 at 12:29 PM Rajesh Kumar wrote: > Hi, > > I am trying to build my module with freebsd current branch. But I am > facing compilation issue with header files as below. I have built and > installed the freebsd current branch and booted to that kernel before > building my module. So, not sure what is going wrong. > > > > > > > *In file included from > /root//freebsd_current/sys/sys/systm.h:44:./machine/atomic.h:230:1: error: > invalid output constraint '=@cce' in > asmATOMIC_CMPSET(char);^./machine/atomic.h:205:4: note: expanded from macro > 'ATOMIC_CMPSET' : "=@cce" (res), /* 0 */ \* > > Am I missing something? > > Thanks, > Rajesh. >