Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4632548ybz; Tue, 28 Apr 2020 15:17:29 -0700 (PDT) X-Google-Smtp-Source: APiQypKRLAEkCM1yJzN7Fy3+2uCNZNO0gfCZ7uY02AUvC0eUm5GqXcbhOkam/Qid3oIuMh2q1yvr X-Received: by 2002:a05:6402:1a46:: with SMTP id bf6mr24026194edb.44.1588112249553; Tue, 28 Apr 2020 15:17:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588112249; cv=none; d=google.com; s=arc-20160816; b=Pnd8qTnhwhBbOXrMWSONePko7X1gbUU2UNQB30hGVMfHM+mSeliqiLUQUI2zlKHuG8 HP1nd1KFh7+mpx8QM0Qi9ExDhCqDagx+LMgNr2Uvwrsx59yfQa/pyoa9XrMmbtmHr/O8 8eZA5U8dEtBUmzkp+gQUNzvQAWQCRwANMWNxte9APXLCHgZGdPN/5luRTLCgd0BCPAaR 6IlDdPHUNlbp3mvwpGzgrIc7iGgNfYZe/URavN+SWnTKNm3y3V/iUw1zlw6u8vBrCGie uRRUhM7QsN7C4X2465PV7hPGuG6QAPv85vmfD0LuaQyIhJYNybbWisVSMQnAVN2K62eI svLA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=7RXicgLKtxfo0xJMhMqi5KWPBmvi4LyzTbOskfEYJQQ=; b=UIUr3DMNLlycCSczDHx0yo4b9cAw1qBzAtWX2dzp+xLHlENAY9rocg+A5tigupg/Dv uANDg6sru74n4R81J8s5Z2/U8YffpoCPFBr+tSy5EltbIx97q206yb4udirUP2oq1gbB 7JhqjKPQ8ffXMeTkNra8SD3+Ce+3OTLkSkjzZNSpygwCDwBU/KwVziYkiZwHFUFETgxb J49DAPtnWSle9+s5xwwML/rgUR9ZjAUxa63grkbmlWTTuEWZAqN4gGoJGY8vAmQpML2R 8UM8MShvDbsEzTKNHdAXBbN8edDjIVcf87ltpn6GsUNL6jt0SqhCYf+LTaB0ZX0sahg6 pj8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cboZAHaR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si2334420ejo.379.2020.04.28.15.17.05; Tue, 28 Apr 2020 15:17:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cboZAHaR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727069AbgD1WO6 (ORCPT + 99 others); Tue, 28 Apr 2020 18:14:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726946AbgD1WOs (ORCPT ); Tue, 28 Apr 2020 18:14:48 -0400 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96ED9C03C1AE; Tue, 28 Apr 2020 15:14:48 -0700 (PDT) Received: by mail-ot1-x342.google.com with SMTP id m13so35588371otf.6; Tue, 28 Apr 2020 15:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7RXicgLKtxfo0xJMhMqi5KWPBmvi4LyzTbOskfEYJQQ=; b=cboZAHaR1XgMdVyexb3ZGscW0yg4jWB0WpJQsyGN+lTcL8lo0DgeHrbARXRAwiBelT fv11CmiuZPcFsPUdZ8Dk+cJFKE8pyoidKR1d3NFr2BdZlfocsEijQwaSXTfJi06/l5hd bghcn7uaGbR50pQ0KULUrZ/37+Xhf1drNozRzBeTLWLqMJN2OItBt7D8ILHkk7qhUv/R FVSPXdnhK/XVrHtHF742d0mlh5PFTggLAAnQhz+u409zzuWp1T2W2dG3BUDYMand6XtU M0E5oV3fpNweYRrDo7ridTW0Qfj/E++JGqWAGbPgSO8EfX8jQx9qmsZ7JzcIP7Qij4H1 Sqlg== 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=7RXicgLKtxfo0xJMhMqi5KWPBmvi4LyzTbOskfEYJQQ=; b=jTdy/cX5adnxpDedcssbFj6GHk2j55rBwxPJRDs0APjjAIIZXpwDMtlAnU1AFSdUDT SjhIiV5HX4wy9rtPU65TPuqmQGBcNzQrXMLkegBnMsbr5KE3jDgE0InQeOdNEHMqwu/W MO0Ql4ZDPACNN4+dDuqQALJ+ekahxmpIKtZ35lvH4CEyg6LKkRf/hlwLlS+EAXjSHYGo rW2YJJmWGkoZc0c2j7PX6Atbi8j/kihPFsiVwYhLmEza1anMKsVAHmxnv286tRZb0SW1 qPYcT39S+nvjaDJfOS+bTzhoTtkaztPlSvbPC+H955dXsqaeUFrPIhK/qfvDIrVNFOKK 84UA== X-Gm-Message-State: AGi0PuYZDZyJ4LnlohK8iz5PI5YRrdCfhFN+EaEWvdaYDFwqgQNPPLQC KYFXSjh7NqsmW8xEwT/SjWc= X-Received: by 2002:a05:6830:92:: with SMTP id a18mr25129047oto.317.1588112087977; Tue, 28 Apr 2020 15:14:47 -0700 (PDT) Received: from localhost.localdomain ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id 186sm5267476ooi.30.2020.04.28.15.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Apr 2020 15:14:47 -0700 (PDT) From: Nathan Chancellor To: Thomas Bogendoerfer , Masahiro Yamada Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, linux-kbuild@vger.kernel.org, Nick Desaulniers , Fangrui Song , Sami Tolvanen , Dmitry Golovin , Sedat Dilek , Nathan Chancellor Subject: [PATCH v4 5/5] MIPS: VDSO: Allow ld.lld to link the VDSO Date: Tue, 28 Apr 2020 15:14:19 -0700 Message-Id: <20200428221419.2530697-6-natechancellor@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200428221419.2530697-1-natechancellor@gmail.com> References: <20200423171807.29713-1-natechancellor@gmail.com> <20200428221419.2530697-1-natechancellor@gmail.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, when linking with ld.lld, this warning pops up: arch/mips/vdso/Makefile:70: MIPS VDSO requires binutils >= 2.25 CONFIG_LD_VERSION is set with scripts/ld-version.sh, which is specific to GNU ld. It returns 0 for ld.lld so CONFIG_MIPS_LD_CAN_LINK_VDSO does not set. ld.lld has a completely different versioning scheme (as it follows LLVM's versioning) and it does not have the issue mentioned in the comment block so it should be allowed to link the VDSO. With this patch, the VDSO successfully links and shows P_MIPS_PC32 in vgettimeofday.o. $ llvm-objdump -Dr arch/mips/vdso/vgettimeofday.o | grep R_MIPS_PC32 00000024: R_MIPS_PC32 _start 000000b0: R_MIPS_PC32 _start 000002bc: R_MIPS_PC32 _start 0000036c: R_MIPS_PC32 _start 00000468: R_MIPS_PC32 _start Reported-by: Dmitry Golovin Signed-off-by: Nathan Chancellor Link: https://github.com/ClangBuiltLinux/linux/issues/785 Link: https://github.com/llvm/llvm-project/commit/e364e2e9ce50c12eb2bf093560e1a1a8544d455a --- v3 -> v4: * No changes. v2 -> v3: * No changes. v1 -> v2: * Move into Kconfig so that the warning does not happen. arch/mips/vdso/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/vdso/Kconfig b/arch/mips/vdso/Kconfig index 36a52158d849b..7aec721398d59 100644 --- a/arch/mips/vdso/Kconfig +++ b/arch/mips/vdso/Kconfig @@ -12,7 +12,7 @@ # the lack of relocations. As such, we disable the VDSO for microMIPS builds. config MIPS_LD_CAN_LINK_VDSO - def_bool LD_VERSION >= 225000000 + def_bool LD_VERSION >= 225000000 || LD_IS_LLD config MIPS_DISABLE_VDSO def_bool CPU_MICROMIPS || (!CPU_MIPSR6 && !MIPS_LD_CAN_LINK_VDSO) -- 2.26.2