From patchwork Tue Apr 14 22:52:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tyler Baker X-Patchwork-Id: 47157 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 19AF52121F for ; Tue, 14 Apr 2015 22:53:25 +0000 (UTC) Received: by wizk4 with SMTP id k4sf7472300wiz.2 for ; Tue, 14 Apr 2015 15:53:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=uqoEZXLp1KdaYvoVR9krj7ZuAXfXXdo65KG+pSN03ug=; b=O+QBJuC+CKQbDMndaiLDSs7R/0lYzipiQMywAaq7ZiF5O4HRrQa7MXbtc77b4wqjUW 0Gbkf9irHYCpbDnB18f5oFA5jv3YQUkA4FngCou9VvXw0eZiKDPft7lP8VB05S4q/iFB zmY/qHFlXCXnu1KxsVl8nSSHkzFL+6HP4gXp0thFlACV7MyFXr4XLMGZ2eVH7yAln3+h NR0cZEsRR1zhLjU8ugUAl5OGJsUsu3AjkkeWKoDYUc198a+ODLE4dF378XQqUYEyD6VZ SbMhaCb/I5K5Ood7tTbWDwWcl261USwVjwcWDRE5YRoC9OEBGTkP4Ce2+RajS3ICeJ3f AGSA== X-Gm-Message-State: ALoCoQmV0/IrHhFjmIkGI0sWZEwZ/6eQvbJHiyYCyeH+4iUSJfvaqr4rI5F/31wuu+LJHzKNyNCy X-Received: by 10.152.3.70 with SMTP id a6mr3828964laa.0.1429052004295; Tue, 14 Apr 2015 15:53:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.197.34 with SMTP id ir2ls110324lac.84.gmail; Tue, 14 Apr 2015 15:53:24 -0700 (PDT) X-Received: by 10.152.120.106 with SMTP id lb10mr13467983lab.92.1429052004050; Tue, 14 Apr 2015 15:53:24 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id j7si2279236lae.69.2015.04.14.15.53.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Apr 2015 15:53:23 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbbuc2 with SMTP id uc2so20633980lbb.2 for ; Tue, 14 Apr 2015 15:53:23 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr20625772lac.41.1429052003771; Tue, 14 Apr 2015 15:53:23 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp2163411lbt; Tue, 14 Apr 2015 15:53:22 -0700 (PDT) X-Received: by 10.68.96.33 with SMTP id dp1mr40411915pbb.4.1429052002005; Tue, 14 Apr 2015 15:53:22 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oz3si3893168pac.22.2015.04.14.15.53.21; Tue, 14 Apr 2015 15:53:21 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933139AbbDNWxL (ORCPT + 27 others); Tue, 14 Apr 2015 18:53:11 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:34293 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932794AbbDNWxE (ORCPT ); Tue, 14 Apr 2015 18:53:04 -0400 Received: by pacyx8 with SMTP id yx8so27751328pac.1 for ; Tue, 14 Apr 2015 15:53:03 -0700 (PDT) X-Received: by 10.70.29.165 with SMTP id l5mr40677940pdh.125.1429051983404; Tue, 14 Apr 2015 15:53:03 -0700 (PDT) Received: from localhost.localdomain ([173.14.250.228]) by mx.google.com with ESMTPSA id mq2sm2124820pbb.16.2015.04.14.15.53.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Apr 2015 15:53:02 -0700 (PDT) From: Tyler Baker To: Shuah Khan Cc: Kevin Hilman , John Stultz , Darren Hart , David Herrmann , Michael Ellerman , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tyler Baker Subject: [PATCH 5/7] selftests/x86: fix cross build logic Date: Tue, 14 Apr 2015 15:52:58 -0700 Message-Id: <1429051978-14778-1-git-send-email-tyler.baker@linaro.org> X-Mailer: git-send-email 2.1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: tyler.baker@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , x86 tests should not be built when ARCH != x86. Reused the logic from breakpoints to determine when it's appropriate to build. Signed-off-by: Tyler Baker --- tools/testing/selftests/x86/Makefile | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile index f0a7918..7be67a0 100644 --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@ -7,31 +7,36 @@ BINARIES_64 := $(TARGETS_C_BOTHBITS:%=%_64) CFLAGS := -O2 -g -std=gnu99 -pthread -Wall -UNAME_P := $(shell uname -p) - -# Always build 32-bit tests +# Taken from perf makefile +uname_M := $(shell uname -m 2>/dev/null || echo not) +ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/) +ifeq ($(ARCH),i386) +ARCH := x86 all: all_32 - +endif +ifeq ($(ARCH),x86_64) +ARCH := x86 # If we're on a 64-bit host, build 64-bit tests as well -ifeq ($(shell uname -p),x86_64) -all: all_64 +all: all_32 all_64 endif all_32: check_build32 $(BINARIES_32) all_64: $(BINARIES_64) -clean: - $(RM) $(BINARIES_32) $(BINARIES_64) - -run_tests: - ./run_x86_tests.sh - $(TARGETS_C_BOTHBITS:%=%_32): %_32: %.c +ifeq ($(ARCH),x86) $(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl +else + echo "Not an x86 target, can't build x86 tests" +endif $(TARGETS_C_BOTHBITS:%=%_64): %_64: %.c +ifeq ($(ARCH),x86) $(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl +else + echo "Not an x86 target, can't build x86 tests" +endif check_build32: @if ! $(CC) -m32 -o /dev/null trivial_32bit_program.c; then \ @@ -46,3 +51,9 @@ check_build32: echo " yum install glibc-devel.*i686"; \ exit 1; \ fi + +run_tests: + ./run_x86_tests.sh + +clean: + $(RM) $(BINARIES_32) $(BINARIES_64)