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

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

--Apple-Mail=_BDBF1E2A-F9B7-44D8-BE88-11DB7616FC1E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Hello Warner,

Thanks for the suggestions, worked like a charm! So here=E2=80=99s the =
complete list of commands:

```
[root@aeschylus /usr/src]# mkdir /root/backup
[root@aeschylus /usr/src]# cp /lib/libgcc_s.so.1 /root/backup/
[root@aeschylus /usr/src]# cp /usr/lib/debug/lib/libgcc_s.so.1.debug =
/root/backup/
[root@aeschylus /usr/src]# cd /usr/src
[root@aeschylus /usr/src]# patch -C < =
/home/atma/arithmetic_symbols.patch # dry-run mode
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

[root@aeschylus /usr/src]# patch < /home/atma/arithmetic_symbols.patch # =
apply the patch
[=E2=80=A6] # same as above
[root@aeschylus /usr/src]# patch < /home/atma/arithmetic_symbols.patch # =
apply the patch
[root@aeschylus /usr/src]# cd lib/libgcc_s
[root@aeschylus /usr/src]# make clean obj depend all
[=E2=80=A6]
[root@aeschylus /usr/src]# sudo make install
[=E2=80=A6]
```

Radius comes up without errors. The SQL driver works as expected.

Thank you!

> On 17 Dec 2023, at 10:24 AM, Warner Losh <imp@bsdimp.com> wrote:
>=20
>=20
>=20
> On Sun, Dec 17, 2023, 12:35=E2=80=AFAM Panagiotis Atmatzidis =
<atma@convalesco.org <mailto:atma@convalesco.org>> wrote:
>>=20
>>=20
>>> On 17 Dec 2023, at 8:41 AM, Panagiotis Atmatzidis =
<atma@convalesco.org <mailto:atma@convalesco.org>> wrote:
>>>=20
>>> Hello,
>>>=20
>>> I=E2=80=99m trying to setup FreeRadius3 on RPi2 (armv6) running =
FreeBSD-13.2. I=E2=80=99m using MySQL as a backend because it runs =
nicely on a low resource hardware.
>>>=20
>>> Enabling the SQL driver yields the following error:
>>>=20
>>> ```
>>> 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 =
module =E2=80=9Csql"
>>> ```
>>>=20
>>> 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?
>>>=20
>>> 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.
>>>=20
>>> Kind regards,
>>>=20
>>> P.
>>>=20
>>>=20
>>> [^1]: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271087
>>> [^2]: =
https://bugs.freebsd.org/bugzilla/attachment.cgi?bugid=3D271087&action=3Dv=
iewall
>>>=20
>>=20
>> 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-step for posterity.
>>=20
>> Copy the patch (diff file) and place the patch to the home dir e.g. " =
/home/atma/arithmetic_symbols.patch=E2=80=9D and then then:
>>=20
>> ```
>> [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
>> ```
>=20
>=20
> Ideally you'd do a full buildworld/installworld here. On these =
machines that takes a lot of time.
>=20
> You may be able to do:
>=20
> % cd lib/libgcc_s
> % make clean obj depend all
> % sudo make install
>=20
> 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.
>=20
> 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.
>=20
> 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).
>=20
> Warner
>=20
>> --
>> Panagiotis (atmosx) Atmatzidis
>> GPG:       gpg --keyserver pgp.mit.edu <http://pgp.mit.edu/>; =
--recv-keys 1A7BFEC5

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






