mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Schier <nicolas@fjasle.eu>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
	Daniel Gomez <da.gomez@samsung.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>
Subject: Re: [PATCH] kbuild: avoid scripts/kallsyms parsing /dev/null
Date: Wed, 7 Aug 2024 20:29:05 +0200	[thread overview]
Message-ID: <ZrO88YnT8vg5oQGz@bergen> (raw)
In-Reply-To: <20240807181148.660157-1-masahiroy@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1503 bytes --]

On Thu 08 Aug 2024 03:03:00 GMT, Masahiro Yamada wrote:
> On macOS, getline() sets ENOTTY to errno if it is requested to read
> from /dev/null.
> 
> If this is worth fixing, I would rather pass an empty file to
> scripts/kallsyms instead of adding the ugly #ifdef __APPLE__.
> 
> Fixes: c442db3f49f2 ("kbuild: remove PROVIDE() for kallsyms symbols")
> Reported-by: Daniel Gomez <da.gomez@samsung.com>
> Closes: https://lore.kernel.org/all/20240807-macos-build-support-v1-12-4cd1ded85694@samsung.com/
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  scripts/link-vmlinux.sh | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
> index f7b2503cdba9..41c68ae3415d 100755
> --- a/scripts/link-vmlinux.sh
> +++ b/scripts/link-vmlinux.sh
> @@ -219,7 +219,8 @@ kallsymso=
>  strip_debug=
>  
>  if is_enabled CONFIG_KALLSYMS; then
> -	kallsyms /dev/null .tmp_vmlinux0.kallsyms
> +	truncate -s0 .tmp_vmlinux.kallsyms0.syms
> +	kallsyms .tmp_vmlinux.kallsyms0.syms .tmp_vmlinux0.kallsyms
>  fi
>  
>  if is_enabled CONFIG_KALLSYMS || is_enabled CONFIG_DEBUG_INFO_BTF; then
> -- 
> 2.43.0
> 
> 

Thanks!  I definitely support moving special MacOS support from source 
code into scripts and Makefiles.

Might you want to add a comment to truncate, to prevent accidental 
attempts to revert/refactor this?

Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>

Kind regards,
Nicolas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-08-07 18:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240807181200eucas1p242be38e7c6ce8c18fdd74f959d748447@eucas1p2.samsung.com>
2024-08-07 18:03 ` Masahiro Yamada
2024-08-07 18:29   ` Nicolas Schier [this message]
2024-08-07 19:03   ` Daniel Gomez

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=ZrO88YnT8vg5oQGz@bergen \
    --to=nicolas@fjasle.eu \
    --cc=ardb@kernel.org \
    --cc=da.gomez@samsung.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    /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

all inboxes | Powered by JetHome®