Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4387233rwb; Tue, 8 Nov 2022 16:38:38 -0800 (PST) X-Google-Smtp-Source: AMsMyM5Yvjp8/anbzBE2XMxR54w2PWfh9AiyBLJ56LQJFdpE0zwbuE+6u0+re446cqILRomiU5I6 X-Received: by 2002:a17:906:eb09:b0:7ad:d271:e5aa with SMTP id mb9-20020a170906eb0900b007add271e5aamr48154124ejb.182.1667954318530; Tue, 08 Nov 2022 16:38:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667954318; cv=none; d=google.com; s=arc-20160816; b=O70CyfMG9dCjAeer5PqSk7v19umL9dxD6Nz4MxvpMNfojRMn7uG3qmIZ6OCtQZoAmA FU99NWUTbC8AJNM+XB93OXQJEBABzXYvoz5oyyVwlF5DtXTcDgHFi4GZVjCDtTIv3WI+ /zxucLwHRMycvrjkKLITQ6f9xbQsCIcn817eMrfrp/qZ6I3A8v1TRuH4IQqlFAV/Bgx3 R7A8KpIQi7QDv2A0Q2xBIDpKI8FBetBdkkYUqs53PYa4x7yOPUyj8F21kSx7iCPgBv3P u8d+cbGcN60PMtdQ6z8Q3PImRDSnjYv+SZGCU5nEH306DcqSesq/hhrEW3aGAHhxlWDt ZY5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HlAA0Hbu+MhDUaivFleC7V54chr+Q7jitdxy/sQaQW8=; b=Xa3Acb1sNnj8KbhmqBxSbef7hn/3G+lvbbaYpwt0UNvx35I7jZbA8vwOSoCiRdbYtq FF4wZM6PqmIQr6Nj3h5N+9HPM/oxGjVoC63pYlUvfZynDWlBsNDuxx0n7zJMWI052BfI 15FX995c2uR5jL29HoAD1CS6wm8SZzJROMDq2wXuCu87SHsqK7mSDqX6ZnEVZFm03UG0 IZ+qCIEQ7WZJ8sxTz4jbb99LFDJT/iSjrE602hDeXjwEGf+vCYlnoxfUztxRmycmpjMl yIxoqUjmEP9TDSYUAcfXCksFgMHAVLaI6fgonkg4GWr7WBGgwf0KhEHBU2vS52gTbK/k fUjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B3RdZhRr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e24-20020a50a698000000b0045938ab7129si12333737edc.330.2022.11.08.16.38.16; Tue, 08 Nov 2022 16:38:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B3RdZhRr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229689AbiKIADC (ORCPT + 93 others); Tue, 8 Nov 2022 19:03:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229528AbiKIADA (ORCPT ); Tue, 8 Nov 2022 19:03:00 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7630AB7D5 for ; Tue, 8 Nov 2022 16:02:59 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 27F0EB81CAB for ; Wed, 9 Nov 2022 00:02:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 178D0C433C1; Wed, 9 Nov 2022 00:02:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667952176; bh=1XAvvGmXAV0rKXk7VUNfUl0vYbJHJkoGa9C/F5unFa8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B3RdZhRrtNmHZcJkbbQXYCwwKtvFCVjp+chtgcH50CK2NK+PAMBGwg4mfU7/edKXo D4jAFh+f8uqDE6dm7QZ+IkkgaNnoSSt5rfsBVoyak8wPgEhTxviwNArwr+2CuGO+x4 TmO1bkgQGKIqV+qr3FOy8V1cfF3riga6jcgXdXDTpWwGDxLjHWuQqRQVLH3/w/kMFp H7UQwVc7Na0O+6Wkgz9T2a29TgLl1h5IAlCaUeWpTUE2rcSGQiMaKT5oV3M6/TPLF6 QgVodkuMy2LIuMxhGg7CD3VN/GOWQjRhn4ZtaB+w7RS4R7FNl5xeJh3ueyddm3js7A CFJpkjXLIBTDg== Date: Wed, 9 Nov 2022 00:02:52 +0000 From: Conor Dooley To: Nathan Chancellor Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev Subject: Re: [PATCH] RISC-V: vdso: Do not add missing symbols to version section in linker script Message-ID: References: <20221108171324.3377226-1-nathan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221108171324.3377226-1-nathan@kernel.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 08, 2022 at 10:13:23AM -0700, Nathan Chancellor wrote: > Recently, ld.lld moved from '--undefined-version' to > '--no-undefined-version' as the default, which breaks the compat vDSO > build: > > ld.lld: error: version script assignment of 'LINUX_4.15' to symbol '__vdso_gettimeofday' failed: symbol not defined > ld.lld: error: version script assignment of 'LINUX_4.15' to symbol '__vdso_clock_gettime' failed: symbol not defined > ld.lld: error: version script assignment of 'LINUX_4.15' to symbol '__vdso_clock_getres' failed: symbol not defined > > These symbols are not present in the compat vDSO or the regular vDSO for > 32-bit but they are unconditionally included in the version section of > the linker script, which is prohibited with '--no-undefined-version'. > > Fix this issue by only including the symbols that are actually exported > in the version section of the linker script. > > Link: https://github.com/ClangBuiltLinux/linux/issues/1756 Fixed the build for me on 99fe3d266108 ("[mlir][sparse] 3-dimensional sparse tensor insertion test") Tested-by: Conor Dooley Thanks! > Signed-off-by: Nathan Chancellor > --- > arch/riscv/kernel/vdso/Makefile | 3 +++ > arch/riscv/kernel/vdso/vdso.lds.S | 2 ++ > 2 files changed, 5 insertions(+) > > diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile > index f2e065671e4d..82416ebf4cca 100644 > --- a/arch/riscv/kernel/vdso/Makefile > +++ b/arch/riscv/kernel/vdso/Makefile > @@ -28,6 +28,9 @@ obj-vdso := $(addprefix $(obj)/, $(obj-vdso)) > > obj-y += vdso.o > CPPFLAGS_vdso.lds += -P -C -U$(ARCH) > +ifneq ($(filter vgettimeofday, $(vdso-syms)),) > +CPPFLAGS_vdso.lds += -DHAS_VGETTIMEOFDAY > +endif > > # Disable -pg to prevent insert call site > CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os > diff --git a/arch/riscv/kernel/vdso/vdso.lds.S b/arch/riscv/kernel/vdso/vdso.lds.S > index 01d94aae5bf5..150b1a572e61 100644 > --- a/arch/riscv/kernel/vdso/vdso.lds.S > +++ b/arch/riscv/kernel/vdso/vdso.lds.S > @@ -68,9 +68,11 @@ VERSION > LINUX_4.15 { > global: > __vdso_rt_sigreturn; > +#ifdef HAS_VGETTIMEOFDAY > __vdso_gettimeofday; > __vdso_clock_gettime; > __vdso_clock_getres; > +#endif > __vdso_getcpu; > __vdso_flush_icache; > local: *; > > base-commit: f0c4d9fc9cc9462659728d168387191387e903cc > -- > 2.38.1 >