From patchwork Thu Apr 6 19:07:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 9668159 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4269A602B8 for ; Thu, 6 Apr 2017 19:10:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21296285C4 for ; Thu, 6 Apr 2017 19:10:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 128A4285D5; Thu, 6 Apr 2017 19:10:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6FE75285C4 for ; Thu, 6 Apr 2017 19:10:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=tHxKGxGh31PLZQPhd5xbsXiFvFJ593oR/tFafz8/phE=; b=V1Lx7hpgdqDUsR 5NhFDUj0soXySUEgPcQwwxaNpTOHaxG55aiWLHqR+6+OM7oIj8oOXQI5ndduDUwPUSIvDlquwlxvJ uOPlmRsNhN3FHUe+OyTZSt+HDtJt3vPKaSQXsjLOIasxqHMWyxSM4G2jIHgaZAKeAOCJjF4x+RCiN dnB345TDPDf9NcZZXauoSoRWZ1rqgbAa4lhII0Tp1gOble7nSblpxctiXd8n/UamnV/6bOn3LSMcb TKo5jevs8xAz5HrRug9gQH9ANJRe/8ZOIZtvsCFqMLTPKjN4Q37K7QbXW1JbLleznwuUa7J64ajtb ufP5BCWg5PtF4k0OunEA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cwCnJ-0002ax-HC; Thu, 06 Apr 2017 19:10:09 +0000 Received: from mail-wr0-x230.google.com ([2a00:1450:400c:c0c::230]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cwClF-0007uT-Fw for linux-arm-kernel@lists.infradead.org; Thu, 06 Apr 2017 19:08:07 +0000 Received: by mail-wr0-x230.google.com with SMTP id o21so48653089wrb.2 for ; Thu, 06 Apr 2017 12:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NIl3186CHA34bq0En/LGAic1OFHbiI/1oktTisCd6ZY=; b=YAU63FrOoorFNLKspwJ5lfpI6fm/a4zfHwizIHtjVDkcUWvfpXHoxRfzJElaSyYCz5 otAAB4Dr2OvO4xrARDp20RB+7+7BizVB7iX7BVxVpu107kq7/D04fkcw1neyyDO4kF9g rEVljqo9BpWJZc/KX73FYgRC7PrjgzdTqLPkw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NIl3186CHA34bq0En/LGAic1OFHbiI/1oktTisCd6ZY=; b=pUfQLCE5dQssrHeaYgtCW5uy/uULY/EJImnRzXSOtisUBq74gF00tLYo7yxEtI7q0Q fmCDUpgTSCx+eioQx1QLJT9/wt0V0EIIEPRGeditXFxri34O/XDjCbuPivPw9jDHn5A6 mqyPUyVtzhcVpp1+gVvF+/mw76i7tlyH5Uk00GqAXxPFqVaSb69OrwF+O11Dwyg9avPG i2ao3zOQqyzkZz8nzpyHjSkKxXlP1nCj2CGsnW6diL6hiHZ5qFD7U+PS+VcFaFQPO7g7 zK78zBPrYQLffm5gO/w3bEl7OHa+5zU2i7x+V/RpygV9Gppqq8cHjyRdx3J4wvYuozfA ognw== X-Gm-Message-State: AFeK/H37JBUGolAL3fEBNnGnKtZ4+jgdnENTDRO6xcQonaNRwq/A5kGT pMc6vltRiivaICvm3kWz4w== X-Received: by 10.28.142.133 with SMTP id q127mr15689992wmd.116.1491505661886; Thu, 06 Apr 2017 12:07:41 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id f62sm12791772wmh.33.2017.04.06.12.07.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Apr 2017 12:07:39 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id BE11B3E0FF9; Thu, 6 Apr 2017 20:07:37 +0100 (BST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: drjones@redhat.com, pbonzini@redhat.com Subject: [RFC kvm-unit-tests PATCH 8/8] Makefiles: fix up the arm build include and link paths Date: Thu, 6 Apr 2017 20:07:27 +0100 Message-Id: <20170406190727.5624-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170406190727.5624-1-alex.bennee@linaro.org> References: <20170406190727.5624-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170406_120802_076606_04C79E1D X-CRM114-Status: GOOD ( 10.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kvm@vger.kernel.org, marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP We still need to tell the compiler the correct search path for finding headers and the like. This is slightly complicated by the "dynamic" asm search path which is in our build tree but (may be) symlinked to the right architectures headers. Also we explicitly include SRCDIR for the linking scripts as VPATH doesn't seem to find them well enough. Signed-off-by: Alex Bennée --- arm/Makefile.common | 15 +++++++++------ scripts/asm-offsets.mak | 4 +++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/arm/Makefile.common b/arm/Makefile.common index 74c7394..b1fead1 100644 --- a/arm/Makefile.common +++ b/arm/Makefile.common @@ -16,7 +16,10 @@ tests-common += $(TEST_DIR)/pmu.flat tests-common += $(TEST_DIR)/gic.flat tests-common += $(TEST_DIR)/psci.flat -tests-all = $(tests-common) $(tests) +scripts-common += $(TEST_DIR)/run +scripts-common += $(TEST_DIR)/unittests.cfg + +tests-all = $(tests-common) $(tests) $(scripts_common) all: $(tests-all) ################################################################## @@ -26,13 +29,13 @@ CFLAGS += -std=gnu99 CFLAGS += -ffreestanding CFLAGS += -Wextra CFLAGS += -O2 -CFLAGS += -I lib -I lib/libfdt +CFLAGS += -I $(SRCDIR)/lib -I $(SRCDIR)/lib/libfdt -I lib # We want to keep intermediate files .PRECIOUS: %.elf %.o asm-offsets = lib/$(ARCH)/asm-offsets.h -include scripts/asm-offsets.mak +include $(SRCDIR)/scripts/asm-offsets.mak cflatobjs += lib/util.o cflatobjs += lib/alloc.o @@ -60,11 +63,11 @@ start_addr := $(shell printf "%x\n" $$(( $(phys_base) + $(kernel_offset) ))) FLATLIBS = $(libcflat) $(LIBFDT_archive) $(libgcc) $(libeabi) %.elf: LDFLAGS = $(CFLAGS) -nostdlib -%.elf: %.o $(FLATLIBS) arm/flat.lds $(cstart.o) +%.elf: %.o $(FLATLIBS) $(SRCDIR)/arm/flat.lds $(cstart.o) $(CC) $(LDFLAGS) -o $@ \ - -Wl,-T,arm/flat.lds,--build-id=none,-Ttext=$(start_addr) \ + -Wl,-T,$(SRCDIR)/arm/flat.lds,--build-id=none,-Ttext=$(start_addr) \ $(filter %.o, $^) $(FLATLIBS) \ - lib/auxinfo.c -DPROGNAME=\"$(@:.elf=.flat)\" + $(SRCDIR)/lib/auxinfo.c -DPROGNAME=\"$(@:.elf=.flat)\" %.flat: %.elf $(OBJCOPY) -O binary $^ $@ diff --git a/scripts/asm-offsets.mak b/scripts/asm-offsets.mak index b2578a6..ecf583f 100644 --- a/scripts/asm-offsets.mak +++ b/scripts/asm-offsets.mak @@ -29,11 +29,13 @@ define make_asm_offsets endef $(asm-offsets:.h=.s): $(asm-offsets:.h=.c) + mkdir -p $(dir $@) $(CC) $(CFLAGS) -fverbose-asm -S -o $@ $< $(asm-offsets): $(asm-offsets:.h=.s) $(call make_asm_offsets) - cp -f $(asm-offsets) lib/generated + mkdir -p lib/generated + cp -f $(asm-offsets) lib/generated/ asm_offsets_clean: $(RM) $(asm-offsets) $(asm-offsets:.h=.s) \