From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IQKqNtpRImCcWQAAWB0awg (envelope-from ) for ; Tue, 09 Feb 2021 04:11:54 -0500 Received: by simark.ca (Postfix, from userid 112) id D35D61EF4F; Tue, 9 Feb 2021 04:11:54 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [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 B5B061E590 for ; Tue, 9 Feb 2021 04:11:53 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4922C3846403; Tue, 9 Feb 2021 09:11:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4922C3846403 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1612861913; bh=hK8ynKL3GKZl7wcHnlVtIr0jV/Q5Tu4RQZbfUBWWtkg=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=U1ULLgJtEeYQIAxo740BUxX3oONhc0Ug3a/L91d2KyWDeP9C9D8N1xAHO5OQbiccW i0JnSXU9TEZaHGhUCLEM64u7RwCLy6LGKf/5x7N0KGSmng1ydiovJLeqqMBF0A75Gx owvaAxWLaeymLwmCxWiOb9OgrRGTiqXlBdOyRzFo= Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by sourceware.org (Postfix) with ESMTPS id E1AD8385781F for ; Tue, 9 Feb 2021 09:11:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E1AD8385781F Received: by mail-lf1-x130.google.com with SMTP id b2so27289514lfq.0 for ; Tue, 09 Feb 2021 01:11:50 -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:mime-version :content-transfer-encoding; bh=hK8ynKL3GKZl7wcHnlVtIr0jV/Q5Tu4RQZbfUBWWtkg=; b=RF88sJ691pc9bsxSLzzdPK+mdq+aJdN13gJ2zXzje2l38NwSaDKt5dorLzIwnctnd8 Kt9ganx485mBOVe5bSfWplCSFxX1bslJ3YDp+qLq7RybFCQ6Ye7S/wF9hz7UcSbBWoRi Omj7abAK9Yq6P/f8FxgN0Ogf0YVRFP5k8ihaKa6vQESoCFSfOa9L1BKSpMHQP6c7ojlw G/1s1H4ozslU3smxYxA9NcfDa9hQK2RY6588WRScmOT8aK62y1bJefZPjSpyc5rkA4WN Q177PIzgDFst4tVseozDQofMA7j5DNbuzHL1WlVu+eY5sBELTMRSWQt/eG8olldk53k1 4Vgw== X-Gm-Message-State: AOAM530h02iMiSf3h5UikdI1ShDMNe5A75uk8Q8z/YG/mMseOuMV9Uqy It/q2VPK+FoEk0IeVbL1WyTUXpT0Q3Qqfg== X-Google-Smtp-Source: ABdhPJwuA9UAdjKxO1YZDXWddS30Ltr/WibdoCPszNXG/osmuS6J5faAdr3Soa8v9yfR1LQLiCuPgQ== X-Received: by 2002:ac2:5df1:: with SMTP id z17mr3238881lfq.124.1612861909638; Tue, 09 Feb 2021 01:11:49 -0800 (PST) Received: from atlantis.home ([2a03:1b20:4:f011::14d]) by smtp.gmail.com with ESMTPSA id b14sm2439242lff.16.2021.02.09.01.11.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Feb 2021 01:11:48 -0800 (PST) To: gdb-patches@sourceware.org Subject: [PATCH] arc: Fix gcc-4.8 compilation failure for arc.c Date: Tue, 9 Feb 2021 10:12:09 +0100 Message-Id: <20210209091209.7363-1-shahab.vahedi@gmail.com> X-Mailer: git-send-email 2.30.0 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 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 an explicit ctor. --- gdb/arch/arc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gdb/arch/arc.c b/gdb/arch/arc.c index 3808f9fe292..4f2595b9c35 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