[klibc] [klibc:master] fix build failure when CONFIG_KLIBC_ZLIB is not set
klibc-bot for Christophe Leroy
christophe.leroy at c-s.fr
Thu Jan 24 15:15:03 PST 2019
Commit-ID: 534a04d85defc627b031906d27cd9d09a913adc4
Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=534a04d85defc627b031906d27cd9d09a913adc4
Author: Christophe Leroy <christophe.leroy at c-s.fr>
AuthorDate: Wed, 23 Jan 2019 06:16:01 +0000
Committer: Ben Hutchings <ben at decadent.org.uk>
CommitDate: Thu, 24 Jan 2019 23:11:11 +0000
[klibc] fix build failure when CONFIG_KLIBC_ZLIB is not set
When CONFIG_KLIBC_ZLIB is not set, related functions
shall not be called otherwise build failure is encountered:
KLIBCLD usr/kinit/static/kinit
usr/kinit/ramdisk_load.o: In function `load_ramdisk_compressed':
/root/ldb_base/ofl/packages/klibc/usr/kinit/ramdisk_load.c:68: undefined reference to `inflateInit2_'
/root/ldb_base/ofl/packages/klibc/usr/kinit/ramdisk_load.c:116: undefined reference to `inflate'
/root/ldb_base/ofl/packages/klibc/usr/kinit/ramdisk_load.c:128: undefined reference to `inflateEnd'
/root/ldb_base/ofl/packages/klibc/usr/kinit/ramdisk_load.c:132: undefined reference to `inflateEnd'
make[2]: *** [usr/kinit/shared/kinit] Error 1
When CONFIG_KLIBC_ZLIB is not set, this patch redefines
load_ramdisk_compressed() as a simple function printing an error
message and returning -1
Signed-off-by: Christophe Leroy <christophe.leroy at c-s.fr>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/kinit/ramdisk_load.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/usr/kinit/ramdisk_load.c b/usr/kinit/ramdisk_load.c
index 2b3503a..f43339c 100644
--- a/usr/kinit/ramdisk_load.c
+++ b/usr/kinit/ramdisk_load.c
@@ -46,6 +46,7 @@ static int change_disk(const char *devpath, int rfd, int disk)
return open(devpath, O_RDONLY);
}
+#ifdef CONFIG_KLIBC_ZLIB
/* Also used in initrd.c */
int load_ramdisk_compressed(const char *devpath, FILE * wfd,
off_t ramdisk_start)
@@ -133,6 +134,14 @@ err2:
err1:
return -1;
}
+#else
+int load_ramdisk_compressed(const char *devpath, FILE * wfd,
+ off_t ramdisk_start)
+{
+ fprintf(stderr, "Compressed ramdisk not supported\n");
+ return -1;
+}
+#endif
static int
load_ramdisk_raw(const char *devpath, FILE * wfd, off_t ramdisk_start,
More information about the klibc
mailing list