Re: Reduced reproduction of games/libretro-beetle_psx 's armv7 build failure

Mark Millard <[email protected]>
Newsgroups gmane.os.freebsd.devel.toolchain,gmane.os.freebsd.devel.arm
Message-ID <[email protected]>
On 2022-Aug-22, at 11:30, Mark Millard <[email protected]> wrote:

> games/libretro-beetle_psx built for armv7 uses its jit_arm*.c
> code. The below is a simplification of the context for the
> later shown build failure log file from the FreeBSD package
> build servers:
> 
> # more libretro-beetle_psx_build_failure_reduction.c 
> extern float    __addsf3(float, float);
> extern double   __adddf3(double, double);

Investigative activity after an off-list message lead to me
to discover that the above 2 are not from the likes of:

Run-time ABI for the Arm® Architecture

but are instead from the likes of:

https://gcc.gnu.org/onlinedocs/gccint/Soft-float-library-routines.html#Soft-float-library-routines

associated with what the gcc folks sometimes have in
libgcc.a or libgcc_s.so.1 . (The subset varies by
architecture from what I've seen.)

> int main()
> {
>    (void)__addsf3(0, 0);
>    (void)__adddf3(0, 0);
> }
> 
> # cc libretro-beetle_psx_build_failure_reduction.c
> ld: error: undefined symbol: __addsf3
>>>> referenced by libretro-beetle_psx_build_failure_reduction.c
>>>>              /tmp/libretro-beetle_psx_build_failure_reduction-e3ff6d.o:(main)
> 
> ld: error: undefined symbol: __adddf3
>>>> referenced by libretro-beetle_psx_build_failure_reduction.c
>>>>              /tmp/libretro-beetle_psx_build_failure_reduction-e3ff6d.o:(main)
>>>> did you mean: __adddi3
>>>> defined in: /lib/libc.so.7
> cc: error: linker command failed with exit code 1 (use -v to see invocation)

The same goes for trying allowing the use of libgcc_s.so.1
to supply definitions:

# cc -lgcc_s libretro-beetle_psx_build_failure_reduction.c
ld: error: undefined symbol: __addsf3
>>> referenced by libretro-beetle_psx_build_failure_reduction.c
>>>               /tmp/libretro-beetle_psx_build_failure_reduction-fefae9.o:(main)

ld: error: undefined symbol: __adddf3
>>> referenced by libretro-beetle_psx_build_failure_reduction.c
>>>               /tmp/libretro-beetle_psx_build_failure_reduction-fefae9.o:(main)
>>> did you mean: __adddi3
>>> defined in: /lib/libc.so.7
cc: error: linker command failed with exit code 1 (use -v to see invocation)

> An recent example of the build failure on the FreeBSD package
> builder servers is:
> 
> http://ampere2.nyi.freebsd.org/data/main-armv7-default/p85ef7d020401_s0fd8d3589/logs/errors/libretro-beetle_psx-0.20220211_1.log
> 
> There may be other examples than __addsf3 and __adddf3 (in
> other software?). It seems there must not be a (complete)
> test for the coverage of such things.
> 
> That same reduced-problem source (by content) builds for
> aarch64 and runs fine on aarch64.
> 
> There are more issues with missing math routines vs. the lang/gcc*
> code generation --on aarch64 as well. But the above sticks to
> system-clang's toolchain as a context.

It seems that, despite no direct use of lang/gcc* , I'd
wondered into an example of use of gcc* related definitions,
where FreeBSD does not have the 2 math routines covered
for armv7 (but does for aarch64).

> Note: I do not normally build games/libretro-beetle_psx and never
> use it. I got here from looking into a somewhat analogous failure
> and looking to find an official activity that was similar that I
> could reference.
> 



===
Mark Millard
marklmi at yahoo.com
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.