From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id U9hYIU3JImDRZAAAWB0awg (envelope-from ) for ; Tue, 09 Feb 2021 12:41:33 -0500 Received: by simark.ca (Postfix, from userid 112) id 7A8A41EF4F; Tue, 9 Feb 2021 12:41:33 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2039D1E54D for ; Tue, 9 Feb 2021 12:41:33 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 946B8389682C; Tue, 9 Feb 2021 17:41:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 946B8389682C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1612892492; bh=8bMi2FjvLyqn/JWzFaZLJghz2f8/GpOiJOFuqInN9fM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=lRykXSeVb9fzDnIo9YUWzztvEJxCL7AAdPeVyM9p/AkTRfguIunL+8s7J/6VMYBf8 c70nkBNFuxAgWlG3N4/tLJYgTV+612lhRV5KXxEUGCv+6HH50d3MgiwsCofjXN8a4V Xn9hqMIhURJpy6oh+nk7nWkjiCXOgF4afMXWLVlM= Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by sourceware.org (Postfix) with ESMTPS id 19A9F385802B for ; Tue, 9 Feb 2021 17:41:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 19A9F385802B Received: by mail-lf1-x12c.google.com with SMTP id u25so29650803lfc.2 for ; Tue, 09 Feb 2021 09:41:30 -0800 (PST) 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=8bMi2FjvLyqn/JWzFaZLJghz2f8/GpOiJOFuqInN9fM=; b=oVImRPBvhOMk37E7PCVtxaBUHtA9ZZQHCl9K1r/jbn5mQa2f74UW3eQrn2cA2TgdH4 O9bnUmfYwppYjiZnCmH3Bb0y2eH9bmnXj1HX0deCSIvP96nkqgdvqArjS+a2Pgc8IcRU OfOhsUdB4a5V/O6CzvyKjBxVWmcUdrk5pTFvOHeL3LQ47ontVnzZNsM/16p6BxO5OflJ AwTPe6iOJA8m+aM4Sg+TQXvT/E9XqI9K4JIyfpZC/LRQeWCLtW2AnI68G2pHixyEeoYj O0MC/YT2QfimTDwbGKihyMGfS93gKcxE3UgpOzc0P5ns7zK1LeP17fvgZUwIyYQ7Km7E HSmg== X-Gm-Message-State: AOAM530sWEdMeiqeCZbdLLpT64EU62SOFc/1HZlBXFcw0TyAuK3qg2pr b1wFENj0jZflsvS13EqWu5OzgS1lZns= X-Google-Smtp-Source: ABdhPJwaSvTZr4KgyUYYJUYodSqGoNtc/FANZ6OnB6ADDlfkgIgeYzdwj3pmmw0WTgLC6+avc8OpuA== X-Received: by 2002:a19:ec14:: with SMTP id b20mr7589584lfa.208.1612892488904; Tue, 09 Feb 2021 09:41:28 -0800 (PST) Received: from atlantis.home ([2a03:1b20:4:f011::14d]) by smtp.gmail.com with ESMTPSA id v18sm2685648ljj.55.2021.02.09.09.41.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Feb 2021 09:41:28 -0800 (PST) To: gdb-patches@sourceware.org Subject: [PUSHED gdb-10-branch] arc: Fix gcc-4.8 compilation failure for arc.c Date: Tue, 9 Feb 2021 18:41:58 +0100 Message-Id: <20210209174158.8234-1-shahab.vahedi@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210209091209.7363-1-shahab.vahedi@gmail.com> References: <20210209091209.7363-1-shahab.vahedi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Shahab Vahedi via Gdb-patches Reply-To: Shahab Vahedi Cc: Shahab Vahedi , Shahab Vahedi , Tom Tromey , Francois Bedard Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" From: Shahab Vahedi Building an arc target: $ configulre --target=arc-elf32 \ --enable-targets=arc-linux-uclibc \ ... On a system with gcc-4.8 (CentOS 7.x), fails with: --------8<--------- ../../gdb/arch/arc.c:117:43: required from here /usr/include/c++/4.8.2/bits/hashtable_policy.h:195:39: error: no matching function for call to 'std::pair >::pair(const arc_arch_features&, target_desc*&)' : _M_v(std::forward<_Args>(__args)...) { } ^ /usr/include/c++/4.8.2/bits/hashtable_policy.h:195:39: note: candidates are: In file included from /usr/include/c++/4.8.2/utility:70:0, from /usr/include/c++/4.8.2/tuple:38, from /usr/include/c++/4.8.2/functional:55, from ../../gdb/../gdbsupport/ptid.h:35, from ../../gdb/../gdbsupport/common-defs.h:123, from ../../gdb/arch/arc.c:19: /usr/include/c++/4.8.2/bits/stl_pair.h:206:9: note: template std::pair<_T1, _T2>::pair(std::tuple<_Args1 ...>&, std::tuple<_Args2 ...>&, std::_Index_tuple<_Indexes1 ...>, std::_Index_tuple<_Indexes2 ...>) pair(tuple<_Args1...>&, tuple<_Args2...>&, ^ -------->8--------- The corresponding line in arc.c must use an explicit ctor: --------8<--------- arc_lookup_target_description (...) { /* Add the newly created target description to the repertoire. */ - arc_tdesc_cache.emplace (features, tdesc); + arc_tdesc_cache.emplace (features, target_desc_up (tdesc)); return tdesc; } -------->8--------- See "PR gcc/96537" for more details. Last but not least, this problem has originally been investigated by Tom de Vries for RISCV targets (see 38f8aa06d9). gdb/ChangeLog: PR build/27385 * arch/arc.c (arc_lookup_target_description): Use target_desc_up() ctor explicitly. --- gdb/ChangeLog | 6 ++++++ gdb/arch/arc.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9d12c466952..d33bf67c483 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2021-02-09 Shahab Vahedi + + PR build/27385 + * arch/arc.c (arc_lookup_target_description): Use + target_desc_up() ctor explicitly. + 2021-02-08 Shahab Vahedi PR tdep/27369 diff --git a/gdb/arch/arc.c b/gdb/arch/arc.c index d80d2fe4c0d..24d08179c85 100644 --- a/gdb/arch/arc.c +++ b/gdb/arch/arc.c @@ -113,8 +113,9 @@ arc_lookup_target_description (const struct arc_arch_features &features) target_desc *tdesc = arc_create_target_description (features); - /* Add the newly created target description to the repertoire. */ - arc_tdesc_cache.emplace (features, tdesc); + /* Add the newly created target description to the repertoire. + PR build/27385: Use "target_desc_up ()" ctor explicitly. */ + arc_tdesc_cache.emplace (features, target_desc_up (tdesc)); return tdesc; } -- 2.30.0