Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6130581ybv; Tue, 18 Feb 2020 10:29:50 -0800 (PST) X-Google-Smtp-Source: APXvYqzX+b36+tb2Okt0gmfPRskCAGnyGyFk/6QquTB5jzhaug3bi63y4aTrYBr0/L8GergDRrfF X-Received: by 2002:a05:6808:8fc:: with SMTP id d28mr2169077oic.152.1582050587820; Tue, 18 Feb 2020 10:29:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582050587; cv=none; d=google.com; s=arc-20160816; b=An/FHGCDWdwtMNc6GTc3iPNdzO96+/jZnhKn4KQ5wFhzO9ls9cO42iMZW4gMNRIwRt Nrcwre1ZlZ2BhzObIOpUZ8lnmQk2pjVnOqb3TC2da2gEYQ2gC028UNUSJuyMz+RejDtq yjOOklt5XitoVm/5Zv3v6lHGRvxeT27ZIHkT3sa/eCVAbNjIaOpc5bwpuLE7Z7KnnPIV LVXUv9IY1NomThDY2aKcdMGyJIRAJT4oMfG1rohu/zClhHTW88ruA1Zm8VnCWFRb5Ym2 x6m1aBuwXZviDuojMv8ZeSRJdVwr19DDDfCUq19a0RYy0NB/uZwOsv1wNBpDP23q9yDb Rueg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=d3KSdYVbADc8vhuPRBnMJ0Olj+WzBHR91Wg/nozFRYA=; b=IwLGUNRs+F/0gg3z0l807aEjLDGcyqEigL0xOj/yFQ00nlq9aPrSaEzcjVYd5b8P4S l1jsRHtZ1i+3CUyIWlfKZ8j0qmFyBkzpI6LedgbQAQFzzzt0plXwTT2PtBUlge0Ffxiq RPfXZrf6WfkklI/Zt0Z0ewyFjB1ZewlwBw7llk/FNZVFZWnwmB5riRnjVQpx8Jr2alZl bUrYUe/jkuB+jYXWgMkoKX9xyE2e7K+VXC0Wk7F+jnq3FQltupux4o/D192KZn5xbjbe JBcww6pfHRK5cRIeU8ZzdJ6fwcru2AAFfbzh82vOJKmHhxq+f7CA0n80RSZfp3+boX2S VCbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=IaQVxnR3; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o25si2193423otk.28.2020.02.18.10.29.34; Tue, 18 Feb 2020 10:29:47 -0800 (PST) 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; dkim=pass header.i=@google.com header.s=20161025 header.b=IaQVxnR3; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726383AbgBRS21 (ORCPT + 99 others); Tue, 18 Feb 2020 13:28:27 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:45528 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726239AbgBRS20 (ORCPT ); Tue, 18 Feb 2020 13:28:26 -0500 Received: by mail-pf1-f196.google.com with SMTP id 2so11052231pfg.12 for ; Tue, 18 Feb 2020 10:28:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=d3KSdYVbADc8vhuPRBnMJ0Olj+WzBHR91Wg/nozFRYA=; b=IaQVxnR3uw31I9KunUQW5x8fXVHpy/6d/88oLvKBtPts2zAXC4WAIdJJWQN8rU7XFZ F9zes4nbRbK4WtDCM3SHBBblZhNRP6VwotM4uwx/Wy2m0TO6Ps/fsNWL3WO7Y8CmBYJV H4XDlwgzFvNsxnyzezcpPqGpDAbmOtjnpj8zYaDld/s2Z7y+qqodtC/Zefvx7tg/s80J 2KYLk3CgN1goeYX3nnng1hDTQqCJk2NwClrXveS8dbtg4abUilguyuJcQA8wWr9l4kIQ pgaHPCredNAnrNtlgdUt4o3RF/s5wlfgY9h3wpZL0cbnXyK5ZGnkuJdxRduDs7pQqboV 22Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=d3KSdYVbADc8vhuPRBnMJ0Olj+WzBHR91Wg/nozFRYA=; b=iOl2/Zpz5nhBm67hQ4tzH4jlPGTlWNKW032inHK3PbqUz2bqMHc2LeeaxzPGreX3zo ISaXeWc/jzMgvYueuZ9lDnAa4yX5sZ7YhCZ6ZbpouZlpDvZovHMcSfyKcmNaRz7fUB35 QaLCJp5R/EweLpP4BAPmy9G/tVO06tschFy5xlXoUovadt8WO5wVsk/LCpcbUzmlqlxy cSZM9H/9IXBSFdnY9j1HI+oFKr8QFtf9n4unpvI2taVRpvENvmBwYEmggWS681PFDtXL uNRADq0FzIcv7JHWpsx68Q5sBxwZ2268StXx2ssMR2bQiJ1F4DBAZ+fT6UemV1nJ7amu g9kQ== X-Gm-Message-State: APjAAAUBF5XjNHy8ZDKECLH4puuAz2YFquQTfL8fij/R5ns2BUmbKoy6 6tBsZodZqdYaMPPDWe0UjjQBxExxAe0L/4hsyn4CFA== X-Received: by 2002:a63:64c5:: with SMTP id y188mr23652916pgb.10.1582050506059; Tue, 18 Feb 2020 10:28:26 -0800 (PST) MIME-Version: 1.0 References: <20200217211149.44132-1-natechancellor@gmail.com> In-Reply-To: <20200217211149.44132-1-natechancellor@gmail.com> From: Nick Desaulniers Date: Tue, 18 Feb 2020 10:28:15 -0800 Message-ID: Subject: Re: [PATCH] MIPS: vdso: Wrap -mexplicit-relocs in cc-option To: Nathan Chancellor Cc: Ralf Baechle , Paul Burton , linux-mips@vger.kernel.org, LKML , clang-built-linux 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 On Mon, Feb 17, 2020 at 1:11 PM Nathan Chancellor wrote: > > Clang does not support this option and errors out: > > clang-11: error: unknown argument: '-mexplicit-relocs' > > Clang does not appear to need this flag like GCC does because the jalr > check that was added in commit 976c23af3ee5 ("mips: vdso: add build > time check that no 'jalr t9' calls left") passes just fine with > > $ make ARCH=mips CC=clang CROSS_COMPILE=mipsel-linux-gnu- malta_defconfig arch/mips/vdso/ > > even before commit d3f703c4359f ("mips: vdso: fix 'jalr t9' crash in > vdso code"). > > -mrelax-pic-calls has been supported since clang 9, which is the > earliest version that could build a working MIPS kernel, and it is the > default for clang so just leave it be. > > Fixes: d3f703c4359f ("mips: vdso: fix 'jalr t9' crash in vdso code") > Link: https://github.com/ClangBuiltLinux/linux/issues/890 > Signed-off-by: Nathan Chancellor Thanks for the patch, and detailed context. Reviewed-by: Nick Desaulniers With this patch applied: $ make ARCH=mips CC=clang CROSS_COMPILE=mipsel-linux-gnu- malta_defconfig arch/mips/vdso/ $ lvm-objdump --disassemble arch/mips/vdso/vdso.so.dbg.raw | egrep -h "jarl.*t9" $ llvm-objdump --disassemble arch/mips/vdso/vdso.so.dbg.raw | grep jarl So jarl instructions aren't emitted. Tested-by: Nick Desaulniers > --- > arch/mips/vdso/Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/mips/vdso/Makefile b/arch/mips/vdso/Makefile > index 77374c1f0c77..d7fe8408603e 100644 > --- a/arch/mips/vdso/Makefile > +++ b/arch/mips/vdso/Makefile > @@ -33,7 +33,7 @@ endif > cflags-vdso := $(ccflags-vdso) \ > $(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \ > -O3 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \ > - -mrelax-pic-calls -mexplicit-relocs \ > + -mrelax-pic-calls $(call cc-option, -mexplicit-relocs) \ > -fno-stack-protector -fno-jump-tables -DDISABLE_BRANCH_PROFILING \ > $(call cc-option, -fno-asynchronous-unwind-tables) \ > $(call cc-option, -fno-stack-protector) > -- -- Thanks, ~Nick Desaulniers