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
--0000000000004a89b5060c7c15ef
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Dec 14, 2023 at 10:48=E2=80=AFAM John Baldwin <jhb@freebsd.org> wro=
te:

> 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=3D0840bdbf2a07b68e29267bc49057ca6=
df2351360
> >
> > 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 woul=
d
> 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 feel=
s
> a
> >      little backwards), but for now just paper over this by skipping th=
e
> >      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 fashio=
n
> similar
> to the output one gets from 'kldxref -d'.
>

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

Warner

--0000000000004a89b5060c7c15ef
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Thu, Dec 14, 2023 at 10:48=E2=80=
=AFAM John Baldwin &lt;<a href=3D"mailto:jhb@freebsd.org">jhb@freebsd.org</=
a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0p=
x 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=3D"https://cgit.FreeBSD.org/src/commit/?id=3D0840bdbf2a07=
b68e29267bc49057ca6df2351360" rel=3D"noreferrer" target=3D"_blank">https://=
cgit.FreeBSD.org/src/commit/?id=3D0840bdbf2a07b68e29267bc49057ca6df2351360<=
/a><br>
&gt; <br>
&gt; commit 0840bdbf2a07b68e29267bc49057ca6df2351360<br>
&gt; Author:=C2=A0 =C2=A0 =C2=A0Jessica Clarke &lt;jrtc27@FreeBSD.org&gt;<b=
r>
&gt; AuthorDate: 2023-12-14 16:40:08 +0000<br>
&gt; Commit:=C2=A0 =C2=A0 =C2=A0Jessica Clarke &lt;jrtc27@FreeBSD.org&gt;<b=
r>
&gt; CommitDate: 2023-12-14 16:40:08 +0000<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 Don&#39;t try and run kldxref for arm kernels<br>
&gt;=C2=A0 =C2=A0 =C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 Surprisingly, kldxref does not currently support a=
rm, and unhelpfully<br>
&gt;=C2=A0 =C2=A0 =C2=A0 this means it silently does nothing rather than gi=
ve an error, so the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 linker.hints entry added to the METALOG for -DNO_R=
OOT builds (and<br>
&gt;=C2=A0 =C2=A0 =C2=A0 pkgbase ones) refers to a file that doesn&#39;t ex=
ist. Ideally it would be<br>
&gt;=C2=A0 =C2=A0 =C2=A0 supported (and ideally the METALOG handling would =
be less fragile, but<br>
&gt;=C2=A0 =C2=A0 =C2=A0 without integrating it into kldxref the only real =
option would be to<br>
&gt;=C2=A0 =C2=A0 =C2=A0 just run find(1) to get the list of linker.hints f=
iles, which feels a<br>
&gt;=C2=A0 =C2=A0 =C2=A0 little backwards), but for now just paper over thi=
s by skipping the<br>
&gt;=C2=A0 =C2=A0 =C2=A0 build step on arm.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 Reported by:=C2=A0 =C2=A0 bapt<br>
&gt;=C2=A0 =C2=A0 =C2=A0 Fixes:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ff7c12c1f=
17e (&quot;Make kldxref a bootstrap tool and use unconditionally&quot;)<br>
&gt; ---<br>
&gt;=C2=A0 =C2=A0sys/conf/<a href=3D"http://kmod.mk" rel=3D"noreferrer" tar=
get=3D"_blank">kmod.mk</a>=C2=A0 =C2=A0 =C2=A0| 3 ++-<br>
&gt;=C2=A0 =C2=A0sys/modules/Makefile | 3 ++-<br>
&gt;=C2=A0 =C2=A02 files changed, 4 insertions(+), 2 deletions(-)<br>
<br>
I think before the libelf changes it was creating a file, but with only a s=
ingle<br>
version record.=C2=A0 Now it defers emitting the version record until it em=
its at least<br>
one &quot;real&quot; record since it doesn&#39;t know which endianness to u=
se until it has<br>
successfully opened and parsed a file.=C2=A0 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=C2=A0</div></div></div>

--0000000000004a89b5060c7c15ef--



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