From: Norbert Lange Date: Thu, 17 Jun 2021 09:14:54 +0000 (+0200) Subject: package/zstd: observe Buildroot optimisation flags X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8d56423d3d2308c620e61a952e36999c89e4d682;p=buildroot.git package/zstd: observe Buildroot optimisation flags Use Buildroot's setting for optimization, zstd's build system overrides CFLAGS (adds -O3), but MOREFLAGS can override again. Quick tests show that using -O2 (like buildroot) is actually a little faster than -O3 on x86_64 Atoms. Disable the legacy format, these are just needed for decompressing files created with pre-release version. Signed-off-by: Norbert Lange Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk index a0976b0701..5a96c11309 100644 --- a/package/zstd/zstd.mk +++ b/package/zstd/zstd.mk @@ -12,6 +12,7 @@ ZSTD_LICENSE_FILES = LICENSE COPYING ZSTD_CPE_ID_VENDOR = facebook ZSTD_CPE_ID_PRODUCT = zstandard +ZSTD_OPTS += ZSTD_LEGACY_SUPPORT=0 ifeq ($(BR2_PACKAGE_ZLIB),y) ZSTD_DEPENDENCIES += zlib ZSTD_OPTS += HAVE_ZLIB=1 @@ -33,6 +34,9 @@ else ZSTD_OPTS += HAVE_LZ4=0 endif +# zstd will append -O3 after $(CFLAGS), use MOREFLAGS to override again +ZSTD_OPTS += MOREFLAGS="$(TARGET_OPTIMIZATION)" + ifeq ($(BR2_STATIC_LIBS),y) ZSTD_BUILD_LIBS = libzstd.a ZSTD_INSTALL_LIBS = install-static