Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Dec 2023 01:24:28 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Panagiotis Atmatzidis <atma@convalesco.org>
Cc:        "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org>
Subject:   Re: FreeRadius SQL driver undefined symbol __aeabi_uidivmod
Message-ID:  <CANCZdfp=3%2BoFqXs3kLwYMNMak8163ETuTA7CWwnt8%2Bdm1mo3qA@mail.gmail.com>
In-Reply-To: <EAFBDD77-92BA-40CC-8458-F1ED08DB7A6C@convalesco.org>
References:  <5331A126-5DF4-4758-A607-31F23DD5C5B7@convalesco.org> <EAFBDD77-92BA-40CC-8458-F1ED08DB7A6C@convalesco.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000005377da060cb05df5
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sun, Dec 17, 2023, 12:35=E2=80=AFAM Panagiotis Atmatzidis <atma@convales=
co.org>
wrote:

>
>
> On 17 Dec 2023, at 8:41 AM, Panagiotis Atmatzidis <atma@convalesco.org>
> wrote:
>
> Hello,
>
> I=E2=80=99m trying to setup FreeRadius3 on RPi2 (armv6) running FreeBSD-1=
3.2. I=E2=80=99m
> using MySQL as a backend because it runs nicely on a low resource hardwar=
e.
>
> Enabling the SQL driver yields the following error:
>
> ```
> Could not link driver rlm_sql_mysql: /usr/local/lib/libunwind.so.8:
> Undefined symbol "__aeabi_uidivmod"
> Make sure it (and all its dependent libraries!) are in the search path of
> your system's ld
> /usr/local/etc/raddb/mods-enabled/sql[27]: Instantiation failed for modul=
e
> =E2=80=9Csql"
> ```
>
> There is a discussion in bugtraq[^1] about this exact issue and there
> seems to be a patch as well[^2]. Can someone help me apply this patch or
> point me to a tutorial?
>
> I used =E2=80=9Cpkg=E2=80=9D to install "mysql80-server" and "freeradius3=
-mysql=E2=80=9C, however
> I have the ports collection installed so I could use that if it helps.
>
> Kind regards,
>
> P.
>
>
> [^1]: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271087
> [^2]:
> https://bugs.freebsd.org/bugzilla/attachment.cgi?bugid=3D271087&action=3D=
viewall
>
>
> Going through a similar request[^1] in the forums and a bit of  browsing
> the kernel tree helped figure things out. Sharing the solution step-by-st=
ep
> for posterity.
>
> Copy the patch (diff file) and place the patch to the home dir e.g. " /ho=
me/atma/arithmetic_symbols.patch=E2=80=9D
> and then then:
>
> ```
> [root@aeschylus /usr/src]# cd /usr/src
> [root@aeschylus /usr/src]# patch -C < /home/atma/arithmetic_symbols.patch
> Hmm...  Looks like a unified diff to me...
> The text leading up to this was:
> --------------------------
> |diff --git a/lib/libgcc_s/Versions.def b/lib/libgcc_s/Versions.def
> |index d28e9042f744..b90bc705e3de 100644
> |--- a/lib/libgcc_s/Versions.def
> |+++ b/lib/libgcc_s/Versions.def
> --------------------------
> Patching file lib/libgcc_s/Versions.def using Plan A...
> Hunk #1 succeeded at 32 (offset 1 line).
> Hmm...  The next patch looks like a unified diff to me...
> The text leading up to this was:
> --------------------------
> |diff --git a/lib/libgcc_s/arm/Symbol.map b/lib/libgcc_s/arm/Symbol.map
> |index 92b54761d810..49b0820b2a73 100644
> |--- a/lib/libgcc_s/arm/Symbol.map
> |+++ b/lib/libgcc_s/arm/Symbol.map
> --------------------------
> Patching file lib/libgcc_s/arm/Symbol.map using Plan A...
> Hunk #1 succeeded at 16 (offset 1 line).
> done
> ```
>

Ideally you'd do a full buildworld/installworld here. On these machines
that takes a lot of time.

You may be able to do:

% cd lib/libgcc_s
% make clean obj depend all
% sudo make install

