From owner-svn-src-head@freebsd.org Tue Jun 2 10:35:31 2020 Return-Path: Delivered-To: svn-src-head@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 4EAE0330FE4; Tue, 2 Jun 2020 10:35:31 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49bpN21J8fz4S9k; Tue, 2 Jun 2020 10:35:29 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1591094128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ic+t1sws3DG9eYrjYvFUFRbETuy/WoOY9I1lV521NgU=; b=WH2q1DhNGnOWvZewvSvTfpa0qn/X2Z7NCRHdSRndP5Ya/4NdHePdiW3wyk4dVZkV4JVClz UXNLl8V+/B2TWvrseK/PGsd6AtbVpnaLJz8N4vvAJt2Tkg6bWO+sr3ucjzMr8ndcRyZlVs rdbQaKypuBNKmDTR82DvbYn4UkIgPCs= Received: from skull.home.blih.net (lfbn-idf2-1-900-181.w86-238.abo.wanadoo.fr [86.238.131.181]) by mx.blih.net (OpenSMTPD) with ESMTPSA id dc3b548b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 2 Jun 2020 10:35:28 +0000 (UTC) Date: Tue, 2 Jun 2020 12:35:28 +0200 From: Emmanuel Vadot To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361722 - head/sys/compat/linuxkpi/common/include/linux Message-Id: <20200602123528.44c55539be28f1b48740ca76@bidouilliste.com> In-Reply-To: <202006020945.0529jiWs041821@repo.freebsd.org> References: <202006020945.0529jiWs041821@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49bpN21J8fz4S9k X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=WH2q1DhN; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-2.56 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.04)[-1.036]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.02)[-1.017]; DKIM_TRACE(0.00)[bidouilliste.com:+]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; NEURAL_HAM_SHORT(-0.01)[-0.008]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2020 10:35:31 -0000 Hello Hans, On Tue, 2 Jun 2020 09:45:44 +0000 (UTC) Hans Petter Selasky wrote: > Author: hselasky > Date: Tue Jun 2 09:45:43 2020 > New Revision: 361722 > URL: https://svnweb.freebsd.org/changeset/base/361722 > > Log: > Implement BUILD_BUG_ON_ZERO() in the LinuxKPI. > Tested using gcc and clang. > > MFC after: 1 week > Sponsored by: Mellanox Technologies > > Modified: > head/sys/compat/linuxkpi/common/include/linux/kernel.h > > Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h > ============================================================================== > --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Jun 2 03:44:22 2020 (r361721) > +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Tue Jun 2 09:45:43 2020 (r361722) > @@ -94,6 +94,9 @@ > #define BUILD_BUG_ON_NOT_POWER_OF_2(x) BUILD_BUG_ON(!powerof2(x)) > #define BUILD_BUG_ON_INVALID(expr) while (0) { (void)(expr); } > > +extern const volatile int lkpi_build_bug_on_zero; > +#define BUILD_BUG_ON_ZERO(x) ((x) ? lkpi_build_bug_on_zero : 0) > + > #define BUG() panic("BUG at %s:%d", __FILE__, __LINE__) > #define BUG_ON(cond) do { \ > if (cond) { \ That doesn't work for drm-kmod. One example of error : --- intel_display.o --- /usr/home/manu/Work/freebsd/drm-kmod/drivers/gpu/drm/i915/intel_display.c:14804:38: error: implicit declaration of function '__is_constexpr' is invalid in C99 [-Werror,-Wimplicit-function-declaration] val = (val & ~PANEL_UNLOCK_MASK) | PANEL_UNLOCK_REGS; ^ /usr/home/manu/Work/freebsd/drm-kmod/drivers/gpu/drm/i915/i915_reg.h:4770:29: note: expanded from macro 'PANEL_UNLOCK_REGS' #define PANEL_UNLOCK_REGS REG_FIELD_PREP(PANEL_UNLOCK_MASK, 0xabcd) ^ /usr/home/manu/Work/freebsd/drm-kmod/drivers/gpu/drm/i915/i915_reg.h:164:28: note: expanded from macro 'REG_FIELD_PREP' BUILD_BUG_ON_ZERO(!__is_constexpr(__mask)) + \ ^ /usr/home/manu/Work/freebsd/drm-kmod/drivers/gpu/drm/i915/intel_display.c:14804:38: error: '__builtin_choose_expr' requires a constant expression val = (val & ~PANEL_UNLOCK_MASK) | PANEL_UNLOCK_REGS; ^~~~~~~~~~~~~~~~~ /usr/home/manu/Work/freebsd/drm-kmod/drivers/gpu/drm/i915/i915_reg.h:4770:29: note: expanded from macro 'PANEL_UNLOCK_REGS' #define PANEL_UNLOCK_REGS REG_FIELD_PREP(PANEL_UNLOCK_MASK, 0xabcd) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/home/manu/Work/freebsd/drm-kmod/drivers/gpu/drm/i915/i915_reg.h:167:49: note: expanded from macro 'REG_FIELD_PREP' BUILD_BUG_ON_ZERO(__builtin_choose_expr(__is_constexpr(__val), (~((__mask) >> __bf_shf(__mask)) & (__val)), 0)))) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/manu/Work/freebsd/freebsd-svn/base/head/sys//compat/linuxkpi/common/include/linux/kernel.h:98:32: note: expanded from macro 'BUILD_BUG_ON_ZERO' #define BUILD_BUG_ON_ZERO(x) ((x) ? lkpi_build_bug_on_zero : 0) ^ 11 errors generated. *** [intel_display.o] Error code 1 Step to reproduce: git clone https://github.com/freebsd/drm-kmod.git edit drivers/gpu/drm/i915/i915_drv.h to remove the dummy BUILD_BUG_ON_ZERO macro. make -C i915 -- Emmanuel Vadot