Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3795077imm; Mon, 18 Jun 2018 04:18:53 -0700 (PDT) X-Google-Smtp-Source: ADUXVKINr9MEhHrSXSuwnbuiI5GK9Qb+8SO76GYIeZaGgxcmhERdNoh953iy4+S7pS1UAMxWEGMH X-Received: by 2002:a17:902:28c8:: with SMTP id f66-v6mr13751716plb.60.1529320733682; Mon, 18 Jun 2018 04:18:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529320733; cv=none; d=google.com; s=arc-20160816; b=ey1lO8+Hs/h9rDKslviD7AivWfn5HJ+jHVQK6M+vF+7sTZqqe2XwNBwwDV75W4/7KT aELupufj1UZyeijve/1FD9ITzGYhunh0i3fT7bQQadwx1HfOLw/IJhX8Yy9ATGcijPrw nupj/HdcOCa52HbAmiWawoszrWZNRtpPNCaDeoQK3CbA8M4SDB7Jfw2Hq57Twv7NsnjJ kVFp/ubXB4gM3Nk6iuMKX8DhWNjuMjHLSqMEVdaCmAASTI3be5XVwBZMJD0sLJXIPoYc A5+6VjPqnZlcxGi0qIluRreCUTHK4s1TXCz96KMAbiyCKULVgvVk10SmGGgaAey8ZUtx v+hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=IAi+PgjeaVd4Y6ZNI8IwngGjGJBfy7AUp0L98CsssiY=; b=GhFr3/Xp0WOWVXplINkGSHEOLYOs20tflQa8M00ZO3CMetDcugdy7hb7EAEi+M1uqG b0CuE7GhmnJ/ZZhnXQm+oJxoyjqQG/9BsmceOplKU00MJv78NAcHw7kvbyBURz+WQBDi 3cy1pV14dXiCDkeE7LpwwcinpxX+ERnEUvKdOp8ugyJS+2P24kBysaMNUvAaUAM1Yrrx O8v7Oksh0uKbAwiwmwa1ZGAhmY17OECyVnh3DaHm76RTaSWzdQFAA6fEe/cRbkiWtU9q DHqgMll5Zx574ZnGJI0MzzpQ5BBdD6XeYompooAe+dYEEzinNpeOPv/dYzygik4p4Hwd b8Pw== 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 j66-v6si14518909pfc.243.2018.06.18.04.18.40; Mon, 18 Jun 2018 04:18:53 -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 S935415AbeFRITQ (ORCPT + 99 others); Mon, 18 Jun 2018 04:19:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54824 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934160AbeFRITN (ORCPT ); Mon, 18 Jun 2018 04:19:13 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E5646BAD; Mon, 18 Jun 2018 08:19:12 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aurelien Jarno , Palmer Dabbelt , Sasha Levin Subject: [PATCH 4.16 092/279] RISC-V: build vdso-dummy.o with -no-pie Date: Mon, 18 Jun 2018 10:11:17 +0200 Message-Id: <20180618080612.610346402@linuxfoundation.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618080608.851973560@linuxfoundation.org> References: <20180618080608.851973560@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Aurelien Jarno [ Upstream commit 85602bea297fc4e5223adbf7006dcce9aa694f17 ] Debian toolcahin defaults to PIE, and I guess that will also be the case of most distributions. This causes the following build failure: AS arch/riscv/kernel/vdso/getcpu.o AS arch/riscv/kernel/vdso/flush_icache.o VDSOLD arch/riscv/kernel/vdso/vdso.so.dbg OBJCOPY arch/riscv/kernel/vdso/vdso.so AS arch/riscv/kernel/vdso/vdso.o VDSOLD arch/riscv/kernel/vdso/vdso-dummy.o LD arch/riscv/kernel/vdso/vdso-syms.o riscv64-linux-gnu-ld: attempted static link of dynamic object `arch/riscv/kernel/vdso/vdso-dummy.o' make[2]: *** [arch/riscv/kernel/vdso/Makefile:43: arch/riscv/kernel/vdso/vdso-syms.o] Error 1 make[1]: *** [scripts/Makefile.build:575: arch/riscv/kernel/vdso] Error 2 make: *** [Makefile:1018: arch/riscv/kernel] Error 2 While the root Makefile correctly passes "-fno-PIE" to build individual object files, the RISC-V kernel also builds vdso-dummy.o as an executable, which is therefore linked as PIE. Fix that by updating this specific link rule to also include "-no-pie". Signed-off-by: Aurelien Jarno Signed-off-by: Palmer Dabbelt Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/riscv/kernel/vdso/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/riscv/kernel/vdso/Makefile +++ b/arch/riscv/kernel/vdso/Makefile @@ -52,7 +52,7 @@ $(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) -nostdlib $(SYSCFLAGS_$(@F)) \ + cmd_vdsold = $(CC) $(KCFLAGS) $(call cc-option, -no-pie) -nostdlib $(SYSCFLAGS_$(@F)) \ -Wl,-T,$(filter-out FORCE,$^) -o $@.tmp -lgcc && \ $(CROSS_COMPILE)objcopy \ $(patsubst %, -G __vdso_%, $(vdso-syms)) $@.tmp $@