From: Alan Maguire <almagui@kernel.org>
To: ricardo.salveti@oss.qualcomm.com
Cc: acme@kernel.org, alan.maguire@oracle.com, bpf@vger.kernel.org,
dwarves@vger.kernel.org
Subject: Re: [PATCH] dutil: Split the objcopy command into words in exec_objcopy()
Date: Wed, 4 Nov 2026 14:55:40 +0000 [thread overview]
Message-ID: <26aca401-e6b0-4650-a6ef-af2e37ae5b2b@kernel.org> (raw)
In-Reply-To: <20261022035604.3183589-1-ricardo.salveti@oss.qualcomm.com>
> From: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
> To: dwarves@vger.kernel.org
> Cc: acme@kernel.org, alan.maguire@oracle.com, bpf@vger.kernel.org
> Subject: [PATCH] dutil: Split the objcopy command into words in exec_objcopy()
> Date: Thu, 22 Oct 2026 03:56:04 +0000 [thread overview]
> Message-ID: <20261022035604.3183589-1-ricardo.salveti@oss.qualcomm.com> (raw)
>
> pahole 1.31 ran objcopy through system(), so LLVM_OBJCOPY was a command
> line that could carry options, like the $(OBJCOPY) make variable the
> kernel build sets it from. Since the switch to exec_objcopy() the whole
> value of LLVM_OBJCOPY or OBJCOPY is passed to posix_spawnp() as the
> program name, so a value such as "objcopy --some-option", or one with a
> trailing blank, fails with ENOENT.
>
> Kernel builds up to v6.19, including the LTS branches, run
> LLVM_OBJCOPY="${OBJCOPY}" pahole -J from link-vmlinux.sh and use
> ${OBJCOPY} unquoted for their own objcopy calls in the same script, so
> an OBJCOPY that works for the rest of the build now stops the link with:
>
> btf_encoder__write_elf: failed to add .BTF section to '.tmp_vmlinux1'
>
> This breaks OpenEmbedded kernel builds, where OBJCOPY carries the
> machine's objcopy options and ends with a blank when there are none.
>
> Split the command on blanks, like the shell's word splitting did with
> system(), for OBJCOPY as well. Quotes are not interpreted, so a path
> containing blanks can no longer be used, either quoted as with system()
> or as is as with v1.32. Name the file as both input and output, so that
> a stray word in the command makes objcopy fail instead of being taken
> as its input file and replacing the target.
>
> Extend btf_write_elf.sh to check that options in LLVM_OBJCOPY reach
> objcopy.
>
> Fixes: 6789ef8a16d5 ("btf_encoder: Fall back to objcopy when llvm-objcopy is not available")
> Assisted-by: Claude Code:claude-opus-5-5
> Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
Applied, thank you!
prev parent reply other threads:[~2026-11-04 14:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 3:56 [PATCH] dutil: Split the objcopy command into words in exec_objcopy() Ricardo Salveti
2026-11-04 14:55 ` Alan Maguire [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=26aca401-e6b0-4650-a6ef-af2e37ae5b2b@kernel.org \
--to=almagui@kernel.org \
--cc=acme@kernel.org \
--cc=alan.maguire@oracle.com \
--cc=bpf@vger.kernel.org \
--cc=dwarves@vger.kernel.org \
--cc=ricardo.salveti@oss.qualcomm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox