From patchwork Thu May 10 13:36:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 911375 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-477494-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="qB1VYQFI"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40hZ5766tWz9s0x for ; Thu, 10 May 2018 23:36:42 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=drQANBvNdzNvW9jpHCYEkfalpAj3dg2FFH0Cw8YSWsl7tQRBP6ik+ P4o8IY+HQrBDpq6Wpf0PnSdCh8z4lehfXlOkgIB9Zsv/6H4PhaXzXT9xQ/Wivr+f ybWeiqQxfuhL08mUHwaR3h+fO587guP0qBFlwiF8VQsvacYp3jDMj8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; s= default; bh=VPVhe+2Z5ldPgATaEjHt/id+36A=; b=qB1VYQFIQZ5IR/LoxZgB cuOm19dRyLPFWXAhSgag1k2d6yYcUjd8FF/GHgiCTk/YwHVz7bNytjRWWChKPTS5 299IQ9MzXQnjCF1hft0DQNEKrncbqKBDucxytSqjXgl6RPIGbul7Yiuz4nuTDIoU 3Z19knMuiuC1lOATiXO8qF4= Received: (qmail 39647 invoked by alias); 10 May 2018 13:36:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 39515 invoked by uid 89); 10 May 2018 13:36:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-19.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_STOCKGEN autolearn=ham version=3.3.2 spammy= X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 May 2018 13:36:33 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 67DE5D5 for ; Thu, 10 May 2018 15:36:29 +0200 (CEST) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 91bhstYNc521 for ; Thu, 10 May 2018 15:36:26 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p4FDDB419.dip0.t-ipconnect.de [79.221.180.25]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id 46A53D3 for ; Thu, 10 May 2018 15:36:26 +0200 (CEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Subject: [build] Fix Solaris gty handling (PR target/84379) Date: Thu, 10 May 2018 15:36:25 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes As described in the PR, there are a couple of jit testsuite failures on Solaris when using /bin/as. The errors point to GC issues and indeed, gcc/config/sol2.c lacked GTY markup. This patch fixes that, following what darwin.c does for machopic_indirections. I confess I have no idea why I had to change the code the way I did except for the fact that it works. While formally I don't need approval, it would be nice if someone in the know could have a look. Bootstrappedn without regressions on i386-pc-solaris2.11 and sparc-sun-solaris2.11 with as and gas, with and without jit. Rainer # HG changeset patch # Parent 2c72579b3945b50373c09b9c93a37f00d94eee79 Fix Solaris gty handling (PR target/84379) diff --git a/gcc/config.gcc b/gcc/config.gcc --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -880,6 +880,7 @@ case ${target} in fi tm_p_file="${tm_p_file} sol2-protos.h" tmake_file="${tmake_file} t-sol2 t-slibgcc" + target_gtfiles="$target_gtfiles \$(srcdir)/config/sol2.c" c_target_objs="${c_target_objs} sol2-c.o" cxx_target_objs="${cxx_target_objs} sol2-c.o sol2-cxx.o" extra_objs="${extra_objs} sol2.o sol2-stubs.o" diff --git a/gcc/config/sol2.c b/gcc/config/sol2.c --- a/gcc/config/sol2.c +++ b/gcc/config/sol2.c @@ -163,7 +163,7 @@ solaris_assemble_visibility (tree decl, /* Group section information entry stored in solaris_comdat_htab. */ -typedef struct comdat_entry +typedef struct GTY((for_user)) comdat_entry { const char *name; unsigned int flags; @@ -173,11 +173,10 @@ typedef struct comdat_entry /* Helpers for maintaining solaris_comdat_htab. */ -struct comdat_entry_hasher : nofree_ptr_hash +struct comdat_entry_hasher : ggc_ptr_hash { static inline hashval_t hash (const comdat_entry *); static inline bool equal (const comdat_entry *, const comdat_entry *); - static inline void remove (comdat_entry *); }; inline hashval_t @@ -195,7 +194,7 @@ comdat_entry_hasher::equal (const comdat /* Hash table of group signature symbols. */ -static hash_table *solaris_comdat_htab; +static GTY (()) hash_table *solaris_comdat_htab; /* Output assembly to switch to COMDAT group section NAME with attributes FLAGS and group signature symbol DECL, using Sun as syntax. */ @@ -237,14 +236,14 @@ solaris_elf_asm_comdat_section (const ch remember the signature symbols and emit those not marked TREE_SYMBOL_REFERENCED in solaris_file_end. */ if (!solaris_comdat_htab) - solaris_comdat_htab = new hash_table (37); + solaris_comdat_htab = hash_table::create_ggc (37); entry.sig = signature; slot = solaris_comdat_htab->find_slot (&entry, INSERT); if (*slot == NULL) { - *slot = XCNEW (comdat_entry); + *slot = ggc_alloc (); /* Remember fragmented section name. */ (*slot)->name = section; /* Emit as regular section, .group declaration has already been done. */ @@ -299,3 +298,5 @@ solaris_override_options (void) if (!HAVE_LD_EH_FRAME_CIEV3 && !global_options_set.x_dwarf_version) dwarf_version = 2; } + +#include "gt-sol2.h"