Date: Fri, 18 Nov 2016 16:23:32 +0000 (UTC) From: Alexander Kabaev <kan@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r308807 - in head/sys: conf mips/include Message-ID: <201611181623.uAIGNWfV072831@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kan Date: Fri Nov 18 16:23:31 2016 New Revision: 308807 URL: https://svnweb.freebsd.org/changeset/base/308807 Log: Subject: [PATCH] Pass MACHINE_ARCH on command line for MIPS kernels. While there, make param.h guess proper MACHINE_ARCH on hardfloat targets correctly as well, so tools like bmake can get their defaults right. This does not help the kernel case, since we compile them with forced -msoft-float and need to override an incorrect guess by param.h. Reviewed by: br Differential Revision: https://reviews.freebsd.org/D8574 Modified: head/sys/conf/kern.pre.mk head/sys/mips/include/param.h Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Fri Nov 18 16:07:08 2016 (r308806) +++ head/sys/conf/kern.pre.mk Fri Nov 18 16:23:31 2016 (r308807) @@ -74,7 +74,7 @@ CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KE CFLAGS_PARAM_INLINE_UNIT_GROWTH?=100 CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000 .if ${MACHINE_CPUARCH} == "mips" -CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 +CFLAGS_ARCH_PARAMS?=--param max-inline-insns-single=1000 -DMACHINE_ARCH='"${MACHINE_ARCH}"' .endif CFLAGS.gcc+= -fno-common -fms-extensions -finline-limit=${INLINE_LIMIT} CFLAGS.gcc+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH} Modified: head/sys/mips/include/param.h ============================================================================== --- head/sys/mips/include/param.h Fri Nov 18 16:07:08 2016 (r308806) +++ head/sys/mips/include/param.h Fri Nov 18 16:23:31 2016 (r308807) @@ -53,33 +53,36 @@ #define __PCI_REROUTE_INTERRUPT -#ifndef MACHINE -#define MACHINE "mips" -#endif -#ifndef MACHINE_ARCH #if _BYTE_ORDER == _BIG_ENDIAN -#ifdef __mips_n64 -#define MACHINE_ARCH "mips64" -#ifndef MACHINE_ARCH32 -#define MACHINE_ARCH32 "mips" +# define _EL_SUFFIX "" +#else +# define _EL_SUFFIX "el" #endif + +#ifdef __mips_n64 +# define _N64_SUFFIX "64" #elif defined(__mips_n32) -#define MACHINE_ARCH "mipsn32" +# define _N64_SUFFIX "n32" #else -#define MACHINE_ARCH "mips" +# define _N64_SUFFIX "" #endif + +#ifdef __mips_hard_float +# define _HF_SUFFIX "hf" #else -#ifdef __mips_n64 -#define MACHINE_ARCH "mips64el" -#ifndef MACHINE_ARCH32 -#define MACHINE_ARCH32 "mipsel" +# define _HF_SUFFIX "" #endif -#elif defined(__mips_n32) -#define MACHINE_ARCH "mipsn32el" -#else -#define MACHINE_ARCH "mipsel" + +#ifndef MACHINE +# define MACHINE "mips" #endif +#ifndef MACHINE_ARCH +# define MACHINE_ARCH "mips" _N64_SUFFIX _EL_SUFFIX _HF_SUFFIX #endif +#ifdef __mips_n64 +# ifndef MACHINE_ARCH32 +# define MACHINE_ARCH32 "mips" _EL_SUFFIX _HF_SUFFIX +# endif #endif /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611181623.uAIGNWfV072831>