Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp1445462rdb; Sat, 26 Aug 2023 02:56:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGdLgv3y6CIWF5Ef7DkxiWqsT30pFaWJYC0mxvj5EykGmWGa0CPBL5BvMt9RnOtTOcAVxEX X-Received: by 2002:a17:906:54:b0:9a2:26d8:f184 with SMTP id 20-20020a170906005400b009a226d8f184mr4261905ejg.51.1693043796892; Sat, 26 Aug 2023 02:56:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693043796; cv=none; d=google.com; s=arc-20160816; b=nSxMhlJjCn9m/aJAfRB1T/cm2CTl9lzZ+ooISBpE6q6lhFZX07ixZwjl4fBdBJCx8a j6O0jVmwfYSY8zdIP/OujbSrHBrz/eB2eEhxCyb45Fmq4oS0ng6CmSyaaJs9lJraM7lr lTeo1VepIDbfyzV54W60Qq+qFkKk0MeUGJagWy7Ivy/XFqAO60EhR6L9TxE8WHY/TKAk zhqHSKcpMDlv9MppWYjv0w5JxGKG07bQ9aNVHTB8/Qw1RfuXB3aErXfJVIWk+Ju/bwY/ 1+KsKdK0pKvxw0ais44C6mSPdtkwAp7b0okwIJFzaDEydUVyxkd6honW+CpGA6ATuvue M+/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=fAPDkBq9ZLJeSERDPlKfAMPrAPI22ELL/HOGn6Gz454=; fh=8og8I+gIJxSp6RdRw0lNq4GnahxazjTH0ihlEkyy2es=; b=BUox4beyuIZTIGPUNnifWhQmi/CbCNRMnMilgXDYSZpkQCg1MqYGR6FZpcZZmQWavv vXXvlSBhp+psuKtSHx2HjTJVo5Xq1j0iYVDM/8prUD8PiEU0voQyzMLY05pTqncHQClc WRgTYXHy58GpGTUnUzZJsk3asGtrfTBTbuy3+E4ujJGEJkvQPe/cZj0NA0E8zEcwmzI2 Xb/5h+zdqK9AZUTpjKkfX1oIABsPEF46b6yT3cFofbvjpatW027mN/WnDEXaexkGbsmr AK686GSLPIxPcXlFgZN1nnCMRUlRK4E1wCCafTLm+sZurrS6N1aBaxSzyZjyiNv6Fxfh S49A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m11-20020a170906234b00b00993860a6d3bsi1960305eja.518.2023.08.26.02.56.00; Sat, 26 Aug 2023 02:56:36 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231837AbjHZEbk (ORCPT + 99 others); Sat, 26 Aug 2023 00:31:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231835AbjHZEbK (ORCPT ); Sat, 26 Aug 2023 00:31:10 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C55326B8; Fri, 25 Aug 2023 21:31:02 -0700 (PDT) X-QQ-mid: bizesmtp69t1693024250t8x1szhz Received: from linux-lab-host.localdomain ( [116.30.128.222]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 26 Aug 2023 12:30:48 +0800 (CST) X-QQ-SSF: 01200000000000E0Y000000A0000000 X-QQ-FEAT: CR3LFp2JE4lYYSpivJlI2SuOuzPRWJJc0IWzbiEGnrcKe7FBJFh6wZ6s+PQ2F 37o20e7zvbK+67J0O+P7OT4mCfHmX3LySQKEgqzwX26Gr8zpzUHM3ZMUDgjRjHiDKGWpD3P RakL14KHqxla/2WvULqNpYU7G+If8ywK4/UZofvWrn9k1XNJmh4gwyt+Dsnjl8w1dCwHmRg tRRAgHzmHB24F0GBYVTHa6c/87WASvShOI+Yu+6CTgAFAsgwUb6TOlgfKwugUNFelUI4qmh xGo8vC+ioADDnRaCE8B8AndYhPD6Gs0ukpg6f3VSjUqV/5fdQzfLuTfTtBZPC+0/fH4pE4I 5dZGfDHZorEkgf/I41Y/HvOk68z58F8EfJZq5j7 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 558064754395152056 From: Zhangjin Wu To: w@1wt.eu Cc: falcon@tinylab.org, arnd@arndb.de, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux@weissschuh.net, thomas@t-8ch.de, Yuan Tan Subject: Re: [PATCH v2 3/3] selftests/nolibc: fix up O= option support Date: Sat, 26 Aug 2023 12:30:46 +0800 Message-Id: <20230826043046.53692-1-falcon@tinylab.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230806121721.30774-1-falcon@tinylab.org> References: <20230806121721.30774-1-falcon@tinylab.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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 Hi, Willy > > On Sat, Aug 05, 2023 at 02:13:11PM +0800, Zhangjin Wu wrote: > > > To avoid pollute the source code tree and avoid mrproper for every > > > architecture switch, the O= argument must be supported. > > > > > > Both IMAGE and .config are from the building directory, let's use > > > objtree instead of srctree for them. > > > > > > If no O= option specified, means building kernel in source code tree, > > > objtree should be srctree in such case. > > > > > > To support relative path, as suggested by Thomas, $(COMMAND_O) is used > > > to pass the O=$(ABSOLUTE_O) to the $(MAKE) commands. > > > > Zhangjin, I cannot get this one to work, regardless of what I try: > > > > $ make -j8 O=$PWD/output-i386 nolibc-test XARCH=i386 CROSS_COMPILE=/f/tc/nolibc/gcc-12.3.0-nolibc/i386-linux/bin/i386-linux- CC=/f/tc/nolibc/gcc-12.3.0-nolibc/i386-linux/bin/i386-linux-gcc > > (...) > > CC nolibc-test > > In file included from sysroot/i386/include/stdio.h:14, > > from nolibc-test.c:13: > > sysroot/i386/include/errno.h:10:10: fatal error: asm/errno.h: No such file or directory > > 10 | #include > > | ^~~~~~~~~~~~~ > > compilation terminated. > > > > Willy, I also just reproduced the issue, seems only i386 sysroot has no > asm/errno.h, will check why it is no rightly installed later. > > $ find sysroot/ -name "errno.h" > sysroot/arm/include/errno.h > sysroot/arm/include/asm-generic/errno.h > sysroot/arm/include/asm/errno.h > sysroot/arm/include/linux/errno.h > sysroot/riscv/include/errno.h > sysroot/riscv/include/asm-generic/errno.h > sysroot/riscv/include/asm/errno.h > sysroot/riscv/include/linux/errno.h > sysroot/s390/include/errno.h > sysroot/s390/include/asm-generic/errno.h > sysroot/s390/include/asm/errno.h > sysroot/s390/include/linux/errno.h > sysroot/arm64/include/errno.h > sysroot/arm64/include/asm-generic/errno.h > sysroot/arm64/include/asm/errno.h > sysroot/arm64/include/linux/errno.h > sysroot/mips/include/errno.h > sysroot/mips/include/asm-generic/errno.h > sysroot/mips/include/asm/errno.h > sysroot/mips/include/linux/errno.h > sysroot/x86_64/include/errno.h > sysroot/x86_64/include/asm-generic/errno.h > sysroot/x86_64/include/asm/errno.h > sysroot/x86_64/include/linux/errno.h > sysroot/i386/include/errno.h > sysroot/i386/include/asm-generic/errno.h > sysroot/i386/include/linux/errno.h > sysroot/powerpc/include/errno.h > sysroot/powerpc/include/asm-generic/errno.h > sysroot/powerpc/include/asm/errno.h > sysroot/powerpc/include/linux/errno.h > > > I'll leave it aside for now as I've spent way longer than I hoped on > > these series. I could take the previous two patches however. > > > > Ok, let's ignore this one, I will find why sysroot not install well for i386. > Thanks to Yuan, he have done some testing and have found the root cause, that is mrproper on top-level source code tree is required before installing sysroot, otherwise, the 'generated' headers will not be installed (removed by scripts/Makefile.asm-generic). After mrproper (not with O=out, must on top-level source code tree), the asm/errno.h will be there: ubuntu@linux-lab:/labs/linux-lab/src/linux-stable/tools/testing/selftests/nolibc$ find sysroot/ -name "errno.h" sysroot/i386/include/errno.h sysroot/i386/include/asm-generic/errno.h sysroot/i386/include/asm/errno.h --> here it is sysroot/i386/include/linux/errno.h sysroot/x86/include/errno.h sysroot/x86/include/asm-generic/errno.h sysroot/x86/include/asm/errno.h --> here it is sysroot/x86/include/linux/errno.h That also means, to use O=out for run-user, we also need to use O=out for defconfig (and kernel ...) too, otherwise, the top-level source code tree will be polluated. Seems a manual mrproper on top-level source code tree is always required for a new iteration, so, it may be ok to pick this patch with a note on the potential error. Best Regards, Zhangjin > Thanks, > Zhangjin > > > Thanks, > > Willy