mips32 + gcc9 -- still broken

Alexander Richardson arichardson at freebsd.org
Mon Sep 21 07:43:05 UTC 2020


On Mon, 21 Sep 2020, 07:38 Adrian Chadd, <adrian at freebsd.org> wrote:

> So, the big list of unknown symbols was my fault! Whoops.
>
> i've gotten further using gcc-6.4 by fixing some of the warnings/issues
> that have crept up.
>
> Here's a review for one of them:
>
> https://reviews.freebsd.org/D26504
>
> However, now I've hit:
>
> /usr/local/bin/mips-unknown-freebsd13.0-ld:
>
> /usr/home/adrian/work/freebsd/head-embedded/obj/mips_ap/usr/home/adrian/work/freebsd/head-embedded/src/mips.mips/tmp/usr/lib/libc++.so.1:
> undefined reference to `__atomic_fetch_sub_8'
> /usr/local/bin/mips-unknown-freebsd13.0-ld:
>
> /usr/home/adrian/work/freebsd/head-embedded/obj/mips_ap/usr/home/adrian/work/freebsd/head-embedded/src/mips.mips/tmp/usr/lib/libc++.so.1:
> undefined reference to `__atomic_load_8'
> /usr/local/bin/mips-unknown-freebsd13.0-ld:
>
> /usr/home/adrian/work/freebsd/head-embedded/obj/mips_ap/usr/home/adrian/work/freebsd/head-embedded/src/mips.mips/tmp/usr/lib/libc++.so.1:
> undefined reference to `__atomic_fetch_add_8'
>
> .. looks like we need some 64 bit atomics now in mips32 for libc++ / devd
>

Those are now provided by compiler-rt when using clang. With GCC you'll
have to link libatomic. I had a quick look at the code in libc++ that uses
the 64-bit atomics a few weeks ago and I believe it's the futex fallback
code. The best solution would probably be to port it to use umtx but for
MIPS32 it might be fine to use a 32 bit atomic instead.

Alex

>


More information about the freebsd-current mailing list