Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp730816imm; Thu, 13 Sep 2018 06:58:26 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaaZiz0mfG7k/BMsBbKu2nzdlSIm/zWmKPAFoCXgh6GTeEhbtjAx7S35LTDZlnn6ENdRfCD X-Received: by 2002:a63:f:: with SMTP id 15-v6mr7449835pga.430.1536847106088; Thu, 13 Sep 2018 06:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536847106; cv=none; d=google.com; s=arc-20160816; b=McplE/pIvV0J4D1L/KmWsCGy4NWptFEBbXnPaPowiL4jciBzyQMgKbUC1y92cIrzpL 0RocGVWc3t8u00njSOpft93rXQdE2dZhjEYGvZ9EX9gjp07wy8hp5UscJf650m67wazt nn1XSpUxeC6t1QJ0LLHFazMgdUIbVkqQgB1yMl1gkittgDePvE1YLdLTR+BwoO2WDmu2 +FKWLEvsB94EVexd89KLTV634oJ1UREDDtrdV9bVMUuGd7B2pkIcoOaIJBwDvdUL6OI1 pgguX9R74gDns0f3LsYgIv/cPCfdZUIobsyQ6CCnIySq5/Ej07R4j/pDbaLuEGIu1Km5 Wmqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=oroZacM+ZWPw0nvZp7P0pN/HTrCuqdVvRN2Vso7I7A0=; b=Qq4Z76q+5enuV6tlYxsqx+HF4mn1t/qSN8D+S+WDztkUv0euYto6jP8mWJZVAuEtzx VoSO0T9Hyf6hQM8yjoIK1eTQsxR+1SkPMoGCs7NI8e/gWDQN6S8kTx63t7183CIWuEo9 3SPoLvX8JDs/2nIFaEm6EgkjR8Yzwr5TTDBvy3DtMVKKWZgtD+3G2mQzzCkbRQLuWxAk NsWQoiITofESJwq1cDymZwJ5OB1vaqAwuY897Kqz1yUtCvY3ytchuA3TnBkDSMZ948wN uAlSUskaR+egVnB/PCVE8/7PCLQASi1fTmz4+VFYr6xmu2A4D1S+/+A3JSnBQyXeEHbt p5lQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1-v6si4318314pfd.273.2018.09.13.06.58.10; Thu, 13 Sep 2018 06:58:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731408AbeIMTGN (ORCPT + 99 others); Thu, 13 Sep 2018 15:06:13 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34188 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730337AbeIMTGN (ORCPT ); Thu, 13 Sep 2018 15:06:13 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 5414ED19; Thu, 13 Sep 2018 13:56:36 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , Palmer Dabbelt , Sasha Levin Subject: [PATCH 4.18 090/197] RISC-V: Use KBUILD_CFLAGS instead of KCFLAGS when building the vDSO Date: Thu, 13 Sep 2018 15:30:39 +0200 Message-Id: <20180913131845.131802941@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180913131841.568116777@linuxfoundation.org> References: <20180913131841.568116777@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Palmer Dabbelt [ Upstream commit 4938c79bd0f5f3650c8c2cd4cdc972f0a6962ce4 ] If you use a 64-bit compiler to build a 32-bit kernel then you'll get an error when building the vDSO due to a library mismatch. The happens because the relevant "-march" argument isn't supplied to the GCC run that generates one of the vDSO intermediate files. I'm not actually sure what the right thing to do here is as I'm not particularly familiar with the kernel build system. I poked the documentation and it appears that KCFLAGS is the correct thing to do (it's suggested that should be used when building modules), but we set KBUILD_CFLAGS in arch/riscv/Makefile. This does at least fix the build error. Reviewed-by: Christoph Hellwig Signed-off-by: Palmer Dabbelt Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/riscv/kernel/vdso/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/riscv/kernel/vdso/Makefile +++ b/arch/riscv/kernel/vdso/Makefile @@ -52,8 +52,8 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE # Add -lgcc so rv32 gets static muldi3 and lshrdi3 definitions. # Make sure only to export the intended __vdso_xxx symbol offsets. quiet_cmd_vdsold = VDSOLD $@ - cmd_vdsold = $(CC) $(KCFLAGS) $(call cc-option, -no-pie) -nostdlib $(SYSCFLAGS_$(@F)) \ - -Wl,-T,$(filter-out FORCE,$^) -o $@.tmp -lgcc && \ + cmd_vdsold = $(CC) $(KBUILD_CFLAGS) $(call cc-option, -no-pie) -nostdlib -nostartfiles $(SYSCFLAGS_$(@F)) \ + -Wl,-T,$(filter-out FORCE,$^) -o $@.tmp && \ $(CROSS_COMPILE)objcopy \ $(patsubst %, -G __vdso_%, $(vdso-syms)) $@.tmp $@