From patchwork Tue Jun 15 10:35:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Norbert Lange X-Patchwork-Id: 1492120 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=heBZXEyv; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G44VJ3B8Lz9sW4 for ; Tue, 15 Jun 2021 20:36:07 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 988E383ACA; Tue, 15 Jun 2021 10:36:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oQ2FoqeA40TY; Tue, 15 Jun 2021 10:36:04 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id DF4C283A90; Tue, 15 Jun 2021 10:36:03 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id B46201BF296 for ; Tue, 15 Jun 2021 10:36:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id A37FB402AE for ; Tue, 15 Jun 2021 10:36:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp2.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Joxia10JPAW5 for ; Tue, 15 Jun 2021 10:36:02 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by smtp2.osuosl.org (Postfix) with ESMTPS id DE53740025 for ; Tue, 15 Jun 2021 10:36:01 +0000 (UTC) Received: by mail-wr1-x429.google.com with SMTP id c9so17739581wrt.5 for ; Tue, 15 Jun 2021 03:36:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ukRJNNC5Rs9QXpZAJEPjFjYoxaRKUxp6tDpU9SdQsgA=; b=heBZXEyvfAIxrzGuUefYLBZuxhDTGTmpSBrAFxw2M49y5uy+K6AcL5sEsRAk6CykxT 6OcjaQqbiRkP+7iT6HihNSrSPQLzuhqkiTUXKswEZgHGXQMlb/M0iL4nZPMbZrGTPNin bVlUaNjorCy26VRyDCZ4Fitaxv48ndtTp5r0p5Hlx9aM53Js7Q67GQvvc0uCtN9yTv/O tM8A4l8mqiI914ZcM7TCimBqxqwz0K38/aZPz/SExhTnqJhyvFQ5BoI1v4PcgK4jehtI 7LBWVlsfrGUhq0wJXxby2acla+1EiO2+4eD6CIVk4NUviWNe9VEusNZWwnWblDcUgRBy P6AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ukRJNNC5Rs9QXpZAJEPjFjYoxaRKUxp6tDpU9SdQsgA=; b=t7NoPcvu2/b+bXIhAvDFjsY2zC3d4TatlZaKvGKkydknTLtPcaU6X2gky1CdfC6tvD EwsHsxg1xoGjdzh242DM541yTcAFs83p3gRFN+nyr1TkapucPo14iGBu3FCy3kWRE759 MpmtUQyi5oHK0vDMoLttu3I6TsHphuz9mvE62DHrLIhBrNPiS5MH1ZfBezPj19AFTRbE CDjhtIGah+q5a/+F+814W86aOSfIS8uz50NN3+ikTZLc6tsFRRm5I4rYV7MkRQIkMQoF kvG4Walz7T3Wly5jGSNZcaX/P9YzJPc5skcDbfCjLnCqXYhvaD8a5xjy810JvpeTVDNa ud6g== X-Gm-Message-State: AOAM532heIWmFAQE4/F8bJ/EEiFf5+rSducE5foycGYfvj/sl2k/1HMi k6KYvcF1sZE6B5uWHag/gfPnpb2VWgs= X-Google-Smtp-Source: ABdhPJy3qhKVACj9Uu8Vk1tl8ihKwDysifUCaJ14AS+K6H1HUJlN3+KetlBUGwcejy4rUYOgB+8Bmg== X-Received: by 2002:a5d:5983:: with SMTP id n3mr24321726wri.241.1623753360124; Tue, 15 Jun 2021 03:36:00 -0700 (PDT) Received: from debian-noppl.. (84-114-45-16.cable.dynamic.surfer.at. [84.114.45.16]) by smtp.gmail.com with ESMTPSA id q11sm18132945wrx.80.2021.06.15.03.35.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 03:35:59 -0700 (PDT) From: Norbert Lange To: buildroot@buildroot.org Date: Tue, 15 Jun 2021 12:35:46 +0200 Message-Id: <20210615103549.271478-1-nolange79@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 1/3] package/zstd: rework build and install X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: patrickdepinguin@gmail.com, Andrey Smirnov , Norbert Lange Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 1.5.0 uses Threads by default for cli tool and DSO, the build now does the same unless: If only static libraries are build, then build that library like the DSO is normally built. This should ensure that programs requsting the DSO will always get the multithreaded version. Signed-off-by: Norbert Lange --- v2->v3: * use normal = for assignment v1->v2: * rebased against upstream/master Signed-off-by: Norbert Lange --- package/zstd/zstd.mk | 52 ++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk index 2a876376a2..95f25ebfa4 100644 --- a/package/zstd/zstd.mk +++ b/package/zstd/zstd.mk @@ -12,6 +12,8 @@ ZSTD_LICENSE_FILES = LICENSE COPYING ZSTD_CPE_ID_VENDOR = facebook ZSTD_CPE_ID_PRODUCT = zstandard +ZSTD_OPTS += PREFIX=/usr + ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y) ZSTD_OPTS += HAVE_THREAD=1 else @@ -39,43 +41,55 @@ else ZSTD_OPTS += HAVE_LZ4=0 endif -ifeq ($(BR2_STATIC_LIBS),y) -ZSTD_BUILD_LIBS = libzstd.a -ZSTD_INSTALL_LIBS = install-static -else ifeq ($(BR2_SHARED_LIBS),y) -ZSTD_BUILD_LIBS = libzstd -ZSTD_INSTALL_LIBS = install-shared +ZSTD_BUILD_PROG_TARGET = zstd-release + +# Since v1.5.0 the dynamic library is built for +# multithreading, while the static library is not. +# +# Keep those defaults, unless Buildroot is not +# providing the dynamic library and the +# static library will be automatically used instead. +ifeq ($(BR2_STATIC_LIBS)$(BR2_SHARED_STATIC_LIBS),y) +ZSTD_INSTALL_LIBS += install-static +ifeq ($(BR2_STATIC_LIBS)$(BR2_TOOLCHAIN_HAS_THREADS),yy) +# Use the static lib as replacement for the mt dynlib +ZSTD_BUILD_LIBS += libzstd.a-mt else -ZSTD_BUILD_LIBS = libzstd.a libzstd -ZSTD_INSTALL_LIBS = install-static install-shared +ZSTD_BUILD_LIBS += libzstd.a-nomt +endif endif -# The HAVE_THREAD flag is read by the 'programs' makefile but not by the 'lib' -# one. Building a multi-threaded binary with a library (which defaults to -# single-threaded) gives a runtime error when compressing files. -# The 'lib' makefile provides specific '%-mt' targets for this purpose. +ifeq ($(BR2_SHARED_LIBS)$(BR2_SHARED_STATIC_LIBS),y) +ZSTD_INSTALL_LIBS += install-shared ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y) -ZSTD_BUILD_LIBS := $(addsuffix -mt,$(ZSTD_BUILD_LIBS)) +ZSTD_BUILD_LIBS += libzstd-mt +else +ZSTD_BUILD_LIBS += libzstd-nomt +endif endif define ZSTD_BUILD_CMDS $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \ - -C $(@D)/lib $(ZSTD_BUILD_LIBS) + -C $(@D)/lib $(addsuffix -release,$(ZSTD_BUILD_LIBS) libzstd.pc) $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \ - -C $(@D) zstd + -C $(@D)/programs $(ZSTD_BUILD_PROG_TARGET) endef define ZSTD_INSTALL_STAGING_CMDS + [ -e $(@D)/programs/zstd ] && [ -e $(@D)/lib/libzstd.pc ] + $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \ + -C $(@D)/lib DESTDIR=$(STAGING_DIR) $(ZSTD_INSTALL_LIBS) \ + install-pc install-includes $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \ - DESTDIR=$(STAGING_DIR) PREFIX=/usr -C $(@D)/lib \ - install-pc install-includes $(ZSTD_INSTALL_LIBS) + -C $(@D)/programs DESTDIR=$(STAGING_DIR) install endef define ZSTD_INSTALL_TARGET_CMDS + [ -e $(@D)/programs/zstd ] $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \ - DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/programs install + -C $(@D)/lib DESTDIR=$(TARGET_DIR) $(ZSTD_INSTALL_LIBS) $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \ - DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/lib $(ZSTD_INSTALL_LIBS) + -C $(@D)/programs DESTDIR=$(TARGET_DIR) install endef HOST_ZSTD_OPTS += PREFIX=$(HOST_DIR) From patchwork Tue Jun 15 10:35:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Norbert Lange X-Patchwork-Id: 1492121 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=JxVdgnaO; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G44Vh2l5Xz9sW4 for ; Tue, 15 Jun 2021 20:36:28 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 961D283B7B; Tue, 15 Jun 2021 10:36:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xLzxHX626xf8; Tue, 15 Jun 2021 10:36:25 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id F259583B72; Tue, 15 Jun 2021 10:36:24 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 47F2D1BF296 for ; Tue, 15 Jun 2021 10:36:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 36FC583ACA for ; Tue, 15 Jun 2021 10:36:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 136OXpmwo40a for ; Tue, 15 Jun 2021 10:36:03 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by smtp1.osuosl.org (Postfix) with ESMTPS id 6ECC38338B for ; Tue, 15 Jun 2021 10:36:03 +0000 (UTC) Received: by mail-wr1-x42c.google.com with SMTP id z8so17753892wrp.12 for ; Tue, 15 Jun 2021 03:36:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iP229RPO7fVbCU7pR1oNYTbx8smpbm/6M0EfGVqDUo0=; b=JxVdgnaOnPvl+CN5Z53qMow0lAOrd6VWZx4oEZ5UZFel07oOKOdHqpuWfbnKMpUBL0 C0f4bquKIOhbZh0qOU+Qq51dLsuLPrVbS0mNGIXqwVUqf6oFjtv4JCYv84mCkIxhjoeU tn3DRuV5j45qcQA+WDYPZqkPkLglo1UdSmqW5HUZ4vMgQRhy4ctRJZAHofAs7wTiWdsp TnP15Nlwb7lJMkX/p7MEbJjw3OmnjEQHWq/qLNvOax4kGiRx93DutsDNQY0EV5QQy0nz 6qs74UqtEPqFfkBdFHiqEYAT0bzBH4Z5lzbiffeF31HimYyBguhtIhQvw/bD+971DqPE 2uUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iP229RPO7fVbCU7pR1oNYTbx8smpbm/6M0EfGVqDUo0=; b=S5sb5MIwbhCaO/qPxdomiXWKzTC9nkdfoU/nkXSUuSXVU9ALVlveMlF/rzpUW+ziUq 8wFuW7HYqJ9IMt6ZbLNJmr7NOevxCGPlKccdMkaD+zpngmJTTlULA6MLV4ZHd8CX14kY g7lYeu1jwCw+0emJWnPZfByxCMQ3fx5Bq8OlrVXRs4ENPZgtc1MMOXDbxKAQdjT6rIBK yh7qVFMqXjjnpTR8eVCZJCxUQehJvt6B5ZV9Bcd+uKhm+iLYslNxAyroF/05ux+AXq17 raqC5yEYYm7L8l/hPFHuxdQzjQw6jPz4U2Kf3fnlPWoOFk7YNXafOG68nR3Snfis8DQv yrfQ== X-Gm-Message-State: AOAM5300E7oa9IiyxqBfGhzNqmSTeNZ5mYIexs3uBhSCSVXZI4neMH7I +fUPn5PRKzjr7VTalbu0q/0A8ylVCOg= X-Google-Smtp-Source: ABdhPJzFTjf1vv2KcoVQ90zRt4CZ2AU0KuIVkOsQgiYThy7USQ8WGFmxgU9E+1NwqFbRQfgAHXJfmQ== X-Received: by 2002:adf:a191:: with SMTP id u17mr24368434wru.150.1623753361567; Tue, 15 Jun 2021 03:36:01 -0700 (PDT) Received: from debian-noppl.. (84-114-45-16.cable.dynamic.surfer.at. [84.114.45.16]) by smtp.gmail.com with ESMTPSA id q11sm18132945wrx.80.2021.06.15.03.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 03:36:01 -0700 (PDT) From: Norbert Lange To: buildroot@buildroot.org Date: Tue, 15 Jun 2021 12:35:47 +0200 Message-Id: <20210615103549.271478-2-nolange79@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210615103549.271478-1-nolange79@gmail.com> References: <20210615103549.271478-1-nolange79@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 2/3] package/zstd: Change Build options X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: patrickdepinguin@gmail.com, Andrey Smirnov , Norbert Lange Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Disable the legacy format, these are just needed for decompressing files created with pre-release version. Use Buildroot's setting for optimization, zstd's build system overrides CFLAGS, but MOREFLAGS can override again. Quick tests show that using -O2 (like buildroot) is actually a little faster than -O3 on x86_64 Atoms. Signed-off-by: Norbert Lange --- v2->v3: * Remove ZSTD_OPTS_MOREFLAGS variable --- package/zstd/zstd.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk index 95f25ebfa4..54ce4133fe 100644 --- a/package/zstd/zstd.mk +++ b/package/zstd/zstd.mk @@ -13,6 +13,7 @@ ZSTD_CPE_ID_VENDOR = facebook ZSTD_CPE_ID_PRODUCT = zstandard ZSTD_OPTS += PREFIX=/usr +ZSTD_OPTS += ZSTD_LEGACY_SUPPORT=0 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y) ZSTD_OPTS += HAVE_THREAD=1 @@ -41,6 +42,9 @@ else ZSTD_OPTS += HAVE_LZ4=0 endif +# zstd will append -O3 after $(CFLAGS), use MOREFLAGS to override again +ZSTD_OPTS += MOREFLAGS="$(TARGET_OPTIMIZATION)" + ZSTD_BUILD_PROG_TARGET = zstd-release # Since v1.5.0 the dynamic library is built for From patchwork Tue Jun 15 10:35:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Norbert Lange X-Patchwork-Id: 1492122 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=cOsnAxgx; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G44W140Yzz9sW4 for ; Tue, 15 Jun 2021 20:36:45 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 2EEFC83BA8; Tue, 15 Jun 2021 10:36:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sqY2OunjPePt; Tue, 15 Jun 2021 10:36:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 92A3F83BA7; Tue, 15 Jun 2021 10:36:37 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 4D0671BF296 for ; Tue, 15 Jun 2021 10:36:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 49752608EF for ; Tue, 15 Jun 2021 10:36:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V_9h3aP8ow-b for ; Tue, 15 Jun 2021 10:36:04 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by smtp3.osuosl.org (Postfix) with ESMTPS id A66CA6082A for ; Tue, 15 Jun 2021 10:36:04 +0000 (UTC) Received: by mail-wr1-x436.google.com with SMTP id a20so17789562wrc.0 for ; Tue, 15 Jun 2021 03:36:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rlixKkVUQ1TUdbBxZkbHD8JtHTwr//HLM6sEEqM+1Zs=; b=cOsnAxgx3xChZPD3mQfR8rGfkfu5JOLA7ZetnYwpqhIfcMYtv61TyXMvObUUsstew+ Vn1us13GeQAjVkDzwjr0IFLQp45iPO7vRFq4tQwgiOKN724+FmdfMyZbs/Pw8E4iKEYN gl3xJljRrN3cL3ZZ9rx36nzYxntmVvkj48okbIKXfAbYmcAD86T67rts4mLPPoqInqdS 5kixOANC9pbN6CNLyLY92nBpIGjZc4yhE7SFpfc1FgVxVlaPSwNTITrtj99sFu+2WcRJ 2GB6Mg9mUqy0HYlmoCaktiwJT8pE8HWuwJnapr1kF+EO16P3GR73jbN1a8FbfEHFkBnu SFCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rlixKkVUQ1TUdbBxZkbHD8JtHTwr//HLM6sEEqM+1Zs=; b=a91AT6teNaU0MIeq4hSWDALsy46pFBz5YDZSzYVFlNj8Urqv7eyR/jPwzqfRAclr1Q v1YzU6KW/bQWUaTc0wo+It8MQeXSTweGAshXZQl6twGs7jelUptRTZSPx8liD+iWRcms 9S2gyGKlcJ92YRoPcVlagQ2FHqMWYlxULIVp0f9O+9uBHDkdhCXvFQpyT/3urMyEOzE6 ZJVvcMGswEnyt+sxONHYnmko75N0Mwpt83NVBCE3+aBjTs4tF+TC6niebttzJpaW6t9H YtzBD2EkG/6FHuQKo6weUzVk4eDFNj9pHE5J7Swun7It5Sh0+UJswCWWrim4N5F3LBoL KoFw== X-Gm-Message-State: AOAM533XHB/KFVvUKv5kZNVaRNyrQLkEuGXImYQ7w9ZGQdxpFFA9p74z smfDESh9fgTXoBc9shlXY9XmkIkafr8= X-Google-Smtp-Source: ABdhPJyAGrQkDBk1EJN/top9VL8mEgoLXC43eFedRRJL/dPanMZNGNxdGVa6glloZM8IsTVY001u6A== X-Received: by 2002:a05:6000:1049:: with SMTP id c9mr23933294wrx.416.1623753362900; Tue, 15 Jun 2021 03:36:02 -0700 (PDT) Received: from debian-noppl.. (84-114-45-16.cable.dynamic.surfer.at. [84.114.45.16]) by smtp.gmail.com with ESMTPSA id q11sm18132945wrx.80.2021.06.15.03.36.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 03:36:02 -0700 (PDT) From: Norbert Lange To: buildroot@buildroot.org Date: Tue, 15 Jun 2021 12:35:48 +0200 Message-Id: <20210615103549.271478-3-nolange79@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210615103549.271478-1-nolange79@gmail.com> References: <20210615103549.271478-1-nolange79@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v3 3/3] package/zstd: Prefer dynamically linked tool X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: patrickdepinguin@gmail.com, Andrey Smirnov , Norbert Lange Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" If the libzstd DSO is available, then link the tool against it. Signed-off-by: Norbert Lange --- v2->v3: * Drop config options, just use zstd-dll if possible --- package/zstd/zstd.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk index 54ce4133fe..726c6ae4a4 100644 --- a/package/zstd/zstd.mk +++ b/package/zstd/zstd.mk @@ -45,7 +45,12 @@ endif # zstd will append -O3 after $(CFLAGS), use MOREFLAGS to override again ZSTD_OPTS += MOREFLAGS="$(TARGET_OPTIMIZATION)" +# prefer zstd-dll unless no library is available +ifeq ($(BR2_STATIC_LIBS),y) ZSTD_BUILD_PROG_TARGET = zstd-release +else +ZSTD_BUILD_PROG_TARGET = zstd-dll +endif # Since v1.5.0 the dynamic library is built for # multithreading, while the static library is not.