From patchwork Wed Sep 30 03:55:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Wilson X-Patchwork-Id: 1374063 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=QHCwHVE8; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4C1Mqb6m1xz9sSC for ; Wed, 30 Sep 2020 13:55:55 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 43C713857809; Wed, 30 Sep 2020 03:55:53 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id 2C1913857C6B for ; Wed, 30 Sep 2020 03:55:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2C1913857C6B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jimw@sifive.com Received: by mail-pl1-x635.google.com with SMTP id y6so203950plt.9 for ; Tue, 29 Sep 2020 20:55:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EOkuAheaIrjPpJxkNupshC6sEuq6YfpwqsQ9aM9ESDw=; b=QHCwHVE80fZk19ePZTjgayXnrWNOXaesLoe9ojkq3MHftCXbOb5jn1bwD+1oP8zeBd aNDAfyy09pp+84JudKYIfn20T7fRA54d6xKQCLyuIhd1f1da9AnmF89N6vWCdAenv3Bg BRdl+HnZDnCZA8v26MMKAze8M4yivioI+Wxsy3+eWhT9IeZOc/Z3ioGap2CdIRNjBbe5 3q/K6uF0a+/OjyW3/eLyxItCHVH4IPfO4+kjE6BBwzVwTPwZ+Uyiqzthw8tfqbhLrpWs VPF4sJb94jodI2OXrSvQGr9hngDnPf+suk1y5JGRfi9A8i8P/1FWycyvvwHxvgeYalQy oVLQ== 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; bh=EOkuAheaIrjPpJxkNupshC6sEuq6YfpwqsQ9aM9ESDw=; b=QFdaKB6X7x8G9Gx2+VffwzDFX2CUF9/IsSKUuw02JQPKB7ZF5fjQBiAeLv3tyYVkhO FHReWp4lboJAfuivXbErQOSoIKHyJIBpG/JwqXvFwtzycFRdLhpkzbI4LYRuFNXYgXid fI+AP2xXt36Mpm8RJOFeyuaGQz24RvynuSO4X5h9TugnKHp2Xx3Uh1OsMVzki8hhDcPM e3BHwGtiVVvgIEH8Bd9yWsvPgtva8NcVi+vZLrTbuV75e1zggRaFLI7hFag7nBEDRzrX 4S3aX28GcVDVtJ72JnRRs3Bu7iQiJkMm2VxzIalbeB9fUgfqw+CLgD73MvOvTw2keH2V g/Lw== X-Gm-Message-State: AOAM532YTUTrWvc0nwMC98wzmVpIy1GLiQmePr4N3w5/z/GnctKeQdmV YluPAn/ahWcux7IeH0T226bP7XDSh8rIcCpr X-Google-Smtp-Source: ABdhPJyjMpErBNYzYDR6CQwecX6pHVw6O8EELrEaK5y8TlpNeAUXpOflMYunlzYs5CZ28AsUmRK8vA== X-Received: by 2002:a17:902:b7c4:b029:d0:b7a2:d16 with SMTP id v4-20020a170902b7c4b02900d0b7a20d16mr886443plz.11.1601438146822; Tue, 29 Sep 2020 20:55:46 -0700 (PDT) Received: from rohan.hsd1.ca.comcast.net ([2601:646:c180:b150:313f:ae49:6cf8:8cb9]) by smtp.gmail.com with ESMTPSA id f6sm313215pfq.82.2020.09.29.20.55.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2020 20:55:46 -0700 (PDT) From: Jim Wilson To: gcc-patches@gcc.gnu.org Subject: [PATCH][GCC 10] Fix build failure with zstd versio9n 1.2.0 or older. Date: Tue, 29 Sep 2020 20:55:21 -0700 Message-Id: <20200930035521.32370-1-jimw@sifive.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200929004546.792-1-jimw@sifive.com> References: <20200929004546.792-1-jimw@sifive.com> X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" This is the gcc-10 branch version of the patch on mainline. Extends the configure check for zstd.h to also verify the zstd version, since gcc requires features that only exist in 1.3.0 and newer. Without this patch we get a build error for lto-compress.c when using an old zstd version. OK? Jim Backported from master: 2020-09-29 Jim Wilson gcc/ PR bootstrap/97183 * configure.ac (gcc_cv_header_zstd_h): Check ZSTD_VERISON_NUMBER. * configure: Regenerated. --- gcc/configure | 11 ++++++++--- gcc/configure.ac | 7 ++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/gcc/configure b/gcc/configure index eb6061c1631..b4088d8fd1e 100755 --- a/gcc/configure +++ b/gcc/configure @@ -10024,9 +10024,14 @@ $as_echo_n "checking for zstd.h... " >&6; } if ${gcc_cv_header_zstd_h+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # We require version 1.3.0 or later. This is the first version that has +# ZSTD_getFrameContentSize. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include +#if ZSTD_VERSION_NUMBER < 10300 +#error "need zstd 1.3.0 or better" +#endif int main () { @@ -19015,7 +19020,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19018 "configure" +#line 19023 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -19121,7 +19126,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 19124 "configure" +#line 19129 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/gcc/configure.ac b/gcc/configure.ac index 715fcba0482..070b9c6c497 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1382,8 +1382,13 @@ LDFLAGS="$LDFLAGS $ZSTD_LDFLAGS" AC_MSG_CHECKING(for zstd.h) AC_CACHE_VAL(gcc_cv_header_zstd_h, +# We require version 1.3.0 or later. This is the first version that has +# ZSTD_getFrameContentSize. [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( -[[#include ]])], +[[#include +#if ZSTD_VERSION_NUMBER < 10300 +#error "need zstd 1.3.0 or better" +#endif]])], [gcc_cv_header_zstd_h=yes], [gcc_cv_header_zstd_h=no])]) AC_MSG_RESULT($gcc_cv_header_zstd_h)