From patchwork Thu Apr 6 19:07:26 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: 9668157 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 719F7602B8 for ; Thu, 6 Apr 2017 19:09:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 552D5285C4 for ; Thu, 6 Apr 2017 19:09:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A07B285D5; Thu, 6 Apr 2017 19:09:52 +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 EE979285C4 for ; Thu, 6 Apr 2017 19:09:51 +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=jV7V+wTJEutRQqQrKskKSxqJiMqCw48ZICQJLixXY08=; b=hqUNxDIKelfF9J J6BuAW+M9WNlZQ0FElypOF44tcY6u2cugDj9G2UjC92AgA5OL7yemLatixf7kUj3XXxVrQUjPh+Gc +zRE9g0vkqn7nER5cx+eAhQ7vloekAZ3j/ebAnGKuxNDBmz+zrYHhOgAI8TG0Dc5Pabb1HYsmSwgM Iowfy5hpwLj8XGkd0s0Z9+rAJY472atATjTxyfLobN5zSfYOSbeF6Mik7zdgZhnMjv3eCDUdDr+zV Yh7NGK71QYq4UkAPiOCJx1iev2T9+HApPuvzWDLq6ddJp9bJ/FXoGMd8Dj4Y7BiyEOCC/JxWR/vjY ROa6his7Uif2L1KS9DLw==; 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 1cwCn0-0001tk-UQ; Thu, 06 Apr 2017 19:09:50 +0000 Received: from mail-wr0-x235.google.com ([2a00:1450:400c:c0c::235]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cwClF-0007uS-MC for linux-arm-kernel@lists.infradead.org; Thu, 06 Apr 2017 19:08:04 +0000 Received: by mail-wr0-x235.google.com with SMTP id g19so32949890wrb.0 for ; Thu, 06 Apr 2017 12:07:42 -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=vdCCwPr2qMAPfqLNNbuwel/QSJHWZDYOnbQPIYfE60E=; b=DDuWszW2S4GYwifotFmdUSwsN3Ze8gvEdFP80AOrwDoztiyTNktXxY3sReb9pNOqUd 8gdRwa/auUPpdPTHT7m2hT5gvhqEs6QpPYQV1TwkNhOP9FB41dsH6jIDXLVJTGibCNQ4 cPbapztA6eL54P6MUJmVRFVT9x/bkvfqJUIdM= 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=vdCCwPr2qMAPfqLNNbuwel/QSJHWZDYOnbQPIYfE60E=; b=YzDEJ32/RKvXk4qz6Xvx/koe6JC0yOuncNWta1niNKthAANfLGIlBRKsZB8HAH/yYB gmTM/dfTQo6JNMLVXu1wipEhDplFJuGPVW7m6kxemp6WP687ngcF/mzZjTUXeHq0Mwf6 jOo58xJQhgD1H/wXkNPhQaY1AnT1jn5cvAHAa2X9XtvCbOMSV+LrA/BQn3gZUBuOt1w+ sPUgP0UV+TRcPEYlMGxiDWh0c0u05ViMwgYElZaTJzxAGeTnkh1NOqHFtZMl5geYURs0 TBsvYCVK2Zd9+SnEOzd1qaG+qRAF6yQ+ZE9XsjQj4R2syG+KF7DLFSMC0KTv1G05nuI+ 7nzA== X-Gm-Message-State: AFeK/H3s3e9QpyHBtyeMxJWlMZz21F7HQ5O+XZHtSFzahYTmzY6biTcSP07wHo0RzbBReGVn X-Received: by 10.223.174.241 with SMTP id y104mr34542261wrc.79.1491505661000; 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 g10sm3150209wrb.56.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 B34FA3E0FDF; 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 7/8] Makefiles: fix up the x86 build include and link paths Date: Thu, 6 Apr 2017 20:07:26 +0100 Message-Id: <20170406190727.5624-8-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_102730_C9F85E22 X-CRM114-Status: GOOD ( 10.65 ) 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 --- Makefile | 2 +- x86/Makefile.common | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index c9fea88..22da887 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ $(libcflat): $(cflatobjs) $(AR) rcs $@ $^ include $(LIBFDT_srcdir)/Makefile.libfdt -$(LIBFDT_archive): CFLAGS += -ffreestanding -I lib -I lib/libfdt -Wno-sign-compare +$(LIBFDT_archive): CFLAGS += -ffreestanding -I $(SRCDIR)/lib -I $(SRCDIR)/lib/libfdt -Wno-sign-compare $(LIBFDT_archive): $(addprefix $(LIBFDT_objdir)/,$(LIBFDT_OBJS)) $(AR) rcs $@ $^ diff --git a/x86/Makefile.common b/x86/Makefile.common index ef6e543..032ed19 100644 --- a/x86/Makefile.common +++ b/x86/Makefile.common @@ -17,7 +17,7 @@ cflatobjs += lib/x86/acpi.o cflatobjs += lib/x86/stack.o $(libcflat): LDFLAGS += -nostdlib -$(libcflat): CFLAGS += -ffreestanding -I lib +$(libcflat): CFLAGS += -ffreestanding -I $(SRCDIR)/lib -I lib CFLAGS += -m$(bits) CFLAGS += -O1 @@ -31,8 +31,8 @@ libgcc := $(shell $(CC) -m$(bits) --print-libgcc-file-name) .PRECIOUS: %.elf %.o FLATLIBS = lib/libcflat.a $(libgcc) -%.elf: %.o $(FLATLIBS) x86/flat.lds $(cstart.o) - $(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,x86/flat.lds \ +%.elf: %.o $(FLATLIBS) $(SRCDIR)/x86/flat.lds $(cstart.o) + $(CC) $(CFLAGS) -nostdlib -o $@ -Wl,-T,$(SRCDIR)/x86/flat.lds \ $(filter %.o, $^) $(FLATLIBS) %.flat: %.elf @@ -60,10 +60,10 @@ scripts-common += $(TEST_DIR)/unittests.cfg test_cases: $(tests-common) $(tests) -$(TEST_DIR)/%.o: CFLAGS += -std=gnu99 -ffreestanding -I lib -I lib/x86 +$(TEST_DIR)/%.o: CFLAGS += -std=gnu99 -ffreestanding -I $(SRCDIR)/lib -I $(SRCDIR)/lib/x86 -I lib $(TEST_DIR)/realmode.elf: $(TEST_DIR)/realmode.o - $(CC) -m32 -nostdlib -o $@ -Wl,-T,$(TEST_DIR)/realmode.lds $^ + $(CC) -m32 -nostdlib -o $@ -Wl,-T,$(SRCDIR)/$(TEST_DIR)/realmode.lds $^ $(TEST_DIR)/realmode.o: bits = 32