From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C61E204C1E; Tue, 4 Mar 2025 16:28:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741105731; cv=none; b=Y4tGqEXUfvkdc0qqC6GPG2dmG9ukU0LFPpr+pkpQzv3loGicI22f85O1YVRWpKyAz3+ixsl9K0NIpsMe/+X8iImh66IoNG1QiLeA7GzDTv8RpPmqeaCMUhk99UniefJ7YuO4gVrfPZRo/BMsiWm/2lRw/ZBj8vDHFypBtepqEcc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741105731; c=relaxed/simple; bh=lqDg7gYU+818e4TRIz2Zp6nENwnhnzNwXB/jM7gTjZE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HmbRUiwMdBk7B/xPBhSIPDdO+Vsc0UqK8y3B41XI91k2PXoEo/JnbHfZCtoPjPXfnkdsvMNhzj42X9YpOeuH0aU6z6cXOwP54IZDFe6j51uxp55+A106k6Rm92WPgQBJE6nzjxq3bglFj4RJho0eqIofPytXZBgJ/02k3j9xImo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uNwTkCXL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uNwTkCXL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CA79C4CEE5; Tue, 4 Mar 2025 16:28:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741105730; bh=lqDg7gYU+818e4TRIz2Zp6nENwnhnzNwXB/jM7gTjZE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uNwTkCXLfXwiuaqh7iLk5y3XWPiY1JXK/OGKUOGuMB80rvDgvmVcz0CuY7XoJB6gW WjWtX9m/ml3NqoloVaQK8+n+Y+rnSv/F7iatqbUF5SbkgsM8YO9nfjbIa2U4Mld4F8 ywsGb9TiNP2p7RhvGv8Lsuq6whau+k08Bb7X7RFgxyQHJn8Fw/AYcCHACXC/K+YSY7 1NaIqSQqbuf4vzxBxSJPNNDkvgL4MC+ihZqW6KBUl4y3y2cAYwAxTysBuBq6Efci+Y H0F02I4OUtdPlogRunR6CtdLYDnhjhiTdTDl5QmovnZY5CVl3AUqgB0X3LyHX36OuT qZx6pziRIq+PQ== Date: Tue, 4 Mar 2025 17:28:45 +0100 From: Nathan Chancellor To: Kees Cook Cc: Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Bill Wendling , Justin Stitt , Masahiro Yamada , Nicolas Schier , llvm@lists.linux.dev, linux-kbuild@vger.kernel.org, David Gow , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v2] kbuild: clang: Support building UM with SUBARCH=i386 Message-ID: <20250304162845.GA1479759@ax162> References: <20250304162124.it.785-kees@kernel.org> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20250304162124.it.785-kees@kernel.org> On Tue, Mar 04, 2025 at 08:21:29AM -0800, Kees Cook wrote: > The UM builds distinguish i386 from x86_64 via SUBARCH, but we don't > support building i386 directly with Clang. To make SUBARCH work for > i386 UM, we need to explicitly test for it. > > This lets me run i386 KUnit tests with Clang: > > $ ./tools/testing/kunit/kunit.py run \ > --make_options LLVM=1 \ > --make_options SUBARCH=i386 > ... > > Fixes: c7500c1b53bf ("um: Allow builds with Clang") > Signed-off-by: Kees Cook Reviewed-by: Nathan Chancellor > --- > Cc: Nathan Chancellor > Cc: Thomas Weißschuh > Cc: Bill Wendling > Cc: Justin Stitt > Cc: Masahiro Yamada > Cc: Nicolas Schier > Cc: llvm@lists.linux.dev > Cc: linux-kbuild@vger.kernel.org > --- > scripts/Makefile.clang | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/scripts/Makefile.clang b/scripts/Makefile.clang > index 2435efae67f5..b67636b28c35 100644 > --- a/scripts/Makefile.clang > +++ b/scripts/Makefile.clang > @@ -12,6 +12,8 @@ CLANG_TARGET_FLAGS_riscv := riscv64-linux-gnu > CLANG_TARGET_FLAGS_s390 := s390x-linux-gnu > CLANG_TARGET_FLAGS_sparc := sparc64-linux-gnu > CLANG_TARGET_FLAGS_x86 := x86_64-linux-gnu > +# This is only for i386 UM builds, which need the 32-bit target not -m32 > +CLANG_TARGET_FLAGS_i386 := i386-linux-gnu > CLANG_TARGET_FLAGS_um := $(CLANG_TARGET_FLAGS_$(SUBARCH)) > CLANG_TARGET_FLAGS := $(CLANG_TARGET_FLAGS_$(SRCARCH)) > > -- > 2.34.1 >