But that assumes your system has all the compilers, libraries etc installed
on it... If you are cross building, then just do a full buildworld since
the above depends on make includes and possibly other things running first.

If we still have armv6 snapshots, there's a chance that the
/lib/libgcc_s.so.1 from it will have the fix and you can copy it over...
but that might be more hassle and may be less safe than the above.

Good luck. And make backups of /lib/libgcc_s.so.1 before starting (keep a
copy in /lib, and use /rescue/sh if you mess this up and /bin/sh can't run
for single-user).

Warner

--
> Panagiotis (atmosx) Atmatzidis
> GPG:       gpg --keyserver pgp.mit.edu --recv-keys 1A7BFEC5
>
>
>
>
>
>

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

<div dir=3D"ltr"><div dir=3D"auto"><div><br><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Sun, Dec 17, 2023, 12:35=E2=80=AFA=
M Panagiotis Atmatzidis &lt;<a href=3D"mailto:atma@convalesco.org" target=
=3D"_blank">atma@convalesco.org</a>&gt; wrote:<br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div style=3D"line-break:after-white-space"><br><div><br><blo=
ckquote type=3D"cite"><div>On 17 Dec 2023, at 8:41 AM, Panagiotis Atmatzidi=
s &lt;<a href=3D"mailto:atma@convalesco.org" rel=3D"noreferrer" target=3D"_=
blank">atma@convalesco.org</a>&gt; wrote:</div><br><div><div style=3D"line-=
break:after-white-space">Hello,<div><br></div><div>I=E2=80=99m trying to se=
tup FreeRadius3 on RPi2 (armv6) running FreeBSD-13.2. I=E2=80=99m using MyS=
QL as a backend because it runs nicely on a low resource hardware.</div><di=
v><br></div><div>Enabling the SQL driver yields the following error:</div><=
div><br></div><div>```</div><div><div>Could not link driver rlm_sql_mysql: =
/usr/local/lib/libunwind.so.8: Undefined symbol &quot;__aeabi_uidivmod&quot=
;</div><div>Make sure it (and all its dependent libraries!) are in the sear=
ch path of your system&#39;s ld</div><div>/usr/local/etc/raddb/mods-enabled=
/sql[27]: Instantiation failed for module =E2=80=9Csql&quot;</div></div><di=
v>```</div><div><br></div><div>There is a discussion in bugtraq[^1] about t=
his exact issue and there seems to be a patch as well[^2]. Can someone help=
 me apply this patch or point me to a tutorial?</div><div><br></div><div>I =
used =E2=80=9Cpkg=E2=80=9D to install &quot;mysql80-server&quot; and &quot;=
freeradius3-mysql=E2=80=9C, however I have the ports collection installed s=
o I could use that if it helps.</div><div><br></div><div>Kind regards,</div=
><div><br></div><div>P.</div><div><br></div><div><br></div><div>[^1]:=C2=A0=
<a href=3D"https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271087" rel=
=3D"noreferrer" target=3D"_blank">https://bugs.freebsd.org/bugzilla/show_bu=
g.cgi?id=3D271087</a></div><div>[^2]:=C2=A0<a href=3D"https://bugs.freebsd.=
org/bugzilla/attachment.cgi?bugid=3D271087&amp;action=3Dviewall" rel=3D"nor=
eferrer" target=3D"_blank">https://bugs.freebsd.org/bugzilla/attachment.cgi=
?bugid=3D271087&amp;action=3Dviewall</a></div><div><div>
<br></div></div></div></div></blockquote><br></div><div>Going through a sim=
ilar request[^1] in the forums and a bit of =C2=A0browsing the kernel tree =
helped figure things out. Sharing the solution step-by-step for posterity.<=
/div><div><br></div><div>Copy the patch (diff file) and place the patch to =
the home dir e.g. &quot;<span style=3D"color:rgb(0,0,0)">=C2=A0</span><font=
 color=3D"#000000">/home/atma/arithmetic_symbols.patch=E2=80=9D and then th=
