All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: David Gow <davidgow@google.com>
Cc: "Nathan Chancellor" <nathan@kernel.org>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	"Bill Wendling" <morbo@google.com>,
	"Justin Stitt" <justinstitt@google.com>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Nicolas Schier" <nicolas@fjasle.eu>,
	llvm@lists.linux.dev, linux-kbuild@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH v2] kbuild: clang: Support building UM with SUBARCH=i386
Date: Thu, 6 Mar 2025 19:41:59 -0800	[thread overview]
Message-ID: <202503061939.AAC6EF5A44@keescook> (raw)
In-Reply-To: <CABVgOSnEaTVUfZB6KACFJE4mM=oSWnUtcrf7ETHFq8h_k=mFTw@mail.gmail.com>

On Thu, Mar 06, 2025 at 04:59:53PM +0800, David Gow wrote:
> On Wed, 5 Mar 2025 at 00:21, Kees Cook <kees@kernel.org> 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 <kees@kernel.org>
> > ---
> 
> Thanks for this -- I'd been using `--kconfig_add CONFIG_64BIT=n` as a
> way to build i386 UML kernels, which seems to work even without this
> patch -- but this is definitely an improvement.

Thanks! Yeah, I figured there must have been a way to get at it. I
wanted to make it work the "normal" way.

> It may be worth noting that CONFIG_FORTIFY_SOURCE is incompatible with
> clang + i386, which seems to affect UML as well. (That might actually
> not be required, as I think UML doesn't use any of the strange
> -mregparm calling convention stuff which appears to be what breaks
> FORTIFY_SOURCE here.)

Also fixed! :)
https://lore.kernel.org/lkml/20250303214929.work.499-kees@kernel.org/

> Tested-by: David Gow <davidgow@google.com>

Thanks for testing; I've updated the trailers in my tree.

-Kees

-- 
Kees Cook

      reply	other threads:[~2025-03-07  3:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-04 16:21 [PATCH v2] kbuild: clang: Support building UM with SUBARCH=i386 Kees Cook
2025-03-04 16:28 ` Nathan Chancellor
2025-03-04 17:50 ` Kees Cook
2025-03-06  8:59 ` David Gow
2025-03-07  3:41   ` Kees Cook [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202503061939.AAC6EF5A44@keescook \
    --to=kees@kernel.org \
    --cc=davidgow@google.com \
    --cc=justinstitt@google.com \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=llvm@lists.linux.dev \
    --cc=masahiroy@kernel.org \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=nicolas@fjasle.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.