From owner-svn-src-all@FreeBSD.ORG Mon Jan 13 19:01:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62E8DA21; Mon, 13 Jan 2014 19:01:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 369EC1D1E; Mon, 13 Jan 2014 19:01:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s0DJ1FUw020127; Mon, 13 Jan 2014 19:01:15 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s0DJ1F6g020125; Mon, 13 Jan 2014 19:01:15 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201401131901.s0DJ1F6g020125@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 13 Jan 2014 19:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260599 - head/lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jan 2014 19:01:15 -0000 Author: marcel Date: Mon Jan 13 19:01:14 2014 New Revision: 260599 URL: http://svnweb.freebsd.org/changeset/base/260599 Log: Re-apply the part of r260022 that was reverted by r260030 with one significant difference: for LIB32 builds both TARGET_ARCH and MACHINE_ARCH are defined. TARGET_ARCH confusingly holds the architecture of the host (e.g. amd64), while MACHINE_ARCH holds the architecture were trying to build (e.g. i386). With both set and different, r260022 changed the behaviour to interpret the condition as building a cross-amd64 libkvm on i386, when obviously we're trying to build an i386 version on amd64. When COMPAT_32BIT is defined, we're building LIB32 and ignore the value of TARGET_ARCH as we did before. Modified: head/lib/libkvm/Makefile Modified: head/lib/libkvm/Makefile ============================================================================== --- head/lib/libkvm/Makefile Mon Jan 13 18:57:30 2014 (r260598) +++ head/lib/libkvm/Makefile Mon Jan 13 19:01:14 2014 (r260599) @@ -1,23 +1,36 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ +.if defined(TARGET_ARCH) && !defined(COMPAT_32BIT) +KVM_XARCH=${TARGET_ARCH} +KVM_XCPUARCH=${KVM_XARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb)?/arm/:C/powerpc64/powerpc/} +.else +KVM_XARCH=${MACHINE_ARCH} +KVM_XCPUARCH=${MACHINE_CPUARCH} +.endif + +.if ${KVM_XARCH} != ${MACHINE_ARCH} +LIB= kvm-${KVM_XARCH} +CFLAGS+=-DCROSS_LIBKVM +.else LIB= kvm +.endif + SHLIBDIR?= /lib SHLIB_MAJOR= 6 CFLAGS+=-DLIBC_SCCS -I${.CURDIR} -.if exists(${.CURDIR}/kvm_${MACHINE_ARCH}.c) -KVM_ARCH=${MACHINE_ARCH} +.if exists(${.CURDIR}/kvm_${KVM_XARCH}.c) +KVM_ARCH=${KVM_XARCH} .else -KVM_ARCH=${MACHINE_CPUARCH} +KVM_ARCH=${KVM_XCPUARCH} .endif WARNS?= 3 SRCS= kvm.c kvm_${KVM_ARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \ kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c kvm_vnet.c -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ - ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" +.if exists(${.CURDIR}/kvm_minidump_${KVM_ARCH}.c) SRCS+= kvm_minidump_${KVM_ARCH}.c .endif INCS= kvm.h