Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1328710pxb; Sat, 29 Jan 2022 03:01:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyeR/nweRdGS1iQVtgegQJeN1ObZlX2FObIBGrSgLx9XlcsPSJT7Tlh7pGnO0PJE0mwVz1d X-Received: by 2002:a63:82c1:: with SMTP id w184mr9832793pgd.272.1643454069598; Sat, 29 Jan 2022 03:01:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643454069; cv=none; d=google.com; s=arc-20160816; b=S74pBZ2UxtgBJKUfCxQ0yRrSlZR8WG2iCKk+gS5ay4fKBSy7YBjXOa3gV2vWTBSTkf BnZNDenLsV8RmN+ewFNv02FCfj3tn0eVl0Q8Wz8+GbzgDZewvC1bAEbKkplzGof5WGTp 1chPoxORgc/Yb0s0sIfGM/KMbg9PHrzOZLs2iE17IFLxE28gKMGrJj3qyCzoRqzz9Sbq 2t4H4UmYZ+LfZJvDwwITKKYoVsi2izyKE/GDXx+muMEeOH/ajBSi6BCcSGa8usQkJeo/ GC2bB/aMMhnu1leMmkpxITV/naNA6IYJsF0SRBpmvcUSYLEmFRqJOeiScJ+kF0L3AY32 vEYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=4JwARZdKVo3l5mCIOwcu21mpuSYlPGM/jXChU9Tmvv8=; b=ev0VOzjB8HNfANBGSeOIWq+mBRrG7xqtmTJ8I2E1bdzFuPTlGrKx3J1rIfz9c01IDR eIXpR0nzxv6WJIBsy3Oh9auwbwWunX/i59s3ACjMTRYyfZjSORjNk3cvEqxqigRLUc2y sazFcuNaFA6O/MN2HRfnutZdrzWnW1w3wbY+Ej7+XACNxLx4jmIpT3CLdJMynjsXJrC8 KIW1x5lOvDE7MoxHoHjvw3kyYqiTaacQIlYEPBkLncfXESFlE/Pl0SLl+IqyPX4LMnY6 XDOFQ/lnpbeY6IAAXPzFu1AsGR50WsoRlwx63r5woGCP7k3g7SuT3KMG/L4JZJPaGaT9 DeOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=lMJ1QSht; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f131si7988300pgc.849.2022.01.29.03.00.32; Sat, 29 Jan 2022 03:01:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=lMJ1QSht; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345498AbiA1Clt (ORCPT + 99 others); Thu, 27 Jan 2022 21:41:49 -0500 Received: from conssluserg-03.nifty.com ([210.131.2.82]:20782 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241696AbiA1Clr (ORCPT ); Thu, 27 Jan 2022 21:41:47 -0500 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (authenticated) by conssluserg-03.nifty.com with ESMTP id 20S2fY8X008122; Fri, 28 Jan 2022 11:41:34 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com 20S2fY8X008122 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1643337694; bh=4JwARZdKVo3l5mCIOwcu21mpuSYlPGM/jXChU9Tmvv8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=lMJ1QSht7dX1owf3nll55YpxS/G/4siojSVe7w7p2iLOjEA5y0bMCCqyjSJUN/54B +eSlP9dCRjPQUnQd3pqwf3YCEEtCw+z/shb0W6gc2VZT4iOj8Kxeg/j+pXouSgNUjs B8oxA1r5s9CiIsu3waOEi6UawlRbFKmYdCSjCTub2bIzh9fh+/JDV2Uz+NQ4XOSoKC lD0X3ilOn6GUkg0CjTtQ4EB4CAq/rOIiT+SzHTrkKxH1sPyK37BKuZJeaai8uHJu6S hhD+LSPmPrRt5zH0pevbvO9ztWegM52QpkEoxZ3LWd4Q8UPHPOZgqSZHfr2yXA0iT/ AXH44hL8KcwtQ== X-Nifty-SrcIP: [209.85.216.45] Received: by mail-pj1-f45.google.com with SMTP id d5so5161591pjk.5; Thu, 27 Jan 2022 18:41:34 -0800 (PST) X-Gm-Message-State: AOAM533WE2OgiQsewbJZXxBa0Lu0n8DGYHp/J7JO2FiHfZRkWFtc8krV FstK4jae3NaRXdcDKdDabGfeE8f8PQkj2NneJ0Y= X-Received: by 2002:a17:90b:1647:: with SMTP id il7mr9537952pjb.119.1643337693823; Thu, 27 Jan 2022 18:41:33 -0800 (PST) MIME-Version: 1.0 References: <20220112224342.958358-1-quic_eberman@quicinc.com> In-Reply-To: <20220112224342.958358-1-quic_eberman@quicinc.com> From: Masahiro Yamada Date: Fri, 28 Jan 2022 11:40:56 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: Add environment variables for userprogs flags To: Elliot Berman Cc: Nick Desaulniers , Michal Marek , Nathan Chancellor , Fangrui Song , Matthias Maennich , Linux Kbuild mailing list , Linux Kernel Mailing List , llvm@lists.linux.dev, Arnd Bergmann Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org (+CC: Arnd) On Thu, Jan 13, 2022 at 7:44 AM Elliot Berman wrote: > > Allow additional arguments be passed to userprogs compilation. > Reproducible clang builds need to provide a sysroot and gcc path to > ensure same toolchain is used across hosts. KCFLAGS is not currently > used for any user programs compilation, so add new USERCFLAGS and > USERLDFLAGS which serves similar purpose as HOSTCFLAGS/HOSTLDFLAGS. > > Specifically, I'm trying to force CC_CAN_LINK to consistently fail in > an environment where a user sysroot is not specifically available. > Currently, Clang might automatically detect GCC installation on hosts > which have it installed to a default location in /. With addition of > these environment variables, our build environment can do like > "--sysroot=/dev/null" to force sysroot detection to fail. > > Signed-off-by: Elliot Berman > --- > --- a/usr/include/Makefile > +++ b/usr/include/Makefile > @@ -12,6 +12,9 @@ UAPI_CFLAGS := -std=c90 -Wall -Werror=implicit-function-declaration > # It is here just because CONFIG_CC_CAN_LINK is tested with -m32 or -m64. > UAPI_CFLAGS += $(filter -m32 -m64, $(KBUILD_CFLAGS)) > > +# USERCFLAGS might contain sysroot location for CC > +UAPI_CFLAGS += $(USERCFLAGS) > I am OK with this patch, but I was not sure with this line. Initially, I thought exported UAPI headers should be self-contained. In other words, we should be able to compile-test them without relying on compiler or libc headers. Is this achievable or not? I think Arnd is an expert in this area. I hope some input from him. + > override c_flags = $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I$(objtree)/usr/include > > # The following are excluded for now because they fail to build. > -- > 2.25.1 > -- Best Regards Masahiro Yamada