Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E3EE7C433EF for ; Thu, 17 Mar 2022 10:42:35 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 396AC837EC; Thu, 17 Mar 2022 11:42:33 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="NKhl9Weu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4D05983ADC; Thu, 17 Mar 2022 11:42:31 +0100 (CET) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C2E7C833F1 for ; Thu, 17 Mar 2022 11:42:27 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ptosi@google.com Received: by mail-wr1-x42e.google.com with SMTP id r10so6766854wrp.3 for ; Thu, 17 Mar 2022 03:42:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=NhHbasaLohR52F85R3lM/I0ZsqYbj0zU99xl7TDiPOI=; b=NKhl9Weu60XY6ATETmINw5UJ150r7PMTTYmed7KMQ4CIvoFybDsNLI/I9jyXLkdd92 kacPlMaMeRTCwJXSx4iMeSnFsHalLZhVO9rWuSSCT+xy4JFAEBZEEHbQAaAq61uOQK8K REF8zXvktbzrWLPIpjLmKY9HKFT88a8egfGoiQhpQoQGFfG7ntY5AibA5Xe5lSbjeDuG 7b0GvgcLMQqhmrQc3tIxNsrYyJug+UnjvzW+DhYmMtuOmlQ3PRYVbZSErdo1qlpc81To cgyne3z6h03ZA0UjUfwBa2Bdv6veO/RitK8AU7/3M7dWh1haMQdDjMG5pKoAy+YDUCoO O1WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=NhHbasaLohR52F85R3lM/I0ZsqYbj0zU99xl7TDiPOI=; b=SCsgqHaF7bkmho6YyVgal+Oy89I6IclqUsgnWR2ZPR9aRf+5BlFi+WHhsGW1PvvtzG AyN80n0/ex++9irPQSii5Lr6nfE1bRO5/0H31cAQJ3pRcYciURiPseDjmG+3xtYlpIES yRGtvpQxugIY4YYibZ5k8tqnXG2QLe0QaGsQJ8mMuJMfSA7KYyN1WaSOb/RDjYJgRfwY 7F6h0LploPqY/gZHldV28T/LnVcLYHoT6Z8ZxNmgDQk+URpMcLy44oo9n16U0bUIqa8z k/bSQCT40NwMDoicg6IIWGIBUd5BXDY4AP5pNiGcp9IbIryOTgN58KCNlDGoStwQ8jrZ geFA== X-Gm-Message-State: AOAM532OBZdg3D4Mljs6XPXygkNnDlJ3nqpH9ZuC5GG/UGmm2yUOAFCi kJarptdpMstusFP2vT6tOfAmXw== X-Google-Smtp-Source: ABdhPJxU94nSL7GBBszT8/qnKXh772pFfnzT9IZIFIyEybtQMybqim+9nNR2v72AHjfueCqjmSuv0A== X-Received: by 2002:adf:eec2:0:b0:203:f121:2994 with SMTP id a2-20020adfeec2000000b00203f1212994mr207713wrp.250.1647513747186; Thu, 17 Mar 2022 03:42:27 -0700 (PDT) Received: from google.com (203.75.199.104.bc.googleusercontent.com. [104.199.75.203]) by smtp.gmail.com with ESMTPSA id g10-20020adfe40a000000b00203eb3551f0sm1542027wrm.117.2022.03.17.03.42.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 03:42:26 -0700 (PDT) Date: Thu, 17 Mar 2022 10:42:22 +0000 From: =?utf-8?Q?Pierre-Cl=C3=A9ment?= Tosi To: Simon Glass Cc: U-Boot Mailing List Subject: Re: [PATCH 3/9] scripts: Makefile.lib: Pass __UBOOT__ to DTC's CPP Message-ID: <20220317104222.qqfwtq456qf34wyt@google.com> References: <20220316153948.197650-1-ptosi@google.com> <20220316153948.197650-3-ptosi@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean On Wed, Mar 16, 2022 at 01:23:43PM -0600, Simon Glass wrote: > Hi Pierre-Clément, > > On Wed, 16 Mar 2022 at 09:40, Pierre-Clément Tosi wrote: > > > > Some headers included (possibly indirectly) from .dts files might have > > U-Boot specific content relying on the __UBOOT__ macro passed to CPP > > when building C code. In that case, it would be sensible for DTC to see > > that content instead of the non-U-Boot one. To do so, pass the macro to > > the pre-processor when generate DTC inputs. > > Can you give an example of such a situation? This patch isn't fixing an existing issue. Instead, it preempts one that following patches, adding "#ifndef __UBOOT__/{code not supported in U-Boot}" in Linux headers, would bring. But IMO (and IIUC), it makes sense on its own given the meaning that CPP macro has in C code and how it's systematically set through KBUILD_CPPFLAGS. > > > > > Signed-off-by: Pierre-Clément Tosi > > Cc: Simon Glass > > --- > > scripts/Makefile.lib | 1 + > > 1 file changed, 1 insertion(+) > > Reviewed-by: Simon Glass > > > > > > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > > index c14da10de7..d7b548dce8 100644 > > --- a/scripts/Makefile.lib > > +++ b/scripts/Makefile.lib > > @@ -192,6 +192,7 @@ dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \ > > -I$(srctree)/arch/$(ARCH)/include \ > > -include $(srctree)/include/linux/kconfig.h \ > > -D__ASSEMBLY__ \ > > + -D__UBOOT__ \ > > -undef -D__DTS__ > > > > # Finds the multi-part object the current object will be linked into > > -- > > 2.35.1.723.g4982287a31-goog > > -- Pierre