NetBSD Problem Report #61069
From www@netbsd.org Wed Nov 25 02:57:42 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
client-signature RSA-PSS (2048 bits) client-digest SHA256)
(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 494121A923B
for <gnats-bugs@gnats.NetBSD.org>; Wed, 25 Nov 2026 02:57:42 +0000 (UTC)
Message-Id: <20261125025740.816C01A923D@mollari.NetBSD.org>
Date: Wed, 25 Nov 2026 02:57:40 +0000 (UTC)
From: zr90004@gmail.com
Reply-To: zr90004@gmail.com
To: gnats-bugs@NetBSD.org
Subject: gcc 12.5 on NetBSD 11.1 i386 fails to compile GLSMAC Github project
X-Send-Pr-Version: www-1.0
X-From4GNATS: "zr90004@gmail.com via gnats" <gnats-admin@NetBSD.org>
>Number: 61069
>Category: port-i386
>Synopsis: gcc 12.5 on NetBSD 11.1 i386 fails to compile GLSMAC Github project
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: port-i386-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Nov 25 03:00:00 +0000 2026
>Last-Modified: Fri Nov 27 09:35:01 +0000 2026
>Originator: Lubo
>Release: NetBSD 11.1_i386
>Organization:
>Environment:
NetBSD 11.1_i386 11.1 NetBSD 11.1 (GENERIC) #0: Mon Nov 2 16:34:32 UTC 2026 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/i386/compile/GENERIC i386
>Description:
Attempting i386 compile of:
https://github.com/afwbkbc/glsmac.git
Same project compiles fine on amd64 port.
i386 generates errors:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug && make -C build
-- Configuring done (0.2s)
-- Generating done (17.8s)
-- Build files have been written to: /home/lubod/glsmac/build
[100%] Linking CXX executable bin/GLSMAC
ld: CMakeFiles/GLSMAC.dir/src/game/backend/Game.cpp.o: in function `std::__atomic_base<unsigned long long>::store(unsigned long long, std::memory_order)':
/usr/include/g++/bits/atomic_base.h:480:(.text._ZNSt13__atomic_baseIyEaSEy[_ZNSt13__atomic_baseIyEaSEy]+0xb5): undefined reference to `__atomic_store_8'
ld: CMakeFiles/GLSMAC.dir/src/game/backend/Game.cpp.o: in function `std::__atomic_base<unsigned long long>::operator++()':
/usr/include/g++/bits/atomic_base.h:401:(.text._ZNSt13__atomic_baseIyEppEv[_ZNSt13__atomic_baseIyEppEv]+0x25): undefined reference to `__atomic_fetch_add_8'
*** Error code 1
Stop.
make[2]: stopped making "CMakeFiles/GLSMAC.dir/build" in /home/lubod/glsmac/build
*** Error code 1
Stop.
make[1]: stopped making "all" in /home/lubod/glsmac/build
*** Error code 1
Stop.
make: stopped making "default_target" in /home/lubod/glsmac/build
>How-To-Repeat:
Set up GLSMAC build as shown on github.
Build with cmake command above, or another one of your choice.
Build does NOT complete on 11.1 i386 BUT does on 11.1 amd64.
>Fix:
>Audit-Trail:
From: RVP <rvp@SDF.ORG>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: port-i386/61069: gcc 12.5 on NetBSD 11.1 i386 fails to compile
GLSMAC Github project
Date: Wed, 25 Nov 2026 08:06:54 +0000 (UTC)
On Wed, 25 Nov 2026, zr90004@gmail.com via gnats wrote:
> Attempting i386 compile of:
> https://github.com/afwbkbc/glsmac.git
>
> Same project compiles fine on amd64 port.
>
> i386 generates errors:
>
> cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug && make -C build
> -- Configuring done (0.2s)
> -- Generating done (17.8s)
> -- Build files have been written to: /home/lubod/glsmac/build
>
> [100%] Linking CXX executable bin/GLSMAC
> ld: CMakeFiles/GLSMAC.dir/src/game/backend/Game.cpp.o: in function `std::__atomic_base<unsigned long long>::store(unsigned long long, std::memory_order)':
> /usr/include/g++/bits/atomic_base.h:480:(.text._ZNSt13__atomic_baseIyEaSEy[_ZNSt13__atomic_baseIyEaSEy]+0xb5): undefined reference to `__atomic_store_8'
> ld: CMakeFiles/GLSMAC.dir/src/game/backend/Game.cpp.o: in function `std::__atomic_base<unsigned long long>::operator++()':
> /usr/include/g++/bits/atomic_base.h:401:(.text._ZNSt13__atomic_baseIyEppEv[_ZNSt13__atomic_baseIyEppEv]+0x25): undefined reference to `__atomic_fetch_add_8'
> *** Error code 1
>
The default CPU for gcc(1) in the NetBSD/i386 port is 486 (-march=i486). Gcc
doesn't have atomics for `long long' types on this CPU--even on Linux.
Use at least pentium (-march=pentium).
-RVP
From: "Lubomir G. Diakov" <zr90004@gmail.com>
To: "RVP via gnats" <gnats-admin@NetBSD.org>, RVP <rvp@SDF.ORG>
Cc: gnats-bugs@netbsd.org, port-i386-maintainer@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: port-i386/61069: gcc 12.5 on NetBSD 11.1 i386 fails to compile
GLSMAC Github project
Date: Thu, 26 Nov 2026 15:35:09 -0800
Thank you for your help, RVP! I hope this information is archived in
the mail lists for future reference.
Unfortunately, none of the ways to access the lists (subscribe, browse
or nntp) seem to offer a "search function, to find prior post by
content instead of date. Is there such a search function?
Regards,
Lubo
On Wed, 25 Nov 2026 08:10:01 +0000 (UTC)
"RVP via gnats" <gnats-admin@NetBSD.org> wrote:
> The following reply was made to PR port-i386/61069; it has been noted
> by GNATS.
>
> From: RVP <rvp@SDF.ORG>
> To: gnats-bugs@netbsd.org
> Cc:
> Subject: Re: port-i386/61069: gcc 12.5 on NetBSD 11.1 i386 fails to
> compile GLSMAC Github project
> Date: Wed, 25 Nov 2026 08:06:54 +0000 (UTC)
>
> On Wed, 25 Nov 2026, zr90004@gmail.com via gnats wrote:
>
> > Attempting i386 compile of:
> > https://github.com/afwbkbc/glsmac.git
> >
> > Same project compiles fine on amd64 port.
> >
> > i386 generates errors:
> >
> > cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug && make -C build
> > -- Configuring done (0.2s)
> > -- Generating done (17.8s)
> > -- Build files have been written to: /home/lubod/glsmac/build
> >
> > [100%] Linking CXX executable bin/GLSMAC
> > ld: CMakeFiles/GLSMAC.dir/src/game/backend/Game.cpp.o: in function
> > `std::__atomic_base<unsigned long long>::store(unsigned long long,
> > std::memory_order)':
> > /usr/include/g++/bits/atomic_base.h:480:(.text._ZNSt13__atomic_baseIyEaSEy[_ZNSt13__atomic_baseIyEaSEy]+0xb5):
> > undefined reference to `__atomic_store_8' ld:
> > CMakeFiles/GLSMAC.dir/src/game/backend/Game.cpp.o: in function
> > `std::__atomic_base<unsigned long long>::operator++()':
> > /usr/include/g++/bits/atomic_base.h:401:(.text._ZNSt13__atomic_baseIyEppEv[_ZNSt13__atomic_baseIyEppEv]+0x25):
> > undefined reference to `__atomic_fetch_add_8' *** Error code 1
>
> The default CPU for gcc(1) in the NetBSD/i386 port is 486
> (-march=i486). Gcc doesn't have atomics for `long long' types on this
> CPU--even on Linux.
> Use at least pentium (-march=pentium).
>
> -RVP
>
From: "Lubomir G. Diakov" <zr90004@gmail.com>
To: "RVP via gnats" <gnats-admin@NetBSD.org>, RVP <rvp@SDF.ORG>
Cc: gnats-bugs@netbsd.org, port-i386-maintainer@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: port-i386/61069: gcc 12.5 on NetBSD 11.1 i386 fails to compile
GLSMAC Github project
Date: Thu, 26 Nov 2026 22:53:15 -0800
In the interest of leaving breadcrumbs (either for myself or others
with the same error(s):
GLSMAC builds with CMake, thus I modified CMakeLists.txt with a stanza
to force march=pentium if i486 is detected. Of course that means almost
certainly incompatible with anything below a pentium, and it may
compile pentium code even with a newer CPU, but the error is gone.
complete:
#LGD, conditional cmake adds march=pentium, 486 fails on atomic long
long types! include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-march=i486" COMPILER_SUPPORTS_MARCH_i486)
if(COMPILER_SUPPORTS_MARCH_i486)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=pentium")
message(STATUS "Pentium CPU or above, 486 fails on atomic long long
types!. -march=pentium.") endif()
Any refinements to exclude newer CPUs or suggestions how to force gcc
to default to march=pentium at an OS level, systemwide, not just in
CMake gladly accepted.
Regards,
Lubo
On Thu, 26 Nov 2026 15:35:09 -0800
"Lubomir G. Diakov" <zr90004@gmail.com> wrote:
> Thank you for your help, RVP! I hope this information is archived in
> the mail lists for future reference.
>
> Unfortunately, none of the ways to access the lists (subscribe, browse
> or nntp) seem to offer a "search function, to find prior post by
> content instead of date. Is there such a search function?
>
> Regards,
> Lubo
>
> On Wed, 25 Nov 2026 08:10:01 +0000 (UTC)
> "RVP via gnats" <gnats-admin@NetBSD.org> wrote:
>
> > The following reply was made to PR port-i386/61069; it has been
> > noted by GNATS.
> >
> > From: RVP <rvp@SDF.ORG>
> > To: gnats-bugs@netbsd.org
> > Cc:
> > Subject: Re: port-i386/61069: gcc 12.5 on NetBSD 11.1 i386 fails to
> > compile GLSMAC Github project
> > Date: Wed, 25 Nov 2026 08:06:54 +0000 (UTC)
> >
> > On Wed, 25 Nov 2026, zr90004@gmail.com via gnats wrote:
> >
> > > Attempting i386 compile of:
> > > https://github.com/afwbkbc/glsmac.git
> > >
> > > Same project compiles fine on amd64 port.
> > >
> > > i386 generates errors:
> > >
> > > cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug && make -C build
> > > -- Configuring done (0.2s)
> > > -- Generating done (17.8s)
> > > -- Build files have been written to: /home/lubod/glsmac/build
> > >
> > > [100%] Linking CXX executable bin/GLSMAC
> > > ld: CMakeFiles/GLSMAC.dir/src/game/backend/Game.cpp.o: in
> > > function `std::__atomic_base<unsigned long long>::store(unsigned
> > > long long, std::memory_order)':
> > > /usr/include/g++/bits/atomic_base.h:480:(.text._ZNSt13__atomic_baseIyEaSEy[_ZNSt13__atomic_baseIyEaSEy]+0xb5):
> > > undefined reference to `__atomic_store_8' ld:
> > > CMakeFiles/GLSMAC.dir/src/game/backend/Game.cpp.o: in function
> > > `std::__atomic_base<unsigned long long>::operator++()':
> > > /usr/include/g++/bits/atomic_base.h:401:(.text._ZNSt13__atomic_baseIyEppEv[_ZNSt13__atomic_baseIyEppEv]+0x25):
> > > undefined reference to `__atomic_fetch_add_8' *** Error code 1
> >
> > The default CPU for gcc(1) in the NetBSD/i386 port is 486
> > (-march=i486). Gcc doesn't have atomics for `long long' types on
> > this CPU--even on Linux.
> > Use at least pentium (-march=pentium).
> >
> > -RVP
> >
>
From: RVP <rvp@SDF.ORG>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: port-i386/61069: gcc 12.5 on NetBSD 11.1 i386 fails to compile
GLSMAC Github project
Date: Fri, 27 Nov 2026 09:29:05 +0000 (UTC)
On Thu, 26 Nov 2026, Lubomir G. Diakov via gnats wrote:
> Unfortunately, none of the ways to access the lists (subscribe, browse
> or nntp) seem to offer a "search function, to find prior post by
> content instead of date. Is there such a search function?
>
Can't find any... I use `site:mail-index.netbsd.org foo' myself.
-RVP
From: RVP <rvp@SDF.ORG>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: port-i386/61069: gcc 12.5 on NetBSD 11.1 i386 fails to compile
GLSMAC Github project
Date: Fri, 27 Nov 2026 09:33:28 +0000 (UTC)
On Fri, 27 Nov 2026, Lubomir G. Diakov via gnats wrote:
> GLSMAC builds with CMake, thus I modified CMakeLists.txt with a stanza
> to force march=pentium if i486 is detected. Of course that means almost
> certainly incompatible with anything below a pentium, and it may
> compile pentium code even with a newer CPU, but the error is gone.
>
> complete:
> #LGD, conditional cmake adds march=pentium, 486 fails on atomic long
> long types! include(CheckCXXCompilerFlag)
> CHECK_CXX_COMPILER_FLAG("-march=i486" COMPILER_SUPPORTS_MARCH_i486)
> if(COMPILER_SUPPORTS_MARCH_i486)
> set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=pentium")
> message(STATUS "Pentium CPU or above, 486 fails on atomic long long
> types!. -march=pentium.") endif()
>
> Any refinements to exclude newer CPUs or suggestions how to force gcc
> to default to march=pentium at an OS level, systemwide, not just in
> CMake gladly accepted.
>
The NetBSD folks're unlikely to bump `-march=' to i486+ because i486 is still
supported. What you could do is use `-march=native' if you want speed... But,
you wouldn't be able to distribute built like that...
-RVP
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.