From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0C3D2D94BA for ; Wed, 1 Jul 2026 20:09:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782936581; cv=none; b=qusWg8TeehtTwDEhFIlII6S7JbHe3/V0UI+hnY38as2tkZWxmRmemnpMtFFdatUMtmQxWqpP5xmVxPugmnXmIKq3YlbHHgBefB9tYYKvIHbPbkAsk598eWre/hbdPuhbgtQwYZO4DoUhhq87lt9pgYUPyDBbC4BWOhYOZ7AURTE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782936581; c=relaxed/simple; bh=8Z33gt14YruXZVQWlNdLGRiTaxBelzqYJzcAvGs+Frg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=AE4RIeEHtO0HhrRXK22IzcKVQGNJTKhYcUovlqE0aD2PU9ENmc7H2vUkl4tf0q/C96qlI0IhNdz4HtdFmyOv6J+2/qKlzDOKVGVqGrpuhw28WNrcjGLj/26IhYdhUcbRY8Q/xaFVdsGtfIKSIwF23hoO3FmhMSCO7E7P2kceMi4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AwWs3+wT; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AwWs3+wT" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2c9b1edf2bdso8285385ad.1 for ; Wed, 01 Jul 2026 13:09:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782936580; x=1783541380; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=by6eNeUUnBqGGUuZCPqc4D5qeE7MVKDL2q1UJlwxCrE=; b=AwWs3+wTMOh4AjdajXh2wny3KIm3S+mQmU32GfRonIAbLcveaowgjKpLvqOfG/lVEq Hvq6AaA6qgiOWAbLR7WJyjj9Qm480cjf2BP/Kp5ANbYeiuk1Y0r47hAeWPXIszBPyBqS Mb8s6J4jHjnvBTvpYZIe/fIcIEJlWxAej06tBnu2Wbvzxz0JSYx+OAa0nqyUHDbEnMCd kyr2L75GldszcXlSVythW8iqiOVmb7aiwg0xAcoMCSpXgj9XfxOcWDqr/Kw/f2JxNgR8 lZrc5NbDzQeON5MQ5fsUhDrK2jXmxQZgjMxloS92eGpGlczfShxcJq+vtZycS6qDQ36T 6LvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782936580; x=1783541380; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=by6eNeUUnBqGGUuZCPqc4D5qeE7MVKDL2q1UJlwxCrE=; b=Oqfo4FwIS6nKdThS+85RRfbR9u90NkSZ6UDC1tg3A4ksKXSVuIRVxrsjsPhoZ1yVpn qYcTSk9EU+r09lgRNliP3KY0JAgWzZvszZDX//EeP2OwaW1q9ci00zxVd1T9u4WuKyjw 9wYXhQvSWo7hBHIh09swlySM1icBNhDxKx/ENT+NymyuAiHQAvnrT/Bq61N7Jc7LUJ86 PS9VBZAmAORv3epwpRnU4uTeXD50BXOnZF+M/B1XCOE0TEJQ8mWRGEjQFoj1FnvxP8Df cnWQpthcR2kAVh5Yg6qR7kiTq/zLEOMBk16lSDGMjWLoHdM78XLtjaaBNgXnPhdfKIv/ BnAA== X-Forwarded-Encrypted: i=1; AHgh+Rowdf14fKQPuE0vHPpAIB67NqsNr/o4kQnBbakKq5wKaw8tvS1nJaync/b28aZXLRAwoCSY9m9JkvoFcHQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyD5r5omonIlLBzQlc1No/zxez4mtRcClhzOaoMCyky+ni03XJm jLkNg9a7HIFzzoGylif3AbYNW9n+pDrYbqna4xR/ynm/pF4BZHIGN6Nx X-Gm-Gg: AfdE7cl+SiodayOQ5ccwnQfjm1MzTkotvus3SIZY2ubE7xynZtqFE7QFQwwjd4C+yYi x5VbJ4sYrBRllt4YP3/0J+QfY1pWJGwInhxwPngt+aybSJ8yczSJavSBMTKekw9wzM/0eNsV2pa FURsoifvwumkS9Bk6768mnMhewj9WWZH5+sJKcIZK2GG4/v1+PW3S7yR7xKAcbB1SsONSk9X9Nv 0f/0PGVefyOcoZsDAICb2BUZsE+Kj7QCLoJCUc/wgfctaP48TVhPW0whJI1nG+cV6IBekPCAVQG myxzcoD8unodnlFSxQ6dGGwuFYhQe4rFZgbAEwtQ3SLd3avOJ7+TWZRulMmjRFEGNYvsYLy7ZtY 4TXFuF5obSx5EF+cLyIB5AYvJGi8YZUsTH5wtGVA0YIU0YbzZwegbKv/6CW7E6HEx/FjDF9nZBd r5PMAFxwXxYfdEuFkK3YpFyoDyUXRfgw== X-Received: by 2002:a17:903:22d1:b0:2c0:f807:9bf3 with SMTP id d9443c01a7336-2ca7e654734mr31187765ad.10.1782936579875; Wed, 01 Jul 2026 13:09:39 -0700 (PDT) Received: from victus-15.tail2d4da1.ts.net ([220.78.36.173]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ca9a8dec40sm3350245ad.5.2026.07.01.13.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jul 2026 13:09:39 -0700 (PDT) From: "Joy H.J. Lee" To: Andrew Morton Cc: Nathan Chancellor , David Laight , linux-kernel@vger.kernel.org, "Joy H.J. Lee" Subject: [PATCH v2] tools/compiler: match glibc 2.42 definition of __attribute_const__ Date: Thu, 2 Jul 2026 05:06:35 +0900 Message-ID: <20260701200635.3992767-1-rkr0k0r@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit glibc 2.42 added __attribute_const__ to sys/cdefs.h: # define __attribute_const__ __attribute__ ((__const__)) GCC 15 warns when a macro is redefined to a different replacement list (-Wbuiltin-macro-redefined). Since host tool Makefiles (resolve_btfids, objtool) pass -Werror, this conflict becomes fatal. The warning is suppressed on standard native builds because GCC treats /usr/include as a system header path (-isystem), and macro-redefinition warnings from system headers are silently suppressed by GCC. It fires when glibc headers are on a regular include path (-I) instead, which is the case in cross-compilation setups such as NixOS, where the sysroot's glibc is passed explicitly via -I rather than -isystem. Per (C11 6.10.3), identical replacement lists are accepted silently. Match the glibc definition exactly, including the space before "((", so the redefinition is accepted without warning regardless of whether glibc headers are treated as system or non-system includes. Signed-off-by: Joy H.J. Lee --- tools/include/linux/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h index f40bd2b04..f2f54b038 100644 --- a/tools/include/linux/compiler.h +++ b/tools/include/linux/compiler.h @@ -119,7 +119,7 @@ #define __read_mostly #ifndef __attribute_const__ -# define __attribute_const__ +# define __attribute_const__ __attribute__ ((__const__)) #endif #ifndef __maybe_unused -- 2.53.0 --- v2: expand commit message to clarify when the warning fires (-I vs -isystem); apologies for the direct reply to Nathan on v1.