pkgsrc-Users archive

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

Re: "kicad" build fails on netbsd-9/i386



On Wed, Mar 23, 2022 at 09:19:06AM +0100, Manuel Bouyer wrote:
> When I was still running i386 on desktops, I think I did work around this
> with something like
> CFLAGS+= -march=i686
> (from memory, this may not be the exact syntax).
> 
> Of course this will then run only on CPUs which supports the i686 
> instruction set.

Just trying to clear things up so people know how to solve this
problem in the future.

The minimum architecture level on 32-bit x86 to get compiler
support for atomic instructions is i586. NetBSD's default target
is i486. i586 covers the overwhelming majority of 32-bit embedded
boards (except a couple of particularly rusty examples from Soekris,
probably), and is a reasonable minimum for desktop software.

On other 32-bit architectures where GCC cannot generate 64-bit
atomic code (powerpc, sparc...) we use libatomic. Avoiding libatomic
is desirable because it's a buggy mess.

I created atomic64.mk to automatically select the appropriate
compiler flags OR add a libatomic dependency.

So the current "recommended" fix for these problems is:

.include "../../mk/atomic64.mk"

Please add this to any package you see fail on 32-bit x86 due
to missing atomic instructions if there is not a route to
avoid them entirely (e.g. some packages have a --disable-atomic
option in their build systems).


Home | Main Index | Thread Index | Old Index