Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp538730lqp; Tue, 11 Jun 2024 11:34:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWq/hKIZ1s0NY6eTY7LSJVeYBXqFFfw33E+wr9I2tQDfFZwc1FTsye0vocXdBbE3yGkY2xYc4pfqLfRo8wiZ+PpuSI7o0bFQr/GH4Iyhg== X-Google-Smtp-Source: AGHT+IGhrtcu9wfBOSkIxAy+3496SquKshmTj0HdgkeUmy8AJatmz31sORHfqMDX/B+uIwY/+7ql X-Received: by 2002:a05:620a:28c8:b0:795:4bfe:ebd with SMTP id af79cd13be357-7954bfe0ff4mr1512632485a.30.1718130841567; Tue, 11 Jun 2024 11:34:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718130841; cv=pass; d=google.com; s=arc-20160816; b=t+1eybJEsz9wETwKuob/3CZcsF+pIcPjzNVuxrxcKR41aN4yM4kNpt/+/1rm2XsyL1 cXTTn8pF2MKd19sn841y3tnu9hYSXfRtMDf08kdWe94qfrP9muR1UnzR6/LPoP6POknq 7TG8/eI1d3Gi8p0oH0L6T68VBgPzQK6aVHhvROmVNxJWZPTX/KeZiZ0/YYmWpUkv5ftQ izaRR3AqBr+nKhYkN0+Yqo6u2UnXH+JulecPdtqGdNmRXlPp+3RzHsEM0ZcXrK2ByT+I XYybT2uWn/yJmrLWPZPvtpL5Xg5OenOoJWLJ68fDUWprbGx8dHSh3ye82Twv2XTZXcUh 1Lbg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=XE4BOZRZpuQSDr/bb7Z6GCdUYJnxu9albyuBquTmaIo=; fh=xp6l5pwJ12M3oNEH3zdac2j6MZi7fWbDSU0UGRioMR0=; b=aB+wpRHcAqOmZ40esC8Qe4iu384bC5hZjWDsQhb9gcXeoEOE3fW842oCoAQw6FmXz1 xNKXh6UYsb28W5rDHtgW3Civ/NVrrRPSIUCFm6cn73dAFK4XUjKiJnOgq08i5AjLRkZI eCKd0/2mHbQszL9UMBgaXBslBFF38rfuKDIglpG6RrKXOtnr2M9PedC09v7a460GzxRV olda4Hox/xg161oAltIKuD57Re2+lDRrhxhs3K61lYe06N+wAy3UcebGWLs0hUnSXdYo WPbEST5tgxZDHJd7yA2uiN2UQLSafpqepocRvYUOHBWM/Nk606SVE9JEwNq+u9LL+uab j8XA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=hkjeBnER; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-210442-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210442-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-795481c7cefsi1017116985a.770.2024.06.11.11.34.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 11:34:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210442-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=hkjeBnER; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-210442-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210442-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 7C2A71C2433A for ; Tue, 11 Jun 2024 18:33:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF7F780055; Tue, 11 Jun 2024 18:30:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="hkjeBnER" Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (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 614D381723 for ; Tue, 11 Jun 2024 18:30:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718130607; cv=none; b=T8lhHwCDfzJcmjukWlHN//Tu/Zub7A+UkanlMou1HCj/fNLZ3srTcuLEZX+9B6qzZvaLdRFotBV/VVJCKYTwpTrNNfEBpiqZ0tM92te+Q25suLCyTylVRkF0QSvbelnkN1j0cWGdg73OF3e6tQ+dz/c1ahtwn6P4kwWC+N+44x4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718130607; c=relaxed/simple; bh=vmJlB5Vx85oOAvr/aM38OCLvx/FPwgawAx4TV4XmcSI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=APMBmpuZbRYlMq8VarjtU4CglcHhncQbmkMLHhgzmJQ9XqxtQZdcg7nimsuzkBZkjefD5vc/FrO1tsFKu7hEzYemQyLLYkvmtiDo1RB8AQs0ikfI60fUcfz4wbZRc16RGYiHHE9JIoePJJDVQ4VAdZCWFGOoXl+6Y6HVS/tPXDo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=hkjeBnER; arc=none smtp.client-ip=209.85.214.181 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=google.com Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1f8395a530dso36845ad.0 for ; Tue, 11 Jun 2024 11:30:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1718130606; x=1718735406; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=XE4BOZRZpuQSDr/bb7Z6GCdUYJnxu9albyuBquTmaIo=; b=hkjeBnERHHqamfY8VO6wgZRrPlkbNCuMfpVHGoVs2jIRDMpGPTWKwEP9fn15ViaurN vEE8Jx0d11lUxsmq4+HG42RX8yhrL7yAw88LwcKo3z0F3eTwC/hyHL194B8jGp69F4Do gwzpMcRJpbbkI0x6+o0aV6dzz71qkZvWEIy9PY3Y6IKTZnOR2rdL3ZnQDw/Qt2QS9QPy FaIs77vCOodeeqKPRoBq7u0iSKVxYM2kHT6+e+KDbiHYfAdVv6+L5xZQ4kvB2OdzuSP+ aKbpGl5ulcXMQlfcDdUBrs6e6l0yu02y66nqHM/W/K6NoARta9ET4/L34Tst8rB7l3Yn FO6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718130606; x=1718735406; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=XE4BOZRZpuQSDr/bb7Z6GCdUYJnxu9albyuBquTmaIo=; b=d4gH1vUybMeKzrYOUxLbzYVAUB8hL9KAUyYzRQt+B+uYeTTqIyB4mcZWJRKFfG2K2m vt76YqJXbLK9R81v3TWO9+bb5bHudfpvPGZwApaTXiPM/SvhOlHhPOTPbYSRxAczF+bs SyXFjkqrc+v8q1EMf+0NdXDwZUNBJMBwm4z4xe3U6DYkXKaz8zkV7+0uGoy8J0WnhDIU MSNQwFckVHTA3g4BiFSSSCaKlLX010QdTBcTTYXnWLgp37hVrZlsqbVUhIg12jSSTm9a rqwI+ir+uns15FlazXnzVl6pl32Koyin4jJP1JQCem1zmh1XCwnVx3UGbyBD39T3uAjt e2Sg== X-Forwarded-Encrypted: i=1; AJvYcCW2Nmr1wBRm/nRJGhMfEhSboF/25jd1/uF8d5InSHvnz/pxsFQRa0CIOc+cGboshqpvX8sibXHwpEaJ6Wn6X7Tgw3l+K9+Qq2hXMAPl X-Gm-Message-State: AOJu0YwpFGp0lK4iut+1H2ii3zQXtLoVTQ0rt+vsPEwxAoBpNBSloFZ/ JAAyW0glSaAtqWgA59BdMncRwzE9S/ySL+DuWxnC2aOXOYsDPQtHugJ0m+9tSQ== X-Received: by 2002:a17:902:f54d:b0:1f7:340e:71ac with SMTP id d9443c01a7336-1f7340e7491mr23223975ad.50.1718130604876; Tue, 11 Jun 2024 11:30:04 -0700 (PDT) Received: from google.com (226.75.127.34.bc.googleusercontent.com. [34.127.75.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f72110e4b5sm30490685ad.125.2024.06.11.11.30.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 11:30:04 -0700 (PDT) Date: Tue, 11 Jun 2024 18:30:00 +0000 From: Carlos Llamas To: John Hubbard Cc: Shuah Khan , Mark Brown , Vincenzo Frascino , Colin Ian King , Valentin Obst , linux-kselftest@vger.kernel.org, LKML , llvm@lists.linux.dev Subject: Re: [PATCH v2] selftests/vDSO: fix clang build errors and warnings Message-ID: References: <20240527211622.290635-1-jhubbard@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240527211622.290635-1-jhubbard@nvidia.com> On Mon, May 27, 2024 at 02:16:22PM -0700, John Hubbard wrote: > When building with clang, via: > > make LLVM=1 -C tools/testing/selftests > > ...there are several warnings, and an error. This fixes all of those and > allows these tests to run and pass. It might be best to split the 4 _different_ fixes into separate patches. > > 1. Fix linker error (undefined reference to memcpy) by providing a local > version of memcpy. > > 2. clang complains about using this form: > > if (g = h & 0xf0000000) > > ...so factor out the assignment into a separate step. There has been multiple attempts to fix this. I can see these two: https://lore.kernel.org/all/20211206102931.1433871-1-anders.roxell@linaro.org/ https://lore.kernel.org/all/20240501002150.1370861-1-edliaw@google.com/ ... I guess we somehow missed those? > > 3. The code is passing a signed const char* to elf_hash(), which expects > a const unsigned char *. There are several callers, so fix this at > the source by allowing the function to accept a signed argument, and > then converting to unsigned operations, once inside the function. > There is also a v4 fix for this item that was sent out here: https://lore.kernel.org/all/20240506181951.1804451-1-edliaw@google.com/ > 4. clang doesn't have __attribute__((externally_visible)) and generates > a warning to that effect. Fortunately, gcc 12 and gcc 13 do not seem > to require that attribute in order to build, run and pass tests here, > so remove it. > > [1] https://lore.kernel.org/all/20240329-selftests-libmk-llvm-rfc-v1-1-2f9ed7d1c49f@valentinobst.de/ What is this about? Left over from v1 maybe? > > Signed-off-by: John Hubbard > --- I would prefer to pick up the fixes from folks who sent out the patches first but I'm fine either way. Reviewed-by: Carlos Llamas