Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Dec 2023 11:02:02 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Jessica Clarke <jrtc27@freebsd.org>, src-committers@freebsd.org,  dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: 0840bdbf2a07 - main - Don't try and run kldxref for arm kernels
Message-ID:  <CANCZdfqJqFR0ZZJP--zYaKSaN3%2BtGgMHjk0_ZsbqL-Lwf2P7BQ@mail.gmail.com>
In-Reply-To: <92a185f3-ab96-4dd0-b455-a3e28aa595f6@FreeBSD.org>
References:  <202312141644.3BEGiQKZ081497@gitrepo.freebsd.org> <92a185f3-ab96-4dd0-b455-a3e28aa595f6@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Thu, Dec 14, 2023 at 10:48 AM John Baldwin <jhb@freebsd.org> wrote:

> On 12/14/23 8:44 AM, Jessica Clarke wrote:
> > The branch main has been updated by jrtc27:
> >
> > URL:
> https://cgit.FreeBSD.org/src/commit/?id=0840bdbf2a07b68e29267bc49057ca6df2351360
> >
> > commit 0840bdbf2a07b68e29267bc49057ca6df2351360
> > Author:     Jessica Clarke <jrtc27@FreeBSD.org>
> > AuthorDate: 2023-12-14 16:40:08 +0000
> > Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
> > CommitDate: 2023-12-14 16:40:08 +0000
> >
> >      Don't try and run kldxref for arm kernels
> >
> >      Surprisingly, kldxref does not currently support arm, and
> unhelpfully
> >      this means it silently does nothing rather than give an error, so
> the
> >      linker.hints entry added to the METALOG for -DNO_ROOT builds (and
> >      pkgbase ones) refers to a file that doesn't exist. Ideally it would
> be
> >      supported (and ideally the METALOG handling would be less fragile,
> but
> >      without integrating it into kldxref the only real option would be to
> >      just run find(1) to get the list of linker.hints files, which feels
> a
> >      little backwards), but for now just paper over this by skipping the
> >      build step on arm.
> >
> >      Reported by:    bapt
> >      Fixes:          ff7c12c1f17e ("Make kldxref a bootstrap tool and
> use unconditionally")
> > ---
> >   sys/conf/kmod.mk     | 3 ++-
> >   sys/modules/Makefile | 3 ++-
> >   2 files changed, 4 insertions(+), 2 deletions(-)
>
> I think before the libelf changes it was creating a file, but with only a
> single
> version record.  Now it defers emitting the version record until it emits
> at least
> one "real" record since it doesn't know which endianness to use until it
> has
> successfully opened and parsed a file.  As a result it is now leaving the
> file
> empty rather than with the version record.
>
> It should not be hard to add ef_arm.c to fix for arm.
>
> Another fun project btw would be for someone to add a "read" mode to
> kldxref to
> read a linker.hints file and dump the contents in a human readable fashion
> similar
> to the output one gets from 'kldxref -d'.
>

devmatch -v I think does this. But it's not nice.

Warner

[-- Attachment #2 --]
<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 14, 2023 at 10:48 AM John Baldwin &lt;<a href="mailto:jhb@freebsd.org">jhb@freebsd.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 12/14/23 8:44 AM, Jessica Clarke wrote:<br>
&gt; The branch main has been updated by jrtc27:<br>
&gt; <br>
&gt; URL: <a href="https://cgit.FreeBSD.org/src/commit/?id=0840bdbf2a07b68e29267bc49057ca6df2351360" rel="noreferrer" target="_blank">https://cgit.FreeBSD.org/src/commit/?id=0840bdbf2a07b68e29267bc49057ca6df2351360</a><br>;
&gt; <br>
&gt; commit 0840bdbf2a07b68e29267bc49057ca6df2351360<br>
&gt; Author:     Jessica Clarke &lt;jrtc27@FreeBSD.org&gt;<br>
&gt; AuthorDate: 2023-12-14 16:40:08 +0000<br>
&gt; Commit:     Jessica Clarke &lt;jrtc27@FreeBSD.org&gt;<br>
&gt; CommitDate: 2023-12-14 16:40:08 +0000<br>
&gt; <br>
&gt;      Don&#39;t try and run kldxref for arm kernels<br>
&gt;      <br>
&gt;      Surprisingly, kldxref does not currently support arm, and unhelpfully<br>
&gt;      this means it silently does nothing rather than give an error, so the<br>
&gt;      linker.hints entry added to the METALOG for -DNO_ROOT builds (and<br>
&gt;      pkgbase ones) refers to a file that doesn&#39;t exist. Ideally it would be<br>
&gt;      supported (and ideally the METALOG handling would be less fragile, but<br>
&gt;      without integrating it into kldxref the only real option would be to<br>
&gt;      just run find(1) to get the list of linker.hints files, which feels a<br>
&gt;      little backwards), but for now just paper over this by skipping the<br>
&gt;      build step on arm.<br>
&gt;      <br>
&gt;      Reported by:    bapt<br>
&gt;      Fixes:          ff7c12c1f17e (&quot;Make kldxref a bootstrap tool and use unconditionally&quot;)<br>
&gt; ---<br>
&gt;   sys/conf/<a href="http://kmod.mk" rel="noreferrer" target="_blank">kmod.mk</a>     | 3 ++-<br>
&gt;   sys/modules/Makefile | 3 ++-<br>
&gt;   2 files changed, 4 insertions(+), 2 deletions(-)<br>
<br>
I think before the libelf changes it was creating a file, but with only a single<br>
version record.  Now it defers emitting the version record until it emits at least<br>
one &quot;real&quot; record since it doesn&#39;t know which endianness to use until it has<br>
successfully opened and parsed a file.  As a result it is now leaving the file<br>
empty rather than with the version record.<br>
<br>
It should not be hard to add ef_arm.c to fix for arm.<br>
<br>
Another fun project btw would be for someone to add a &quot;read&quot; mode to kldxref to<br>
read a linker.hints file and dump the contents in a human readable fashion similar<br>
to the output one gets from &#39;kldxref -d&#39;.<br></blockquote><div><br></div><div>devmatch -v I think does this. But it&#39;s not nice.</div><div><br></div><div>Warner </div></div></div>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqJqFR0ZZJP--zYaKSaN3%2BtGgMHjk0_ZsbqL-Lwf2P7BQ>