From nobody Fri Jan 16 19:40:59 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dt9FS1YB5z6Nldb for ; Fri, 16 Jan 2026 19:41:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dt9FR3gxyz3xTx for ; Fri, 16 Jan 2026 19:40:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768592459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ebg7hEiJXMCqzbW5RVPR2zwjyz3e7F/z581b3SdgUI=; b=T5/dFV30DalJwZbVQ1+CY40UXiPA5X/xpcu+eBqqVlTQnJNf9zbZLqHOCTbXd9VO4wxTxd 8ldav29RhaFFWkqbFaWgoOmeo/1GfqvGMacjQOpNWodgOFKgfcWda8NDLHxcFNjGFaRapS AeIyuPfWPEZvmaqaNXwdxo6jTcfcDXZu2uBYwUO0uLt9qJ9yt51toD1RG2iH6u1rlO+Cdp /A/IaDDQ3rAK752rJ2JcgGWUqBSVSWJtjTY8eVUshKSfheom1p8+KJJXyNOBWnSVOePyRL lyyc5ySDldi3IS9SI4xjXz+mddcjm/3LAFe9Ueif7woAHM0x/1rfTJXojzLM9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768592459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/ebg7hEiJXMCqzbW5RVPR2zwjyz3e7F/z581b3SdgUI=; b=f3z6ReyatQe4wpZcXKWyr2IhfouF3w50EWRYStQ+A39arJ8Gffu8aiN0Zw7P2zvaNlC97k xOy//sTqEEk32dBEDu6EBOaZeXRttdu7xHhhm3zkRg0roasO3oN9TwEJDWgNuBWd2tC7+e MqCoHTMAS/Vkd7Cudu73DoRejmvUL5uTaZ+CGc15o6aRcm9+ZjNwspwexM0vZcv2DLon7O PAyp+pSpLxmydS5f6mVGyl9SpEDMtP5dQ8/q6DsdiXyMyNusMnASv66jlxv2mxhzvpsiwL IhHgv+Wcij9Fydo+vYcFDYgsCILiPIjOlyy7XGvogb7JThWTa7a7ZLhky9/DIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1768592459; a=rsa-sha256; cv=none; b=rlTQpLXKxdXzApcWbl5HA7TjI445qYQ14CFkPUjdeyM7oZKDw1XpgXADi9+fYP1qj5WI+C TWFMVZR7T62e+uEnHQclFlHckDwKNiYYiWcUSmtlIcubt7yZxwS65tHM0F9ThO7tHXyVMn TTqqu7NLI56WRrGQfPHQNmTVJI+IpyrUJlONQKEFyuDgSfE9ky+C+UVUlGimC/F7MBJJvi 2LG2jSt/WAxYQHuP5IpFurR5I4NnsexhIMzda3oNc1vIuvaCUnkFBXZ6/s+MbTN5Gm6N6W m0csIpeNMGhK7GO2ndZebVbp5Fxz3K27J47eLT9Clolwzmdl25CHJAHQyVhccw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dt9FR3GgVzCYS for ; Fri, 16 Jan 2026 19:40:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id dbe7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 16 Jan 2026 19:40:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Bjoern A. Zeeb Subject: git: eba61bc6749e - stable/14 - LinuxKPI: add __struct_size List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: eba61bc6749e571ca5797b85f572925916266927 Auto-Submitted: auto-generated Date: Fri, 16 Jan 2026 19:40:59 +0000 Message-Id: <696a944b.dbe7.2977831b@gitrepo.freebsd.org> The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=eba61bc6749e571ca5797b85f572925916266927 commit eba61bc6749e571ca5797b85f572925916266927 Author: Bjoern A. Zeeb AuthorDate: 2025-08-18 19:53:55 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-01-16 19:37:48 +0000 LinuxKPI: add __struct_size Use __builtin_object_size() by default. If __builtin_dynamic_object_size() is available use that instead. I would hope that in a future version we can remove the conditional checks but in order to be able to MFC this without checking all compiler versions simply keep it this way for now. Sponsored by: The FreeBSD Foundation (initially) Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D52077 (cherry picked from commit ff5bcb742899f8398ccb1b9e292b2e5aeeb7fedb) (cherry picked from commit 310885b40ad256b054d65353c375b29700ee024c) --- sys/compat/linuxkpi/common/include/linux/compiler.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/compiler.h b/sys/compat/linuxkpi/common/include/linux/compiler.h index fb5ad3bf4fe4..948396144ad6 100644 --- a/sys/compat/linuxkpi/common/include/linux/compiler.h +++ b/sys/compat/linuxkpi/common/include/linux/compiler.h @@ -130,4 +130,10 @@ #define is_signed_type(t) ((t)-1 < (t)1) #define is_unsigned_type(t) ((t)-1 > (t)1) +#if __has_builtin(__builtin_dynamic_object_size) +#define __struct_size(_s) __builtin_dynamic_object_size(_s, 0) +#else +#define __struct_size(_s) __builtin_object_size(_s, 0) +#endif + #endif /* _LINUXKPI_LINUX_COMPILER_H_ */