Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7293C433FE for ; Thu, 10 Dec 2020 11:44:41 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 58FAD23D5A for ; Thu, 10 Dec 2020 11:44:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58FAD23D5A Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.49127.86878 (Exim 4.92) (envelope-from ) id 1knKN6-0001VG-CF; Thu, 10 Dec 2020 11:44:32 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 49127.86878; Thu, 10 Dec 2020 11:44:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1knKN6-0001V9-8r; Thu, 10 Dec 2020 11:44:32 +0000 Received: by outflank-mailman (input) for mailman id 49127; Thu, 10 Dec 2020 11:44:31 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1knKN5-0001Uu-01 for xen-devel@lists.xenproject.org; Thu, 10 Dec 2020 11:44:31 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 1151a45e-295f-45b5-a6c1-8421fcc2c5ae; Thu, 10 Dec 2020 11:44:29 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id BA173AD5C; Thu, 10 Dec 2020 11:44:27 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 1151a45e-295f-45b5-a6c1-8421fcc2c5ae X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1607600669; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kGZ1v2zV5ELcG+fBrSPDafSIORbvLPX59cOeyhmcLHo=; b=F/SWGT1zGXxFxZwqDhu2D0nzaR+3ozKgQgmsgi5iW2vZ32xE53WK5fvEPDklugr8Vjz9d5 wenkjsDSbG9OwzxdfUFsuJozVeREbsTKjwd3NYa2BFTqupsbPz2Yc53feKf8vp8DhVfDR9 4ruP9BzmCpMB2vB4daK+c3G8RwLk/EU= Subject: Re: [PATCH v3 1/8] xen: fix build when $(obj-y) consists of just blanks To: Anthony PERARD Cc: "xen-devel@lists.xenproject.org" , Andrew Cooper , George Dunlap , Ian Jackson , Julien Grall , Wei Liu , Stefano Stabellini References: <1a6bac6a-7d83-f5b6-c5b9-8b3b39824d40@suse.com> <511be84d-9a13-17ae-f3d9-d6daf9c02711@suse.com> From: Jan Beulich Message-ID: <50fc5143-5b5e-46ae-56a3-6eba2707f293@suse.com> Date: Thu, 10 Dec 2020 11:21:53 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 09.12.2020 18:40, Anthony PERARD wrote: > On Mon, Nov 23, 2020 at 04:20:52PM +0100, Jan Beulich wrote: >> This case can occur when combining empty lists >> >> obj-y := >> ... >> obj-y += $(empty) >> >> or >> >> obj-y := $(empty) $(empty) >> >> where (only) blanks would accumulate. This was only a latent issue until >> now, but would become an active issue for Arm once lib/ gets populated >> with all respective objects going into the to be introduced lib.a. >> >> Also address a related issue at this occasion: When an empty built_in.o >> gets created, .built_in.o.d will have its dependencies recorded. If, on >> a subsequent incremental build, an actual constituent of built_in.o >> appeared, the $(filter-out ) would leave these recorded dependencies in >> place. But of course the linker won't know what to do with C header >> files. (The apparent alternative of avoiding to pass $(c_flags) or >> $(a_flags) would not be reliable afaict, as among these flags there may >> be some affecting information conveyed via the object file to the >> linker. The linker, finding inconsistent flags across object files, may > > How about using $(XEN_CFLAGS) instead of $(c_flags)? That should prevent > CC from generating the .*.o.d files while keeping the relevant flags. What does "relevant" cover? For an empty .o it may not be important right now, but I could see c_flags = -MMD -MP -MF $(@D)/.$(@F).d $(XEN_CFLAGS) '-D__OBJECT_FILE__="$@"' a_flags = -MMD -MP -MF $(@D)/.$(@F).d $(XEN_AFLAGS) include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk c_flags += $(CFLAGS-y) a_flags += $(CFLAGS-y) $(AFLAGS-y) leading to CFLAGS-y / AFLAGS-y which need to be consistent across _all_ object files (e.g. some recording of ABI used). > I > was planing to do that to avoid the issue, see: > https://lore.kernel.org/xen-devel/20200421161208.2429539-10-anthony.perard@citrix.com > >> then error out.) Using just $(obj-y) won't work either: It breaks when >> the same object file is listed more than once. > > Do we need to worry about having a object file been listed twice? > Wouldn't that be a mistake? No. The list approach (obj-$(CONFIG_xyz) += ...) easily allows for this to happen. See xen/arch/x86/mm/Makefile for an existing example. Jan