NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-i386/61069: gcc 12.5 on NetBSD 11.1 i386 fails to compile GLSMAC Github project



The following reply was made to PR port-i386/61069; it has been noted by GNATS.

From: "Lubomir G. Diakov" <zr90004%gmail.com@localhost>
To: "RVP via gnats" <gnats-admin%NetBSD.org@localhost>, RVP <rvp%SDF.ORG@localhost>
Cc: gnats-bugs%netbsd.org@localhost, port-i386-maintainer%netbsd.org@localhost,
 netbsd-bugs%netbsd.org@localhost
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@localhost> 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@localhost> wrote:
 > 
 > > The following reply was made to PR port-i386/61069; it has been
 > > noted by GNATS.
 > > 
 > > From: RVP <rvp%SDF.ORG@localhost>
 > > To: gnats-bugs%netbsd.org@localhost
 > > 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@localhost 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
 > >    
 > 
 



Home | Main Index | Thread Index | Old Index