Linux-EROFS Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: linux-erofs@lists.ozlabs.org
Cc: Gao Xiang <hsiangkao@linux.alibaba.com>,
	Daeho Jeong <daehojeong@google.com>
Subject: [PATCH 1/2] AOSP: erofs-utils: avoid lzma inclusion when liblzma is disabled
Date: Wed, 10 Nov 2021 14:49:31 +0800	[thread overview]
Message-ID: <20211110064931.181727-1-hsiangkao@linux.alibaba.com> (raw)

As Daeho reported [1], erofs-utils will fail to build with the
current AOSP Android.bp:

external/erofs-utils/lib/compressor_liblzma.c:8:10: fatal error:
'lzma.h' file not found
         ^~~~~~~~
1 error generated.
16:13:47 ninja failed with: exit status 1

compressor_liblzma.c won't be compiled if ENABLE_LIBLZMA is not
defined according to lib/Makefile.am. Thus it doesn't have an impact
on non-Android scenarios.

[1] https://lore.kernel.org/r/CACOAw_wt+DX0D+Ps-K=oF+MgUxtVKbXpamShoZR7n4WwM+wODw@mail.gmail.com
Reported-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 lib/compressor_liblzma.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/compressor_liblzma.c b/lib/compressor_liblzma.c
index e9bfcc556c54..40a05efb11dc 100644
--- a/lib/compressor_liblzma.c
+++ b/lib/compressor_liblzma.c
@@ -5,6 +5,8 @@
  * Copyright (C) 2021 Gao Xiang <xiang@kernel.org>
  */
 #include <stdlib.h>
+#include "config.h"
+#ifdef HAVE_LIBLZMA
 #include <lzma.h>
 #include "erofs/config.h"
 #include "erofs/print.h"
@@ -103,3 +105,4 @@ struct erofs_compressor erofs_compressor_lzma = {
 	.setlevel = erofs_compressor_liblzma_setlevel,
 	.compress_destsize = erofs_liblzma_compress_destsize,
 };
+#endif
-- 
2.24.4


             reply	other threads:[~2021-11-10  6:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10  6:49 Gao Xiang [this message]
2021-11-10  6:50 ` [PATCH 2/2] erofs-utils: fsck: use "--extract" instead of "-c" Gao Xiang
2021-11-10  9:51 ` [PATCH 1/2] AOSP: erofs-utils: avoid lzma inclusion when liblzma is disabled Yue Hu
2021-11-10 15:52   ` Daeho Jeong via Linux-erofs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211110064931.181727-1-hsiangkao@linux.alibaba.com \
    --to=hsiangkao@linux.alibaba.com \
    --cc=daehojeong@google.com \
    --cc=linux-erofs@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox