From patchwork Wed Oct 3 19:04:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 188921 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 8191A2C008F for ; Thu, 4 Oct 2012 06:51:16 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1349902276; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=X4WJKU3 zIk19+30T2fXX8B/VGZ4=; b=sDcf973Cko9oz1iNK67EsfrUKrIHsyb04Isw/pr xak4GyfZFLfddO0ygZckbnw37q3JjcE6628vxUtFQQscjROZofHnkLXakT/goSLn LNvNFWjA3YPSYd4vJBp5jN9wuapHXOfJq4U1fNMrZXgpBCv6pGNVzC8HsxmMxFPh Rxjw= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=hsMoNgf69tWB2pP7edPOmH0kh0zH08Oz29p5fERULdGKy6gczXxDFKiurkKPuE O992PoBtoPd2dJJh2cprNpvimuSrjn9Ii6xHL7l8C75XsPu6mtZ+St9zt1LRiuqS lYxJMmf91O92T+BIVBVBS3EKUnMgCbB4nKaxOXIYO7vxs=; Received: (qmail 3603 invoked by alias); 3 Oct 2012 19:04:34 -0000 Received: (qmail 3591 invoked by uid 22791); 3 Oct 2012 19:04:33 -0000 X-SWARE-Spam-Status: No, hits=-7.3 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 03 Oct 2012 19:04:29 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q93J4SdB030032 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 3 Oct 2012 15:04:28 -0400 Received: from [10.3.113.15] ([10.3.113.15]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q93J4RjM000718; Wed, 3 Oct 2012 15:04:28 -0400 Message-ID: <506C8C3B.2010705@redhat.com> Date: Wed, 03 Oct 2012 15:04:27 -0400 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Mike Stump CC: gcc-patches List Subject: RFA: darwin PATCH to fix build, internal visibility 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 This patch fixes a couple of Darwin issues I noticed with a cross-compiler: 1) Adds a couple of consts to avoid const-correctness errors. 2) Treats visibility "internal" like "hidden" rather than like "default". The documentation says that internal is hidden + processor-specific semantics, so treating it as just hidden makes sense to me. OK for trunk? Jason commit 907f8d9588da2e65cf938985639bfaf0dde53c6f Author: Jason Merrill Date: Wed Oct 3 09:55:25 2012 -0400 * config/darwin.c (darwin_assemble_visibility): Treat VISIBILITY_INTERNAL as hidden. * config/darwin-c.c (find_subframework_file): Add missing const. (framework_construct_pathname): Likewise. diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c index a642f66..8e48c30 100644 --- a/gcc/config/darwin-c.c +++ b/gcc/config/darwin-c.c @@ -267,7 +267,7 @@ static struct framework_header framework_header_dirs[] = { static char * framework_construct_pathname (const char *fname, cpp_dir *dir) { - char *buf; + const char *buf; size_t fname_len, frname_len; cpp_dir *fast_dir; char *frname; @@ -344,7 +344,7 @@ find_subframework_file (const char *fname, const char *pname) { char *sfrname; const char *dot_framework = ".framework/"; - char *bufptr; + const char *bufptr; int sfrname_len, i, fname_len; struct cpp_dir *fast_dir; static struct cpp_dir subframe_dir; diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 54c92d1..5a9f50a 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -2623,7 +2623,7 @@ darwin_assemble_visibility (tree decl, int vis) { if (vis == VISIBILITY_DEFAULT) ; - else if (vis == VISIBILITY_HIDDEN) + else if (vis == VISIBILITY_HIDDEN || vis == VISIBILITY_INTERNAL) { fputs ("\t.private_extern ", asm_out_file); assemble_name (asm_out_file, @@ -2631,7 +2631,7 @@ darwin_assemble_visibility (tree decl, int vis) fputs ("\n", asm_out_file); } else - warning (OPT_Wattributes, "internal and protected visibility attributes " + warning (OPT_Wattributes, "protected visibility attribute " "not supported in this configuration; ignored"); }