From owner-svn-src-head@freebsd.org Fri Nov 18 16:23:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5829AC4750C; Fri, 18 Nov 2016 16:23:33 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FEBD1317; Fri, 18 Nov 2016 16:23:32 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAIGNWfJ072833; Fri, 18 Nov 2016 16:23:32 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAIGNWfV072831; Fri, 18 Nov 2016 16:23:32 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201611181623.uAIGNWfV072831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Fri, 18 Nov 2016 16:23:32 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2016 16:23:33 -0000 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 /*