git: 623398ff2efc - main - sysutils/btop: fix build on i386 and powerpc with GCC 11

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Wed, 29 Jun 2022 17:01:38 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=623398ff2efcadc2cd5e6769879fb31800c98d91

commit 623398ff2efcadc2cd5e6769879fb31800c98d91
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2022-06-29 17:00:11 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2022-06-29 17:01:26 +0000

    sysutils/btop: fix build on i386 and powerpc with GCC 11
    
    /usr/local/bin/ld: /tmp/cc4flGwQ.ltrans0.ltrans.o: in function `Runner::_runner(void*)':
    <artificial>:(.text+0x3c74): undefined reference to `__atomic_load_8'
    /usr/local/bin/ld: <artificial>:(.text+0x3c9c): undefined reference to `__atomic_load_8'
    /usr/local/bin/ld: <artificial>:(.text+0x3cc8): undefined reference to `__atomic_compare_exchange_8'
    /usr/local/bin/ld: <artificial>:(.text+0x441c): undefined reference to `__atomic_load_8'
    /usr/local/bin/ld: <artificial>:(.text+0x4448): undefined reference to `__atomic_compare_exchange_8'
    /usr/local/bin/ld: <artificial>:(.text+0x446c): undefined reference to `__atomic_load_8'
    /usr/local/bin/ld: <artificial>:(.text+0x4480): undefined reference to `__atomic_load_8'
    /usr/local/bin/ld: <artificial>:(.text+0x44ac): undefined reference to `__atomic_compare_exchange_8'
    /usr/local/bin/ld: /tmp/cc4flGwQ.ltrans1.ltrans.o: in function `Runner::run(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool)':
    <artificial>:(.text+0x1cf4): undefined reference to `__atomic_fetch_add_8'
    /usr/local/bin/ld: <artificial>:(.text+0x1d44): undefined reference to `__atomic_fetch_add_8'
    /usr/local/bin/ld: /tmp/cc4flGwQ.ltrans1.ltrans.o: in function `Runner::stop()':
    <artificial>:(.text+0x5150): undefined reference to `__atomic_fetch_add_8'
    /usr/local/bin/ld: <artificial>:(.text+0x51a8): undefined reference to `__atomic_fetch_add_8'
    collect2: error: ld returned 1 exit status
---
 sysutils/btop/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sysutils/btop/Makefile b/sysutils/btop/Makefile
index 8be82a92b891..2c6cac5f9669 100644
--- a/sysutils/btop/Makefile
+++ b/sysutils/btop/Makefile
@@ -14,6 +14,8 @@ USE_GCC=	yes
 USE_GITHUB=	yes
 GH_ACCOUNT=	aristocratos
 
+CXXFLAGS_i386=	-latomic
+CXXFLAGS_powerpc=	-latomic
 MAKE_ARGS=	STRIP=true ADDFLAGS="${CXXFLAGS} ${LDFLAGS}"
 
 .include <bsd.port.mk>