diff options
| author | Yann Gautier <yann.gautier@st.com> | 2026-06-24 20:06:10 +0200 |
|---|---|---|
| committer | Yann Gautier <yann.gautier@st.com> | 2026-09-07 13:41:30 +0200 |
| commit | dd82fce0866b0a0ebc5129b5f23ff39a7e2121a9 (patch) | |
| tree | e89d7db031e9ff709346d5840430322d43415870 | |
| parent | 77f2dfc38a9d26809c0656e726d2e7511a5de559 (diff) | |
| download | arm-trusted-firmware-dd82fce0866b0a0ebc5129b5f23ff39a7e2121a9.tar.gz arm-trusted-firmware-dd82fce0866b0a0ebc5129b5f23ff39a7e2121a9.zip | |
refactor(zlib): move zlib to a lib
This allows a dedicated build, and adding compilation flags.
The code size does not increase, it has been checked on ST platforms:
STM32MP13 and STM32MP25.
And the flags -DZ_SOLO -DDEF_WBITS=31 are now dedicated to zlib.
Change-Id: I38509b94c0dbcdf46d4b2fb8a4f7ff0e839bc482
Signed-off-by: Yann Gautier <yann.gautier@st.com>
| -rw-r--r-- | lib/zlib/zlib.mk | 8 | ||||
| -rw-r--r-- | plat/altera/soc/agilex3/platform.mk | 1 | ||||
| -rw-r--r-- | plat/hisilicon/hikey/platform.mk | 1 | ||||
| -rw-r--r-- | plat/hisilicon/hikey960/platform.mk | 1 | ||||
| -rw-r--r-- | plat/intel/soc/agilex/platform.mk | 1 | ||||
| -rw-r--r-- | plat/intel/soc/agilex5/platform.mk | 1 | ||||
| -rw-r--r-- | plat/intel/soc/stratix10/platform.mk | 1 | ||||
| -rw-r--r-- | plat/renesas/rcar/platform.mk | 3 | ||||
| -rw-r--r-- | plat/rockchip/rv1126b/platform.mk | 1 | ||||
| -rw-r--r-- | plat/socionext/uniphier/platform.mk | 3 | ||||
| -rw-r--r-- | plat/st/common/common.mk | 1 |
11 files changed, 6 insertions, 16 deletions
diff --git a/lib/zlib/zlib.mk b/lib/zlib/zlib.mk index a8937a776..9c0458fad 100644 --- a/lib/zlib/zlib.mk +++ b/lib/zlib/zlib.mk @@ -7,7 +7,7 @@ ZLIB_PATH := lib/zlib # Imported from zlib 1.2.11 (do not modify them) -ZLIB_SOURCES := $(addprefix $(ZLIB_PATH)/, \ +LIBZLIB_SRCS := $(addprefix $(ZLIB_PATH)/, \ adler32.c \ crc32.c \ inffast.c \ @@ -16,10 +16,10 @@ ZLIB_SOURCES := $(addprefix $(ZLIB_PATH)/, \ zutil.c) # Implemented for TF -ZLIB_SOURCES += $(addprefix $(ZLIB_PATH)/, \ +LIBZLIB_SRCS += $(addprefix $(ZLIB_PATH)/, \ tf_gunzip.c) INCLUDES += -Iinclude/lib/zlib -# REVISIT: the following flags need not be given globally -TF_CFLAGS += -DZ_SOLO -DDEF_WBITS=31 +LIBZLIB_CFLAGS := -DZ_SOLO -DDEF_WBITS=31 +$(eval $(call MAKE_LIB,zlib)) diff --git a/plat/altera/soc/agilex3/platform.mk b/plat/altera/soc/agilex3/platform.mk index a4b3c175e..2c977cee3 100644 --- a/plat/altera/soc/agilex3/platform.mk +++ b/plat/altera/soc/agilex3/platform.mk @@ -83,7 +83,6 @@ BL2_SOURCES += \ include lib/zlib/zlib.mk PLAT_INCLUDES += -Ilib/zlib -BL2_SOURCES += $(ZLIB_SOURCES) BL31_SOURCES += \ drivers/arm/cci/cci.c \ diff --git a/plat/hisilicon/hikey/platform.mk b/plat/hisilicon/hikey/platform.mk index 0b919e566..8d1ed2793 100644 --- a/plat/hisilicon/hikey/platform.mk +++ b/plat/hisilicon/hikey/platform.mk @@ -97,7 +97,6 @@ endif include lib/zlib/zlib.mk PLAT_INCLUDES += -Ilib/zlib -BL2_SOURCES += $(ZLIB_SOURCES) HIKEY_GIC_SOURCES := drivers/arm/gic/common/gic_common.c \ drivers/arm/gic/v2/gicv2_main.c \ diff --git a/plat/hisilicon/hikey960/platform.mk b/plat/hisilicon/hikey960/platform.mk index 286a01d55..dcdade389 100644 --- a/plat/hisilicon/hikey960/platform.mk +++ b/plat/hisilicon/hikey960/platform.mk @@ -97,7 +97,6 @@ endif include lib/zlib/zlib.mk PLAT_INCLUDES += -Ilib/zlib -BL2_SOURCES += $(ZLIB_SOURCES) BL31_SOURCES += drivers/arm/cci/cci.c \ drivers/arm/pl061/pl061_gpio.c \ diff --git a/plat/intel/soc/agilex/platform.mk b/plat/intel/soc/agilex/platform.mk index ff3f382cb..136be4a82 100644 --- a/plat/intel/soc/agilex/platform.mk +++ b/plat/intel/soc/agilex/platform.mk @@ -65,7 +65,6 @@ BL2_SOURCES += \ include lib/zlib/zlib.mk PLAT_INCLUDES += -Ilib/zlib -BL2_SOURCES += $(ZLIB_SOURCES) BL31_SOURCES += \ drivers/arm/cci/cci.c \ diff --git a/plat/intel/soc/agilex5/platform.mk b/plat/intel/soc/agilex5/platform.mk index 3a3f2167f..94d68ea09 100644 --- a/plat/intel/soc/agilex5/platform.mk +++ b/plat/intel/soc/agilex5/platform.mk @@ -83,7 +83,6 @@ BL2_SOURCES += \ include lib/zlib/zlib.mk PLAT_INCLUDES += -Ilib/zlib -BL2_SOURCES += $(ZLIB_SOURCES) BL31_SOURCES += \ drivers/arm/cci/cci.c \ diff --git a/plat/intel/soc/stratix10/platform.mk b/plat/intel/soc/stratix10/platform.mk index 6f459b1fb..d1bf35e98 100644 --- a/plat/intel/soc/stratix10/platform.mk +++ b/plat/intel/soc/stratix10/platform.mk @@ -61,7 +61,6 @@ BL2_SOURCES += \ include lib/zlib/zlib.mk PLAT_INCLUDES += -Ilib/zlib -BL2_SOURCES += $(ZLIB_SOURCES) BL31_SOURCES += \ drivers/arm/cci/cci.c \ diff --git a/plat/renesas/rcar/platform.mk b/plat/renesas/rcar/platform.mk index cbee73b3d..f068ea54d 100644 --- a/plat/renesas/rcar/platform.mk +++ b/plat/renesas/rcar/platform.mk @@ -366,8 +366,7 @@ BL2_SOURCES += plat/renesas/rcar/bl2_plat_setup.c \ ifeq (${RCAR_GEN3_BL33_GZIP},1) include lib/zlib/zlib.mk -BL2_SOURCES += common/image_decompress.c \ - $(ZLIB_SOURCES) +BL2_SOURCES += common/image_decompress.c endif ifneq (${ENABLE_STACK_PROTECTOR},0) diff --git a/plat/rockchip/rv1126b/platform.mk b/plat/rockchip/rv1126b/platform.mk index 46bb5e6b2..41efa2422 100644 --- a/plat/rockchip/rv1126b/platform.mk +++ b/plat/rockchip/rv1126b/platform.mk @@ -70,7 +70,6 @@ BL31_SOURCES += ${RK_GIC_SOURCES} \ drivers/scmi-msg/smt.c \ lib/cpus/aarch64/cortex_a53.S \ $(LIBFDT_SRCS) \ - $(ZLIB_SOURCES) \ ${RK_PLAT_COMMON}/aarch64/plat_helpers.S \ ${RK_PLAT_COMMON}/aarch64/platform_common.c \ ${RK_PLAT_COMMON}/bl31_plat_setup.c \ diff --git a/plat/socionext/uniphier/platform.mk b/plat/socionext/uniphier/platform.mk index 4c12f725d..bac768542 100644 --- a/plat/socionext/uniphier/platform.mk +++ b/plat/socionext/uniphier/platform.mk @@ -121,8 +121,7 @@ ifeq (${FIP_GZIP},1) include lib/zlib/zlib.mk -BL2_SOURCES += common/image_decompress.c \ - $(ZLIB_SOURCES) +BL2_SOURCES += common/image_decompress.c $(eval $(call add_define,UNIPHIER_DECOMPRESS_GZIP)) diff --git a/plat/st/common/common.mk b/plat/st/common/common.mk index 454f35b10..7d6333364 100644 --- a/plat/st/common/common.mk +++ b/plat/st/common/common.mk @@ -198,7 +198,6 @@ PLAT_BL_COMMON_SOURCES += drivers/clk/clk.c \ plat/st/common/stm32mp_dt.c BL2_SOURCES += ${FCONF_SOURCES} ${FCONF_DYN_SOURCES} -BL2_SOURCES += $(ZLIB_SOURCES) BL2_SOURCES += drivers/io/io_fip.c \ plat/st/common/bl2_io_storage.c \ |
