@ -121,6 +121,14 @@ rec {
js = { bits = 32 ; significantByte = littleEndian ; family = " j s " ; } ;
} ;
# GNU build systems assume that older NetBSD architectures are using a.out.
gnuNetBSDDefaultExecFormat = cpu :
if ( cpu . family == " x 8 6 " && cpu . bits == 32 ) ||
( cpu . family == " a r m " && cpu . bits == 32 ) ||
( cpu . family == " s p a r c " && cpu . bits == 32 )
then execFormats . aout
else execFormats . elf ;
# Determine when two CPUs are compatible with each other. That is,
# can code built for system B run on system A? For that to happen,
# the programs that system B accepts must be a subset of the
@ -463,8 +471,12 @@ rec {
else " ${ cpu . name } - ${ kernel . name } " ;
tripleFromSystem = { cpu , vendor , kernel , abi , . . . } @ sys : assert isSystem sys ; let
optExecFormat =
lib . optionalString ( kernel . name == " n e t b s d " &&
gnuNetBSDDefaultExecFormat cpu != kernel . execFormat )
kernel . execFormat . name ;
optAbi = lib . optionalString ( abi != abis . unknown ) " - ${ abi . name } " ;
in " ${ cpu . name } - ${ vendor . name } - ${ kernel . name } ${ optAbi } " ;
in " ${ cpu . name } - ${ vendor . name } - ${ kernel . name } ${ optExecFormat } ${ opt Abi } " ;
################################################################################