From nobody Sun Dec 17 08:24:28 2023 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4StGGM3bBLz54Hsx for ; Sun, 17 Dec 2023 08:24:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4StGGM1Wzvz3Ly5 for ; Sun, 17 Dec 2023 08:24:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-50bf69afa99so2491645e87.3 for ; Sun, 17 Dec 2023 00:24:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1702801480; x=1703406280; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=21o9QdFxLb4Za5QXqKxvJi6ZD2ORrUjpHZ95rR2V2MI=; b=bq/rTs70uxCkdzum+eU6xCtlMfVr3URKJ7GRDrZFawTksu/Y4YQGIHY34o2FOmcUUl Hqo/DSHUl7eo4Cppr23ScJBelAsVvFlzrIfBCcZbg0tdaJux/TvZ7tBy+fdbT/Z7fcHR pCYXpS9qo8UFidl3HLASxQjY0ewfnNoyctzT28hTJY7BG31wQDC/7XZejgfRJBHSFTDS mHHa7KTUa8UOZbelt1PSBnL6HO8F/BMjdRJiwlm18aX/vIXEU9YFGh+CnKLIWv3uoN/L 8Y1OUitSELVrzDLEYv4l3Ol33XWT7G4VnAajm9/qr7LXeQ9u5Ez3zA37V4l7UzKFMSkg RGlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702801480; x=1703406280; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=21o9QdFxLb4Za5QXqKxvJi6ZD2ORrUjpHZ95rR2V2MI=; b=FjtuH1mqgkT9IYbJZafkOZFTluHzSzKfrMyDdaLB7EBF+NnIFhtBFjxaHa/1+2tpZ3 2J4eG45rceaRxa6L+Iosr1XA4x7BoKho0e0+zGq8lcPmdJ43FlSdocp4GFiEdypAv8Fw +2qiuhMjaQMHx8Ucw7x4pmH3f7cEXqH4VOOXZ4lTtOI4hd7KX6GOvojUXuU3l35sn1eB Ijd6T0emUanTGyei6ekjF6WOqkvN/H6IarKDm8na1Rl9NthBfvaWRL+33ooU2ONHJHRH ldgehomQRe5ovT3WPWlrxTd5Muaazh6H66LI9oPiuEyK8POkNWiXH8jYKvtmtd4Yli1n OK6A== X-Gm-Message-State: AOJu0YxWaQPLcdHmuiyc3iGx1/ng/Fq538kEwUD6zDlxCv7q+E+MO3IC SDvYAlBe1yHNT08LV2z8b/SLXGUKyxhgKljvrkmRA+UmeNdrBct+DSM= X-Google-Smtp-Source: AGHT+IGzZMK8Gg/6exM6zxlvEGqv4Q8iDISu4IrztlyzZuUvKnIwAcDDBtzYtG+XOsqzg/W5sOXO4w8zKd9xp/3FyZY= X-Received: by 2002:a05:6512:124c:b0:50d:1888:1e4b with SMTP id fb12-20020a056512124c00b0050d18881e4bmr9774069lfb.49.1702801479787; Sun, 17 Dec 2023 00:24:39 -0800 (PST) List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 References: <5331A126-5DF4-4758-A607-31F23DD5C5B7@convalesco.org> In-Reply-To: From: Warner Losh Date: Sun, 17 Dec 2023 01:24:28 -0700 Message-ID: Subject: Re: FreeRadius SQL driver undefined symbol __aeabi_uidivmod To: Panagiotis Atmatzidis Cc: "freebsd-arm@freebsd.org" Content-Type: multipart/alternative; boundary="0000000000005377da060cb05df5" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4StGGM1Wzvz3Ly5 --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 wrote: > > > On 17 Dec 2023, at 8:41 AM, Panagiotis Atmatzidis > 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


=
On Sun, Dec 17, 2023, 12:35=E2=80=AFA= M Panagiotis Atmatzidis <atma@convalesco.org> wrote:


On 17 Dec 2023, at 8:41 AM, Panagiotis Atmatzidi= s <atma@convalesco.org> wrote:

Hello,

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.

Enabling the SQL driver yields the following error:
<= div>
```
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 sear= ch path of your system's ld
/usr/local/etc/raddb/mods-enabled= /sql[27]: Instantiation failed for module =E2=80=9Csql"
```

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?

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 s= o I could use that if it helps.


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>

Copy the patch (diff file) and place the patch to = the home dir e.g. "=C2=A0/home/atma/arithmetic_symbols.patch=E2=80=9D and then th= en:

```
[root@aeschylus /usr/src]# cd /usr/src
[root@= aeschylus /usr/src]# patch -C < /home/atma/arithmetic_symbols.patch
Hmm...=C2=A0 Looks like a unified diff to me...
The text le= ading up to this was:
--------------------------
|diff = --git a/lib/libgcc_s/Versions.def b/lib/libgcc_s/Versions.def
|in= dex d28e9042f744..b90bc705e3de 100644
|--- a/lib/libgcc_s/Version= s.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...=C2=A0= The next patch looks like a unified diff to me...
The text leadi= ng up to this was:
--------------------------
|diff --g= it a/lib/libgcc_s/arm/Symbol.map b/lib/libgcc_s/arm/Symbol.map
|i= ndex 92b54761d810..49b0820b2a73 100644
|--- a/lib/libgcc_s/arm/Sy= mbol.map
|+++ b/lib/libgcc_s/arm/Symbol.map
-----------= ---------------
Patching file lib/libgcc_s/arm/Symbol.map using P= lan A...
Hunk #1 succeeded at 16 (offset 1 line).
done<= /div>
```
<= br>
Ideally you'd do a full buildworld/installwo= rld here. On these machines that takes a lot of time.

You may be able to do:

% cd lib/libgcc_s
% mak= e 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 buildi= ng, 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 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.

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't run for single-user).

Warner

--
Panagiotis (atmosx) AtmatzidisGPG: =C2=A0 =C2=A0 =C2=A0 gpg --keyserver pgp.mit.edu --recv-keys=C2=A01A7BF= EC5





--0000000000005377da060cb05df5--