Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp16539lqt; Wed, 5 Jun 2024 15:36:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWfqK20kTJbw4Z1Dycb0DbstqWP9xOYxy00Ec0Rjj8BuG6jETcMaM2dYOh9oRJFJgYsAe4aTUeYd4dpB6DVQvvnZAGT7FGsrQIQSvt1Ag== X-Google-Smtp-Source: AGHT+IExp2nR+uNpcCJsOLg7zroRcZoNqflZfAzfUVjWM5LxDXljnx21B4eu4rtFcd03a7/z5BEc X-Received: by 2002:a05:620a:4d17:b0:792:a238:4a0a with SMTP id af79cd13be357-79523d2dd70mr409975185a.1.1717627016393; Wed, 05 Jun 2024 15:36:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717627016; cv=pass; d=google.com; s=arc-20160816; b=aSj7mn8RIstg0TxVAZsR7zyQbhNrKRRjP+92A6Ngum043ArTo44frR4Pz9tfsccn3U Sr28EFsTPk8gVHwX8L3cb0LyEI5woc6dCYNtL3dqQaEqKpwG1lyiXxI3hj15xWyYuPkp OrS/1Fu7PKANLSKWeCRQ72iY0/PIDHh+cn/hXDM8Gfl8A/JHQK/xLIgZjQVEnwSD6J+L sSAxu0LHoDIh/8CP64oOOQiaRw5UQ/CZVBIARU0sAYr/fQSGf3J28LGszxxkvOml7mia KPGNf+aq8SGYtpEG/id1y9Q6gq8nfGQJr6T5VrShS7PLYTsPYE7imSv1/1a5ZdTKh2w+ 8oTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=UDMXqeIeVKqn4Qjsv0IGaXMAVsD6Gi7Ax4kHrxCoB1Q=; fh=3pgjFascFY8X/BeSxDW6M7SamjW6RDoRiKsYd2HiANw=; b=XUyupZDYa6ADLaXXTWBdxVgkkq0eH1eIT+On/h8orh7/hOidS5r9PJh1m5gbEVXKLl H8aQzDLd9WsvJ+lAVahDe1fO3CAmPzigUs81ziNJ/xfDiF2MLNMH2EvQdh5Id0RbjpNd 7XGA245/A/0iYKCg/y23ZegQXBX1XTcIuqHs7+9tCwfamqrLwZkpKjMzHw2c+gAmk9MY AfDU+eTPEgS9YvE5usdegNsAhzvXlfJxge92mwpjfYdx0cMlD4akqxdI6PcliVofXJjF KPr/w2YZnhqthcY3wQpEwdMvnYo1jRi09f4O91laS1JO96BrPClpfl3zlKNl4KvGi4bZ P/pg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=dgme9dCS; arc=pass (i=1 spf=pass spfdomain=flex--edliaw.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203357-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203357-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-7953284d189si2375185a.148.2024.06.05.15.36.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 15:36:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203357-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=dgme9dCS; arc=pass (i=1 spf=pass spfdomain=flex--edliaw.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-203357-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203357-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 224CA1C22293 for ; Wed, 5 Jun 2024 22:36:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A9A5015FA8B; Wed, 5 Jun 2024 22:36:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="dgme9dCS" Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (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 83E22136E1F for ; Wed, 5 Jun 2024 22:36:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717627010; cv=none; b=pEDIIyw8aO0y4h9s1FktwSXsQM/dHpQNXY3s3GwsjTlyMd12L8ZbRkxZglNnvQjIIKmp0OxqQzo/O7usrRYnqEqT1Hq6GvtfvjlK1hvUzW86exB2fq9tPIrJXvy+FLLN9HLOpNjZmTI6llMJGWS6kNvkA03h5dSZ3+KMRXOAltA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717627010; c=relaxed/simple; bh=FAxq/WJA3jAwur4ufatkzAyl90jSZN079xQn1B8hIQo=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=sD61TkOrqrf/38R0xoGmHN4RnjDZy4BgSG8v4+WooUaiiBM7T0pmF4DX8bsRJ+2f1V3zFNYjypG+VZSGxwUhWWs+obvASGa69tWzt315KSQxnECLIfzcETROMQV4ej8PGWR/2zFV//olnROp9+PU2q8IfY0hFn9O9eEuqIYZFvM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--edliaw.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=dgme9dCS; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--edliaw.bounces.google.com Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-62a08273919so4280147b3.1 for ; Wed, 05 Jun 2024 15:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1717627008; x=1718231808; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=UDMXqeIeVKqn4Qjsv0IGaXMAVsD6Gi7Ax4kHrxCoB1Q=; b=dgme9dCS7bxFo79XggJO1kNtpxaKsww73MwHScbgnSVRhbu+P6wHnFe5TJcY6QpNIt WMnNKSwrveL3ZNJC8WT5mIR5cBhzN/a7Z+wGiR7zRM+HuH5/0iRqJozcUUqnmrun6pPq FRjWM3YpziB1wzNcAjNbLqHf9/nHr7p74CNDogTCBWtX102Ui564OqPWNLz6lpP0+CIy XrWm0IdBAJTLMsAgE7suGqH+uFx270W26lQBjWR0mepLDJLdZArHw75hgZoD6xMuoNP5 jgvWQM5SRNLxcBFgf7c5EmXcVR+csM2PMY4UmaOwz2ddwxxB5cHnYtHqvwDkwqmMjQin ceTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717627008; x=1718231808; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=UDMXqeIeVKqn4Qjsv0IGaXMAVsD6Gi7Ax4kHrxCoB1Q=; b=h+TZxXT0JJMcugGzfWJ0o6nrgSR1Jf2RSGeM5UnH4OLdd3Euuh3uF/tmoXl2zSTyTj Uu4VqbZqAvWRBVQC6ZkHIPqOExgxHJMdjtBk6Rd/lhlo1GO/2842pAMjSC9OQ9C90v/E p6Q0OjDwnnN7wHi13RRp4ArWmSFKccugykgtPCgt2Uxu7aJIKKXKFu/12GdT3PcmpPqn FkEdSBwI4zYei8jc30oe59LUIosQIOS27vnMIPwTsMJbJcC6XofYxJWe+ilu6/gNGwuh YktHkK7U1zwOwUz7Rnp7timahlcNzD8WjYyAmnve6lFqtyif8C0deO3SkoQP6zjfD0/a wWRQ== X-Forwarded-Encrypted: i=1; AJvYcCXP8GM/9CUAZKB7lfZUEodKGWDhK4Nai9+foOA9Bavxi3j5/78pAnJCGEhUWd0JrA/gFJJ8KEDL+gvUcu7OwnCNfcMZggoYtGHBciQO X-Gm-Message-State: AOJu0Yx99fD+3WHBleL4Bq3lmdrhH0rRHWnuzBHolFLVcQt0y7CvSiFD +UY0ODrM3grE7U4AcI1T0MHl+810hWBscN3G/7ntO+BM4d2/tsadDtLlICtWlzKpGmBhNe90AxJ hiA== X-Received: from edliaw.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:305d]) (user=edliaw job=sendgmr) by 2002:a05:690c:38c:b0:627:a961:caee with SMTP id 00721157ae682-62cbb4cd151mr5405207b3.4.1717627008528; Wed, 05 Jun 2024 15:36:48 -0700 (PDT) Date: Wed, 5 Jun 2024 22:36:33 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.45.1.467.gbab1589fc0-goog Message-ID: <20240605223637.1374969-1-edliaw@google.com> Subject: [PATCH v1 0/2] selftests/mm: thuge-gen defines From: Edward Liaw To: shuah@kernel.org, Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt Cc: cmllamas@google.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com, Edward Liaw , llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" When compiling with Android bionic, the MAP_HUGE_* and SHM_HUGE_* macros are redefined because they are included from the uapi by sys/mman.h and sys/shm.h: INFO: From Compiling common/tools/testing/selftests/mm/thuge-gen.c: common/tools/testing/selftests/mm/thuge-gen.c:32:9: warning: 'MAP_HUGE_2MB' macro redefined [-Wmacro-redefined] 32 | #define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT) | ^ external/_main~_repo_rules~prebuilt_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/linux/mman.h:38:9: note: previous definition is here 38 | #define MAP_HUGE_2MB HUGETLB_FLAG_ENCODE_2MB | ^ common/tools/testing/selftests/mm/thuge-gen.c:33:9: warning: 'MAP_HUGE_1GB' macro redefined [-Wmacro-redefined] 33 | #define MAP_HUGE_1GB (30 << MAP_HUGE_SHIFT) | ^ external/_main~_repo_rules~prebuilt_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/linux/mman.h:44:9: note: previous definition is here This test should probably use the uapi definitions instead of redefining them. However, glibc gets struct redefinitions when including sys/shm.h and linux/shm.h together. So, add guards for the SHM_HUGE_* macros instead. Edward Liaw (2): selftests/mm: Include linux/mman.h selftests/mm: Guard defines from shm tools/testing/selftests/mm/thuge-gen.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) -- 2.45.1.467.gbab1589fc0-goog