diff mbox series

[1/1] test: linking test/compression.c fails

Message ID 20201031075925.6877-1-xypron.glpk@gmx.de
State Accepted
Commit de429d7b0962a91f91bbe921600745fb4608ece0
Delegated to: Simon Glass
Headers show
Series [1/1] test: linking test/compression.c fails | expand

Commit Message

Heinrich Schuchardt Oct. 31, 2020, 7:59 a.m. UTC
Building U-Boot with unit tests on a non-sandbox systems fails:

ld.bfd: test/built-in.o: in function `compress_using_gzip':
test/compression.c:138: undefined reference to `gzip'
ld.bfd: test/built-in.o: in function `uncompress_using_bzip2':
test/compression.c:187: undefined reference to `BZ2_bzBuffToBuffDecompress'
ld.bfd: test/built-in.o: in function `uncompress_using_lzma':
test/compression.c:222: undefined reference to `lzmaBuffToBuffDecompress'
ld.bfd: test/built-in.o: in function `uncompress_using_lzo':
test/compression.c:257: undefined reference to `lzop_decompress'
ld.bfd: test/built-in.o: in function `uncompress_using_lz4':
test/compression.c:292: undefined reference to `ulz4fn

Add the missing dependencies.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 test/Kconfig  | 9 +++++++++
 test/Makefile | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

--
2.20.1

Comments

Simon Glass Nov. 3, 2020, 3:12 p.m. UTC | #1
On Sat, 31 Oct 2020 at 01:59, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> Building U-Boot with unit tests on a non-sandbox systems fails:
>
> ld.bfd: test/built-in.o: in function `compress_using_gzip':
> test/compression.c:138: undefined reference to `gzip'
> ld.bfd: test/built-in.o: in function `uncompress_using_bzip2':
> test/compression.c:187: undefined reference to `BZ2_bzBuffToBuffDecompress'
> ld.bfd: test/built-in.o: in function `uncompress_using_lzma':
> test/compression.c:222: undefined reference to `lzmaBuffToBuffDecompress'
> ld.bfd: test/built-in.o: in function `uncompress_using_lzo':
> test/compression.c:257: undefined reference to `lzop_decompress'
> ld.bfd: test/built-in.o: in function `uncompress_using_lz4':
> test/compression.c:292: undefined reference to `ulz4fn
>
> Add the missing dependencies.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  test/Kconfig  | 9 +++++++++
>  test/Makefile | 2 +-
>  2 files changed, 10 insertions(+), 1 deletion(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>
Simon Glass Nov. 3, 2020, 11:02 p.m. UTC | #2
On Sat, 31 Oct 2020 at 01:59, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> Building U-Boot with unit tests on a non-sandbox systems fails:
>
> ld.bfd: test/built-in.o: in function `compress_using_gzip':
> test/compression.c:138: undefined reference to `gzip'
> ld.bfd: test/built-in.o: in function `uncompress_using_bzip2':
> test/compression.c:187: undefined reference to `BZ2_bzBuffToBuffDecompress'
> ld.bfd: test/built-in.o: in function `uncompress_using_lzma':
> test/compression.c:222: undefined reference to `lzmaBuffToBuffDecompress'
> ld.bfd: test/built-in.o: in function `uncompress_using_lzo':
> test/compression.c:257: undefined reference to `lzop_decompress'
> ld.bfd: test/built-in.o: in function `uncompress_using_lz4':
> test/compression.c:292: undefined reference to `ulz4fn
>
> Add the missing dependencies.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  test/Kconfig  | 9 +++++++++
>  test/Makefile | 2 +-
>  2 files changed, 10 insertions(+), 1 deletion(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/test/Kconfig b/test/Kconfig
index 2646e7d825..ab3ac54a1b 100644
--- a/test/Kconfig
+++ b/test/Kconfig
@@ -50,6 +50,15 @@  config UT_LIB_RSA

 endif

+config UT_COMPRESSION
+	bool "Unit test for compression"
+	depends on UNIT_TEST
+	depends on CMDLINE && GZIP_COMPRESSED && BZIP2 && LZMA && LZO && LZ4
+	default y
+	help
+	  Enables tests for compression and decompression routines for simple
+	  sanity and for buffer overflow conditions.
+
 config UT_LOG
 	bool "Unit tests for logging functions"
 	depends on UNIT_TEST
diff --git a/test/Makefile b/test/Makefile
index 39ae04a3d2..8296734eb3 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -8,7 +8,7 @@  endif
 obj-$(CONFIG_$(SPL_)CMDLINE) += cmd/
 obj-$(CONFIG_$(SPL_)CMDLINE) += cmd_ut.o
 obj-$(CONFIG_$(SPL_)CMDLINE) += command_ut.o
-obj-$(CONFIG_$(SPL_)CMDLINE) += compression.o
+obj-$(CONFIG_$(SPL_)UT_COMPRESSION) += compression.o
 obj-y += dm/
 obj-$(CONFIG_$(SPL_)CMDLINE) += print_ut.o
 obj-$(CONFIG_$(SPL_)CMDLINE) += str_ut.o