Re: Undefined __aeabi_uidivmod in 14.0 armv7

"John F Carr" <[email protected]>
Newsgroups gmane.os.freebsd.devel.arm
Message-ID <[email protected]>
On Nov 23, 2023, at 13:23, Robert Clausecker <[email protected]> wrote:
> 
> Hi John,
> 
> This is a long standing open issue in base.  These __aeabi symbols are
> shims used by the ARM EABI to implement functionality missing in the
> instruction set.  Back when this was implemented, whoever did the port
> hacked something up and only added those symbols that were initially
> needed.  However, turns out a bunch more will be used by gcc/clang
> under certain circumstances.
> 
> While we actually have code for all of these symbols in clang's runtime,
> the version scripts were never fixed and the symbols remain unexposed.
> I have previously raised this issue with a bunch of people involved in
> the ARM bits of FreeBSD but never managed to get anybody to fix it.
> 
> Maybe it'll be different this time.
> 
> If you want to give it a try yourself, check the ARM EABI document.  It
> has a list of all __aeabi symbols that should be present.  You could try
> and add the missing ones to the appropriate libraries.
> 
> Yours,
> Robert Clausecker

This solves my build problem.  I made up a version string and
assumed all the __aeabi_ symbols in libgcc.a were to be exported.
I omitted the string functions as suggested in bug 271087.

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
@@ -31,3 +31,6 @@ GCC_4.3.0 {
 
 GCC_4.6.0 {
 } GCC_4.3.0;
+
+EABI_1 {
+};
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
@@ -15,3 +15,30 @@ GCC_3.5 {
 GCC_4.3.0 {
 	_Unwind_Backtrace;
 };
+
+EABI_1 {
+	__aeabi_llsl;
+	__aeabi_lasr;
+	__aeabi_lcmp;
+	__aeabi_idiv;
+	__aeabi_h2f;
+	__aeabi_d2lz;
+	__aeabi_f2lz;
+	__aeabi_d2ulz;
+	__aeabi_f2ulz;
+	__aeabi_ui2d;
+	__aeabi_ui2f;
+	__aeabi_llsr;
+	__aeabi_lmul;
+	__aeabi_d2h;
+	__aeabi_f2h;
+	__aeabi_ulcmp;
+	__aeabi_uidiv;
+	__aeabi_l2d;
+	__aeabi_l2f;
+	__aeabi_ul2d;
+	__aeabi_ul2f;
+	__aeabi_idiv0;
+	__aeabi_ldivmod;
+	__aeabi_uidivmod;
+};
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.