From patchwork Wed Oct 3 19:04:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: RFA: darwin PATCH to fix build, internal visibility X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 188921 Message-Id: <506C8C3B.2010705@redhat.com> To: Mike Stump Cc: gcc-patches List Date: Wed, 03 Oct 2012 15:04:27 -0400 From: Jason Merrill List-Id: 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"); }