en:</font></div><div><br></div><div>```</div><div><div><span style=3D"color=
:rgb(0,0,0)">[root@aeschylus /usr/src]# cd /usr/src</span></div><div>[root@=
aeschylus /usr/src]# patch -C &lt; /home/atma/arithmetic_symbols.patch</div=
><div>Hmm...=C2=A0 Looks like a unified diff to me...</div><div>The text le=
ading up to this was:</div><div>--------------------------</div><div>|diff =
--git a/lib/libgcc_s/Versions.def b/lib/libgcc_s/Versions.def</div><div>|in=
dex d28e9042f744..b90bc705e3de 100644</div><div>|--- a/lib/libgcc_s/Version=
s.def</div><div>|+++ b/lib/libgcc_s/Versions.def</div><div>----------------=
----------</div><div>Patching file lib/libgcc_s/Versions.def using Plan A..=
.</div><div>Hunk #1 succeeded at 32 (offset 1 line).</div><div>Hmm...=C2=A0=
 The next patch looks like a unified diff to me...</div><div>The text leadi=
ng up to this was:</div><div>--------------------------</div><div>|diff --g=
it a/lib/libgcc_s/arm/Symbol.map b/lib/libgcc_s/arm/Symbol.map</div><div>|i=
ndex 92b54761d810..49b0820b2a73 100644</div><div>|--- a/lib/libgcc_s/arm/Sy=
mbol.map</div><div>|+++ b/lib/libgcc_s/arm/Symbol.map</div><div>-----------=
---------------</div><div>Patching file lib/libgcc_s/arm/Symbol.map using P=
lan A...</div><div>Hunk #1 succeeded at 16 (offset 1 line).</div><div>done<=
/div><div>```</div></div></div></blockquote></div></div><div dir=3D"auto"><=
br></div><div dir=3D"auto">Ideally you&#39;d do a full buildworld/installwo=
rld here. On these machines that takes a lot of time.</div><div dir=3D"auto=
"><br></div><div dir=3D"auto">You may be able to do:</div><div dir=3D"auto"=
><br></div><div dir=3D"auto">% cd lib/libgcc_s</div><div dir=3D"auto">% mak=
e clean obj depend all</div><div dir=3D"auto">% sudo make install</div><div=
 dir=3D"auto"><br></div><div dir=3D"auto">But that assumes your system has =
all the compilers, libraries etc installed on it... If you are cross buildi=
ng, then just do a full buildworld since the above depends on make includes=
 and possibly other things running first.</div><div dir=3D"auto"><br></div>=
<div dir=3D"auto">If we still have armv6 snapshots, there&#39;s a chance th=
at the /lib/libgcc_s.so.1 from it will have the fix and you can copy it ove=
r... but that might be more hassle and may be less safe than the above.</di=
v><div dir=3D"auto"><br></div><div>Good luck. And make backups of /lib/libg=
cc_s.so.1 before starting (keep a copy in /lib, and use /rescue/sh if you m=
ess this up and /bin/sh can&#39;t run for single-user).</div><div dir=3D"au=
to"><br></div><div dir=3D"auto">Warner</div><div dir=3D"auto"><br></div><di=
v dir=3D"auto"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote"=
 style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><d=
iv style=3D"line-break:after-white-space"><div>
<div dir=3D"auto" style=3D"color:rgb(0,0,0);letter-spacing:normal;text-alig=
n:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing=
:0px;text-decoration:none;line-break:after-white-space"><div dir=3D"auto" s=
tyle=3D"color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent=
:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoratio=
n:none;line-break:after-white-space">--<br>Panagiotis (atmosx) Atmatzidis<b=
r>GPG: =C2=A0 =C2=A0 =C2=A0 gpg --keyserver <a href=3D"http://pgp.mit.edu" =
rel=3D"noreferrer" target=3D"_blank">pgp.mit.edu</a> --recv-keys=C2=A01A7BF=
EC5<br><br><br><br><br></div></div>
</div>
<br></div></blockquote></div></div></div>
</div>

--0000000000005377da060cb05df5--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfp=3%2BoFqXs3kLwYMNMak8163ETuTA7CWwnt8%2Bdm1mo3qA>