--Apple-Mail=_BDBF1E2A-F9B7-44D8-BE88-11DB7616FC1E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;">Hello =
Warner,<div><br></div><div>Thanks for the suggestions, worked like a =
charm! So here=E2=80=99s the complete list of =
commands:</div><div><br></div><div>```</div><div><span =
style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, =
0);">[root@aeschylus /usr/src]# mkdir =
/root/backup</span></div><div><span style=3D"caret-color: rgb(0, 0, 0); =
color: rgb(0, 0, 0);">[root@aeschylus /usr/src]#&nbsp;</span>cp =
/lib/libgcc_s.so.1 /root/backup/</div><div><span style=3D"caret-color: =
rgb(0, 0, 0); color: rgb(0, 0, 0);">[root@aeschylus =
/usr/src]#&nbsp;</span>cp /usr/lib/debug/lib/libgcc_s.so.1.debug =
/root/backup/</div><div><div><span style=3D"caret-color: rgb(0, 0, 0); =
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 # dry-run mode</div><div>Hmm... =
&nbsp;Looks like a unified diff to me...</div><div>The text leading up =
to this was:</div><div>--------------------------</div><div>|diff --git =
a/lib/libgcc_s/Versions.def b/lib/libgcc_s/Versions.def</div><div>|index =
d28e9042f744..b90bc705e3de 100644</div><div>|--- =
a/lib/libgcc_s/Versions.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... &nbsp;The next =
patch looks like a unified diff to me...</div><div>The text leading up =
to this was:</div><div>--------------------------</div><div>|diff --git =
a/lib/libgcc_s/arm/Symbol.map =
b/lib/libgcc_s/arm/Symbol.map</div><div>|index =
92b54761d810..49b0820b2a73 100644</div><div>|--- =
a/lib/libgcc_s/arm/Symbol.map</div><div>|+++ =
b/lib/libgcc_s/arm/Symbol.map</div><div>--------------------------</div><d=
iv>Patching file lib/libgcc_s/arm/Symbol.map using Plan =
A...</div><div>Hunk #1 succeeded at 16 (offset 1 =
line).</div><div>done</div><div><div><br></div><div><span =
style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, =
0);">[root@aeschylus /usr/src]# patch &lt; =
/home/atma/arithmetic_symbols.patch # apply the =
patch</span></div><div><font color=3D"#000000"><span style=3D"caret-color:=
 rgb(0, 0, 0);">[=E2=80=A6] # same as =
above</span></font></div><div><span style=3D"caret-color: rgb(0, 0, 0); =
color: rgb(0, 0, 0);">[root@aeschylus /usr/src]# patch &lt; =
/home/atma/arithmetic_symbols.patch # apply the =
patch</span></div><div><div dir=3D"auto" style=3D"caret-color: rgb(0, 0, =
0); color: rgb(0, 0, 0);">[root@aeschylus /usr/src]# cd =
lib/libgcc_s</div><div dir=3D"auto" style=3D"caret-color: rgb(0, 0, 0); =
color: rgb(0, 0, 0);">[root@aeschylus /usr/src]# make clean obj depend =
all</div><div dir=3D"auto" style=3D"caret-color: rgb(0, 0, 0); color: =
rgb(0, 0, 0);">[=E2=80=A6]</div><div dir=3D"auto" style=3D"caret-color: =
rgb(0, 0, 0); color: rgb(0, 0, 0);">[root@aeschylus /usr/src]# sudo make =
install</div><div dir=3D"auto" style=3D"caret-color: rgb(0, 0, 0); =
color: rgb(0, 0, 0);">[=E2=80=A6]</div><div dir=3D"auto" =
style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">```</div><div =
dir=3D"auto" style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, =
0);"><br></div><div dir=3D"auto" style=3D"caret-color: rgb(0, 0, 0); =
color: rgb(0, 0, 0);">Radius comes up without errors. The SQL driver =
works as expected.</div><div dir=3D"auto" style=3D"caret-color: rgb(0, =
0, 0); color: rgb(0, 0, 0);"><br></div><div dir=3D"auto" =
style=3D"caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">Thank =
you!</div></div><div><br><blockquote type=3D"cite"><div>On 17 Dec 2023, =
at 10:24 AM, Warner Losh &lt;imp@bsdimp.com&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div><meta charset=3D"UTF-8"><div =
dir=3D"ltr" style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;"><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=AFAM =
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: 0px =
0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; =
border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div =
style=3D"line-break: after-white-space;"><br><div><br><blockquote =
type=3D"cite"><div>On 17 Dec 2023, at 8:41 AM, Panagiotis Atmatzidis =
&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 setup FreeRadius3 on RPi2 (armv6) running FreeBSD-13.2. =
I=E2=80=99m using MySQL as a backend because it runs nicely on a low =
resource hardware.</div><div><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 =
"__aeabi_uidivmod"</div><div>Make sure it (and all its dependent =
libraries!) are in the search path of your system's =
ld</div><div>/usr/local/etc/raddb/mods-enabled/sql[27]: Instantiation =
failed for module =
=E2=80=9Csql"</div></div><div>```</div><div><br></div><div>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?</div><div><br></div><div>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.</div><div><br></div><div>Kind =
regards,</div><div><br></div><div>P.</div><div><br></div><div><br></div><d=
iv>[^1]:&nbsp;<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_bug.cgi?id=3D2710=
87</a></div><div>[^2]:&nbsp;<a =
href=3D"https://bugs.freebsd.org/bugzilla/attachment.cgi?bugid=3D271087&am=
p;action=3Dviewall" rel=3D"noreferrer" =
target=3D"_blank">https://bugs.freebsd.org/bugzilla/attachment.cgi?bugid=3D=
271087&amp;action=3Dviewall</a></div><div><div><br></div></div></div></div=
></blockquote><br></div><div>Going through a similar request[^1] in the =
forums and a bit of &nbsp;browsing 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. "<span =
style=3D"">&nbsp;</span><font>/home/atma/arithmetic_symbols.patch=E2=80=9D=
 and then then:</font></div><div><br></div><div>```</div><div><div><span =
style=3D"">[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...&nbsp; Looks like a =
unified diff to me...</div><div>The text leading up to this =
was:</div><div>--------------------------</div><div>|diff --git =
a/lib/libgcc_s/Versions.def b/lib/libgcc_s/Versions.def</div><div>|index =
d28e9042f744..b90bc705e3de 100644</div><div>|--- =
a/lib/libgcc_s/Versions.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...&nbsp; The next =
patch looks like a unified diff to me...</div><div>The text leading up =
to this was:</div><div>--------------------------</div><div>|diff --git =
a/lib/libgcc_s/arm/Symbol.map =
b/lib/libgcc_s/arm/Symbol.map</div><div>|index =
92b54761d810..49b0820b2a73 100644</div><div>|--- =
a/lib/libgcc_s/arm/Symbol.map</div><div>|+++ =
b/lib/libgcc_s/arm/Symbol.map</div><div>--------------------------</div><d=
iv>Patching file lib/libgcc_s/arm/Symbol.map using Plan =
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'd do a =
full buildworld/installworld 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">% make 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 =
building, 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'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.</div><div =
dir=3D"auto"><br></div><div>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).</div><div dir=3D"auto"><br></div><div =
dir=3D"auto">Warner</div><div dir=3D"auto"><br></div><div =
dir=3D"auto"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" =
style=3D"margin: 0px 0px 0px 0.8ex; border-left-width: 1px; =
border-left-style: solid; border-left-color: rgb(204, 204, 204); =
padding-left: 1ex;"><div style=3D"line-break: =
after-white-space;"><div><div dir=3D"auto" style=3D"letter-spacing: =
normal; text-align: 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" style=3D"letter-spacing:=
 normal; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; word-spacing: 0px; text-decoration: none; =
line-break: after-white-space;">--<br>Panagiotis (atmosx) =
Atmatzidis<br>GPG: &nbsp; &nbsp; &nbsp; gpg --keyserver<span =
class=3D"Apple-converted-space">&nbsp;</span><a =
href=3D"http://pgp.mit.edu/" rel=3D"noreferrer" =
target=3D"_blank">pgp.mit.edu</a><span =
class=3D"Apple-converted-space">&nbsp;</span>--recv-keys&nbsp;1A7BFEC5</di=
v></div></div></div></blockquote></div></div></div></div></div></blockquot=
e></div><br><div>
<meta charset=3D"UTF-8"><div dir=3D"auto" style=3D"caret-color: rgb(0, =
0, 0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: =
after-white-space;"><div dir=3D"auto" style=3D"caret-color: rgb(0, 0, =
0); color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: =
after-white-space;">--<br>Panagiotis (atmosx) Atmatzidis<br>GPG: &nbsp; =
&nbsp; &nbsp; gpg --keyserver pgp.mit.edu =
--recv-keys&nbsp;1A7BFEC5<br><br><br><br><br></div></div>
</div>
<br></div></div></body></html>=

--Apple-Mail=_BDBF1E2A-F9B7-44D8-BE88-11DB7616FC1E--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?292A20D8-94CB-47FE-B48B-D3EFF10079AC>