Overhaul the MACHINE_CPU behaviour:
* Rip out MACHINE_CPU stuff from sys.mk and include a new <bsd.cpu.mk>
after we pull in /etc/make.conf. We need to do it afterwards so we can
react to the user setting of the:
* CPUTYPE variable, which contains the CPU type which the user wants to
optimize for. For example, if you want your binaries to only run on an
i686-class machine (or higher), set this to i686. If you want to support
running binaries on a variety of CPU generations, set this to the lowest
common denominator. Supported values are listed in make.conf.
* bsd.cpu.mk does the expansion of CPUTYPE into MACHINE_CPU using the
(hopefully) correct unordered list of CPU types which should be used on
that CPU. For example, an AMD k6 CPU wants any of the following:
k6 k5 i586 i486 i386
This is still an unordered list so the client makefile logic is simple -
client makefiles need to test for the various elements of the set in
decreasing order of priority using ${MACHINE_CPU:M<foo>}, as before.
The various MACHINE_CPU lists are believed to be correct, but should be
checked.
* If NO_CPU_CFLAGS is not defined, add relevant gcc compiler optimization
settings by default (e.g. -karch=k6 for CPUTYPE=k6, etc). Release
builders and developers of third-party software need to make sure not to
enable CPU-specific optimization when generating code intended to be
portable. We probably need to move to an /etc/world.conf to allow the
optimization stuff to be applied separately to world/kernel and external
compilations, but it's not any worse a problem than it was before.
* Add coverage for the ia64/itanium MACHINE_ARCH/CPUTYPE.
* Add CPUTYPE support for all of the CPU types supported by FreeBSD and gcc
(only i386, alpha and ia64 first, since those are the minimally-working
ports. Other architecture porters, please feel free to add the relevant
gunk for your platform).
Reviewed by: jhb, obrien
2001-02-22 06:14:25 -05:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
2002-07-27 18:04:05 -04:00
|
|
|
# Set default CPU compile flags and baseline CPUTYPE for each arch. The
|
|
|
|
|
# compile flags must support the minimum CPU type for each architecture but
|
|
|
|
|
# may tune support for more advanced processors.
|
Overhaul the MACHINE_CPU behaviour:
* Rip out MACHINE_CPU stuff from sys.mk and include a new <bsd.cpu.mk>
after we pull in /etc/make.conf. We need to do it afterwards so we can
react to the user setting of the:
* CPUTYPE variable, which contains the CPU type which the user wants to
optimize for. For example, if you want your binaries to only run on an
i686-class machine (or higher), set this to i686. If you want to support
running binaries on a variety of CPU generations, set this to the lowest
common denominator. Supported values are listed in make.conf.
* bsd.cpu.mk does the expansion of CPUTYPE into MACHINE_CPU using the
(hopefully) correct unordered list of CPU types which should be used on
that CPU. For example, an AMD k6 CPU wants any of the following:
k6 k5 i586 i486 i386
This is still an unordered list so the client makefile logic is simple -
client makefiles need to test for the various elements of the set in
decreasing order of priority using ${MACHINE_CPU:M<foo>}, as before.
The various MACHINE_CPU lists are believed to be correct, but should be
checked.
* If NO_CPU_CFLAGS is not defined, add relevant gcc compiler optimization
settings by default (e.g. -karch=k6 for CPUTYPE=k6, etc). Release
builders and developers of third-party software need to make sure not to
enable CPU-specific optimization when generating code intended to be
portable. We probably need to move to an /etc/world.conf to allow the
optimization stuff to be applied separately to world/kernel and external
compilations, but it's not any worse a problem than it was before.
* Add coverage for the ia64/itanium MACHINE_ARCH/CPUTYPE.
* Add CPUTYPE support for all of the CPU types supported by FreeBSD and gcc
(only i386, alpha and ia64 first, since those are the minimally-working
ports. Other architecture porters, please feel free to add the relevant
gunk for your platform).
Reviewed by: jhb, obrien
2001-02-22 06:14:25 -05:00
|
|
|
|
2002-08-02 14:04:22 -04:00
|
|
|
.if !defined(CPUTYPE) || empty(CPUTYPE)
|
2004-01-30 14:51:26 -05:00
|
|
|
_CPUCFLAGS =
|
2010-09-13 03:22:14 -04:00
|
|
|
. if ${MACHINE_CPUARCH} == "i386"
|
2003-04-11 17:28:17 -04:00
|
|
|
MACHINE_CPU = i486
|
2010-09-13 03:22:14 -04:00
|
|
|
. elif ${MACHINE_CPUARCH} == "amd64"
|
2010-04-20 21:13:08 -04:00
|
|
|
MACHINE_CPU = amd64 sse2 sse mmx
|
2010-09-13 03:22:14 -04:00
|
|
|
. elif ${MACHINE_CPUARCH} == "ia64"
|
2002-09-18 16:44:46 -04:00
|
|
|
MACHINE_CPU = itanium
|
2010-09-13 03:22:14 -04:00
|
|
|
. elif ${MACHINE_CPUARCH} == "powerpc"
|
2008-03-03 15:40:20 -05:00
|
|
|
MACHINE_CPU = aim
|
2010-09-13 03:22:14 -04:00
|
|
|
. elif ${MACHINE_CPUARCH} == "sparc64"
|
2010-12-30 10:58:23 -05:00
|
|
|
MACHINE_CPU = ultrasparc
|
2010-09-13 03:22:14 -04:00
|
|
|
. elif ${MACHINE_CPUARCH} == "arm"
|
2004-05-14 09:34:15 -04:00
|
|
|
MACHINE_CPU = arm
|
2010-09-13 03:22:14 -04:00
|
|
|
. elif ${MACHINE_CPUARCH} == "mips"
|
2008-03-19 08:20:44 -04:00
|
|
|
MACHINE_CPU = mips
|
2002-07-27 18:15:42 -04:00
|
|
|
. endif
|
2002-07-27 18:04:05 -04:00
|
|
|
.else
|
Overhaul the MACHINE_CPU behaviour:
* Rip out MACHINE_CPU stuff from sys.mk and include a new <bsd.cpu.mk>
after we pull in /etc/make.conf. We need to do it afterwards so we can
react to the user setting of the:
* CPUTYPE variable, which contains the CPU type which the user wants to
optimize for. For example, if you want your binaries to only run on an
i686-class machine (or higher), set this to i686. If you want to support
running binaries on a variety of CPU generations, set this to the lowest
common denominator. Supported values are listed in make.conf.
* bsd.cpu.mk does the expansion of CPUTYPE into MACHINE_CPU using the
(hopefully) correct unordered list of CPU types which should be used on
that CPU. For example, an AMD k6 CPU wants any of the following:
k6 k5 i586 i486 i386
This is still an unordered list so the client makefile logic is simple -
client makefiles need to test for the various elements of the set in
decreasing order of priority using ${MACHINE_CPU:M<foo>}, as before.
The various MACHINE_CPU lists are believed to be correct, but should be
checked.
* If NO_CPU_CFLAGS is not defined, add relevant gcc compiler optimization
settings by default (e.g. -karch=k6 for CPUTYPE=k6, etc). Release
builders and developers of third-party software need to make sure not to
enable CPU-specific optimization when generating code intended to be
portable. We probably need to move to an /etc/world.conf to allow the
optimization stuff to be applied separately to world/kernel and external
compilations, but it's not any worse a problem than it was before.
* Add coverage for the ia64/itanium MACHINE_ARCH/CPUTYPE.
* Add CPUTYPE support for all of the CPU types supported by FreeBSD and gcc
(only i386, alpha and ia64 first, since those are the minimally-working
ports. Other architecture porters, please feel free to add the relevant
gunk for your platform).
Reviewed by: jhb, obrien
2001-02-22 06:14:25 -05:00
|
|
|
|
|
|
|
|
# Handle aliases (not documented in make.conf to avoid user confusion
|
|
|
|
|
# between e.g. i586 and pentium)
|
|
|
|
|
|
2010-09-13 03:22:14 -04:00
|
|
|
. if ${MACHINE_CPUARCH} == "i386"
|
2007-01-17 09:49:13 -05:00
|
|
|
. if ${CPUTYPE} == "nocona"
|
|
|
|
|
CPUTYPE = prescott
|
2011-03-14 09:36:51 -04:00
|
|
|
. elif ${CPUTYPE} == "core"
|
2007-01-17 09:49:13 -05:00
|
|
|
CPUTYPE = prescott
|
2004-10-17 01:19:45 -04:00
|
|
|
. elif ${CPUTYPE} == "p4"
|
2004-10-17 01:08:29 -04:00
|
|
|
CPUTYPE = pentium4
|
|
|
|
|
. elif ${CPUTYPE} == "p4m"
|
|
|
|
|
CPUTYPE = pentium4m
|
|
|
|
|
. elif ${CPUTYPE} == "p3"
|
|
|
|
|
CPUTYPE = pentium3
|
|
|
|
|
. elif ${CPUTYPE} == "p3m"
|
|
|
|
|
CPUTYPE = pentium3m
|
|
|
|
|
. elif ${CPUTYPE} == "p-m"
|
|
|
|
|
CPUTYPE = pentium-m
|
|
|
|
|
. elif ${CPUTYPE} == "p2"
|
|
|
|
|
CPUTYPE = pentium2
|
|
|
|
|
. elif ${CPUTYPE} == "i686"
|
|
|
|
|
CPUTYPE = pentiumpro
|
|
|
|
|
. elif ${CPUTYPE} == "i586/mmx"
|
|
|
|
|
CPUTYPE = pentium-mmx
|
|
|
|
|
. elif ${CPUTYPE} == "i586"
|
|
|
|
|
CPUTYPE = pentium
|
2011-02-20 17:32:21 -05:00
|
|
|
. elif ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" || \
|
|
|
|
|
${CPUTYPE} == "k8-sse3"
|
|
|
|
|
CPUTYPE = prescott
|
2004-10-17 01:19:45 -04:00
|
|
|
. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || \
|
|
|
|
|
${CPUTYPE} == "k8"
|
2004-08-11 17:51:27 -04:00
|
|
|
CPUTYPE = athlon-mp
|
2002-09-06 21:15:29 -04:00
|
|
|
. elif ${CPUTYPE} == "k7"
|
|
|
|
|
CPUTYPE = athlon
|
2002-07-27 18:15:42 -04:00
|
|
|
. endif
|
2010-09-13 03:22:14 -04:00
|
|
|
. elif ${MACHINE_CPUARCH} == "amd64"
|
2011-03-07 09:58:23 -05:00
|
|
|
. if ${CPUTYPE} == "prescott"
|
2004-10-17 01:19:45 -04:00
|
|
|
CPUTYPE = nocona
|
|
|
|
|
. endif
|
2010-12-30 10:58:23 -05:00
|
|
|
. elif ${MACHINE_ARCH} == "sparc64"
|
|
|
|
|
. if ${CPUTYPE} == "us"
|
|
|
|
|
CPUTYPE = ultrasparc
|
|
|
|
|
. elif ${CPUTYPE} == "us3"
|
|
|
|
|
CPUTYPE = ultrasparc3
|
|
|
|
|
. endif
|
Overhaul the MACHINE_CPU behaviour:
* Rip out MACHINE_CPU stuff from sys.mk and include a new <bsd.cpu.mk>
after we pull in /etc/make.conf. We need to do it afterwards so we can
react to the user setting of the:
* CPUTYPE variable, which contains the CPU type which the user wants to
optimize for. For example, if you want your binaries to only run on an
i686-class machine (or higher), set this to i686. If you want to support
running binaries on a variety of CPU generations, set this to the lowest
common denominator. Supported values are listed in make.conf.
* bsd.cpu.mk does the expansion of CPUTYPE into MACHINE_CPU using the
(hopefully) correct unordered list of CPU types which should be used on
that CPU. For example, an AMD k6 CPU wants any of the following:
k6 k5 i586 i486 i386
This is still an unordered list so the client makefile logic is simple -
client makefiles need to test for the various elements of the set in
decreasing order of priority using ${MACHINE_CPU:M<foo>}, as before.
The various MACHINE_CPU lists are believed to be correct, but should be
checked.
* If NO_CPU_CFLAGS is not defined, add relevant gcc compiler optimization
settings by default (e.g. -karch=k6 for CPUTYPE=k6, etc). Release
builders and developers of third-party software need to make sure not to
enable CPU-specific optimization when generating code intended to be
portable. We probably need to move to an /etc/world.conf to allow the
optimization stuff to be applied separately to world/kernel and external
compilations, but it's not any worse a problem than it was before.
* Add coverage for the ia64/itanium MACHINE_ARCH/CPUTYPE.
* Add CPUTYPE support for all of the CPU types supported by FreeBSD and gcc
(only i386, alpha and ia64 first, since those are the minimally-working
ports. Other architecture porters, please feel free to add the relevant
gunk for your platform).
Reviewed by: jhb, obrien
2001-02-22 06:14:25 -05:00
|
|
|
. endif
|
|
|
|
|
|
2004-10-17 01:08:29 -04:00
|
|
|
###############################################################################
|
2002-05-11 16:18:54 -04:00
|
|
|
# Logic to set up correct gcc optimization flag. This must be included
|
Overhaul the MACHINE_CPU behaviour:
* Rip out MACHINE_CPU stuff from sys.mk and include a new <bsd.cpu.mk>
after we pull in /etc/make.conf. We need to do it afterwards so we can
react to the user setting of the:
* CPUTYPE variable, which contains the CPU type which the user wants to
optimize for. For example, if you want your binaries to only run on an
i686-class machine (or higher), set this to i686. If you want to support
running binaries on a variety of CPU generations, set this to the lowest
common denominator. Supported values are listed in make.conf.
* bsd.cpu.mk does the expansion of CPUTYPE into MACHINE_CPU using the
(hopefully) correct unordered list of CPU types which should be used on
that CPU. For example, an AMD k6 CPU wants any of the following:
k6 k5 i586 i486 i386
This is still an unordered list so the client makefile logic is simple -
client makefiles need to test for the various elements of the set in
decreasing order of priority using ${MACHINE_CPU:M<foo>}, as before.
The various MACHINE_CPU lists are believed to be correct, but should be
checked.
* If NO_CPU_CFLAGS is not defined, add relevant gcc compiler optimization
settings by default (e.g. -karch=k6 for CPUTYPE=k6, etc). Release
builders and developers of third-party software need to make sure not to
enable CPU-specific optimization when generating code intended to be
portable. We probably need to move to an /etc/world.conf to allow the
optimization stuff to be applied separately to world/kernel and external
compilations, but it's not any worse a problem than it was before.
* Add coverage for the ia64/itanium MACHINE_ARCH/CPUTYPE.
* Add CPUTYPE support for all of the CPU types supported by FreeBSD and gcc
(only i386, alpha and ia64 first, since those are the minimally-working
ports. Other architecture porters, please feel free to add the relevant
gunk for your platform).
Reviewed by: jhb, obrien
2001-02-22 06:14:25 -05:00
|
|
|
# after /etc/make.conf so it can react to the local value of CPUTYPE
|
2002-05-11 16:18:54 -04:00
|
|
|
# defined therein. Consult:
|
2006-07-20 18:42:48 -04:00
|
|
|
# http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
|
2008-06-25 02:07:03 -04:00
|
|
|
# http://gcc.gnu.org/onlinedocs/gcc/IA_002d64-Options.html
|
|
|
|
|
# http://gcc.gnu.org/onlinedocs/gcc/RS_002f6000-and-PowerPC-Options.html
|
2008-03-19 08:20:44 -04:00
|
|
|
# http://gcc.gnu.org/onlinedocs/gcc/MIPS-Options.html
|
2004-03-20 23:57:24 -05:00
|
|
|
# http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html
|
2008-06-25 02:07:03 -04:00
|
|
|
# http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html
|
Overhaul the MACHINE_CPU behaviour:
* Rip out MACHINE_CPU stuff from sys.mk and include a new <bsd.cpu.mk>
after we pull in /etc/make.conf. We need to do it afterwards so we can
react to the user setting of the:
* CPUTYPE variable, which contains the CPU type which the user wants to
optimize for. For example, if you want your binaries to only run on an
i686-class machine (or higher), set this to i686. If you want to support
running binaries on a variety of CPU generations, set this to the lowest
common denominator. Supported values are listed in make.conf.
* bsd.cpu.mk does the expansion of CPUTYPE into MACHINE_CPU using the
(hopefully) correct unordered list of CPU types which should be used on
that CPU. For example, an AMD k6 CPU wants any of the following:
k6 k5 i586 i486 i386
This is still an unordered list so the client makefile logic is simple -
client makefiles need to test for the various elements of the set in
decreasing order of priority using ${MACHINE_CPU:M<foo>}, as before.
The various MACHINE_CPU lists are believed to be correct, but should be
checked.
* If NO_CPU_CFLAGS is not defined, add relevant gcc compiler optimization
settings by default (e.g. -karch=k6 for CPUTYPE=k6, etc). Release
builders and developers of third-party software need to make sure not to
enable CPU-specific optimization when generating code intended to be
portable. We probably need to move to an /etc/world.conf to allow the
optimization stuff to be applied separately to world/kernel and external
compilations, but it's not any worse a problem than it was before.
* Add coverage for the ia64/itanium MACHINE_ARCH/CPUTYPE.
* Add CPUTYPE support for all of the CPU types supported by FreeBSD and gcc
(only i386, alpha and ia64 first, since those are the minimally-working
ports. Other architecture porters, please feel free to add the relevant
gunk for your platform).
Reviewed by: jhb, obrien
2001-02-22 06:14:25 -05:00
|
|
|
|
2010-09-13 03:22:14 -04:00
|
|
|
. if ${MACHINE_CPUARCH} == "i386"
|
2004-04-05 05:55:50 -04:00
|
|
|
. if ${CPUTYPE} == "crusoe"
|
|
|
|
|
_CPUCFLAGS = -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0
|
2004-10-17 01:08:29 -04:00
|
|
|
. elif ${CPUTYPE} == "k5"
|
|
|
|
|
_CPUCFLAGS = -march=pentium
|
2011-03-14 09:36:51 -04:00
|
|
|
. elif ${CPUTYPE} == "core2"
|
|
|
|
|
_CPUCFLAGS = -march=prescott
|
2004-10-17 01:08:29 -04:00
|
|
|
. else
|
|
|
|
|
_CPUCFLAGS = -march=${CPUTYPE}
|
|
|
|
|
. endif # GCC on 'i386'
|
2010-09-13 03:22:14 -04:00
|
|
|
. elif ${MACHINE_CPUARCH} == "amd64"
|
2004-10-17 01:19:45 -04:00
|
|
|
_CPUCFLAGS = -march=${CPUTYPE}
|
2010-09-13 03:22:14 -04:00
|
|
|
. elif ${MACHINE_CPUARCH} == "arm"
|
2004-10-17 01:08:29 -04:00
|
|
|
. if ${CPUTYPE} == "xscale"
|
2007-10-16 14:32:37 -04:00
|
|
|
#XXX: gcc doesn't seem to like -mcpu=xscale, and dies while rebuilding itself
|
|
|
|
|
#_CPUCFLAGS = -mcpu=xscale
|
|
|
|
|
_CPUCFLAGS = -march=armv5te -D__XSCALE__
|
2004-10-17 01:08:29 -04:00
|
|
|
. else
|
|
|
|
|
_CPUCFLAGS = -mcpu=${CPUTYPE}
|
2004-09-23 18:59:31 -04:00
|
|
|
. endif
|
2010-11-13 20:37:08 -05:00
|
|
|
. elif ${MACHINE_ARCH} == "powerpc"
|
2008-03-03 15:40:20 -05:00
|
|
|
. if ${CPUTYPE} == "e500"
|
|
|
|
|
_CPUCFLAGS = -Wa,-me500 -msoft-float
|
2009-02-22 13:45:30 -05:00
|
|
|
. else
|
2009-04-03 20:22:44 -04:00
|
|
|
_CPUCFLAGS = -mcpu=${CPUTYPE} -mno-powerpc64
|
2008-03-03 15:40:20 -05:00
|
|
|
. endif
|
2010-07-09 22:32:50 -04:00
|
|
|
. elif ${MACHINE_ARCH} == "powerpc64"
|
|
|
|
|
_CPUCFLAGS = -mcpu=${CPUTYPE}
|
2010-09-13 03:22:14 -04:00
|
|
|
. elif ${MACHINE_CPUARCH} == "mips"
|
2008-03-19 08:20:44 -04:00
|
|
|
. if ${CPUTYPE} == "mips32"
|
|
|
|
|
_CPUCFLAGS = -march=mips32
|
|
|
|
|
. elif ${CPUTYPE} == "mips32r2"
|
|
|
|
|
_CPUCFLAGS = -march=mips32r2
|
|
|
|
|
. elif ${CPUTYPE} == "mips64"
|
|
|
|
|
_CPUCFLAGS = -march=mips64
|
|
|
|
|
. elif ${CPUTYPE} == "mips64r2"
|
|
|
|
|
_CPUCFLAGS = -march=mips64r2
|
|
|
|
|
. elif ${CPUTYPE} == "mips4kc"
|
|
|
|
|
_CPUCFLAGS = -march=4kc
|
|
|
|
|
. elif ${CPUTYPE} == "mips24kc"
|
|
|
|
|
_CPUCFLAGS = -march=24kc
|
|
|
|
|
. endif
|
2010-12-30 10:58:23 -05:00
|
|
|
. elif ${MACHINE_ARCH} == "sparc64"
|
|
|
|
|
. if ${CPUTYPE} == "v9"
|
|
|
|
|
_CPUCFLAGS = -mcpu=v9
|
|
|
|
|
. elif ${CPUTYPE} == "ultrasparc"
|
|
|
|
|
_CPUCFLAGS = -mcpu=ultrasparc
|
|
|
|
|
. elif ${CPUTYPE} == "ultrasparc3"
|
|
|
|
|
_CPUCFLAGS = -mcpu=ultrasparc3
|
|
|
|
|
. endif
|
Overhaul the MACHINE_CPU behaviour:
* Rip out MACHINE_CPU stuff from sys.mk and include a new <bsd.cpu.mk>
after we pull in /etc/make.conf. We need to do it afterwards so we can
react to the user setting of the:
* CPUTYPE variable, which contains the CPU type which the user wants to
optimize for. For example, if you want your binaries to only run on an
i686-class machine (or higher), set this to i686. If you want to support
running binaries on a variety of CPU generations, set this to the lowest
common denominator. Supported values are listed in make.conf.
* bsd.cpu.mk does the expansion of CPUTYPE into MACHINE_CPU using the
(hopefully) correct unordered list of CPU types which should be used on
that CPU. For example, an AMD k6 CPU wants any of the following:
k6 k5 i586 i486 i386
This is still an unordered list so the client makefile logic is simple -
client makefiles need to test for the various elements of the set in
decreasing order of priority using ${MACHINE_CPU:M<foo>}, as before.
The various MACHINE_CPU lists are believed to be correct, but should be
checked.
* If NO_CPU_CFLAGS is not defined, add relevant gcc compiler optimization
settings by default (e.g. -karch=k6 for CPUTYPE=k6, etc). Release
builders and developers of third-party software need to make sure not to
enable CPU-specific optimization when generating code intended to be
portable. We probably need to move to an /etc/world.conf to allow the
optimization stuff to be applied separately to world/kernel and external
compilations, but it's not any worse a problem than it was before.
* Add coverage for the ia64/itanium MACHINE_ARCH/CPUTYPE.
* Add CPUTYPE support for all of the CPU types supported by FreeBSD and gcc
(only i386, alpha and ia64 first, since those are the minimally-working
ports. Other architecture porters, please feel free to add the relevant
gunk for your platform).
Reviewed by: jhb, obrien
2001-02-22 06:14:25 -05:00
|
|
|
. endif
|
|
|
|
|
|
|
|
|
|
# Set up the list of CPU features based on the CPU type. This is an
|
|
|
|
|
# unordered list to make it easy for client makefiles to test for the
|
|
|
|
|
# presence of a CPU feature.
|
|
|
|
|
|
2010-09-13 03:22:14 -04:00
|
|
|
. if ${MACHINE_CPUARCH} == "i386"
|
2011-02-20 17:32:21 -05:00
|
|
|
. if ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3"
|
|
|
|
|
MACHINE_CPU = athlon-xp athlon k7 3dnow sse3 sse2 sse mmx k6 k5 i586 i486 i386
|
|
|
|
|
. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64"
|
2004-10-17 01:19:45 -04:00
|
|
|
MACHINE_CPU = athlon-xp athlon k7 3dnow sse2 sse mmx k6 k5 i586 i486 i386
|
|
|
|
|
. elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \
|
2004-01-30 21:17:11 -05:00
|
|
|
${CPUTYPE} == "athlon-4"
|
2004-10-17 01:08:29 -04:00
|
|
|
MACHINE_CPU = athlon-xp athlon k7 3dnow sse mmx k6 k5 i586 i486 i386
|
2004-03-05 10:59:33 -05:00
|
|
|
. elif ${CPUTYPE} == "athlon" || ${CPUTYPE} == "athlon-tbird"
|
2003-03-28 22:13:19 -05:00
|
|
|
MACHINE_CPU = athlon k7 3dnow mmx k6 k5 i586 i486 i386
|
2011-03-07 09:58:23 -05:00
|
|
|
. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2" || ${CPUTYPE} == "geode"
|
2001-03-10 06:49:05 -05:00
|
|
|
MACHINE_CPU = 3dnow mmx k6 k5 i586 i486 i386
|
2002-09-18 16:51:25 -04:00
|
|
|
. elif ${CPUTYPE} == "k6"
|
2001-03-10 06:49:05 -05:00
|
|
|
MACHINE_CPU = mmx k6 k5 i586 i486 i386
|
2002-09-18 16:51:25 -04:00
|
|
|
. elif ${CPUTYPE} == "k5"
|
Overhaul the MACHINE_CPU behaviour:
* Rip out MACHINE_CPU stuff from sys.mk and include a new <bsd.cpu.mk>
after we pull in /etc/make.conf. We need to do it afterwards so we can
react to the user setting of the:
* CPUTYPE variable, which contains the CPU type which the user wants to
optimize for. For example, if you want your binaries to only run on an
i686-class machine (or higher), set this to i686. If you want to support
running binaries on a variety of CPU generations, set this to the lowest
common denominator. Supported values are listed in make.conf.
* bsd.cpu.mk does the expansion of CPUTYPE into MACHINE_CPU using the
(hopefully) correct unordered list of CPU types which should be used on
that CPU. For example, an AMD k6 CPU wants any of the following:
k6 k5 i586 i486 i386
This is still an unordered list so the client makefile logic is simple -
client makefiles need to test for the various elements of the set in
decreasing order of priority using ${MACHINE_CPU:M<foo>}, as before.
The various MACHINE_CPU lists are believed to be correct, but should be
checked.
* If NO_CPU_CFLAGS is not defined, add relevant gcc compiler optimization
settings by default (e.g. -karch=k6 for CPUTYPE=k6, etc). Release
builders and developers of third-party software need to make sure not to
enable CPU-specific optimization when generating code intended to be
portable. We probably need to move to an /etc/world.conf to allow the
optimization stuff to be applied separately to world/kernel and external
compilations, but it's not any worse a problem than it was before.
* Add coverage for the ia64/itanium MACHINE_ARCH/CPUTYPE.
* Add CPUTYPE support for all of the CPU types supported by FreeBSD and gcc
(only i386, alpha and ia64 first, since those are the minimally-working
ports. Other architecture porters, please feel free to add the relevant
gunk for your platform).
Reviewed by: jhb, obrien
2001-02-22 06:14:25 -05:00
|
|
|
MACHINE_CPU = k5 i586 i486 i386
|
2006-07-19 07:27:19 -04:00
|
|
|
. elif ${CPUTYPE} == "c3"
|
2006-08-13 04:47:41 -04:00
|
|
|
MACHINE_CPU = 3dnow mmx i586 i486 i386
|
2006-07-19 07:27:19 -04:00
|
|
|
. elif ${CPUTYPE} == "c3-2"
|
|
|
|
|
MACHINE_CPU = sse mmx i586 i486 i386
|
2008-02-29 14:20:05 -05:00
|
|
|
. elif ${CPUTYPE} == "c7"
|
|
|
|
|
MACHINE_CPU = sse3 sse2 sse i686 mmx i586 i486 i386
|
2011-03-14 09:36:51 -04:00
|
|
|
. elif ${CPUTYPE} == "core2"
|
|
|
|
|
MACHINE_CPU = ssse3 sse3 sse2 sse i686 mmx i586 i486 i386
|
2007-01-17 09:49:13 -05:00
|
|
|
. elif ${CPUTYPE} == "prescott"
|
2007-01-17 07:43:06 -05:00
|
|
|
MACHINE_CPU = sse3 sse2 sse i686 mmx i586 i486 i386
|
2004-10-17 01:19:45 -04:00
|
|
|
. elif ${CPUTYPE} == "pentium4" || ${CPUTYPE} == "pentium4m" || ${CPUTYPE} == "pentium-m"
|
2002-09-06 21:15:29 -04:00
|
|
|
MACHINE_CPU = sse2 sse i686 mmx i586 i486 i386
|
2004-10-17 01:08:29 -04:00
|
|
|
. elif ${CPUTYPE} == "pentium3" || ${CPUTYPE} == "pentium3m"
|
2001-02-27 06:21:47 -05:00
|
|
|
MACHINE_CPU = sse i686 mmx i586 i486 i386
|
2004-10-17 01:08:29 -04:00
|
|
|
. elif ${CPUTYPE} == "pentium2"
|
2001-03-21 03:29:39 -05:00
|
|
|
MACHINE_CPU = i686 mmx i586 i486 i386
|
2004-10-17 01:08:29 -04:00
|
|
|
. elif ${CPUTYPE} == "pentiumpro"
|
Overhaul the MACHINE_CPU behaviour:
* Rip out MACHINE_CPU stuff from sys.mk and include a new <bsd.cpu.mk>
after we pull in /etc/make.conf. We need to do it afterwards so we can
react to the user setting of the:
* CPUTYPE variable, which contains the CPU type which the user wants to
optimize for. For example, if you want your binaries to only run on an
i686-class machine (or higher), set this to i686. If you want to support
running binaries on a variety of CPU generations, set this to the lowest
common denominator. Supported values are listed in make.conf.
* bsd.cpu.mk does the expansion of CPUTYPE into MACHINE_CPU using the
(hopefully) correct unordered list of CPU types which should be used on
that CPU. For example, an AMD k6 CPU wants any of the following:
k6 k5 i586 i486 i386
This is still an unordered list so the client makefile logic is simple -
client makefiles need to test for the various elements of the set in
decreasing order of priority using ${MACHINE_CPU:M<foo>}, as before.
The various MACHINE_CPU lists are believed to be correct, but should be
checked.
* If NO_CPU_CFLAGS is not defined, add relevant gcc compiler optimization
settings by default (e.g. -karch=k6 for CPUTYPE=k6, etc). Release
builders and developers of third-party software need to make sure not to
enable CPU-specific optimization when generating code intended to be
portable. We probably need to move to an /etc/world.conf to allow the
optimization stuff to be applied separately to world/kernel and external
compilations, but it's not any worse a problem than it was before.
* Add coverage for the ia64/itanium MACHINE_ARCH/CPUTYPE.
* Add CPUTYPE support for all of the CPU types supported by FreeBSD and gcc
(only i386, alpha and ia64 first, since those are the minimally-working
ports. Other architecture porters, please feel free to add the relevant
gunk for your platform).
Reviewed by: jhb, obrien
2001-02-22 06:14:25 -05:00
|
|
|
MACHINE_CPU = i686 i586 i486 i386
|
2004-10-17 01:08:29 -04:00
|
|
|
. elif ${CPUTYPE} == "pentium-mmx"
|
2001-02-27 06:21:47 -05:00
|
|
|
MACHINE_CPU = mmx i586 i486 i386
|
2004-10-17 01:08:29 -04:00
|
|
|
. elif ${CPUTYPE} == "pentium"
|
Overhaul the MACHINE_CPU behaviour:
* Rip out MACHINE_CPU stuff from sys.mk and include a new <bsd.cpu.mk>
after we pull in /etc/make.conf. We need to do it afterwards so we can
react to the user setting of the:
* CPUTYPE variable, which contains the CPU type which the user wants to
optimize for. For example, if you want your binaries to only run on an
i686-class machine (or higher), set this to i686. If you want to support
running binaries on a variety of CPU generations, set this to the lowest
common denominator. Supported values are listed in make.conf.
* bsd.cpu.mk does the expansion of CPUTYPE into MACHINE_CPU using the
(hopefully) correct unordered list of CPU types which should be used on
that CPU. For example, an AMD k6 CPU wants any of the following:
k6 k5 i586 i486 i386
This is still an unordered list so the client makefile logic is simple -
client makefiles need to test for the various elements of the set in
decreasing order of priority using ${MACHINE_CPU:M<foo>}, as before.
The various MACHINE_CPU lists are believed to be correct, but should be
checked.
* If NO_CPU_CFLAGS is not defined, add relevant gcc compiler optimization
settings by default (e.g. -karch=k6 for CPUTYPE=k6, etc). Release
builders and developers of third-party software need to make sure not to
enable CPU-specific optimization when generating code intended to be
portable. We probably need to move to an /etc/world.conf to allow the
optimization stuff to be applied separately to world/kernel and external
compilations, but it's not any worse a problem than it was before.
* Add coverage for the ia64/itanium MACHINE_ARCH/CPUTYPE.
* Add CPUTYPE support for all of the CPU types supported by FreeBSD and gcc
(only i386, alpha and ia64 first, since those are the minimally-working
ports. Other architecture porters, please feel free to add the relevant
gunk for your platform).
Reviewed by: jhb, obrien
2001-02-22 06:14:25 -05:00
|
|
|
MACHINE_CPU = i586 i486 i386
|
2002-09-18 16:51:25 -04:00
|
|
|
. elif ${CPUTYPE} == "i486"
|
Overhaul the MACHINE_CPU behaviour:
* Rip out MACHINE_CPU stuff from sys.mk and include a new <bsd.cpu.mk>
after we pull in /etc/make.conf. We need to do it afterwards so we can
react to the user setting of the:
* CPUTYPE variable, which contains the CPU type which the user wants to
optimize for. For example, if you want your binaries to only run on an
i686-class machine (or higher), set this to i686. If you want to support
running binaries on a variety of CPU generations, set this to the lowest
common denominator. Supported values are listed in make.conf.
* bsd.cpu.mk does the expansion of CPUTYPE into MACHINE_CPU using the
(hopefully) correct unordered list of CPU types which should be used on
that CPU. For example, an AMD k6 CPU wants any of the following:
k6 k5 i586 i486 i386
This is still an unordered list so the client makefile logic is simple -
client makefiles need to test for the various elements of the set in
decreasing order of priority using ${MACHINE_CPU:M<foo>}, as before.
The various MACHINE_CPU lists are believed to be correct, but should be
checked.
* If NO_CPU_CFLAGS is not defined, add relevant gcc compiler optimization
settings by default (e.g. -karch=k6 for CPUTYPE=k6, etc). Release
builders and developers of third-party software need to make sure not to
enable CPU-specific optimization when generating code intended to be
portable. We probably need to move to an /etc/world.conf to allow the
optimization stuff to be applied separately to world/kernel and external
compilations, but it's not any worse a problem than it was before.
* Add coverage for the ia64/itanium MACHINE_ARCH/CPUTYPE.
* Add CPUTYPE support for all of the CPU types supported by FreeBSD and gcc
(only i386, alpha and ia64 first, since those are the minimally-working
ports. Other architecture porters, please feel free to add the relevant
gunk for your platform).
Reviewed by: jhb, obrien
2001-02-22 06:14:25 -05:00
|
|
|
MACHINE_CPU = i486 i386
|
2002-09-18 16:51:25 -04:00
|
|
|
. elif ${CPUTYPE} == "i386"
|
Overhaul the MACHINE_CPU behaviour:
* Rip out MACHINE_CPU stuff from sys.mk and include a new <bsd.cpu.mk>
after we pull in /etc/make.conf. We need to do it afterwards so we can
react to the user setting of the:
* CPUTYPE variable, which contains the CPU type which the user wants to
optimize for. For example, if you want your binaries to only run on an
i686-class machine (or higher), set this to i686. If you want to support
running binaries on a variety of CPU generations, set this to the lowest
common denominator. Supported values are listed in make.conf.
* bsd.cpu.mk does the expansion of CPUTYPE into MACHINE_CPU using the
(hopefully) correct unordered list of CPU types which should be used on
that CPU. For example, an AMD k6 CPU wants any of the following:
k6 k5 i586 i486 i386
This is still an unordered list so the client makefile logic is simple -
client makefiles need to test for the various elements of the set in
decreasing order of priority using ${MACHINE_CPU:M<foo>}, as before.
The various MACHINE_CPU lists are believed to be correct, but should be
checked.
* If NO_CPU_CFLAGS is not defined, add relevant gcc compiler optimization
settings by default (e.g. -karch=k6 for CPUTYPE=k6, etc). Release
builders and developers of third-party software need to make sure not to
enable CPU-specific optimization when generating code intended to be
portable. We probably need to move to an /etc/world.conf to allow the
optimization stuff to be applied separately to world/kernel and external
compilations, but it's not any worse a problem than it was before.
* Add coverage for the ia64/itanium MACHINE_ARCH/CPUTYPE.
* Add CPUTYPE support for all of the CPU types supported by FreeBSD and gcc
(only i386, alpha and ia64 first, since those are the minimally-working
ports. Other architecture porters, please feel free to add the relevant
gunk for your platform).
Reviewed by: jhb, obrien
2001-02-22 06:14:25 -05:00
|
|
|
MACHINE_CPU = i386
|
2002-09-18 16:51:25 -04:00
|
|
|
. endif
|
2010-09-13 03:22:14 -04:00
|
|
|
. elif ${MACHINE_CPUARCH} == "amd64"
|
2011-02-20 17:32:21 -05:00
|
|
|
. if ${CPUTYPE} == "opteron-sse3" || ${CPUTYPE} == "athlon64-sse3" || ${CPUTYPE} == "k8-sse3"
|
|
|
|
|
MACHINE_CPU = k8 3dnow sse3
|
|
|
|
|
. elif ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8"
|
2004-12-11 13:36:42 -05:00
|
|
|
MACHINE_CPU = k8 3dnow
|
2011-03-14 09:36:51 -04:00
|
|
|
. elif ${CPUTYPE} == "core2"
|
|
|
|
|
MACHINE_CPU = ssse3 sse3
|
|
|
|
|
. elif ${CPUTYPE} == "nocona"
|
2004-12-11 13:36:42 -05:00
|
|
|
MACHINE_CPU = sse3
|
2004-10-17 01:19:45 -04:00
|
|
|
. endif
|
2004-12-11 13:36:42 -05:00
|
|
|
MACHINE_CPU += amd64 sse2 sse mmx
|
2010-09-13 03:22:14 -04:00
|
|
|
. elif ${MACHINE_CPUARCH} == "ia64"
|
2002-09-18 16:51:25 -04:00
|
|
|
. if ${CPUTYPE} == "itanium"
|
Overhaul the MACHINE_CPU behaviour:
* Rip out MACHINE_CPU stuff from sys.mk and include a new <bsd.cpu.mk>
after we pull in /etc/make.conf. We need to do it afterwards so we can
react to the user setting of the:
* CPUTYPE variable, which contains the CPU type which the user wants to
optimize for. For example, if you want your binaries to only run on an
i686-class machine (or higher), set this to i686. If you want to support
running binaries on a variety of CPU generations, set this to the lowest
common denominator. Supported values are listed in make.conf.
* bsd.cpu.mk does the expansion of CPUTYPE into MACHINE_CPU using the
(hopefully) correct unordered list of CPU types which should be used on
that CPU. For example, an AMD k6 CPU wants any of the following:
k6 k5 i586 i486 i386
This is still an unordered list so the client makefile logic is simple -
client makefiles need to test for the various elements of the set in
decreasing order of priority using ${MACHINE_CPU:M<foo>}, as before.
The various MACHINE_CPU lists are believed to be correct, but should be
checked.
* If NO_CPU_CFLAGS is not defined, add relevant gcc compiler optimization
settings by default (e.g. -karch=k6 for CPUTYPE=k6, etc). Release
builders and developers of third-party software need to make sure not to
enable CPU-specific optimization when generating code intended to be
portable. We probably need to move to an /etc/world.conf to allow the
optimization stuff to be applied separately to world/kernel and external
compilations, but it's not any worse a problem than it was before.
* Add coverage for the ia64/itanium MACHINE_ARCH/CPUTYPE.
* Add CPUTYPE support for all of the CPU types supported by FreeBSD and gcc
(only i386, alpha and ia64 first, since those are the minimally-working
ports. Other architecture porters, please feel free to add the relevant
gunk for your platform).
Reviewed by: jhb, obrien
2001-02-22 06:14:25 -05:00
|
|
|
MACHINE_CPU = itanium
|
2002-09-18 16:51:25 -04:00
|
|
|
. endif
|
2010-12-30 10:58:23 -05:00
|
|
|
. elif ${MACHINE_ARCH} == "powerpc"
|
|
|
|
|
. if ${CPUTYPE} == "e500"
|
|
|
|
|
MACHINE_CPU = booke
|
|
|
|
|
. endif
|
|
|
|
|
. elif ${MACHINE_ARCH} == "sparc64"
|
|
|
|
|
. if ${CPUTYPE} == "v9"
|
|
|
|
|
MACHINE_CPU = v9
|
|
|
|
|
. elif ${CPUTYPE} == "ultrasparc"
|
|
|
|
|
MACHINE_CPU = v9 ultrasparc
|
|
|
|
|
. elif ${CPUTYPE} == "ultrasparc3"
|
|
|
|
|
MACHINE_CPU = v9 ultrasparc ultrasparc3
|
|
|
|
|
. endif
|
Overhaul the MACHINE_CPU behaviour:
* Rip out MACHINE_CPU stuff from sys.mk and include a new <bsd.cpu.mk>
after we pull in /etc/make.conf. We need to do it afterwards so we can
react to the user setting of the:
* CPUTYPE variable, which contains the CPU type which the user wants to
optimize for. For example, if you want your binaries to only run on an
i686-class machine (or higher), set this to i686. If you want to support
running binaries on a variety of CPU generations, set this to the lowest
common denominator. Supported values are listed in make.conf.
* bsd.cpu.mk does the expansion of CPUTYPE into MACHINE_CPU using the
(hopefully) correct unordered list of CPU types which should be used on
that CPU. For example, an AMD k6 CPU wants any of the following:
k6 k5 i586 i486 i386
This is still an unordered list so the client makefile logic is simple -
client makefiles need to test for the various elements of the set in
decreasing order of priority using ${MACHINE_CPU:M<foo>}, as before.
The various MACHINE_CPU lists are believed to be correct, but should be
checked.
* If NO_CPU_CFLAGS is not defined, add relevant gcc compiler optimization
settings by default (e.g. -karch=k6 for CPUTYPE=k6, etc). Release
builders and developers of third-party software need to make sure not to
enable CPU-specific optimization when generating code intended to be
portable. We probably need to move to an /etc/world.conf to allow the
optimization stuff to be applied separately to world/kernel and external
compilations, but it's not any worse a problem than it was before.
* Add coverage for the ia64/itanium MACHINE_ARCH/CPUTYPE.
* Add CPUTYPE support for all of the CPU types supported by FreeBSD and gcc
(only i386, alpha and ia64 first, since those are the minimally-working
ports. Other architecture porters, please feel free to add the relevant
gunk for your platform).
Reviewed by: jhb, obrien
2001-02-22 06:14:25 -05:00
|
|
|
. endif
|
|
|
|
|
.endif
|
2002-09-18 16:48:54 -04:00
|
|
|
|
2010-12-30 10:58:23 -05:00
|
|
|
.if ${MACHINE_CPUARCH} == "mips"
|
2010-03-02 02:44:38 -05:00
|
|
|
CFLAGS += -G0
|
2008-03-19 08:20:44 -04:00
|
|
|
.endif
|
|
|
|
|
|
2004-01-10 13:01:08 -05:00
|
|
|
# NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk
|
2002-09-18 16:48:54 -04:00
|
|
|
|
|
|
|
|
.if !defined(NO_CPU_CFLAGS)
|
|
|
|
|
CFLAGS += ${_CPUCFLAGS}
|
|
|
|
|
.endif
|