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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D6BD3E95A67 for ; Sat, 7 Oct 2023 23:57:45 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4S32Kh1R8nz3c1B for ; Sun, 8 Oct 2023 10:57:44 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.124; helo=out30-124.freemail.mail.aliyun.com; envelope-from=hsiangkao@linux.alibaba.com; receiver=lists.ozlabs.org) Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4S32KW1rnKz2yjD for ; Sun, 8 Oct 2023 10:57:33 +1100 (AEDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R881e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0Vtc4zLx_1696723037; Received: from 192.168.3.4(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0Vtc4zLx_1696723037) by smtp.aliyun-inc.com; Sun, 08 Oct 2023 07:57:19 +0800 Message-ID: <73c11706-a682-f594-8be2-dd4091fb4aa8@linux.alibaba.com> Date: Sun, 8 Oct 2023 07:57:17 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH v1] erofs-utils: Fix cross compile with autoconf To: Sandeep Dhavale References: <20231005224008.817830-1-dhavale@google.com> <531b8a1b-efbb-8fcb-a0f8-018c8650611f@linux.alibaba.com> <9ef1b3c3-9d3c-5639-1859-6d419b2a9594@linux.alibaba.com> From: Gao Xiang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-team@android.com, linux-erofs@lists.ozlabs.org Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" Hi Sandeep, On 2023/10/7 22:51, Sandeep Dhavale wrote: > On Sat, Oct 7, 2023 at 1:25 AM Gao Xiang wrote: ... >> > Hi Gao, > That cannot work because AS_RUN_IFELSE() is only invoked if > MAX_BLOCK_SIZE is not set. > > # Detect maximum block size if necessary > AS_IF([test "x$MAX_BLOCK_SIZE" = "x"], [ > AC_CACHE_CHECK([sysconf (_SC_PAGESIZE)], [erofs_cv_max_block_size], > AC_RUN_IFELSE([AC_LANG_PROGRAM( > [[ > #include > #include > ... > > Cross compilation works if MAX_BLOCK_SIZE is set today as is without > any fix. Cross compilation only fails when MAX_BLOCK_SIZE is not set > AND the configure script tries to detect because there is no action > defined regarding what should be erofs_cv_max_block_size. Yes, I know MAX_BLOCK_SIZE is not set here. My only concern is that hardcoded 4096 is involved many times. I've applied this original version. But I think we might need to clean up multiple 4096 later... Thanks, Gao Xiang > > Thanks, > Sandeep.