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 C773FC7EE25 for ; Fri, 9 Jun 2023 08:06:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D368C86113; Fri, 9 Jun 2023 10:06:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.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=collabora.com header.i=@collabora.com header.b="YTWIk8K6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7799C847C3; Fri, 9 Jun 2023 10:06:37 +0200 (CEST) Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2EC5C847C3 for ; Fri, 9 Jun 2023 10:06:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=eugen.hristev@collabora.com Received: from [192.168.18.121] (unknown [46.8.172.200]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ehristev) by madras.collabora.co.uk (Postfix) with ESMTPSA id 7C7576606F1F; Fri, 9 Jun 2023 09:06:34 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1686297994; bh=qULXH+l1pAM2jdF0GyTLAOkoDewXUEVCZHqBpTeybOQ=; h=Date:Subject:To:References:From:In-Reply-To:From; b=YTWIk8K64w5fX4NvGiXQC521XI/ecrpwMtz9HG8UcOWEkS97/rzbqVKr00ebN25N1 pqfYsyh9y25aY1iX7DMBuNoTfYzBuc85owYnMcNx5GdxElFuDFemv4SAfOmkk/A/Lv ZSail5xyqXdr5eomeSDWdSOE5Tv8UatkPa0sC0BFCsJQVHEQoKIAfryYjKPQMVFb0+ n8WaCf7meDQwqjNydx8gBat4zLoeRci+meBiYimTEP6qNp1ZgqCtouOEsre3BaDpD9 drXJHxgmm6lOB2bMuzpmga53K27LaP9OktOgIj1t1QmTlqplnSszmXUNsYNxFFzP8i BnkgWT+C4PYpg== Message-ID: <68aef737-149a-b100-2fbe-3814eedd2211@collabora.com> Date: Fri, 9 Jun 2023 11:06:31 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] spl: spl_fit: add weak prototype for fpga_load Content-Language: en-US To: u-boot@lists.denx.de, sjg@chromium.org, Michal Simek References: <20230227102707.39409-1-eugen.hristev@collabora.com> From: Eugen Hristev In-Reply-To: <20230227102707.39409-1-eugen.hristev@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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.8 at phobos.denx.de X-Virus-Status: Clean On 2/27/23 12:27, Eugen Hristev wrote: > In case OPTIMIZE_DEBUG is set, unused code will not be optimized out, hence > the reference to fpga_load will be compiled. > if DM_FPGA and SPL_FPGA are not set, the build will fail with : > > aarch64-none-linux-gnu-ld.bfd: common/spl/spl_fit.o: in function `spl_fit_upload_fpga': > u-boot/common/spl/spl_fit.c:595: undefined reference to `fpga_load' > > By adding a weak prototype, build is successful. > > Signed-off-by: Eugen Hristev > --- > common/spl/spl_fit.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c > index c51482b3b659..ca2e337b1ec4 100644 > --- a/common/spl/spl_fit.c > +++ b/common/spl/spl_fit.c > @@ -570,6 +570,12 @@ static void warn_deprecated(const char *msg) > printf("\tSee doc/uImage.FIT/source_file_format.txt\n"); > } > > +__weak int fpga_load(int devnum, const void *buf, size_t bsize, > + bitstream_type bstype, int flags) > +{ > + return 0; > +} > + > static int spl_fit_upload_fpga(struct spl_fit_info *ctx, int node, > struct spl_image_info *fpga_image) > { Gentle ping