Re: [PATCH 3/3] Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS

From: Sedat Dilek
Date: Fri Mar 04 2022 - 01:48:10 EST


On Thu, Mar 3, 2022 at 6:37 PM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> Hi Sedat,
>
> On Thu, Mar 03, 2022 at 07:26:05AM +0100, Sedat Dilek wrote:
> > Hey Nick!
> >
> > This only applies 1/3.
> >
> > $ b4 --version
> > 0.8.0
> >
> > $ b4 am https://lore.kernel.org/lkml/20220301145233.3689119-1-arnd@xxxxxxxxxx/
> > -o - | git am -3
> > Analyzing 14 messages in the thread
> > Will use the latest revision: v3
> > You can pick other revisions using the -vN flag
> > Checking attestation on all messages, may take a moment...
> > ---
> > ✓ [PATCH v3 1/3] Kbuild: move to -std=gnu11
> > ✓ Signed: DKIM/kernel.org
> > + Reviewed-by: Nathan Chancellor <nathan@xxxxxxxxxx> (✓ DKIM/kernel.org)
> > ERROR: missing [2/3]!
> > ERROR: missing [3/3]!
> > ---
> > NOTE: install patatt for end-to-end signature verification
> > ---
> > Total patches: 1
> > ---
> > WARNING: Thread incomplete!
> > Link: https://lore.kernel.org/r/20220301145233.3689119-1-arnd@xxxxxxxxxx
> > Base: not specified
> > Wende an: Kbuild: move to -std=gnu11
>
> It looks like the threading somehow got broken, likely due to the [v3]
> on the first patch and not the second or third:
>
> This worked for me on v5.17-rc6:
>
> $ for i in $(seq 1 3); do b4 shazam -P _ 20220301145233.3689119-"$i"-arnd@xxxxxxxxxx; done
>
> "b4 shazam" is the equivalent of "b4 am -o - ... | git am" and the
> "-P _" tells b4 to only fetch that exact message ID, not the whole
> thread.
>

Hmm, the universe is not good to me...

$ for i in $(seq 1 3); do b4 shazam -P _
20220301145233.3689119-"$i"-arnd@xxxxxxxxxx; done
usage: b4 [-h] [--version] [-d] [-q] {mbox,am,attest,pr,ty,diff,kr} ...
b4: error: argument subcmd: invalid choice: 'shazam' (choose from
'mbox', 'am', 'attest', 'pr', 'ty', 'diff', 'kr')
usage: b4 [-h] [--version] [-d] [-q] {mbox,am,attest,pr,ty,diff,kr} ...
b4: error: argument subcmd: invalid choice: 'shazam' (choose from
'mbox', 'am', 'attest', 'pr', 'ty', 'diff', 'kr')
usage: b4 [-h] [--version] [-d] [-q] {mbox,am,attest,pr,ty,diff,kr} ...
b4: error: argument subcmd: invalid choice: 'shazam' (choose from
'mbox', 'am', 'attest', 'pr', 'ty', 'diff', 'kr')

Do I need a higher version of b4 (here: v0.8.0)?

Check myself... b4.git:

commit 7c1d044ff1d5235e598d4c777c4abfe60e0a09a8
("shazam: change default behaviour to be "apply-here"")

...is post-v0.8.0.

Lemme see if I can apply this patch...

# cd /usr/lib/python3/dist-packages

# LC_ALL=C git apply --check --verbose /root/b4-shazam.patch
Checking patch b4/command.py...
error: while searching for:
sp.add_argument('-M', '--save-as-maildir', dest='maildir',
action='store_true', default=False,
help='Save as maildir (avoids mbox format ambiguities)')

def cmd_am_common_opts(sp):
sp.add_argument('-v', '--use-version', dest='wantver', type=int,
default=None,
help='Get a specific version of the patch/series')

error: patch failed: b4/command.py:35
error: b4/command.py: patch does not apply
Checking patch b4/mbox.py...
error: while searching for:
ifh = io.StringIO()
b4.save_git_am_mbox(am_msgs, ifh)
ambytes = ifh.getvalue().encode()
if cmdargs.applyhere:
amflags = config.get('git-am-flags', '')
sp = shlex.shlex(amflags, posix=True)
sp.whitespace_split = True

error: patch failed: b4/mbox.py:262
error: b4/mbox.py: patch does not apply

Nope.
Dunno if I am willing to do that manually or build-from-git.

Anyway, can you add this b4 shazam tipp/trick to our wiki, please?

Last question:

LLVM/Clang-14...
Do I need any patches to Linux v5.17-rc6 or upstream Git?
Dependent/Independent of "std-gnu-11"?

I can see on my Debian/unstable AMD64 system:

# LC_ALL=C apt-cache policy clang-14
clang-14:
Installed: (none)
Candidate: 1:14.0.0~++20220301114802+19149538e9a9-1~exp1~20220301234814.85
Version table:
1:14.0.0~++20220301114802+19149538e9a9-1~exp1~20220301234814.85 99
99 https://apt.llvm.org/unstable llvm-toolchain-14/main amd64 Packages
1:14.0.0~+rc1-1 99
99 https://ftp.debian.org/debian unstable/main amd64 Packages
99 https://deb.debian.org/debian unstable/main amd64 Packages

The one from apt.llvm.org I guess is LLVM/Clang v14.0.0-rc2?

Maybe, I wait until Masahiroy has the triple in his kbuild Git tree...

Thanks.

Have a nice Friday,
- sed@ -

[1] https://git.kernel.org/pub/scm/utils/b4/b4.git/tag/?h=v0.8.0
[2] https://git.kernel.org/pub/scm/utils/b4/b4.git/commit/?id=7c1d044ff1d5235e598d4c777c4abfe60e0a09a8
[3] https://github.com/ClangBuiltLinux/linux/wiki/Command-line-tips-and-tricks