Re: git: ab52d5af3b6f - main - dns/doh-proxy: fix build on powerpc

From: Piotr Kubaj <pkubaj_at_anongoth.pl>
Date: Fri, 30 May 2025 10:14:07 UTC
On 25-05-29 11:47:28, Gerald Pfeifer wrote:
>On Thu, 15 Aug 2024, Piotr Kubaj wrote:
>>>> https://cgit.FreeBSD.org/ports/commit/?id=ab52d5af3b6fa295d2b9fb45d89e1cd23b15330f
>>>:
>>>>     dns/doh-proxy: fix build on powerpc
>>>>
>>>>       = note: ld: error: undefined symbol: __atomic_load_8
>>>>               >>> referenced by static.c
>>>>               >>>               98cfcaec7182b1d8-static.o:(mi_arena_schedule_purge)
>>>>               >>> in archive
>>>>               >>> /wrkdirs/usr/ports/dns/doh-proxy/work/rustc4xSzx7/liblibmimalloc_sys-4a9c093f9f8149a2.rlib
>>>>               >>> referenced by static.c
>>>>               >>>               98cfcaec7182b1d8-static.o:(mi_arenas_try_purge)
>>>>               >>> in archive
>>>>               >>> /wrkdirs/usr/ports/dns/doh-proxy/work/rustc4xSzx7/liblibmimalloc_sys-4a9c093f9f8149a2.rlib
>>>>               >>> referenced by static.c
>>>>               >>>               98cfcaec7182b1d8-static.o:(mi_stat_update)
>>>>               >>> in archive
>>>>               >>> /wrkdirs/usr/ports/dns/doh-proxy/work/rustc4xSzx7/liblibmimalloc_sys-4a9c093f9f8149a2.rlib
>>>>               >>> referenced 2 more times
>>>
>>>> +.include <bsd.port.options.mk>
>>>> +
>>>> +.if ${ARCH} == powerpc
>>>> +LIB_DEPENDS+=	libatomic.so:lang/gcc${GCC_DEFAULT}
>>>> +LDFLAGS+=	-L/usr/local/lib/gcc${GCC_DEFAULT} -latomic
>>>> +.endif
>>>
>>> This looks ... interesting: pulling in GCC for a single library which
>>> is more an interal aspect on one platform only?
>>>
>>> Isn't rather something broken or missing on powerpc and this is more of
>>> a crude hack leading to a Frankenbuild?
>> It's not the first port that does it, lang/rust itself also needs it.
>> The reason is missing 64-bit atomic functions in LLVM for powerpc.
>
>Then isn't this something for fix in LLVM for powerpc?
>
>(In this case I'm not worried about the maintenance effort on the
>lang/gcc* side. It increases build times and image sizes for users and I'd
>hope upstream LLVM would be open to fixing it? Do you have a bug report?)
>
>Gerald

-- 

I haven't filed a bug report. It isn't actually a bug, it's more of a
missing feature. Full GCC here isn't actually necessary, only libatomic
is. If it's possible to extract libatomic to a separate port, that would
also be ok.