From patchwork Wed Aug 4 21:56:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Norbert Lange X-Patchwork-Id: 1513649 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::137; helo=smtp4.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=up6BYgWM; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (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 4Gg5F3292hz9sPf for ; Thu, 5 Aug 2021 07:57:11 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 4D4AE40403; Wed, 4 Aug 2021 21:57:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lJfNNtCJgyvY; Wed, 4 Aug 2021 21:57:07 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 6357B403E3; Wed, 4 Aug 2021 21:57:06 +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 684241BF5DB for ; Wed, 4 Aug 2021 21:57:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 56A72400F8 for ; Wed, 4 Aug 2021 21:57:04 +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 D-9XpwcaPMUB for ; Wed, 4 Aug 2021 21:57:03 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by smtp2.osuosl.org (Postfix) with ESMTPS id CD27F400D9 for ; Wed, 4 Aug 2021 21:57:02 +0000 (UTC) Received: by mail-wm1-x32b.google.com with SMTP id u15so2026502wmj.1 for ; Wed, 04 Aug 2021 14:57:02 -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=XVAtbPA1+nHEXcLVAUA7RUX1XmLJYYm4mTRn2QY3l7o=; b=up6BYgWM4X3SwO/1hRpad+WrAIqTD+tqq8dNabT4VATMvQ6Ra8zdk5MYfX4hbQ4lvP mCX2peYEh2Fx1vR/RuLIvdNqUeQ7UtakIiAZANGf6mKq7wRypSUn1PNa1Cwb0ywKHmxh AwejCYZ6GBc2KUh9qr9H0z/L3AlCxEl1Lh9xKMA82pl9IaWOR4o0eBElPnJq7Bhz/RDD HAJtKfgM9R3Hi+R3c163w7v4Q7F1amL68sRWyeGtWHxhYcgxnkBqLZLDcTpX8qjrKDPs LmRtwO3Yw3PL9Mlqdth1CbsRt1R/BUxX5yaZNCBEn8d2pMcsWCDJg8mUUVWTHQmq86CI O0sA== 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=XVAtbPA1+nHEXcLVAUA7RUX1XmLJYYm4mTRn2QY3l7o=; b=HFXGbBnWQx3kqJw3INcYZHUIqoniux+Vp5cXJfwcY/x9Yx8hU3FTDn5LxRnNtwBBn2 s3bb0yLw0wgb4vCYSIrZZk2808RCyglKtKrfHd7WeeMAh7XrljsJr4unn3/9eCYB7pl7 f6/y6oAfNnVRjh0bBUrMDT/dKeEWsVLIzwToQPBpkb6Z+YPYTpnVbZ4IburEJyZzW9Mq 3wYqhwAPckW6PKUXXEzQMc1tGTTjbbCkkxszAUzHcA80p5Eey+oc9ExxKgWrbM5HeQVv cb+lzTYS83fawqFcRrOAeEUtypEoqFb7mU6ebngP0r8O/fI4QNV0vMuUKGEYhPkR3U/z 9h5g== X-Gm-Message-State: AOAM5328bc5DxcVyxBmLyZtbzt1dgQESLgBN3Dr0X4Vt+jCVSVSVJ5jQ oo/Sv3mGLqO1gVOtg6M6oq5v7nCDoB3+tw== X-Google-Smtp-Source: ABdhPJz/cv8wyBzsucyJLSnVZXvENG+jVDqI7yM6xBkT4Up9WoQKfB1j3bjN0+siOoCpSdCOAj0sPA== X-Received: by 2002:a1c:48d:: with SMTP id 135mr1560651wme.31.1628114221048; Wed, 04 Aug 2021 14:57:01 -0700 (PDT) Received: from debian-noppl.. (62-178-205-20.cable.dynamic.surfer.at. [62.178.205.20]) by smtp.gmail.com with ESMTPSA id h8sm7049154wmb.35.2021.08.04.14.57.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Aug 2021 14:57:00 -0700 (PDT) From: Norbert Lange To: buildroot@buildroot.org Date: Wed, 4 Aug 2021 23:56:50 +0200 Message-Id: <20210804215652.14775-1-nolange79@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 1/2] 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: Andrey Smirnov , Norbert Lange Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Move PREFIX=/usr to ZSTD_OPTS, even though it is only used by libzstd.pc for now it should be available in every step. Create libzstd.pc in the build step instead of triggering a lazy build during installation when it is missing. Attach '-release' to the targets, since the default is to build lib-release and zstd-release. Signed-off-by: Norbert Lange --- v4->v5: * rebase, remove the parts that are already upstream * improve commit message * try to keep changes minimal v3->v4: * revert to previous scheme of BR2_TOOLCHAIN_HAS_THREADS fixing build options for both static and shared libs. v2->v3: * use normal = for assignment v1->v2: * rebased against upstream/master Signed-off-by: Norbert Lange --- package/zstd/zstd.mk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk index 5a96c11309..d7a0320df4 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 += PREFIX=/usr ZSTD_OPTS += ZSTD_LEGACY_SUPPORT=0 ifeq ($(BR2_PACKAGE_ZLIB),y) ZSTD_DEPENDENCIES += zlib @@ -60,12 +61,13 @@ else ZSTD_OPTS += HAVE_THREAD=0 ZSTD_BUILD_LIBS := $(addsuffix -nomt,$(ZSTD_BUILD_LIBS)) endif +ZSTD_BUILD_LIBS := $(addsuffix -release,$(ZSTD_BUILD_LIBS)) define ZSTD_BUILD_CMDS $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \ - -C $(@D)/lib $(ZSTD_BUILD_LIBS) + -C $(@D)/lib $(ZSTD_BUILD_LIBS) libzstd.pc $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \ - -C $(@D) zstd + -C $(@D) zstd-release endef define ZSTD_INSTALL_STAGING_CMDS @@ -76,9 +78,9 @@ endef define ZSTD_INSTALL_TARGET_CMDS $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \ - DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/programs install + DESTDIR=$(TARGET_DIR) -C $(@D)/programs install $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \ - DESTDIR=$(TARGET_DIR) PREFIX=/usr -C $(@D)/lib $(ZSTD_INSTALL_LIBS) + DESTDIR=$(TARGET_DIR) -C $(@D)/lib $(ZSTD_INSTALL_LIBS) endef HOST_ZSTD_OPTS += PREFIX=$(HOST_DIR) From patchwork Wed Aug 4 21:56:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Norbert Lange X-Patchwork-Id: 1513650 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.137; helo=smtp4.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=MHq3IYLC; dkim-atps=neutral Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 4Gg5FG65KRz9sPf for ; Thu, 5 Aug 2021 07:57:22 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id A6789403D8; Wed, 4 Aug 2021 21:57:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tf4_BWWfapfH; Wed, 4 Aug 2021 21:57:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id E94F240403; Wed, 4 Aug 2021 21:57:18 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id E24DE1BF5DB for ; Wed, 4 Aug 2021 21:57:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id CC27B40435 for ; Wed, 4 Aug 2021 21:57:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8EUfIUFsZztC for ; Wed, 4 Aug 2021 21:57:07 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by smtp4.osuosl.org (Postfix) with ESMTPS id 1C24740403 for ; Wed, 4 Aug 2021 21:57:07 +0000 (UTC) Received: by mail-wr1-x433.google.com with SMTP id h14so3798477wrx.10 for ; Wed, 04 Aug 2021 14:57:06 -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=fJYQPqwFPcY3EVFXoLU4rtBUTytnlt+W59rjEaLaoIQ=; b=MHq3IYLC/2ziTDao4Y2v24hVdeArq3Cnj0J9rOKn1gD2MUcZIQ0O8IqasmG07E2QEm mjXkci0FqpZtiMJT2iQzi02xbWK7qyYm6aP5w84zUY4cbjGzcTamvFc+lnecmTrdIJTh mXfaf1yZH9+8GJg71dzMdv+8DFeNdUp4nJVQ+1CCBVfj1bDHBFl2GSP5NsndtjuiTQ9q MWh0/QbJGiia7q4xOuLg+WBLWAS/n9GCq9Q/EVHc2fYrVoXYPgikCvDhEVlxbOoSAl6+ cxe6YCcaUv0zSw+XSGwAXi4P6+CgG5bDGvCpxJKSLO9VmsClieSFcDkJUJ6Ady5OkNVr uWgQ== 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=fJYQPqwFPcY3EVFXoLU4rtBUTytnlt+W59rjEaLaoIQ=; b=hWknGmpMBmBB5VTIg5E8K9EVxzI65uLVSLvVj4kR3QVvjDEFqZi7r8a8bzzvNrZpab oDqQMIa9bvbFePb3WSceKBpJKtfTGjGHL6pNue14tBA1I5TD/p3SP47oEQBJowu3xsYD 82flUJLQzCuN1y2Fst8zaaTFGBcFT+fK7vSWvqn1gncvDseFA32n7De821NvRjYF0lHW ptdXE27qRLcke8XqiO68PBW8RllnQ+eu2/NXf/LQ+Z9T/vmPi5Wr+L+8dcGWFZk+tJBj oJ2I2iGq1AI/A08WYUJJjjMrSvRuvKya/wZdtQaW2sTcR+peRBwQugo4JqZ9dMmhce0S QWOw== X-Gm-Message-State: AOAM530IwxLjDLSwwK7AiCrHvoNHVapgoSYwUBNtgKnHJr4+tBlhbWUV e2tOD+L5ZPdsdexEdnoHuQ7etKqCcXlSlw== X-Google-Smtp-Source: ABdhPJzTTUl5VpZZxLx+jVEa88U7CAOvl4gIQZ2ka/FgeEkkJ77qgj/qCwu6n+L5abGNyB+Lpp+Www== X-Received: by 2002:adf:eec9:: with SMTP id a9mr1410449wrp.157.1628114225410; Wed, 04 Aug 2021 14:57:05 -0700 (PDT) Received: from debian-noppl.. (62-178-205-20.cable.dynamic.surfer.at. [62.178.205.20]) by smtp.gmail.com with ESMTPSA id h8sm7049154wmb.35.2021.08.04.14.57.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Aug 2021 14:57:05 -0700 (PDT) From: Norbert Lange To: buildroot@buildroot.org Date: Wed, 4 Aug 2021 23:56:51 +0200 Message-Id: <20210804215652.14775-2-nolange79@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210804215652.14775-1-nolange79@gmail.com> References: <20210804215652.14775-1-nolange79@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 2/2] 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: 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 --- v3->v5: * Rebase v2->v3: * Drop config options, just use zstd-dll if possible Signed-off-by: Norbert Lange --- package/zstd/zstd.mk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/package/zstd/zstd.mk b/package/zstd/zstd.mk index d7a0320df4..58dd0dd9d4 100644 --- a/package/zstd/zstd.mk +++ b/package/zstd/zstd.mk @@ -49,6 +49,13 @@ ZSTD_BUILD_LIBS = lib ZSTD_INSTALL_LIBS = install-static install-shared endif +# 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 + # The HAVE_THREAD flag is read by the 'programs' makefile but not by the 'lib' # one. Building a multi-threaded binary with a static library (which defaults # to single-threaded) gives a runtime error when compressing files. @@ -67,7 +74,7 @@ define ZSTD_BUILD_CMDS $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \ -C $(@D)/lib $(ZSTD_BUILD_LIBS) libzstd.pc $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) $(ZSTD_OPTS) \ - -C $(@D) zstd-release + -C $(@D)/programs $(ZSTD_BUILD_PROG_TARGET) endef define ZSTD_INSTALL_STAGING_CMDS